From 8c12449f4793efe10b3b3397073beaaa1251407a Mon Sep 17 00:00:00 2001 From: wesleymccollam Date: Thu, 15 Feb 2024 17:13:46 -0500 Subject: [PATCH] oauthAccessTokenMappingId to optional --- api/pf-swagger.yaml | 1 - configurationapi/api/openapi.yaml | 1 - configurationapi/docs/AccessTokenMapping.md | 9 +++-- .../docs/OauthAccessTokenMappingsApi.md | 4 +-- .../model_access_token_mapping.go | 35 ++++++++++++------- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/api/pf-swagger.yaml b/api/pf-swagger.yaml index a657721..9a8935f 100644 --- a/api/pf-swagger.yaml +++ b/api/pf-swagger.yaml @@ -15183,7 +15183,6 @@ components: - accessTokenManagerRef - attributeContractFulfillment - context - - id type: object properties: id: diff --git a/configurationapi/api/openapi.yaml b/configurationapi/api/openapi.yaml index 2f067f3..527a7a3 100644 --- a/configurationapi/api/openapi.yaml +++ b/configurationapi/api/openapi.yaml @@ -15957,7 +15957,6 @@ components: - accessTokenManagerRef - attributeContractFulfillment - context - - id type: object AccessTokenMappingContext: description: The Access Token Attribute Mapping. diff --git a/configurationapi/docs/AccessTokenMapping.md b/configurationapi/docs/AccessTokenMapping.md index 6a0ced0..92f9059 100644 --- a/configurationapi/docs/AccessTokenMapping.md +++ b/configurationapi/docs/AccessTokenMapping.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | The id of the Access Token Mapping. | +**Id** | Pointer to **string** | The id of the Access Token Mapping. | [optional] **Context** | [**AccessTokenMappingContext**](AccessTokenMappingContext.md) | | **AccessTokenManagerRef** | [**ResourceLink**](ResourceLink.md) | | **AttributeSources** | Pointer to [**[]AttributeSourceAggregation**](AttributeSourceAggregation.md) | A list of configured data stores to look up attributes from. | [optional] @@ -15,7 +15,7 @@ Name | Type | Description | Notes ### NewAccessTokenMapping -`func NewAccessTokenMapping(id string, context AccessTokenMappingContext, accessTokenManagerRef ResourceLink, attributeContractFulfillment map[string]AttributeFulfillmentValue, ) *AccessTokenMapping` +`func NewAccessTokenMapping(context AccessTokenMappingContext, accessTokenManagerRef ResourceLink, attributeContractFulfillment map[string]AttributeFulfillmentValue, ) *AccessTokenMapping` NewAccessTokenMapping instantiates a new AccessTokenMapping object This constructor will assign default values to properties that have it defined, @@ -49,6 +49,11 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. +### HasId + +`func (o *AccessTokenMapping) HasId() bool` + +HasId returns a boolean if a field has been set. ### GetContext diff --git a/configurationapi/docs/OauthAccessTokenMappingsApi.md b/configurationapi/docs/OauthAccessTokenMappingsApi.md index b4e155e..1fcfb10 100644 --- a/configurationapi/docs/OauthAccessTokenMappingsApi.md +++ b/configurationapi/docs/OauthAccessTokenMappingsApi.md @@ -33,7 +33,7 @@ import ( ) func main() { - body := *openapiclient.NewAccessTokenMapping("Id_example", *openapiclient.NewAccessTokenMappingContext("Type_example", *openapiclient.NewResourceLink("Id_example")), *openapiclient.NewResourceLink("Id_example"), map[string]AttributeFulfillmentValue{"key": *openapiclient.NewAttributeFulfillmentValue(*openapiclient.NewSourceTypeIdKey("Type_example"), "Value_example")}) // AccessTokenMapping | Configuration for the new Access Token Mapping. + body := *openapiclient.NewAccessTokenMapping(*openapiclient.NewAccessTokenMappingContext("Type_example", *openapiclient.NewResourceLink("Id_example")), *openapiclient.NewResourceLink("Id_example"), map[string]AttributeFulfillmentValue{"key": *openapiclient.NewAttributeFulfillmentValue(*openapiclient.NewSourceTypeIdKey("Type_example"), "Value_example")}) // AccessTokenMapping | Configuration for the new Access Token Mapping. xBypassExternalValidation := true // bool | External validation will be bypassed when set to true. Default to false. (optional) (default to false) configuration := openapiclient.NewConfiguration() @@ -295,7 +295,7 @@ import ( func main() { id := "id_example" // string | ID of the Access Token Mapping to update. - body := *openapiclient.NewAccessTokenMapping("Id_example", *openapiclient.NewAccessTokenMappingContext("Type_example", *openapiclient.NewResourceLink("Id_example")), *openapiclient.NewResourceLink("Id_example"), map[string]AttributeFulfillmentValue{"key": *openapiclient.NewAttributeFulfillmentValue(*openapiclient.NewSourceTypeIdKey("Type_example"), "Value_example")}) // AccessTokenMapping | Configuration for updated mapping. + body := *openapiclient.NewAccessTokenMapping(*openapiclient.NewAccessTokenMappingContext("Type_example", *openapiclient.NewResourceLink("Id_example")), *openapiclient.NewResourceLink("Id_example"), map[string]AttributeFulfillmentValue{"key": *openapiclient.NewAttributeFulfillmentValue(*openapiclient.NewSourceTypeIdKey("Type_example"), "Value_example")}) // AccessTokenMapping | Configuration for updated mapping. xBypassExternalValidation := true // bool | External validation will be bypassed when set to true. Default to false. (optional) (default to false) configuration := openapiclient.NewConfiguration() diff --git a/configurationapi/model_access_token_mapping.go b/configurationapi/model_access_token_mapping.go index 328bf45..4ed1e3a 100644 --- a/configurationapi/model_access_token_mapping.go +++ b/configurationapi/model_access_token_mapping.go @@ -20,7 +20,7 @@ var _ MappedNullable = &AccessTokenMapping{} // AccessTokenMapping The Access Token Attribute Mapping. type AccessTokenMapping struct { // The id of the Access Token Mapping. - Id string `json:"id" tfsdk:"id"` + Id *string `json:"id,omitempty" tfsdk:"id"` Context AccessTokenMappingContext `json:"context" tfsdk:"context"` AccessTokenManagerRef ResourceLink `json:"accessTokenManagerRef" tfsdk:"access_token_manager_ref"` // A list of configured data stores to look up attributes from. @@ -34,9 +34,8 @@ type AccessTokenMapping 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 NewAccessTokenMapping(id string, context AccessTokenMappingContext, accessTokenManagerRef ResourceLink, attributeContractFulfillment map[string]AttributeFulfillmentValue) *AccessTokenMapping { +func NewAccessTokenMapping(context AccessTokenMappingContext, accessTokenManagerRef ResourceLink, attributeContractFulfillment map[string]AttributeFulfillmentValue) *AccessTokenMapping { this := AccessTokenMapping{} - this.Id = id this.Context = context this.AccessTokenManagerRef = accessTokenManagerRef this.AttributeContractFulfillment = attributeContractFulfillment @@ -51,28 +50,36 @@ func NewAccessTokenMappingWithDefaults() *AccessTokenMapping { return &this } -// GetId returns the Id field value +// GetId returns the Id field value if set, zero value otherwise. func (o *AccessTokenMapping) GetId() string { - if o == nil { + if o == nil || IsNil(o.Id) { var ret string return ret } - - return o.Id + return *o.Id } -// GetIdOk returns a tuple with the Id field value +// GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AccessTokenMapping) GetIdOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Id) { return nil, false } - return &o.Id, true + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AccessTokenMapping) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false } -// SetId sets field value +// SetId gets a reference to the given string and assigns it to the Id field. func (o *AccessTokenMapping) SetId(v string) { - o.Id = v + o.Id = &v } // GetContext returns the Context field value @@ -221,7 +228,9 @@ func (o AccessTokenMapping) MarshalJSON() ([]byte, error) { func (o AccessTokenMapping) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } toSerialize["context"] = o.Context toSerialize["accessTokenManagerRef"] = o.AccessTokenManagerRef if !IsNil(o.AttributeSources) {