Skip to content

Commit

Permalink
chore: auto update client api apecloud/apecloud@2d9974c
Browse files Browse the repository at this point in the history
  • Loading branch information
apecloud-bot committed Dec 10, 2024
1 parent 8acfb0a commit 75c14a1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 205 deletions.
11 changes: 2 additions & 9 deletions .generator/schemas/adminapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12202,14 +12202,6 @@ components:
- updatedAt
- enabled
type: object
orgMemberRole:
description: The default role of the User in the Org. Required
enum:
- orgadmin
- orgaudit
- orgmember
- orgviewer
type: string
orgMember:
description: Org Member info
properties:
Expand All @@ -12220,7 +12212,8 @@ components:
description: The email of User. Required when create. Read-Only after create
type: string
role:
$ref: '#/components/schemas/orgMemberRole'
description: The role of the User in the Org.
type: string
userId:
description: The ID of User. Read-Only
type: string
Expand Down
11 changes: 2 additions & 9 deletions .generator/schemas/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9387,14 +9387,6 @@ components:
description: The display name of the organization
type: string
type: object
orgMemberRole:
description: The default role of the User in the Org. Required
enum:
- orgadmin
- orgaudit
- orgmember
- orgviewer
type: string
orgMember:
description: Org Member info
properties:
Expand All @@ -9405,7 +9397,8 @@ components:
description: The email of User. Required when create. Read-Only after create
type: string
role:
$ref: '#/components/schemas/orgMemberRole'
description: The role of the User in the Org.
type: string
userId:
description: The ID of User. Read-Only
type: string
Expand Down
2 changes: 1 addition & 1 deletion apecloud
Submodule apecloud updated from 92d303 to 2d9974
36 changes: 13 additions & 23 deletions api/kbcloud/admin/model_org_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type OrgMember struct {
DisplayName *string `json:"displayName,omitempty"`
// The email of User. Required when create. Read-Only after create
Email string `json:"email"`
// The default role of the User in the Org. Required
Role OrgMemberRole `json:"role"`
// The role of the User in the Org.
Role string `json:"role"`
// The ID of User. Read-Only
UserId string `json:"userId"`
// Return true if the member is freezed in the organization
Expand All @@ -31,7 +31,7 @@ type OrgMember struct {
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewOrgMember(email string, role OrgMemberRole, userId string, freezed bool) *OrgMember {
func NewOrgMember(email string, role string, userId string, freezed bool) *OrgMember {
this := OrgMember{}
this.Email = email
this.Role = role
Expand Down Expand Up @@ -100,25 +100,25 @@ func (o *OrgMember) SetEmail(v string) {
}

// GetRole returns the Role field value.
func (o *OrgMember) GetRole() OrgMemberRole {
func (o *OrgMember) GetRole() string {
if o == nil {
var ret OrgMemberRole
var ret string
return ret
}
return o.Role
}

// GetRoleOk returns a tuple with the Role field value
// and a boolean to check if the value has been set.
func (o *OrgMember) GetRoleOk() (*OrgMemberRole, bool) {
func (o *OrgMember) GetRoleOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Role, true
}

// SetRole sets field value.
func (o *OrgMember) SetRole(v OrgMemberRole) {
func (o *OrgMember) SetRole(v string) {
o.Role = v
}

Expand Down Expand Up @@ -191,11 +191,11 @@ func (o OrgMember) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *OrgMember) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
DisplayName *string `json:"displayName,omitempty"`
Email *string `json:"email"`
Role *OrgMemberRole `json:"role"`
UserId *string `json:"userId"`
Freezed *bool `json:"freezed"`
DisplayName *string `json:"displayName,omitempty"`
Email *string `json:"email"`
Role *string `json:"role"`
UserId *string `json:"userId"`
Freezed *bool `json:"freezed"`
}{}
if err = common.Unmarshal(bytes, &all); err != nil {
return common.Unmarshal(bytes, &o.UnparsedObject)
Expand All @@ -218,25 +218,15 @@ func (o *OrgMember) UnmarshalJSON(bytes []byte) (err error) {
} else {
return err
}

hasInvalidField := false
o.DisplayName = all.DisplayName
o.Email = *all.Email
if !all.Role.IsValid() {
hasInvalidField = true
} else {
o.Role = *all.Role
}
o.Role = *all.Role
o.UserId = *all.UserId
o.Freezed = *all.Freezed

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

if hasInvalidField {
return common.Unmarshal(bytes, &o.UnparsedObject)
}

return nil
}
70 changes: 0 additions & 70 deletions api/kbcloud/admin/model_org_member_role.go

This file was deleted.

36 changes: 13 additions & 23 deletions api/kbcloud/model_org_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type OrgMember struct {
DisplayName *string `json:"displayName,omitempty"`
// The email of User. Required when create. Read-Only after create
Email string `json:"email"`
// The default role of the User in the Org. Required
Role OrgMemberRole `json:"role"`
// The role of the User in the Org.
Role string `json:"role"`
// The ID of User. Read-Only
UserId string `json:"userId"`
// Return true if the member is freezed in the organization
Expand All @@ -31,7 +31,7 @@ type OrgMember struct {
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewOrgMember(email string, role OrgMemberRole, userId string, freezed bool) *OrgMember {
func NewOrgMember(email string, role string, userId string, freezed bool) *OrgMember {
this := OrgMember{}
this.Email = email
this.Role = role
Expand Down Expand Up @@ -100,25 +100,25 @@ func (o *OrgMember) SetEmail(v string) {
}

// GetRole returns the Role field value.
func (o *OrgMember) GetRole() OrgMemberRole {
func (o *OrgMember) GetRole() string {
if o == nil {
var ret OrgMemberRole
var ret string
return ret
}
return o.Role
}

// GetRoleOk returns a tuple with the Role field value
// and a boolean to check if the value has been set.
func (o *OrgMember) GetRoleOk() (*OrgMemberRole, bool) {
func (o *OrgMember) GetRoleOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Role, true
}

// SetRole sets field value.
func (o *OrgMember) SetRole(v OrgMemberRole) {
func (o *OrgMember) SetRole(v string) {
o.Role = v
}

Expand Down Expand Up @@ -191,11 +191,11 @@ func (o OrgMember) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *OrgMember) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
DisplayName *string `json:"displayName,omitempty"`
Email *string `json:"email"`
Role *OrgMemberRole `json:"role"`
UserId *string `json:"userId"`
Freezed *bool `json:"freezed"`
DisplayName *string `json:"displayName,omitempty"`
Email *string `json:"email"`
Role *string `json:"role"`
UserId *string `json:"userId"`
Freezed *bool `json:"freezed"`
}{}
if err = common.Unmarshal(bytes, &all); err != nil {
return common.Unmarshal(bytes, &o.UnparsedObject)
Expand All @@ -218,25 +218,15 @@ func (o *OrgMember) UnmarshalJSON(bytes []byte) (err error) {
} else {
return err
}

hasInvalidField := false
o.DisplayName = all.DisplayName
o.Email = *all.Email
if !all.Role.IsValid() {
hasInvalidField = true
} else {
o.Role = *all.Role
}
o.Role = *all.Role
o.UserId = *all.UserId
o.Freezed = *all.Freezed

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

if hasInvalidField {
return common.Unmarshal(bytes, &o.UnparsedObject)
}

return nil
}
70 changes: 0 additions & 70 deletions api/kbcloud/model_org_member_role.go

This file was deleted.

0 comments on commit 75c14a1

Please sign in to comment.