Skip to content

Commit

Permalink
release 0.0.19-beta source code for go
Browse files Browse the repository at this point in the history
  • Loading branch information
Huaweicloud-SDK committed Oct 31, 2020
1 parent 940cd95 commit 428654c
Show file tree
Hide file tree
Showing 623 changed files with 30,312 additions and 17,567 deletions.
71 changes: 61 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@
## 0.0.19-beta 2020-10-31
## HuaweiCloud SDK Core
- ### Features
- None
- ### Bug Fix
- Fix: fix the problem that when query parameter contains enumerated variables the request will fail.
- [Issue 7](https://github.com/huaweicloud/huaweicloud-sdk-go-v3/issues/7) resolve the problem of using json.Marshal() returns object{}.
- ### Change
- None

## HuaweiCloud SDK CBR
- ### Features
- Support more interfaces: interfaces related to `TAG`.
- ### Bug Fix
- [Issue 17](https://github.com/huaweicloud/huaweicloud-sdk-java-v3/issues/17) fix the problem of interface: ListBackups.
- ### Change
- None

## HuaweiCloud SDK CTS
- ### Features
- Support more interface: ListQuotas
- ### Bug Fix
- None
- ### Change
- None

## HuaweiCloud SDK EPS
- ### Features
- None
- ### Bug Fix
- None
- ### Change
- Adjust interfaces' names, replace abbreviations of `EP` with `EnterpriseProject`, the involved interfaces are:
1. ListEP → ListEnterpriseProject
2. CreateEP → CreateEnterpriseProject
3. ShowEP → ShowEnterpriseProject
4. ModifyEP → ModifyEnterpriseProject
5. EnableEP → EnableEnterpriseProject
6. ShowEPQuota → ShowEnterpriseProjectQuota
7. ShowResourceBindEP → ShowResourceBindEnterpriseProject
8. DisableEP → DisableEnterpriseProject

## HuaweiCloud SDK Iam
- ### Features
- None
- ### Bug Fix
- None
- ### Change
- Adjust interfaces' names, the involved interfaces are:
1. KeystoneCreateUserTokenByPasswordAndMFA → KeystoneCreateUserTokenByPasswordAndMfa
2. CreateUnscopeTokenByIDPInitiated → CreateUnscopeTokenByIdpInitiated

## HuaweiCloud SDK ProjectMan
- ### Features
- Support more interfaces: iteration information, user information, project members, project information, project indicators, project statistics, etc.
- ### Bug Fix
- None
- ### Change
- None


## 0.0.18-beta 2020-10-20
## HuaweiCloud SDK ELB
- ### Features
Expand Down Expand Up @@ -395,13 +456,3 @@
- Identity and Access Management(IAM)
- Tag Management Service(TMS)
- Virtual Private Cloud(VPC)

# 3.0.17-beta 2020-10-16
## HuaweiCloud SDK DevStar
- ### Features
- Change of title from Devstar to DevStar.
- Supplemental DevStar Automation Test Cases.
- ### Bug Fix
- None
- ### Change
- None
71 changes: 61 additions & 10 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@
## 0.0.19-beta 2020-10-31
## HuaweiCloud SDK Core
- ### 新增特性
-
- ### 解决问题
- Fix: query参数中包含枚举变量时请求失败
- [Issue 7](https://github.com/huaweicloud/huaweicloud-sdk-go-v3/issues/7) 解决json.Marshal变成{}对象的问题
- ### 特性变更
-

## HuaweiCloud SDK CBR
- ### 新增特性
- 新增支持接口:TAG标签相关接口
- ### 解决问题
- [Issue 17](https://github.com/huaweicloud/huaweicloud-sdk-java-v3/issues/17) 修复ListBackups接口响应体问题
- ### 特性变更
-

## HuaweiCloud SDK CTS
- ### 新增特性
- 新增支持接口:ListQuotas(查询租户追踪器配额信息)
- ### 解决问题
-
- ### 特性变更
-

## HuaweiCloud SDK EPS
- ### 新增特性
-
- ### 解决问题
-
- ### 特性变更
- 接口名称调整,原有的`*EP`接口展开为`*EnterpriseProject`,涉及接口:
1. ListEP → ListEnterpriseProject
2. CreateEP → CreateEnterpriseProject
3. ShowEP → ShowEnterpriseProject
4. ModifyEP → ModifyEnterpriseProject
5. EnableEP → EnableEnterpriseProject
6. ShowEPQuota → ShowEnterpriseProjectQuota
7. ShowResourceBindEP → ShowResourceBindEnterpriseProject
8. DisableEP → DisableEnterpriseProject

## HuaweiCloud SDK Iam
- ### 新增特性
-
- ### 解决问题
-
- ### 特性变更
- 接口名称调整,涉及接口:
1. KeystoneCreateUserTokenByPasswordAndMFA → KeystoneCreateUserTokenByPasswordAndMfa
2. CreateUnscopeTokenByIDPInitiated → CreateUnscopeTokenByIdpInitiated

## HuaweiCloud SDK ProjectMan
- ### 新增特性
- 新增支持接口:迭代信息、用户信息、项目成员、项目信息、项目指标、项目统计等相关方法的接口
- ### 解决问题
-
- ### 特性变更
-


## 0.0.18-beta 2020-10-20
## HuaweiCloud SDK ELB
- ### 新增特性
Expand Down Expand Up @@ -396,13 +457,3 @@
- 统一身份认证服务(IAM)
- 标签管理服务(TMS)
- 虚拟私有云(VPC)

# 3.0.17-beta 2020-10-16
## HuaweiCloud SDK DevStar
- ### 新增特性
- title由Devstar更改为DevStar
- 补充DevStar自动化测试用例
- ### 解决问题
-
- ### 特性变更
-
3 changes: 3 additions & 0 deletions core/converter/converters.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package converter

import "reflect"

type Converter interface {
CovertStringToInterface(value string) (interface{}, error)
CovertStringToPrimitiveTypeAndSetField(field reflect.Value, value string, isPtr bool) error
}

func StringConverterFactory(vType string) Converter {
Expand Down
85 changes: 84 additions & 1 deletion core/converter/types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package converter

import "strconv"
import (
"reflect"
"strconv"
)

type Int32Converter struct{}

Expand All @@ -12,6 +15,20 @@ func (i Int32Converter) CovertStringToInterface(value string) (interface{}, erro
return int32(0), err
}

func (i Int32Converter) CovertStringToPrimitiveTypeAndSetField(field reflect.Value, value string, isPtr bool) error {
v, err := i.CovertStringToInterface(value)
if err != nil {
return err
}
val := v.(int32)
if isPtr {
field.Set(reflect.ValueOf(&val))
} else {
field.Set(reflect.ValueOf(val))
}
return nil
}

type Int64Converter struct{}

func (i Int64Converter) CovertStringToInterface(value string) (interface{}, error) {
Expand All @@ -22,6 +39,20 @@ func (i Int64Converter) CovertStringToInterface(value string) (interface{}, erro
return int64(0), err
}

func (i Int64Converter) CovertStringToPrimitiveTypeAndSetField(field reflect.Value, value string, isPtr bool) error {
v, err := i.CovertStringToInterface(value)
if err != nil {
return err
}
val := v.(int64)
if isPtr {
field.Set(reflect.ValueOf(&val))
} else {
field.Set(reflect.ValueOf(val))
}
return nil
}

type Float32Converter struct{}

func (i Float32Converter) CovertStringToInterface(value string) (interface{}, error) {
Expand All @@ -32,6 +63,20 @@ func (i Float32Converter) CovertStringToInterface(value string) (interface{}, er
return float32(0), err
}

func (i Float32Converter) CovertStringToPrimitiveTypeAndSetField(field reflect.Value, value string, isPtr bool) error {
v, err := i.CovertStringToInterface(value)
if err != nil {
return err
}
val := v.(float32)
if isPtr {
field.Set(reflect.ValueOf(&val))
} else {
field.Set(reflect.ValueOf(val))
}
return nil
}

type Float64Converter struct{}

func (i Float64Converter) CovertStringToInterface(value string) (interface{}, error) {
Expand All @@ -42,6 +87,20 @@ func (i Float64Converter) CovertStringToInterface(value string) (interface{}, er
return float64(0), err
}

func (i Float64Converter) CovertStringToPrimitiveTypeAndSetField(field reflect.Value, value string, isPtr bool) error {
v, err := i.CovertStringToInterface(value)
if err != nil {
return err
}
val := v.(float64)
if isPtr {
field.Set(reflect.ValueOf(&val))
} else {
field.Set(reflect.ValueOf(val))
}
return nil
}

type BooleanConverter struct{}

func (i BooleanConverter) CovertStringToInterface(value string) (interface{}, error) {
Expand All @@ -52,8 +111,32 @@ func (i BooleanConverter) CovertStringToInterface(value string) (interface{}, er
return false, err
}

func (i BooleanConverter) CovertStringToPrimitiveTypeAndSetField(field reflect.Value, value string, isPtr bool) error {
v, err := i.CovertStringToInterface(value)
if err != nil {
return err
}
val := v.(bool)
if isPtr {
field.Set(reflect.ValueOf(&val))
} else {
field.Set(reflect.ValueOf(val))
}
return nil
}

type StringConverter struct{}

func (i StringConverter) CovertStringToInterface(value string) (interface{}, error) {
return value, nil
}

func (i StringConverter) CovertStringToPrimitiveTypeAndSetField(field reflect.Value, value string, isPtr bool) error {
val := value
if isPtr {
field.Set(reflect.ValueOf(&val))
} else {
field.Set(reflect.ValueOf(val))
}
return nil
}
12 changes: 12 additions & 0 deletions core/def/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const (
type FieldDef struct {
LocationType LocationType
Name string
JsonTag string
KindName string
}

func NewFieldDef() *FieldDef {
Expand All @@ -46,3 +48,13 @@ func (field *FieldDef) WithName(name string) *FieldDef {
field.Name = name
return field
}

func (field *FieldDef) WithJsonTag(tag string) *FieldDef {
field.JsonTag = tag
return field
}

func (field *FieldDef) WithKindName(kindName string) *FieldDef {
field.KindName = kindName
return field
}
26 changes: 0 additions & 26 deletions core/def/field_tags.go

This file was deleted.

23 changes: 15 additions & 8 deletions core/def/http_request_def.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
package def

type HttpRequestDef struct {
BodyJson interface{}
RequestFields []*FieldDef
Path string
Method string
ContentType string
Method string
Path string
ContentType string
RequestFields []*FieldDef
ResponseFields []*FieldDef
Response interface{}
}

type HttpRequestDefBuilder struct {
Expand All @@ -33,7 +34,8 @@ type HttpRequestDefBuilder struct {

func NewHttpRequestDefBuilder() *HttpRequestDefBuilder {
httpRequestDef := &HttpRequestDef{
RequestFields: []*FieldDef{},
RequestFields: []*FieldDef{},
ResponseFields: []*FieldDef{},
}
HttpRequestDefBuilder := &HttpRequestDefBuilder{
httpRequestDef: httpRequestDef,
Expand All @@ -56,8 +58,8 @@ func (builder *HttpRequestDefBuilder) WithContentType(contentType string) *HttpR
return builder
}

func (builder *HttpRequestDefBuilder) WithBodyJson(bodyJson interface{}) *HttpRequestDefBuilder {
builder.httpRequestDef.BodyJson = bodyJson
func (builder *HttpRequestDefBuilder) WithResponse(response interface{}) *HttpRequestDefBuilder {
builder.httpRequestDef.Response = response
return builder
}

Expand All @@ -66,6 +68,11 @@ func (builder *HttpRequestDefBuilder) WithRequestField(field *FieldDef) *HttpReq
return builder
}

func (builder *HttpRequestDefBuilder) WithResponseField(field *FieldDef) *HttpRequestDefBuilder {
builder.httpRequestDef.ResponseFields = append(builder.httpRequestDef.ResponseFields, field)
return builder
}

func (builder *HttpRequestDefBuilder) Build() *HttpRequestDef {
return builder.httpRequestDef
}
Loading

0 comments on commit 428654c

Please sign in to comment.