From 496e4f51b927bd5653bd4e6bb213296f548935fa Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Wed, 8 Apr 2026 15:29:49 +0000 Subject: [PATCH] Generate serviceaccount --- ...ervice_account_key_response_credentials.go | 59 +++++++++++++++++++ .../serviceaccount/model_service_account.go | 56 +----------------- services/serviceaccount/oas_commit | 2 +- ...ervice_account_key_response_credentials.go | 40 ++++++++++++- .../v2api/model_service_account.go | 34 +---------- 5 files changed, 102 insertions(+), 89 deletions(-) diff --git a/services/serviceaccount/model_create_service_account_key_response_credentials.go b/services/serviceaccount/model_create_service_account_key_response_credentials.go index 50528b38b..6ea75fcfb 100644 --- a/services/serviceaccount/model_create_service_account_key_response_credentials.go +++ b/services/serviceaccount/model_create_service_account_key_response_credentials.go @@ -153,6 +153,33 @@ type CreateServiceAccountKeyResponseCredentialsGetSubArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServiceAccountKeyResponseCredentialsGetSubRetType = string +/* + types and functions for tokenEndpoint +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateServiceAccountKeyResponseCredentialsGetTokenEndpointAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateServiceAccountKeyResponseCredentialsGetTokenEndpointAttributeTypeOk(arg CreateServiceAccountKeyResponseCredentialsGetTokenEndpointAttributeType) (ret CreateServiceAccountKeyResponseCredentialsGetTokenEndpointRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateServiceAccountKeyResponseCredentialsGetTokenEndpointAttributeType(arg *CreateServiceAccountKeyResponseCredentialsGetTokenEndpointAttributeType, val CreateServiceAccountKeyResponseCredentialsGetTokenEndpointRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateServiceAccountKeyResponseCredentialsGetTokenEndpointArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateServiceAccountKeyResponseCredentialsGetTokenEndpointRetType = string + // CreateServiceAccountKeyResponseCredentials struct for CreateServiceAccountKeyResponseCredentials // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServiceAccountKeyResponseCredentials struct { @@ -170,6 +197,8 @@ type CreateServiceAccountKeyResponseCredentials struct { // Service account id // REQUIRED Sub CreateServiceAccountKeyResponseCredentialsGetSubAttributeType `json:"sub" required:"true"` + // Endpoint used to obtain access tokens for the service account. + TokenEndpoint CreateServiceAccountKeyResponseCredentialsGetTokenEndpointAttributeType `json:"tokenEndpoint,omitempty"` } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -305,6 +334,33 @@ func (o *CreateServiceAccountKeyResponseCredentials) SetSub(v CreateServiceAccou setCreateServiceAccountKeyResponseCredentialsGetSubAttributeType(&o.Sub, v) } +// GetTokenEndpoint returns the TokenEndpoint field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateServiceAccountKeyResponseCredentials) GetTokenEndpoint() (res CreateServiceAccountKeyResponseCredentialsGetTokenEndpointRetType) { + res, _ = o.GetTokenEndpointOk() + return +} + +// GetTokenEndpointOk returns a tuple with the TokenEndpoint field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateServiceAccountKeyResponseCredentials) GetTokenEndpointOk() (ret CreateServiceAccountKeyResponseCredentialsGetTokenEndpointRetType, ok bool) { + return getCreateServiceAccountKeyResponseCredentialsGetTokenEndpointAttributeTypeOk(o.TokenEndpoint) +} + +// HasTokenEndpoint returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateServiceAccountKeyResponseCredentials) HasTokenEndpoint() bool { + _, ok := o.GetTokenEndpointOk() + return ok +} + +// SetTokenEndpoint gets a reference to the given string and assigns it to the TokenEndpoint field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateServiceAccountKeyResponseCredentials) SetTokenEndpoint(v CreateServiceAccountKeyResponseCredentialsGetTokenEndpointRetType) { + setCreateServiceAccountKeyResponseCredentialsGetTokenEndpointAttributeType(&o.TokenEndpoint, v) +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateServiceAccountKeyResponseCredentials) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} @@ -323,6 +379,9 @@ func (o CreateServiceAccountKeyResponseCredentials) ToMap() (map[string]interfac if val, ok := getCreateServiceAccountKeyResponseCredentialsGetSubAttributeTypeOk(o.Sub); ok { toSerialize["Sub"] = val } + if val, ok := getCreateServiceAccountKeyResponseCredentialsGetTokenEndpointAttributeTypeOk(o.TokenEndpoint); ok { + toSerialize["TokenEndpoint"] = val + } return toSerialize, nil } diff --git a/services/serviceaccount/model_service_account.go b/services/serviceaccount/model_service_account.go index 34407e24e..ff4e9ff8a 100644 --- a/services/serviceaccount/model_service_account.go +++ b/services/serviceaccount/model_service_account.go @@ -126,33 +126,6 @@ type ServiceAccountGetProjectIdArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceAccountGetProjectIdRetType = string -/* - types and functions for tokenEndpoint -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ServiceAccountGetTokenEndpointAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getServiceAccountGetTokenEndpointAttributeTypeOk(arg ServiceAccountGetTokenEndpointAttributeType) (ret ServiceAccountGetTokenEndpointRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setServiceAccountGetTokenEndpointAttributeType(arg *ServiceAccountGetTokenEndpointAttributeType, val ServiceAccountGetTokenEndpointRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ServiceAccountGetTokenEndpointArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ServiceAccountGetTokenEndpointRetType = string - // ServiceAccount struct for ServiceAccount // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceAccount struct { @@ -168,9 +141,6 @@ type ServiceAccount struct { // ID of the related project // REQUIRED ProjectId ServiceAccountGetProjectIdAttributeType `json:"projectId" required:"true"` - // Endpoint used to obtain access tokens for the service account - // REQUIRED - TokenEndpoint ServiceAccountGetTokenEndpointAttributeType `json:"tokenEndpoint" required:"true"` } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -181,13 +151,12 @@ type _ServiceAccount ServiceAccount // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewServiceAccount(email ServiceAccountGetEmailArgType, id ServiceAccountGetIdArgType, internal ServiceAccountgetInternalArgType, projectId ServiceAccountGetProjectIdArgType, tokenEndpoint ServiceAccountGetTokenEndpointArgType) *ServiceAccount { +func NewServiceAccount(email ServiceAccountGetEmailArgType, id ServiceAccountGetIdArgType, internal ServiceAccountgetInternalArgType, projectId ServiceAccountGetProjectIdArgType) *ServiceAccount { this := ServiceAccount{} setServiceAccountGetEmailAttributeType(&this.Email, email) setServiceAccountGetIdAttributeType(&this.Id, id) setServiceAccountgetInternalAttributeType(&this.Internal, internal) setServiceAccountGetProjectIdAttributeType(&this.ProjectId, projectId) - setServiceAccountGetTokenEndpointAttributeType(&this.TokenEndpoint, tokenEndpoint) return &this } @@ -280,26 +249,6 @@ func (o *ServiceAccount) SetProjectId(v ServiceAccountGetProjectIdRetType) { setServiceAccountGetProjectIdAttributeType(&o.ProjectId, v) } -// GetTokenEndpoint returns the TokenEndpoint field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ServiceAccount) GetTokenEndpoint() (ret ServiceAccountGetTokenEndpointRetType) { - ret, _ = o.GetTokenEndpointOk() - return ret -} - -// GetTokenEndpointOk returns a tuple with the TokenEndpoint field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ServiceAccount) GetTokenEndpointOk() (ret ServiceAccountGetTokenEndpointRetType, ok bool) { - return getServiceAccountGetTokenEndpointAttributeTypeOk(o.TokenEndpoint) -} - -// SetTokenEndpoint sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ServiceAccount) SetTokenEndpoint(v ServiceAccountGetTokenEndpointRetType) { - setServiceAccountGetTokenEndpointAttributeType(&o.TokenEndpoint, v) -} - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ServiceAccount) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} @@ -315,9 +264,6 @@ func (o ServiceAccount) ToMap() (map[string]interface{}, error) { if val, ok := getServiceAccountGetProjectIdAttributeTypeOk(o.ProjectId); ok { toSerialize["ProjectId"] = val } - if val, ok := getServiceAccountGetTokenEndpointAttributeTypeOk(o.TokenEndpoint); ok { - toSerialize["TokenEndpoint"] = val - } return toSerialize, nil } diff --git a/services/serviceaccount/oas_commit b/services/serviceaccount/oas_commit index 234be7ccd..a3d18078a 100644 --- a/services/serviceaccount/oas_commit +++ b/services/serviceaccount/oas_commit @@ -1 +1 @@ -739851cba4a57dde8b44ba05f3e3460fc549fde4 +4a484071a2326e02b082a0930e8c41386992a1d8 diff --git a/services/serviceaccount/v2api/model_create_service_account_key_response_credentials.go b/services/serviceaccount/v2api/model_create_service_account_key_response_credentials.go index 844b15207..61b987238 100644 --- a/services/serviceaccount/v2api/model_create_service_account_key_response_credentials.go +++ b/services/serviceaccount/v2api/model_create_service_account_key_response_credentials.go @@ -29,7 +29,9 @@ type CreateServiceAccountKeyResponseCredentials struct { // Private key. Only present, if the service account API was generating the key. Not recoverable later. PrivateKey *string `json:"privateKey,omitempty"` // Service account id - Sub string `json:"sub"` + Sub string `json:"sub"` + // Endpoint used to obtain access tokens for the service account. + TokenEndpoint *string `json:"tokenEndpoint,omitempty"` AdditionalProperties map[string]interface{} } @@ -184,6 +186,38 @@ func (o *CreateServiceAccountKeyResponseCredentials) SetSub(v string) { o.Sub = v } +// GetTokenEndpoint returns the TokenEndpoint field value if set, zero value otherwise. +func (o *CreateServiceAccountKeyResponseCredentials) GetTokenEndpoint() string { + if o == nil || IsNil(o.TokenEndpoint) { + var ret string + return ret + } + return *o.TokenEndpoint +} + +// GetTokenEndpointOk returns a tuple with the TokenEndpoint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServiceAccountKeyResponseCredentials) GetTokenEndpointOk() (*string, bool) { + if o == nil || IsNil(o.TokenEndpoint) { + return nil, false + } + return o.TokenEndpoint, true +} + +// HasTokenEndpoint returns a boolean if a field has been set. +func (o *CreateServiceAccountKeyResponseCredentials) HasTokenEndpoint() bool { + if o != nil && !IsNil(o.TokenEndpoint) { + return true + } + + return false +} + +// SetTokenEndpoint gets a reference to the given string and assigns it to the TokenEndpoint field. +func (o *CreateServiceAccountKeyResponseCredentials) SetTokenEndpoint(v string) { + o.TokenEndpoint = &v +} + func (o CreateServiceAccountKeyResponseCredentials) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -201,6 +235,9 @@ func (o CreateServiceAccountKeyResponseCredentials) ToMap() (map[string]interfac toSerialize["privateKey"] = o.PrivateKey } toSerialize["sub"] = o.Sub + if !IsNil(o.TokenEndpoint) { + toSerialize["tokenEndpoint"] = o.TokenEndpoint + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -252,6 +289,7 @@ func (o *CreateServiceAccountKeyResponseCredentials) UnmarshalJSON(data []byte) delete(additionalProperties, "kid") delete(additionalProperties, "privateKey") delete(additionalProperties, "sub") + delete(additionalProperties, "tokenEndpoint") o.AdditionalProperties = additionalProperties } diff --git a/services/serviceaccount/v2api/model_service_account.go b/services/serviceaccount/v2api/model_service_account.go index 57fd18e58..a406c152c 100644 --- a/services/serviceaccount/v2api/model_service_account.go +++ b/services/serviceaccount/v2api/model_service_account.go @@ -27,9 +27,7 @@ type ServiceAccount struct { // Flag indicating internal service accounts Internal bool `json:"internal"` // ID of the related project - ProjectId string `json:"projectId"` - // Endpoint used to obtain access tokens for the service account - TokenEndpoint string `json:"tokenEndpoint"` + ProjectId string `json:"projectId"` AdditionalProperties map[string]interface{} } @@ -39,13 +37,12 @@ type _ServiceAccount ServiceAccount // 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 NewServiceAccount(email string, id string, internal bool, projectId string, tokenEndpoint string) *ServiceAccount { +func NewServiceAccount(email string, id string, internal bool, projectId string) *ServiceAccount { this := ServiceAccount{} this.Email = email this.Id = id this.Internal = internal this.ProjectId = projectId - this.TokenEndpoint = tokenEndpoint return &this } @@ -153,30 +150,6 @@ func (o *ServiceAccount) SetProjectId(v string) { o.ProjectId = v } -// GetTokenEndpoint returns the TokenEndpoint field value -func (o *ServiceAccount) GetTokenEndpoint() string { - if o == nil { - var ret string - return ret - } - - return o.TokenEndpoint -} - -// GetTokenEndpointOk returns a tuple with the TokenEndpoint field value -// and a boolean to check if the value has been set. -func (o *ServiceAccount) GetTokenEndpointOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.TokenEndpoint, true -} - -// SetTokenEndpoint sets field value -func (o *ServiceAccount) SetTokenEndpoint(v string) { - o.TokenEndpoint = v -} - func (o ServiceAccount) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -191,7 +164,6 @@ func (o ServiceAccount) ToMap() (map[string]interface{}, error) { toSerialize["id"] = o.Id toSerialize["internal"] = o.Internal toSerialize["projectId"] = o.ProjectId - toSerialize["tokenEndpoint"] = o.TokenEndpoint for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -209,7 +181,6 @@ func (o *ServiceAccount) UnmarshalJSON(data []byte) (err error) { "id", "internal", "projectId", - "tokenEndpoint", } allProperties := make(map[string]interface{}) @@ -243,7 +214,6 @@ func (o *ServiceAccount) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "id") delete(additionalProperties, "internal") delete(additionalProperties, "projectId") - delete(additionalProperties, "tokenEndpoint") o.AdditionalProperties = additionalProperties }