From 64903aec3210a8b06528e97bcac2a4e20197aec0 Mon Sep 17 00:00:00 2001 From: "M. Simon" <100732743+mjspi@users.noreply.github.com> Date: Tue, 31 Oct 2023 07:15:14 -0500 Subject: [PATCH] Support the issuance of multiple verifiable credentials based on a directory attribute. (#275) * SDK update to support the issuance of multiple verifiable credentials based on a directory attribute. * Changelog update. * uplift `credentials` version + changelog --------- Co-authored-by: Patrick Cowland --- CHANGELOG.md | 3 + credentials/.openapi-generator/FILES | 2 + credentials/.version | 2 +- credentials/CHANGELOG.md | 5 + credentials/README.md | 3 +- credentials/api/openapi.yaml | 36 +++++- credentials/configuration.go | 2 +- credentials/docs/CredentialType.md | 26 ++++ .../docs/CredentialTypeMetaDataFieldsInner.md | 26 ++++ credentials/docs/CredentialTypeMultiple.md | 51 ++++++++ .../docs/EntityArrayEmbeddedItemsInner.md | 26 ++++ credentials/generate/pingone-credentials.yml | 12 ++ credentials/go.mod | 2 +- credentials/go.sum | 4 +- credentials/model_credential_type.go | 36 ++++++ ..._credential_type_meta_data_fields_inner.go | 37 ++++++ credentials/model_credential_type_multiple.go | 118 ++++++++++++++++++ 17 files changed, 381 insertions(+), 10 deletions(-) create mode 100644 credentials/docs/CredentialTypeMultiple.md create mode 100644 credentials/model_credential_type_multiple.go diff --git a/CHANGELOG.md b/CHANGELOG.md index bb396bf9..b096a11a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Release (Unreleased) +* `github.com/patrickcping/pingone-go-sdk-v2/credentials` : [v0.5.0](./credentials/CHANGELOG.md) + * **Enhancement** Added the `Default` property to the `CredentialTypeMetaDataFieldsInner` object model. [#275](https://github.com/patrickcping/pingone-go-sdk-v2/pull/275) + * **Enhancement** Added `Multiple` object attribute to the `CredentialType` object model. [#275](https://github.com/patrickcping/pingone-go-sdk-v2/pull/275) * `github.com/patrickcping/pingone-go-sdk-v2/management` : [v0.31.0](./management/CHANGELOG.md) * **Enhancement** Added `DisplayName`, `SourceId` and `SourceType` object attributes to the `Group` object model. [#264](https://github.com/patrickcping/pingone-go-sdk-v2/pull/264) * **Enhancement** Added `TlsClientAuthKeyPair` object attributes to the `Subscription` object model. [#265](https://github.com/patrickcping/pingone-go-sdk-v2/pull/265) diff --git a/credentials/.openapi-generator/FILES b/credentials/.openapi-generator/FILES index 83610bfb..a7a9d56a 100644 --- a/credentials/.openapi-generator/FILES +++ b/credentials/.openapi-generator/FILES @@ -42,6 +42,7 @@ docs/CredentialIssuersApi.md docs/CredentialType.md docs/CredentialTypeMetaData.md docs/CredentialTypeMetaDataFieldsInner.md +docs/CredentialTypeMultiple.md docs/CredentialTypeOnDelete.md docs/CredentialTypesApi.md docs/DigitalWalletApplication.md @@ -111,6 +112,7 @@ model_credential_issuer_profile_application_instance.go model_credential_type.go model_credential_type_meta_data.go model_credential_type_meta_data_fields_inner.go +model_credential_type_multiple.go model_credential_type_on_delete.go model_digital_wallet_application.go model_entity_array.go diff --git a/credentials/.version b/credentials/.version index 44bb5d1f..79a2734b 100644 --- a/credentials/.version +++ b/credentials/.version @@ -1 +1 @@ -0.4.1 \ No newline at end of file +0.5.0 \ No newline at end of file diff --git a/credentials/CHANGELOG.md b/credentials/CHANGELOG.md index 7a08dfb1..52f06b34 100644 --- a/credentials/CHANGELOG.md +++ b/credentials/CHANGELOG.md @@ -1,3 +1,8 @@ +# v0.5.0 (Unreleased) + +* **Enhancement** Added the `Default` property to the `CredentialTypeMetaDataFieldsInner` object model. [#275](https://github.com/patrickcping/pingone-go-sdk-v2/pull/275) +* **Enhancement** Added `Multiple` object attribute to the `CredentialType` object model. [#275](https://github.com/patrickcping/pingone-go-sdk-v2/pull/275) + # v0.4.1 (2023-10-16) * **Note** Unskip read only attributes when converting API models to maps. [#255](https://github.com/patrickcping/pingone-go-sdk-v2/pull/255) diff --git a/credentials/README.md b/credentials/README.md index df695d08..f1e8007e 100644 --- a/credentials/README.md +++ b/credentials/README.md @@ -6,7 +6,7 @@ The PingOne Platform API covering the PingOne Credentials service This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: 2023-06-29 -- Package version: 0.4.1 +- Package version: 0.5.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation @@ -147,6 +147,7 @@ Class | Method | HTTP request | Description - [CredentialType](docs/CredentialType.md) - [CredentialTypeMetaData](docs/CredentialTypeMetaData.md) - [CredentialTypeMetaDataFieldsInner](docs/CredentialTypeMetaDataFieldsInner.md) + - [CredentialTypeMultiple](docs/CredentialTypeMultiple.md) - [CredentialTypeOnDelete](docs/CredentialTypeOnDelete.md) - [DigitalWalletApplication](docs/DigitalWalletApplication.md) - [EntityArray](docs/EntityArray.md) diff --git a/credentials/api/openapi.yaml b/credentials/api/openapi.yaml index 8a525551..a4eae976 100644 --- a/credentials/api/openapi.yaml +++ b/credentials/api/openapi.yaml @@ -2420,14 +2420,16 @@ components: bgOpacityPercent: 0 cardColor: cardColor fields: - - attribute: attribute + - default: default + attribute: attribute id: id isVisible: true fileSupport: null title: title type: null value: value - - attribute: attribute + - default: default + attribute: attribute id: id isVisible: true fileSupport: null @@ -2488,14 +2490,16 @@ components: bgOpacityPercent: 0 cardColor: cardColor fields: - - attribute: attribute + - default: default + attribute: attribute id: id isVisible: true fileSupport: null title: title type: null value: value - - attribute: attribute + - default: default + attribute: attribute id: id isVisible: true fileSupport: null @@ -2511,6 +2515,8 @@ components: href: https://openapi-generator.tech issuerName: issuerName cardType: cardType + multiple: + expression: expression description: description title: title issuer: @@ -2562,6 +2568,8 @@ components: type: string metadata: $ref: '#/components/schemas/CredentialTypeMetaData' + multiple: + $ref: '#/components/schemas/CredentialType_multiple' onDelete: $ref: '#/components/schemas/CredentialType_onDelete' title: @@ -3554,6 +3562,7 @@ components: type: object CredentialTypeMetaData_fields_inner: example: + default: default attribute: attribute id: id isVisible: true @@ -3566,6 +3575,10 @@ components: description: A string that specifies the name of the PingOne Directory attribute if field.type is Directory Attribute. type: string + default: + description: Assigns a default field value if a PingOne Expression Language + (PEL) expression in the fields.attribute evaluates to no value. + type: string id: description: A string that specifies the identifier of the field. type: string @@ -3591,6 +3604,21 @@ components: - title - type type: object + CredentialType_multiple: + description: An object containing directives that enable the issuance of multiple + credentials to a user based on a directory attribute. + example: + expression: expression + properties: + expression: + description: "A PingOne Expression Language (PEL) expression evaluated by\ + \ the P1 Credentials service on issuance.If an array, calculates the array\ + \ length for the count. Populates the limit to a variable, __ITERATOR__,\ + \ available to PEL expressions in metadata.fields.attribute." + type: string + required: + - expression + type: object CredentialType_onDelete: example: revokeIssuedCredentials: true diff --git a/credentials/configuration.go b/credentials/configuration.go index 726d6cc9..5d00e34d 100644 --- a/credentials/configuration.go +++ b/credentials/configuration.go @@ -91,7 +91,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "pingtools PingOne-GOLANG-SDK (credentials)/0.4.1 go", + UserAgent: "pingtools PingOne-GOLANG-SDK (credentials)/0.5.0 go", Debug: false, DefaultServerIndex: 0, Servers: ServerConfigurations{ diff --git a/credentials/docs/CredentialType.md b/credentials/docs/CredentialType.md index 63694bda..ce0c5459 100644 --- a/credentials/docs/CredentialType.md +++ b/credentials/docs/CredentialType.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **Issuer** | Pointer to [**ObjectIssuer**](ObjectIssuer.md) | | [optional] **IssuerName** | Pointer to **string** | v issuer name associated with the card, can differ from title. | [optional] **Metadata** | [**CredentialTypeMetaData**](CredentialTypeMetaData.md) | | +**Multiple** | Pointer to [**CredentialTypeMultiple**](CredentialTypeMultiple.md) | | [optional] **OnDelete** | Pointer to [**CredentialTypeOnDelete**](CredentialTypeOnDelete.md) | | [optional] **Title** | **string** | A string that specifies the title of the credential. Verification sites are expected to be able to request the issued credential from the compatible wallet app using the title. | **UpdatedAt** | Pointer to **time.Time** | A string that specifies the date and time the credential type was last updated; can be null. | [optional] [readonly] @@ -303,6 +304,31 @@ and a boolean to check if the value has been set. SetMetadata sets Metadata field to given value. +### GetMultiple + +`func (o *CredentialType) GetMultiple() CredentialTypeMultiple` + +GetMultiple returns the Multiple field if non-nil, zero value otherwise. + +### GetMultipleOk + +`func (o *CredentialType) GetMultipleOk() (*CredentialTypeMultiple, bool)` + +GetMultipleOk returns a tuple with the Multiple field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMultiple + +`func (o *CredentialType) SetMultiple(v CredentialTypeMultiple)` + +SetMultiple sets Multiple field to given value. + +### HasMultiple + +`func (o *CredentialType) HasMultiple() bool` + +HasMultiple returns a boolean if a field has been set. + ### GetOnDelete `func (o *CredentialType) GetOnDelete() CredentialTypeOnDelete` diff --git a/credentials/docs/CredentialTypeMetaDataFieldsInner.md b/credentials/docs/CredentialTypeMetaDataFieldsInner.md index a751daef..0c5ede3b 100644 --- a/credentials/docs/CredentialTypeMetaDataFieldsInner.md +++ b/credentials/docs/CredentialTypeMetaDataFieldsInner.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Attribute** | Pointer to **string** | A string that specifies the name of the PingOne Directory attribute if field.type is Directory Attribute. | [optional] +**Default** | Pointer to **string** | Assigns a default field value if a PingOne Expression Language (PEL) expression in the fields.attribute evaluates to no value. | [optional] **Id** | **string** | A string that specifies the identifier of the field. | **FileSupport** | Pointer to [**EnumCredentialTypeMetaDataFieldsFileSupport**](EnumCredentialTypeMetaDataFieldsFileSupport.md) | | [optional] **IsVisible** | **bool** | A boolean value that specifies whether the field should be visible to viewers of the credential. | @@ -56,6 +57,31 @@ SetAttribute sets Attribute field to given value. HasAttribute returns a boolean if a field has been set. +### GetDefault + +`func (o *CredentialTypeMetaDataFieldsInner) GetDefault() string` + +GetDefault returns the Default field if non-nil, zero value otherwise. + +### GetDefaultOk + +`func (o *CredentialTypeMetaDataFieldsInner) GetDefaultOk() (*string, bool)` + +GetDefaultOk returns a tuple with the Default field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefault + +`func (o *CredentialTypeMetaDataFieldsInner) SetDefault(v string)` + +SetDefault sets Default field to given value. + +### HasDefault + +`func (o *CredentialTypeMetaDataFieldsInner) HasDefault() bool` + +HasDefault returns a boolean if a field has been set. + ### GetId `func (o *CredentialTypeMetaDataFieldsInner) GetId() string` diff --git a/credentials/docs/CredentialTypeMultiple.md b/credentials/docs/CredentialTypeMultiple.md new file mode 100644 index 00000000..d17cfb87 --- /dev/null +++ b/credentials/docs/CredentialTypeMultiple.md @@ -0,0 +1,51 @@ +# CredentialTypeMultiple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Expression** | **string** | A PingOne Expression Language (PEL) expression evaluated by the P1 Credentials service on issuance.If an array, calculates the array length for the count. Populates the limit to a variable, __ITERATOR__, available to PEL expressions in metadata.fields.attribute. | + +## Methods + +### NewCredentialTypeMultiple + +`func NewCredentialTypeMultiple(expression string, ) *CredentialTypeMultiple` + +NewCredentialTypeMultiple instantiates a new CredentialTypeMultiple object +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 + +### NewCredentialTypeMultipleWithDefaults + +`func NewCredentialTypeMultipleWithDefaults() *CredentialTypeMultiple` + +NewCredentialTypeMultipleWithDefaults instantiates a new CredentialTypeMultiple object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetExpression + +`func (o *CredentialTypeMultiple) GetExpression() string` + +GetExpression returns the Expression field if non-nil, zero value otherwise. + +### GetExpressionOk + +`func (o *CredentialTypeMultiple) GetExpressionOk() (*string, bool)` + +GetExpressionOk returns a tuple with the Expression field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpression + +`func (o *CredentialTypeMultiple) SetExpression(v string)` + +SetExpression sets Expression field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/credentials/docs/EntityArrayEmbeddedItemsInner.md b/credentials/docs/EntityArrayEmbeddedItemsInner.md index 3ea0ceea..1351d6d4 100644 --- a/credentials/docs/EntityArrayEmbeddedItemsInner.md +++ b/credentials/docs/EntityArrayEmbeddedItemsInner.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **Issuer** | Pointer to [**ObjectIssuer**](ObjectIssuer.md) | | [optional] **IssuerName** | Pointer to **string** | v issuer name associated with the card, can differ from title. | [optional] **Metadata** | [**CredentialTypeMetaData**](CredentialTypeMetaData.md) | | +**Multiple** | Pointer to [**CredentialTypeMultiple**](CredentialTypeMultiple.md) | | [optional] **OnDelete** | Pointer to [**CredentialTypeOnDelete**](CredentialTypeOnDelete.md) | | [optional] **Title** | **string** | A string that specifies the title of the credential. Verification sites are expected to be able to request the issued credential from the compatible wallet app using the title. | **UpdatedAt** | Pointer to **time.Time** | | [optional] [readonly] @@ -309,6 +310,31 @@ and a boolean to check if the value has been set. SetMetadata sets Metadata field to given value. +### GetMultiple + +`func (o *EntityArrayEmbeddedItemsInner) GetMultiple() CredentialTypeMultiple` + +GetMultiple returns the Multiple field if non-nil, zero value otherwise. + +### GetMultipleOk + +`func (o *EntityArrayEmbeddedItemsInner) GetMultipleOk() (*CredentialTypeMultiple, bool)` + +GetMultipleOk returns a tuple with the Multiple field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMultiple + +`func (o *EntityArrayEmbeddedItemsInner) SetMultiple(v CredentialTypeMultiple)` + +SetMultiple sets Multiple field to given value. + +### HasMultiple + +`func (o *EntityArrayEmbeddedItemsInner) HasMultiple() bool` + +HasMultiple returns a boolean if a field has been set. + ### GetOnDelete `func (o *EntityArrayEmbeddedItemsInner) GetOnDelete() CredentialTypeOnDelete` diff --git a/credentials/generate/pingone-credentials.yml b/credentials/generate/pingone-credentials.yml index 3606587f..07c3a6d8 100644 --- a/credentials/generate/pingone-credentials.yml +++ b/credentials/generate/pingone-credentials.yml @@ -162,6 +162,9 @@ components: attribute: type: string description: A string that specifies the name of the PingOne Directory attribute if field.type is Directory Attribute. + default: + type: string + description: Assigns a default field value if a PingOne Expression Language (PEL) expression in the fields.attribute evaluates to no value. id: type: string description: A string that specifies the identifier of the field. @@ -230,6 +233,15 @@ components: description: v issuer name associated with the card, can differ from title. metadata: $ref: '#/components/schemas/CredentialTypeMetaData' + multiple: + type: object + description: An object containing directives that enable the issuance of multiple credentials to a user based on a directory attribute. + properties: + expression: + type: string + description: A PingOne Expression Language (PEL) expression evaluated by the P1 Credentials service on issuance.If an array, calculates the array length for the count. Populates the limit to a variable, __ITERATOR__, available to PEL expressions in metadata.fields.attribute. + required: + - expression onDelete: type: object properties: diff --git a/credentials/go.mod b/credentials/go.mod index 161183fc..bb2a45d1 100644 --- a/credentials/go.mod +++ b/credentials/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 + golang.org/x/exp v0.0.0-20231006140011-7918f672742d ) require ( diff --git a/credentials/go.sum b/credentials/go.sum index 4524181c..2ec18e08 100644 --- a/credentials/go.sum +++ b/credentials/go.sum @@ -4,8 +4,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/credentials/model_credential_type.go b/credentials/model_credential_type.go index 7ebb449e..673ccfd3 100644 --- a/credentials/model_credential_type.go +++ b/credentials/model_credential_type.go @@ -38,6 +38,7 @@ type CredentialType struct { // v issuer name associated with the card, can differ from title. IssuerName *string `json:"issuerName,omitempty"` Metadata CredentialTypeMetaData `json:"metadata"` + Multiple *CredentialTypeMultiple `json:"multiple,omitempty"` OnDelete *CredentialTypeOnDelete `json:"onDelete,omitempty"` // A string that specifies the title of the credential. Verification sites are expected to be able to request the issued credential from the compatible wallet app using the title. Title string `json:"title"` @@ -401,6 +402,38 @@ func (o *CredentialType) SetMetadata(v CredentialTypeMetaData) { o.Metadata = v } +// GetMultiple returns the Multiple field value if set, zero value otherwise. +func (o *CredentialType) GetMultiple() CredentialTypeMultiple { + if o == nil || IsNil(o.Multiple) { + var ret CredentialTypeMultiple + return ret + } + return *o.Multiple +} + +// GetMultipleOk returns a tuple with the Multiple field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialType) GetMultipleOk() (*CredentialTypeMultiple, bool) { + if o == nil || IsNil(o.Multiple) { + return nil, false + } + return o.Multiple, true +} + +// HasMultiple returns a boolean if a field has been set. +func (o *CredentialType) HasMultiple() bool { + if o != nil && !IsNil(o.Multiple) { + return true + } + + return false +} + +// SetMultiple gets a reference to the given CredentialTypeMultiple and assigns it to the Multiple field. +func (o *CredentialType) SetMultiple(v CredentialTypeMultiple) { + o.Multiple = &v +} + // GetOnDelete returns the OnDelete field value if set, zero value otherwise. func (o *CredentialType) GetOnDelete() CredentialTypeOnDelete { if o == nil || IsNil(o.OnDelete) { @@ -528,6 +561,9 @@ func (o CredentialType) ToMap() (map[string]interface{}, error) { toSerialize["issuerName"] = o.IssuerName } toSerialize["metadata"] = o.Metadata + if !IsNil(o.Multiple) { + toSerialize["multiple"] = o.Multiple + } if !IsNil(o.OnDelete) { toSerialize["onDelete"] = o.OnDelete } diff --git a/credentials/model_credential_type_meta_data_fields_inner.go b/credentials/model_credential_type_meta_data_fields_inner.go index 4e055199..11abb47d 100644 --- a/credentials/model_credential_type_meta_data_fields_inner.go +++ b/credentials/model_credential_type_meta_data_fields_inner.go @@ -21,6 +21,8 @@ var _ MappedNullable = &CredentialTypeMetaDataFieldsInner{} type CredentialTypeMetaDataFieldsInner struct { // A string that specifies the name of the PingOne Directory attribute if field.type is Directory Attribute. Attribute *string `json:"attribute,omitempty"` + // Assigns a default field value if a PingOne Expression Language (PEL) expression in the fields.attribute evaluates to no value. + Default *string `json:"default,omitempty"` // A string that specifies the identifier of the field. Id string `json:"id"` FileSupport *EnumCredentialTypeMetaDataFieldsFileSupport `json:"fileSupport,omitempty"` @@ -86,6 +88,38 @@ func (o *CredentialTypeMetaDataFieldsInner) SetAttribute(v string) { o.Attribute = &v } +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *CredentialTypeMetaDataFieldsInner) GetDefault() string { + if o == nil || IsNil(o.Default) { + var ret string + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialTypeMetaDataFieldsInner) GetDefaultOk() (*string, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *CredentialTypeMetaDataFieldsInner) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given string and assigns it to the Default field. +func (o *CredentialTypeMetaDataFieldsInner) SetDefault(v string) { + o.Default = &v +} + // GetId returns the Id field value func (o *CredentialTypeMetaDataFieldsInner) GetId() string { if o == nil { @@ -259,6 +293,9 @@ func (o CredentialTypeMetaDataFieldsInner) ToMap() (map[string]interface{}, erro if !IsNil(o.Attribute) { toSerialize["attribute"] = o.Attribute } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } toSerialize["id"] = o.Id if !IsNil(o.FileSupport) { toSerialize["fileSupport"] = o.FileSupport diff --git a/credentials/model_credential_type_multiple.go b/credentials/model_credential_type_multiple.go new file mode 100644 index 00000000..da6988b5 --- /dev/null +++ b/credentials/model_credential_type_multiple.go @@ -0,0 +1,118 @@ +/* +PingOne Platform API - Credentials + +The PingOne Platform API covering the PingOne Credentials service + +API version: 2023-06-29 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package credentials + +import ( + "encoding/json" +) + +// checks if the CredentialTypeMultiple type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialTypeMultiple{} + +// CredentialTypeMultiple An object containing directives that enable the issuance of multiple credentials to a user based on a directory attribute. +type CredentialTypeMultiple struct { + // A PingOne Expression Language (PEL) expression evaluated by the P1 Credentials service on issuance.If an array, calculates the array length for the count. Populates the limit to a variable, __ITERATOR__, available to PEL expressions in metadata.fields.attribute. + Expression string `json:"expression"` +} + +// NewCredentialTypeMultiple instantiates a new CredentialTypeMultiple object +// 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 NewCredentialTypeMultiple(expression string) *CredentialTypeMultiple { + this := CredentialTypeMultiple{} + this.Expression = expression + return &this +} + +// NewCredentialTypeMultipleWithDefaults instantiates a new CredentialTypeMultiple object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCredentialTypeMultipleWithDefaults() *CredentialTypeMultiple { + this := CredentialTypeMultiple{} + return &this +} + +// GetExpression returns the Expression field value +func (o *CredentialTypeMultiple) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *CredentialTypeMultiple) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *CredentialTypeMultiple) SetExpression(v string) { + o.Expression = v +} + +func (o CredentialTypeMultiple) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialTypeMultiple) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["expression"] = o.Expression + return toSerialize, nil +} + +type NullableCredentialTypeMultiple struct { + value *CredentialTypeMultiple + isSet bool +} + +func (v NullableCredentialTypeMultiple) Get() *CredentialTypeMultiple { + return v.value +} + +func (v *NullableCredentialTypeMultiple) Set(val *CredentialTypeMultiple) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialTypeMultiple) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialTypeMultiple) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialTypeMultiple(val *CredentialTypeMultiple) *NullableCredentialTypeMultiple { + return &NullableCredentialTypeMultiple{value: val, isSet: true} +} + +func (v NullableCredentialTypeMultiple) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialTypeMultiple) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +