From 876804a84a5c64c68f7d007e3fa54afe48497f06 Mon Sep 17 00:00:00 2001 From: Patrick Cowland <44225864+patrickcping@users.noreply.github.com> Date: Mon, 22 May 2023 12:15:14 +0100 Subject: [PATCH] Support for `PhoneExtensions` in the `MFASettings` model (#175) * Support for `PhoneExtensions` in the `MFASettings` model * changelogs --- CHANGELOG.md | 2 + mfa/.openapi-generator/FILES | 2 + mfa/.version | 2 +- mfa/CHANGELOG.md | 4 + mfa/README.md | 3 +- mfa/api/openapi.yaml | 16 +++ mfa/configuration.go | 2 +- mfa/docs/MFASettings.md | 26 +++++ mfa/docs/MFASettingsPhoneExtensions.md | 56 +++++++++ mfa/go.mod | 2 +- mfa/go.sum | 4 +- mfa/model_mfa_settings.go | 36 ++++++ mfa/model_mfa_settings_phone_extensions.go | 127 +++++++++++++++++++++ pingone-mfa.yml | 7 ++ 14 files changed, 283 insertions(+), 6 deletions(-) create mode 100644 mfa/docs/MFASettingsPhoneExtensions.md create mode 100644 mfa/model_mfa_settings_phone_extensions.go diff --git a/CHANGELOG.md b/CHANGELOG.md index de54b88b..6e354504 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ * `github.com/patrickcping/pingone-go-sdk-v2/management` : [v0.21.0](./management/CHANGELOG.md) * **Note** Deprecated `bundleId` and `packageName` at the root level of the `ApplicationOIDC` model. Customers should use `mobile.bundleId` and `mobile.packageName` going forward. [#172](https://github.com/patrickcping/pingone-go-sdk-v2/pull/172) * **Enhancement** Added `filterOptions.ipAddressExposed` and `filterOptions.userAgentExposed` to the `Subscription` (webhook) data model. [#173](https://github.com/patrickcping/pingone-go-sdk-v2/pull/173) +* `github.com/patrickcping/pingone-go-sdk-v2/mfa` : [v0.11.0](./mfa/CHANGELOG.md) + * **Enhancement** Support for `PhoneExtensions` in the `MFASettings` model. [#175](https://github.com/patrickcping/pingone-go-sdk-v2/pull/175) # Release (2023-05-19) diff --git a/mfa/.openapi-generator/FILES b/mfa/.openapi-generator/FILES index ddcb5eb7..1e43cb71 100644 --- a/mfa/.openapi-generator/FILES +++ b/mfa/.openapi-generator/FILES @@ -67,6 +67,7 @@ docs/MFASettingsApi.md docs/MFASettingsAuthentication.md docs/MFASettingsLockout.md docs/MFASettingsPairing.md +docs/MFASettingsPhoneExtensions.md docs/ObjectEnvironment.md docs/P1Error.md docs/P1ErrorDetailsInner.md @@ -127,6 +128,7 @@ model_mfa_settings.go model_mfa_settings_authentication.go model_mfa_settings_lockout.go model_mfa_settings_pairing.go +model_mfa_settings_phone_extensions.go model_object_environment.go model_p1_error.go model_p1_error_details_inner.go diff --git a/mfa/.version b/mfa/.version index 2774f858..142464bf 100644 --- a/mfa/.version +++ b/mfa/.version @@ -1 +1 @@ -0.10.0 \ No newline at end of file +0.11.0 \ No newline at end of file diff --git a/mfa/CHANGELOG.md b/mfa/CHANGELOG.md index d86eff63..40a94153 100644 --- a/mfa/CHANGELOG.md +++ b/mfa/CHANGELOG.md @@ -1,3 +1,7 @@ +# v0.11.0 (Unreleased) + +* **Enhancement** Support for `PhoneExtensions` in the `MFASettings` model. [#175](https://github.com/patrickcping/pingone-go-sdk-v2/pull/175) + # v0.10.0 (2023-05-19) * **Note** Change default useragent for HTTP requests. [#160](https://github.com/patrickcping/pingone-go-sdk-v2/pull/160) diff --git a/mfa/README.md b/mfa/README.md index 6cdc4e81..221c2beb 100644 --- a/mfa/README.md +++ b/mfa/README.md @@ -6,7 +6,7 @@ The PingOne Platform API covering the PingOne MFA 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: 2021-10-17 -- Package version: 0.10.0 +- Package version: 0.11.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation @@ -168,6 +168,7 @@ Class | Method | HTTP request | Description - [MFASettingsAuthentication](docs/MFASettingsAuthentication.md) - [MFASettingsLockout](docs/MFASettingsLockout.md) - [MFASettingsPairing](docs/MFASettingsPairing.md) + - [MFASettingsPhoneExtensions](docs/MFASettingsPhoneExtensions.md) - [ObjectEnvironment](docs/ObjectEnvironment.md) - [P1Error](docs/P1Error.md) - [P1ErrorDetailsInner](docs/P1ErrorDetailsInner.md) diff --git a/mfa/api/openapi.yaml b/mfa/api/openapi.yaml index 5f199995..94c0c8e6 100644 --- a/mfa/api/openapi.yaml +++ b/mfa/api/openapi.yaml @@ -3155,6 +3155,8 @@ components: example: environment: id: id + phoneExtensions: + enabled: true lockout: durationSeconds: 6 failureCount: 0 @@ -3173,6 +3175,8 @@ components: $ref: '#/components/schemas/MFASettings_lockout' pairing: $ref: '#/components/schemas/MFASettings_pairing' + phoneExtensions: + $ref: '#/components/schemas/MFASettings_phoneExtensions' updatedAt: description: The time the resource was last updated. format: date-time @@ -4079,6 +4083,18 @@ components: - maxAllowedDevices - pairingKeyFormat type: object + MFASettings_phoneExtensions: + description: Contains settings for phone extension support. + example: + enabled: true + properties: + enabled: + description: "Set to `true` to allow one-time passwords to be delivered\ + \ via voice to phone numbers that include extensions. Set to `false` to\ + \ disable support for phone numbers with extensions. By default, support\ + \ for extensions is disabled." + type: boolean + type: object P1Error_details_inner_innerError: description: Additional details to help the client developer resolve the fault (primarily for UI validation reasons). diff --git a/mfa/configuration.go b/mfa/configuration.go index 561a357c..a2a9455d 100644 --- a/mfa/configuration.go +++ b/mfa/configuration.go @@ -89,7 +89,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "PingOne-GOLANG-SDK/0.10.0/go", + UserAgent: "PingOne-GOLANG-SDK/0.11.0/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/mfa/docs/MFASettings.md b/mfa/docs/MFASettings.md index 063217a3..76b40d00 100644 --- a/mfa/docs/MFASettings.md +++ b/mfa/docs/MFASettings.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Authentication** | Pointer to [**MFASettingsAuthentication**](MFASettingsAuthentication.md) | | [optional] **Lockout** | Pointer to [**MFASettingsLockout**](MFASettingsLockout.md) | | [optional] **Pairing** | [**MFASettingsPairing**](MFASettingsPairing.md) | | +**PhoneExtensions** | Pointer to [**MFASettingsPhoneExtensions**](MFASettingsPhoneExtensions.md) | | [optional] **UpdatedAt** | Pointer to **time.Time** | The time the resource was last updated. | [optional] [readonly] ## Methods @@ -124,6 +125,31 @@ and a boolean to check if the value has been set. SetPairing sets Pairing field to given value. +### GetPhoneExtensions + +`func (o *MFASettings) GetPhoneExtensions() MFASettingsPhoneExtensions` + +GetPhoneExtensions returns the PhoneExtensions field if non-nil, zero value otherwise. + +### GetPhoneExtensionsOk + +`func (o *MFASettings) GetPhoneExtensionsOk() (*MFASettingsPhoneExtensions, bool)` + +GetPhoneExtensionsOk returns a tuple with the PhoneExtensions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhoneExtensions + +`func (o *MFASettings) SetPhoneExtensions(v MFASettingsPhoneExtensions)` + +SetPhoneExtensions sets PhoneExtensions field to given value. + +### HasPhoneExtensions + +`func (o *MFASettings) HasPhoneExtensions() bool` + +HasPhoneExtensions returns a boolean if a field has been set. + ### GetUpdatedAt `func (o *MFASettings) GetUpdatedAt() time.Time` diff --git a/mfa/docs/MFASettingsPhoneExtensions.md b/mfa/docs/MFASettingsPhoneExtensions.md new file mode 100644 index 00000000..39b309b4 --- /dev/null +++ b/mfa/docs/MFASettingsPhoneExtensions.md @@ -0,0 +1,56 @@ +# MFASettingsPhoneExtensions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | Pointer to **bool** | Set to `true` to allow one-time passwords to be delivered via voice to phone numbers that include extensions. Set to `false` to disable support for phone numbers with extensions. By default, support for extensions is disabled. | [optional] + +## Methods + +### NewMFASettingsPhoneExtensions + +`func NewMFASettingsPhoneExtensions() *MFASettingsPhoneExtensions` + +NewMFASettingsPhoneExtensions instantiates a new MFASettingsPhoneExtensions 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 + +### NewMFASettingsPhoneExtensionsWithDefaults + +`func NewMFASettingsPhoneExtensionsWithDefaults() *MFASettingsPhoneExtensions` + +NewMFASettingsPhoneExtensionsWithDefaults instantiates a new MFASettingsPhoneExtensions 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 + +### GetEnabled + +`func (o *MFASettingsPhoneExtensions) GetEnabled() bool` + +GetEnabled returns the Enabled field if non-nil, zero value otherwise. + +### GetEnabledOk + +`func (o *MFASettingsPhoneExtensions) GetEnabledOk() (*bool, bool)` + +GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnabled + +`func (o *MFASettingsPhoneExtensions) SetEnabled(v bool)` + +SetEnabled sets Enabled field to given value. + +### HasEnabled + +`func (o *MFASettingsPhoneExtensions) HasEnabled() bool` + +HasEnabled returns a boolean if a field has been set. + + +[[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/mfa/go.mod b/mfa/go.mod index 51824799..e98fa628 100644 --- a/mfa/go.mod +++ b/mfa/go.mod @@ -2,4 +2,4 @@ module github.com/patrickcping/pingone-go-sdk-v2/mfa go 1.18 -require golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 +require golang.org/x/exp v0.0.0-20230519143937-03e91628a987 diff --git a/mfa/go.sum b/mfa/go.sum index 268a27e0..5336453d 100644 --- a/mfa/go.sum +++ b/mfa/go.sum @@ -1,2 +1,2 @@ -golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= -golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230519143937-03e91628a987 h1:3xJIFvzUFbu4ls0BTBYcgbCGhA63eAOEMxIHugyXJqA= +golang.org/x/exp v0.0.0-20230519143937-03e91628a987/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= diff --git a/mfa/model_mfa_settings.go b/mfa/model_mfa_settings.go index da737851..4b9cc287 100644 --- a/mfa/model_mfa_settings.go +++ b/mfa/model_mfa_settings.go @@ -25,6 +25,7 @@ type MFASettings struct { Authentication *MFASettingsAuthentication `json:"authentication,omitempty"` Lockout *MFASettingsLockout `json:"lockout,omitempty"` Pairing MFASettingsPairing `json:"pairing"` + PhoneExtensions *MFASettingsPhoneExtensions `json:"phoneExtensions,omitempty"` // The time the resource was last updated. UpdatedAt *time.Time `json:"updatedAt,omitempty"` } @@ -170,6 +171,38 @@ func (o *MFASettings) SetPairing(v MFASettingsPairing) { o.Pairing = v } +// GetPhoneExtensions returns the PhoneExtensions field value if set, zero value otherwise. +func (o *MFASettings) GetPhoneExtensions() MFASettingsPhoneExtensions { + if o == nil || IsNil(o.PhoneExtensions) { + var ret MFASettingsPhoneExtensions + return ret + } + return *o.PhoneExtensions +} + +// GetPhoneExtensionsOk returns a tuple with the PhoneExtensions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MFASettings) GetPhoneExtensionsOk() (*MFASettingsPhoneExtensions, bool) { + if o == nil || IsNil(o.PhoneExtensions) { + return nil, false + } + return o.PhoneExtensions, true +} + +// HasPhoneExtensions returns a boolean if a field has been set. +func (o *MFASettings) HasPhoneExtensions() bool { + if o != nil && !IsNil(o.PhoneExtensions) { + return true + } + + return false +} + +// SetPhoneExtensions gets a reference to the given MFASettingsPhoneExtensions and assigns it to the PhoneExtensions field. +func (o *MFASettings) SetPhoneExtensions(v MFASettingsPhoneExtensions) { + o.PhoneExtensions = &v +} + // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *MFASettings) GetUpdatedAt() time.Time { if o == nil || IsNil(o.UpdatedAt) { @@ -222,6 +255,9 @@ func (o MFASettings) ToMap() (map[string]interface{}, error) { toSerialize["lockout"] = o.Lockout } toSerialize["pairing"] = o.Pairing + if !IsNil(o.PhoneExtensions) { + toSerialize["phoneExtensions"] = o.PhoneExtensions + } // skip: updatedAt is readOnly return toSerialize, nil } diff --git a/mfa/model_mfa_settings_phone_extensions.go b/mfa/model_mfa_settings_phone_extensions.go new file mode 100644 index 00000000..e57e67fe --- /dev/null +++ b/mfa/model_mfa_settings_phone_extensions.go @@ -0,0 +1,127 @@ +/* +PingOne Platform API - PingOne MFA + +The PingOne Platform API covering the PingOne MFA service + +API version: 2021-10-17 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package mfa + +import ( + "encoding/json" +) + +// checks if the MFASettingsPhoneExtensions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MFASettingsPhoneExtensions{} + +// MFASettingsPhoneExtensions Contains settings for phone extension support. +type MFASettingsPhoneExtensions struct { + // Set to `true` to allow one-time passwords to be delivered via voice to phone numbers that include extensions. Set to `false` to disable support for phone numbers with extensions. By default, support for extensions is disabled. + Enabled *bool `json:"enabled,omitempty"` +} + +// NewMFASettingsPhoneExtensions instantiates a new MFASettingsPhoneExtensions 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 NewMFASettingsPhoneExtensions() *MFASettingsPhoneExtensions { + this := MFASettingsPhoneExtensions{} + return &this +} + +// NewMFASettingsPhoneExtensionsWithDefaults instantiates a new MFASettingsPhoneExtensions 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 NewMFASettingsPhoneExtensionsWithDefaults() *MFASettingsPhoneExtensions { + this := MFASettingsPhoneExtensions{} + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *MFASettingsPhoneExtensions) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MFASettingsPhoneExtensions) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *MFASettingsPhoneExtensions) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *MFASettingsPhoneExtensions) SetEnabled(v bool) { + o.Enabled = &v +} + +func (o MFASettingsPhoneExtensions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MFASettingsPhoneExtensions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + return toSerialize, nil +} + +type NullableMFASettingsPhoneExtensions struct { + value *MFASettingsPhoneExtensions + isSet bool +} + +func (v NullableMFASettingsPhoneExtensions) Get() *MFASettingsPhoneExtensions { + return v.value +} + +func (v *NullableMFASettingsPhoneExtensions) Set(val *MFASettingsPhoneExtensions) { + v.value = val + v.isSet = true +} + +func (v NullableMFASettingsPhoneExtensions) IsSet() bool { + return v.isSet +} + +func (v *NullableMFASettingsPhoneExtensions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMFASettingsPhoneExtensions(val *MFASettingsPhoneExtensions) *NullableMFASettingsPhoneExtensions { + return &NullableMFASettingsPhoneExtensions{value: val, isSet: true} +} + +func (v NullableMFASettingsPhoneExtensions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMFASettingsPhoneExtensions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pingone-mfa.yml b/pingone-mfa.yml index cc72960b..bbff13e9 100644 --- a/pingone-mfa.yml +++ b/pingone-mfa.yml @@ -576,6 +576,13 @@ components: required: - maxAllowedDevices - pairingKeyFormat + phoneExtensions: + type: object + description: Contains settings for phone extension support. + properties: + enabled: + type: boolean + description: Set to `true` to allow one-time passwords to be delivered via voice to phone numbers that include extensions. Set to `false` to disable support for phone numbers with extensions. By default, support for extensions is disabled. updatedAt: type: string format: date-time