From 0fb27b4fa1a77cbc5a90c1b015868298625d7908 Mon Sep 17 00:00:00 2001 From: Patrick Cowland Date: Mon, 26 Jun 2023 19:21:30 +0100 Subject: [PATCH 1/4] Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. --- CHANGELOG.md | 1 + management/.openapi-generator/FILES | 4 + management/CHANGELOG.md | 1 + management/README.md | 2 + management/api/openapi.yaml | 35 +++++ management/api_notifications_settings.go | 10 +- .../EnumNotificationsSettingsDeliveryMode.md | 11 ++ management/docs/NotificationsSettings.md | 78 +++++++++++ management/docs/NotificationsSettingsApi.md | 8 +- .../NotificationsSettingsWhitelistInner.md | 56 ++++++++ ...um_notifications_settings_delivery_mode.go | 109 +++++++++++++++ management/model_notifications_settings.go | 108 +++++++++++++++ ..._notifications_settings_whitelist_inner.go | 126 ++++++++++++++++++ pingone-management.yml | 24 ++++ 14 files changed, 569 insertions(+), 4 deletions(-) create mode 100644 management/docs/EnumNotificationsSettingsDeliveryMode.md create mode 100644 management/docs/NotificationsSettingsWhitelistInner.md create mode 100644 management/model_enum_notifications_settings_delivery_mode.go create mode 100644 management/model_notifications_settings_whitelist_inner.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bf8601a..1c2b1ade 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * **Bug** Corrected `Name` as required property of `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `Numbers` array to the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `PhoneDeliverySettings` array to the `EntityArray` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) + * **Enhancement** Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. [#196](https://github.com/patrickcping/pingone-go-sdk-v2/pull/196) * `github.com/patrickcping/pingone-go-sdk-v2/mfa` : [v0.13.0](./mfa/CHANGELOG.md) * **Breaking change** Migrated `CreateMFAPushCredentialRequest` and `UpdateMFAPushCredentialRequest` to `MFAPushCredentialRequest`. [#201](https://github.com/patrickcping/pingone-go-sdk-v2/pull/201) * **Breaking change** Migrated `EntityArrayEmbeddedPushCredentialsInner` to `MFAPushCredentialResponse`. [#201](https://github.com/patrickcping/pingone-go-sdk-v2/pull/201) diff --git a/management/.openapi-generator/FILES b/management/.openapi-generator/FILES index 74dde11d..adba2acd 100644 --- a/management/.openapi-generator/FILES +++ b/management/.openapi-generator/FILES @@ -249,6 +249,7 @@ docs/EnumNotificationsPolicyCountryLimitDeliveryMethod.md docs/EnumNotificationsPolicyCountryLimitType.md docs/EnumNotificationsPolicyQuotaDeliveryMethods.md docs/EnumNotificationsPolicyQuotaItemType.md +docs/EnumNotificationsSettingsDeliveryMode.md docs/EnumNotificationsSettingsPhoneDeliverySettingsCustomAuthMethod.md docs/EnumNotificationsSettingsPhoneDeliverySettingsCustomDeliveryMethod.md docs/EnumNotificationsSettingsPhoneDeliverySettingsCustomNumberFormat.md @@ -447,6 +448,7 @@ docs/NotificationsSettingsReplyTo.md docs/NotificationsSettingsRestrictions.md docs/NotificationsSettingsRestrictionsSmsVoiceQuota.md docs/NotificationsSettingsSMTPApi.md +docs/NotificationsSettingsWhitelistInner.md docs/NotificationsTemplatesApi.md docs/ObjectApplication.md docs/ObjectEnvironment.md @@ -754,6 +756,7 @@ model_enum_notifications_policy_country_limit_delivery_method.go model_enum_notifications_policy_country_limit_type.go model_enum_notifications_policy_quota_delivery_methods.go model_enum_notifications_policy_quota_item_type.go +model_enum_notifications_settings_delivery_mode.go model_enum_notifications_settings_phone_delivery_settings_custom_auth_method.go model_enum_notifications_settings_phone_delivery_settings_custom_delivery_method.go model_enum_notifications_settings_phone_delivery_settings_custom_number_format.go @@ -929,6 +932,7 @@ model_notifications_settings_phone_delivery_settings_twilio_syniverse_all_of.go model_notifications_settings_reply_to.go model_notifications_settings_restrictions.go model_notifications_settings_restrictions_sms_voice_quota.go +model_notifications_settings_whitelist_inner.go model_object_application.go model_object_organization.go model_object_population.go diff --git a/management/CHANGELOG.md b/management/CHANGELOG.md index c1e85aa7..b17524e0 100644 --- a/management/CHANGELOG.md +++ b/management/CHANGELOG.md @@ -5,6 +5,7 @@ * **Bug** Corrected `Name` as required property of `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `Numbers` array to the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `PhoneDeliverySettings` array to the `EntityArray` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) +* **Enhancement** Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. [#196](https://github.com/patrickcping/pingone-go-sdk-v2/pull/196) # v0.22.0 (2023-05-30) diff --git a/management/README.md b/management/README.md index ff985de3..866afba0 100644 --- a/management/README.md +++ b/management/README.md @@ -571,6 +571,7 @@ Class | Method | HTTP request | Description - [EnumNotificationsPolicyCountryLimitType](docs/EnumNotificationsPolicyCountryLimitType.md) - [EnumNotificationsPolicyQuotaDeliveryMethods](docs/EnumNotificationsPolicyQuotaDeliveryMethods.md) - [EnumNotificationsPolicyQuotaItemType](docs/EnumNotificationsPolicyQuotaItemType.md) + - [EnumNotificationsSettingsDeliveryMode](docs/EnumNotificationsSettingsDeliveryMode.md) - [EnumNotificationsSettingsPhoneDeliverySettingsCustomAuthMethod](docs/EnumNotificationsSettingsPhoneDeliverySettingsCustomAuthMethod.md) - [EnumNotificationsSettingsPhoneDeliverySettingsCustomDeliveryMethod](docs/EnumNotificationsSettingsPhoneDeliverySettingsCustomDeliveryMethod.md) - [EnumNotificationsSettingsPhoneDeliverySettingsCustomNumberFormat](docs/EnumNotificationsSettingsPhoneDeliverySettingsCustomNumberFormat.md) @@ -747,6 +748,7 @@ Class | Method | HTTP request | Description - [NotificationsSettingsReplyTo](docs/NotificationsSettingsReplyTo.md) - [NotificationsSettingsRestrictions](docs/NotificationsSettingsRestrictions.md) - [NotificationsSettingsRestrictionsSmsVoiceQuota](docs/NotificationsSettingsRestrictionsSmsVoiceQuota.md) + - [NotificationsSettingsWhitelistInner](docs/NotificationsSettingsWhitelistInner.md) - [ObjectApplication](docs/ObjectApplication.md) - [ObjectEnvironment](docs/ObjectEnvironment.md) - [ObjectOrganization](docs/ObjectOrganization.md) diff --git a/management/api/openapi.yaml b/management/api/openapi.yaml index a7509df3..8926ad5a 100644 --- a/management/api/openapi.yaml +++ b/management/api/openapi.yaml @@ -14238,6 +14238,11 @@ paths: schema: type: string style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationsSettings' responses: "400": content: @@ -23490,6 +23495,10 @@ components: - USER - ENVIRONMENT type: string + EnumNotificationsSettingsDeliveryMode: + enum: + - ALL + type: string EnumNotificationsSettingsPhoneDeliverySettingsCustomDeliveryMethod: description: | The notification's delivery method. Possible values: @@ -27451,9 +27460,12 @@ components: type: object NotificationsSettings: example: + environment: + id: id smsProvidersFallbackChain: - smsProvidersFallbackChain - smsProvidersFallbackChain + deliveryMode: null replyTo: address: address name: name @@ -27464,6 +27476,11 @@ components: address: address name: name id: id + whitelist: + - user: + id: id + - user: + id: id updatedAt: 2000-01-23T04:56:07.000+00:00 properties: updatedAt: @@ -27471,6 +27488,10 @@ components: format: date-time readOnly: true type: string + environment: + $ref: '#/components/schemas/ObjectEnvironment' + deliveryMode: + $ref: '#/components/schemas/EnumNotificationsSettingsDeliveryMode' restrictions: $ref: '#/components/schemas/NotificationsSettings_restrictions' id: @@ -27499,6 +27520,10 @@ components: $ref: '#/components/schemas/NotificationsSettings_from' replyTo: $ref: '#/components/schemas/NotificationsSettings_replyTo' + whitelist: + items: + $ref: '#/components/schemas/NotificationsSettings_whitelist_inner' + type: array type: object NotificationsSettingsEmailDeliverySettings: example: @@ -29394,6 +29419,8 @@ components: - type type: object Application_accessControl_group_groups_inner: + example: + id: id properties: id: type: string @@ -33022,6 +33049,14 @@ components: \ for details." type: string type: object + NotificationsSettings_whitelist_inner: + example: + user: + id: id + properties: + user: + $ref: '#/components/schemas/Application_accessControl_group_groups_inner' + type: object NotificationsSettingsEmailDeliverySettings_from: example: address: address diff --git a/management/api_notifications_settings.go b/management/api_notifications_settings.go index 46b18233..f0ffda72 100644 --- a/management/api_notifications_settings.go +++ b/management/api_notifications_settings.go @@ -369,6 +369,12 @@ type ApiUpdateNotificationsSettingsRequest struct { ctx context.Context ApiService *NotificationsSettingsApiService environmentID string + notificationsSettings *NotificationsSettings +} + +func (r ApiUpdateNotificationsSettingsRequest) NotificationsSettings(notificationsSettings NotificationsSettings) ApiUpdateNotificationsSettingsRequest { + r.notificationsSettings = ¬ificationsSettings + return r } func (r ApiUpdateNotificationsSettingsRequest) Execute() (*NotificationsSettings, *http.Response, error) { @@ -422,7 +428,7 @@ func (a *NotificationsSettingsApiService) internalUpdateNotificationsSettingsExe localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -438,6 +444,8 @@ func (a *NotificationsSettingsApiService) internalUpdateNotificationsSettingsExe if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.notificationsSettings req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err diff --git a/management/docs/EnumNotificationsSettingsDeliveryMode.md b/management/docs/EnumNotificationsSettingsDeliveryMode.md new file mode 100644 index 00000000..2af1d38e --- /dev/null +++ b/management/docs/EnumNotificationsSettingsDeliveryMode.md @@ -0,0 +1,11 @@ +# EnumNotificationsSettingsDeliveryMode + +## Enum + + +* `ALL` (value: `"ALL"`) + + +[[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/management/docs/NotificationsSettings.md b/management/docs/NotificationsSettings.md index f229b89f..5acc1abf 100644 --- a/management/docs/NotificationsSettings.md +++ b/management/docs/NotificationsSettings.md @@ -5,11 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **UpdatedAt** | Pointer to **time.Time** | The time the resource was last updated. | [optional] [readonly] +**Environment** | Pointer to [**ObjectEnvironment**](ObjectEnvironment.md) | | [optional] +**DeliveryMode** | Pointer to [**EnumNotificationsSettingsDeliveryMode**](EnumNotificationsSettingsDeliveryMode.md) | | [optional] **Restrictions** | Pointer to [**NotificationsSettingsRestrictions**](NotificationsSettingsRestrictions.md) | | [optional] **Id** | Pointer to **string** | A string that specifies the resource’s unique identifier. | [optional] [readonly] **SmsProvidersFallbackChain** | Pointer to **[]string** | A list which represents the execution order of different SMS/Voice providers configured for the environment. The providers and their accounts’ configurations are represented in the list by the ID of the corresponding `PhoneDeliverySettings` resource. The only provider which is not represented by a `phoneDeliverySettingsID` is the PingOne Twilio provider. The PingOne Twilio provider is represented by the `PINGONE_TWILIO` string. If the `smsProvidersFallbackChain` list is empty, an SMS or voice message will be sent using the default Ping Twilio account. Otherwise, an SMS or voice message will be sent using the first provider in the list. If the server fails to queue the message using that provider, it will use the next provider in the list to try to send the message. This process will go on until there are no more providers in the list. If the server failed to send the message using all providers, the notification status is set to `FAILED`. | [optional] **From** | Pointer to [**NotificationsSettingsFrom**](NotificationsSettingsFrom.md) | | [optional] **ReplyTo** | Pointer to [**NotificationsSettingsReplyTo**](NotificationsSettingsReplyTo.md) | | [optional] +**Whitelist** | Pointer to [**[]NotificationsSettingsWhitelistInner**](NotificationsSettingsWhitelistInner.md) | | [optional] ## Methods @@ -55,6 +58,56 @@ SetUpdatedAt sets UpdatedAt field to given value. HasUpdatedAt returns a boolean if a field has been set. +### GetEnvironment + +`func (o *NotificationsSettings) GetEnvironment() ObjectEnvironment` + +GetEnvironment returns the Environment field if non-nil, zero value otherwise. + +### GetEnvironmentOk + +`func (o *NotificationsSettings) GetEnvironmentOk() (*ObjectEnvironment, bool)` + +GetEnvironmentOk returns a tuple with the Environment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironment + +`func (o *NotificationsSettings) SetEnvironment(v ObjectEnvironment)` + +SetEnvironment sets Environment field to given value. + +### HasEnvironment + +`func (o *NotificationsSettings) HasEnvironment() bool` + +HasEnvironment returns a boolean if a field has been set. + +### GetDeliveryMode + +`func (o *NotificationsSettings) GetDeliveryMode() EnumNotificationsSettingsDeliveryMode` + +GetDeliveryMode returns the DeliveryMode field if non-nil, zero value otherwise. + +### GetDeliveryModeOk + +`func (o *NotificationsSettings) GetDeliveryModeOk() (*EnumNotificationsSettingsDeliveryMode, bool)` + +GetDeliveryModeOk returns a tuple with the DeliveryMode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryMode + +`func (o *NotificationsSettings) SetDeliveryMode(v EnumNotificationsSettingsDeliveryMode)` + +SetDeliveryMode sets DeliveryMode field to given value. + +### HasDeliveryMode + +`func (o *NotificationsSettings) HasDeliveryMode() bool` + +HasDeliveryMode returns a boolean if a field has been set. + ### GetRestrictions `func (o *NotificationsSettings) GetRestrictions() NotificationsSettingsRestrictions` @@ -180,6 +233,31 @@ SetReplyTo sets ReplyTo field to given value. HasReplyTo returns a boolean if a field has been set. +### GetWhitelist + +`func (o *NotificationsSettings) GetWhitelist() []NotificationsSettingsWhitelistInner` + +GetWhitelist returns the Whitelist field if non-nil, zero value otherwise. + +### GetWhitelistOk + +`func (o *NotificationsSettings) GetWhitelistOk() (*[]NotificationsSettingsWhitelistInner, bool)` + +GetWhitelistOk returns a tuple with the Whitelist field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWhitelist + +`func (o *NotificationsSettings) SetWhitelist(v []NotificationsSettingsWhitelistInner)` + +SetWhitelist sets Whitelist field to given value. + +### HasWhitelist + +`func (o *NotificationsSettings) HasWhitelist() bool` + +HasWhitelist 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/management/docs/NotificationsSettingsApi.md b/management/docs/NotificationsSettingsApi.md index 3c254f38..8d3aa89e 100644 --- a/management/docs/NotificationsSettingsApi.md +++ b/management/docs/NotificationsSettingsApi.md @@ -146,7 +146,7 @@ Name | Type | Description | Notes ## UpdateNotificationsSettings -> NotificationsSettings UpdateNotificationsSettings(ctx, environmentID).Execute() +> NotificationsSettings UpdateNotificationsSettings(ctx, environmentID).NotificationsSettings(notificationsSettings).Execute() UPDATE Notifications Settings @@ -164,10 +164,11 @@ import ( func main() { environmentID := "environmentID_example" // string | + notificationsSettings := *openapiclient.NewNotificationsSettings() // NotificationsSettings | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationsSettingsApi.UpdateNotificationsSettings(context.Background(), environmentID).Execute() + resp, r, err := apiClient.NotificationsSettingsApi.UpdateNotificationsSettings(context.Background(), environmentID).NotificationsSettings(notificationsSettings).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NotificationsSettingsApi.UpdateNotificationsSettings``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -193,6 +194,7 @@ Other parameters are passed through a pointer to a apiUpdateNotificationsSetting Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **notificationsSettings** | [**NotificationsSettings**](NotificationsSettings.md) | | ### Return type @@ -204,7 +206,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/management/docs/NotificationsSettingsWhitelistInner.md b/management/docs/NotificationsSettingsWhitelistInner.md new file mode 100644 index 00000000..59e3edbe --- /dev/null +++ b/management/docs/NotificationsSettingsWhitelistInner.md @@ -0,0 +1,56 @@ +# NotificationsSettingsWhitelistInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**User** | Pointer to [**ApplicationAccessControlGroupGroupsInner**](ApplicationAccessControlGroupGroupsInner.md) | | [optional] + +## Methods + +### NewNotificationsSettingsWhitelistInner + +`func NewNotificationsSettingsWhitelistInner() *NotificationsSettingsWhitelistInner` + +NewNotificationsSettingsWhitelistInner instantiates a new NotificationsSettingsWhitelistInner 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 + +### NewNotificationsSettingsWhitelistInnerWithDefaults + +`func NewNotificationsSettingsWhitelistInnerWithDefaults() *NotificationsSettingsWhitelistInner` + +NewNotificationsSettingsWhitelistInnerWithDefaults instantiates a new NotificationsSettingsWhitelistInner 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 + +### GetUser + +`func (o *NotificationsSettingsWhitelistInner) GetUser() ApplicationAccessControlGroupGroupsInner` + +GetUser returns the User field if non-nil, zero value otherwise. + +### GetUserOk + +`func (o *NotificationsSettingsWhitelistInner) GetUserOk() (*ApplicationAccessControlGroupGroupsInner, bool)` + +GetUserOk returns a tuple with the User field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUser + +`func (o *NotificationsSettingsWhitelistInner) SetUser(v ApplicationAccessControlGroupGroupsInner)` + +SetUser sets User field to given value. + +### HasUser + +`func (o *NotificationsSettingsWhitelistInner) HasUser() bool` + +HasUser 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/management/model_enum_notifications_settings_delivery_mode.go b/management/model_enum_notifications_settings_delivery_mode.go new file mode 100644 index 00000000..994b1043 --- /dev/null +++ b/management/model_enum_notifications_settings_delivery_mode.go @@ -0,0 +1,109 @@ +/* +PingOne Platform API - SSO and Base + +The PingOne Platform API covering the base and SSO services (otherwise known as the Management APIs) + +API version: 2022-08-02 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package management + +import ( + "encoding/json" + "fmt" +) + +// EnumNotificationsSettingsDeliveryMode the model 'EnumNotificationsSettingsDeliveryMode' +type EnumNotificationsSettingsDeliveryMode string + +// List of EnumNotificationsSettingsDeliveryMode +const ( + ENUMNOTIFICATIONSSETTINGSDELIVERYMODE_ALL EnumNotificationsSettingsDeliveryMode = "ALL" +) + +// All allowed values of EnumNotificationsSettingsDeliveryMode enum +var AllowedEnumNotificationsSettingsDeliveryModeEnumValues = []EnumNotificationsSettingsDeliveryMode{ + "ALL", +} + +func (v *EnumNotificationsSettingsDeliveryMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EnumNotificationsSettingsDeliveryMode(value) + for _, existing := range AllowedEnumNotificationsSettingsDeliveryModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EnumNotificationsSettingsDeliveryMode", value) +} + +// NewEnumNotificationsSettingsDeliveryModeFromValue returns a pointer to a valid EnumNotificationsSettingsDeliveryMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEnumNotificationsSettingsDeliveryModeFromValue(v string) (*EnumNotificationsSettingsDeliveryMode, error) { + ev := EnumNotificationsSettingsDeliveryMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EnumNotificationsSettingsDeliveryMode: valid values are %v", v, AllowedEnumNotificationsSettingsDeliveryModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EnumNotificationsSettingsDeliveryMode) IsValid() bool { + for _, existing := range AllowedEnumNotificationsSettingsDeliveryModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EnumNotificationsSettingsDeliveryMode value +func (v EnumNotificationsSettingsDeliveryMode) Ptr() *EnumNotificationsSettingsDeliveryMode { + return &v +} + +type NullableEnumNotificationsSettingsDeliveryMode struct { + value *EnumNotificationsSettingsDeliveryMode + isSet bool +} + +func (v NullableEnumNotificationsSettingsDeliveryMode) Get() *EnumNotificationsSettingsDeliveryMode { + return v.value +} + +func (v *NullableEnumNotificationsSettingsDeliveryMode) Set(val *EnumNotificationsSettingsDeliveryMode) { + v.value = val + v.isSet = true +} + +func (v NullableEnumNotificationsSettingsDeliveryMode) IsSet() bool { + return v.isSet +} + +func (v *NullableEnumNotificationsSettingsDeliveryMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnumNotificationsSettingsDeliveryMode(val *EnumNotificationsSettingsDeliveryMode) *NullableEnumNotificationsSettingsDeliveryMode { + return &NullableEnumNotificationsSettingsDeliveryMode{value: val, isSet: true} +} + +func (v NullableEnumNotificationsSettingsDeliveryMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnumNotificationsSettingsDeliveryMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/management/model_notifications_settings.go b/management/model_notifications_settings.go index d5013702..1f5756c4 100644 --- a/management/model_notifications_settings.go +++ b/management/model_notifications_settings.go @@ -22,6 +22,8 @@ var _ MappedNullable = &NotificationsSettings{} type NotificationsSettings struct { // The time the resource was last updated. UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Environment *ObjectEnvironment `json:"environment,omitempty"` + DeliveryMode *EnumNotificationsSettingsDeliveryMode `json:"deliveryMode,omitempty"` Restrictions *NotificationsSettingsRestrictions `json:"restrictions,omitempty"` // A string that specifies the resource’s unique identifier. Id *string `json:"id,omitempty"` @@ -29,6 +31,7 @@ type NotificationsSettings struct { SmsProvidersFallbackChain []string `json:"smsProvidersFallbackChain,omitempty"` From *NotificationsSettingsFrom `json:"from,omitempty"` ReplyTo *NotificationsSettingsReplyTo `json:"replyTo,omitempty"` + Whitelist []NotificationsSettingsWhitelistInner `json:"whitelist,omitempty"` } // NewNotificationsSettings instantiates a new NotificationsSettings object @@ -80,6 +83,70 @@ func (o *NotificationsSettings) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } +// GetEnvironment returns the Environment field value if set, zero value otherwise. +func (o *NotificationsSettings) GetEnvironment() ObjectEnvironment { + if o == nil || IsNil(o.Environment) { + var ret ObjectEnvironment + return ret + } + return *o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationsSettings) GetEnvironmentOk() (*ObjectEnvironment, bool) { + if o == nil || IsNil(o.Environment) { + return nil, false + } + return o.Environment, true +} + +// HasEnvironment returns a boolean if a field has been set. +func (o *NotificationsSettings) HasEnvironment() bool { + if o != nil && !IsNil(o.Environment) { + return true + } + + return false +} + +// SetEnvironment gets a reference to the given ObjectEnvironment and assigns it to the Environment field. +func (o *NotificationsSettings) SetEnvironment(v ObjectEnvironment) { + o.Environment = &v +} + +// GetDeliveryMode returns the DeliveryMode field value if set, zero value otherwise. +func (o *NotificationsSettings) GetDeliveryMode() EnumNotificationsSettingsDeliveryMode { + if o == nil || IsNil(o.DeliveryMode) { + var ret EnumNotificationsSettingsDeliveryMode + return ret + } + return *o.DeliveryMode +} + +// GetDeliveryModeOk returns a tuple with the DeliveryMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationsSettings) GetDeliveryModeOk() (*EnumNotificationsSettingsDeliveryMode, bool) { + if o == nil || IsNil(o.DeliveryMode) { + return nil, false + } + return o.DeliveryMode, true +} + +// HasDeliveryMode returns a boolean if a field has been set. +func (o *NotificationsSettings) HasDeliveryMode() bool { + if o != nil && !IsNil(o.DeliveryMode) { + return true + } + + return false +} + +// SetDeliveryMode gets a reference to the given EnumNotificationsSettingsDeliveryMode and assigns it to the DeliveryMode field. +func (o *NotificationsSettings) SetDeliveryMode(v EnumNotificationsSettingsDeliveryMode) { + o.DeliveryMode = &v +} + // GetRestrictions returns the Restrictions field value if set, zero value otherwise. func (o *NotificationsSettings) GetRestrictions() NotificationsSettingsRestrictions { if o == nil || IsNil(o.Restrictions) { @@ -240,6 +307,38 @@ func (o *NotificationsSettings) SetReplyTo(v NotificationsSettingsReplyTo) { o.ReplyTo = &v } +// GetWhitelist returns the Whitelist field value if set, zero value otherwise. +func (o *NotificationsSettings) GetWhitelist() []NotificationsSettingsWhitelistInner { + if o == nil || IsNil(o.Whitelist) { + var ret []NotificationsSettingsWhitelistInner + return ret + } + return o.Whitelist +} + +// GetWhitelistOk returns a tuple with the Whitelist field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationsSettings) GetWhitelistOk() ([]NotificationsSettingsWhitelistInner, bool) { + if o == nil || IsNil(o.Whitelist) { + return nil, false + } + return o.Whitelist, true +} + +// HasWhitelist returns a boolean if a field has been set. +func (o *NotificationsSettings) HasWhitelist() bool { + if o != nil && !IsNil(o.Whitelist) { + return true + } + + return false +} + +// SetWhitelist gets a reference to the given []NotificationsSettingsWhitelistInner and assigns it to the Whitelist field. +func (o *NotificationsSettings) SetWhitelist(v []NotificationsSettingsWhitelistInner) { + o.Whitelist = v +} + func (o NotificationsSettings) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -251,6 +350,12 @@ func (o NotificationsSettings) MarshalJSON() ([]byte, error) { func (o NotificationsSettings) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} // skip: updatedAt is readOnly + if !IsNil(o.Environment) { + toSerialize["environment"] = o.Environment + } + if !IsNil(o.DeliveryMode) { + toSerialize["deliveryMode"] = o.DeliveryMode + } if !IsNil(o.Restrictions) { toSerialize["restrictions"] = o.Restrictions } @@ -264,6 +369,9 @@ func (o NotificationsSettings) ToMap() (map[string]interface{}, error) { if !IsNil(o.ReplyTo) { toSerialize["replyTo"] = o.ReplyTo } + if !IsNil(o.Whitelist) { + toSerialize["whitelist"] = o.Whitelist + } return toSerialize, nil } diff --git a/management/model_notifications_settings_whitelist_inner.go b/management/model_notifications_settings_whitelist_inner.go new file mode 100644 index 00000000..7bd4d153 --- /dev/null +++ b/management/model_notifications_settings_whitelist_inner.go @@ -0,0 +1,126 @@ +/* +PingOne Platform API - SSO and Base + +The PingOne Platform API covering the base and SSO services (otherwise known as the Management APIs) + +API version: 2022-08-02 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package management + +import ( + "encoding/json" +) + +// checks if the NotificationsSettingsWhitelistInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotificationsSettingsWhitelistInner{} + +// NotificationsSettingsWhitelistInner struct for NotificationsSettingsWhitelistInner +type NotificationsSettingsWhitelistInner struct { + User *ApplicationAccessControlGroupGroupsInner `json:"user,omitempty"` +} + +// NewNotificationsSettingsWhitelistInner instantiates a new NotificationsSettingsWhitelistInner 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 NewNotificationsSettingsWhitelistInner() *NotificationsSettingsWhitelistInner { + this := NotificationsSettingsWhitelistInner{} + return &this +} + +// NewNotificationsSettingsWhitelistInnerWithDefaults instantiates a new NotificationsSettingsWhitelistInner 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 NewNotificationsSettingsWhitelistInnerWithDefaults() *NotificationsSettingsWhitelistInner { + this := NotificationsSettingsWhitelistInner{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *NotificationsSettingsWhitelistInner) GetUser() ApplicationAccessControlGroupGroupsInner { + if o == nil || IsNil(o.User) { + var ret ApplicationAccessControlGroupGroupsInner + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationsSettingsWhitelistInner) GetUserOk() (*ApplicationAccessControlGroupGroupsInner, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *NotificationsSettingsWhitelistInner) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given ApplicationAccessControlGroupGroupsInner and assigns it to the User field. +func (o *NotificationsSettingsWhitelistInner) SetUser(v ApplicationAccessControlGroupGroupsInner) { + o.User = &v +} + +func (o NotificationsSettingsWhitelistInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotificationsSettingsWhitelistInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + return toSerialize, nil +} + +type NullableNotificationsSettingsWhitelistInner struct { + value *NotificationsSettingsWhitelistInner + isSet bool +} + +func (v NullableNotificationsSettingsWhitelistInner) Get() *NotificationsSettingsWhitelistInner { + return v.value +} + +func (v *NullableNotificationsSettingsWhitelistInner) Set(val *NotificationsSettingsWhitelistInner) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationsSettingsWhitelistInner) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationsSettingsWhitelistInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationsSettingsWhitelistInner(val *NotificationsSettingsWhitelistInner) *NullableNotificationsSettingsWhitelistInner { + return &NullableNotificationsSettingsWhitelistInner{value: val, isSet: true} +} + +func (v NullableNotificationsSettingsWhitelistInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationsSettingsWhitelistInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pingone-management.yml b/pingone-management.yml index f890558a..248aabef 100644 --- a/pingone-management.yml +++ b/pingone-management.yml @@ -285,6 +285,9 @@ components: type: string enum: [USER, ENVIRONMENT] description: Specifies whether the limit defined is per-user or per environment. Value must be either `USER` or `ENVIRONMENT`. + EnumNotificationsSettingsDeliveryMode: + type: string + enum: [ALL] EnumNotificationsSettingsPhoneDeliverySettingsCustomDeliveryMethod: type: string enum: [SMS, VOICE] @@ -3567,6 +3570,10 @@ components: format: date-time readOnly: true description: The time the resource was last updated. + environment: + $ref: '#/components/schemas/ObjectEnvironment' + deliveryMode: + $ref: '#/components/schemas/EnumNotificationsSettingsDeliveryMode' restrictions: type: object properties: @@ -3611,6 +3618,18 @@ components: address: type: string description: A string that specifies the email's "reply to" address (relevant when `deliveryMethod` is `Email`). This value must be a trusted email address. See [Note](https://apidocs.pingidentity.com/pingone/platform/v1/api/#notifications-settings-from-replyTo-note) for details. + whitelist: + type: array + items: + type: object + properties: + user: + type: object + properties: + id: + type: string + required: + - id NotificationsSettingsEmailDeliverySettings: type: object properties: @@ -13906,6 +13925,11 @@ paths: - Notifications Settings summary: UPDATE Notifications Settings operationId: updateNotificationsSettings + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationsSettings' parameters: - name: environmentID in: path From 3d843b607f6e2fc0a17b8c94bcb1fd31f89a91de Mon Sep 17 00:00:00 2001 From: Patrick Cowland Date: Mon, 26 Jun 2023 19:22:39 +0100 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 2 +- management/CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c2b1ade..46766514 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ * **Bug** Corrected `Name` as required property of `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `Numbers` array to the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `PhoneDeliverySettings` array to the `EntityArray` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) - * **Enhancement** Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. [#196](https://github.com/patrickcping/pingone-go-sdk-v2/pull/196) + * **Enhancement** Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) * `github.com/patrickcping/pingone-go-sdk-v2/mfa` : [v0.13.0](./mfa/CHANGELOG.md) * **Breaking change** Migrated `CreateMFAPushCredentialRequest` and `UpdateMFAPushCredentialRequest` to `MFAPushCredentialRequest`. [#201](https://github.com/patrickcping/pingone-go-sdk-v2/pull/201) * **Breaking change** Migrated `EntityArrayEmbeddedPushCredentialsInner` to `MFAPushCredentialResponse`. [#201](https://github.com/patrickcping/pingone-go-sdk-v2/pull/201) diff --git a/management/CHANGELOG.md b/management/CHANGELOG.md index b17524e0..d387fa7d 100644 --- a/management/CHANGELOG.md +++ b/management/CHANGELOG.md @@ -5,7 +5,7 @@ * **Bug** Corrected `Name` as required property of `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `Numbers` array to the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `PhoneDeliverySettings` array to the `EntityArray` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) -* **Enhancement** Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. [#196](https://github.com/patrickcping/pingone-go-sdk-v2/pull/196) +* **Enhancement** Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) # v0.22.0 (2023-05-30) From acb2ab8eaf5f0f620781a289430fb68b227d7868 Mon Sep 17 00:00:00 2001 From: Patrick Cowland Date: Tue, 27 Jun 2023 14:57:43 +0100 Subject: [PATCH 3/4] Corrected `DeleteNotificationsSettings` response code and payload --- CHANGELOG.md | 1 + go.work.sum | 1 + management/CHANGELOG.md | 1 + management/api/openapi.yaml | 6 ++- management/api_notifications_settings.go | 60 ++++++++++++--------- management/docs/NotificationsSettingsApi.md | 8 +-- management/go.mod | 2 +- management/go.sum | 4 +- pingone-management.yml | 6 ++- 9 files changed, 56 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46766514..39b169ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * **Bug** Fixed Phone Notification Settings `POST` and `PUT` request payload data model. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Bug** Corrected `Requests` from object to array in the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Bug** Corrected `Name` as required property of `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) + * **Bug** Corrected `DeleteNotificationsSettings` response code and payload. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) * **Enhancement** Added `Numbers` array to the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `PhoneDeliverySettings` array to the `EntityArray` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) diff --git a/go.work.sum b/go.work.sum index 353e317e..395b5fe1 100644 --- a/go.work.sum +++ b/go.work.sum @@ -489,6 +489,7 @@ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhp golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/management/CHANGELOG.md b/management/CHANGELOG.md index d387fa7d..fc91999b 100644 --- a/management/CHANGELOG.md +++ b/management/CHANGELOG.md @@ -3,6 +3,7 @@ * **Bug** Fixed Phone Notification Settings `POST` and `PUT` request payload data model. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Bug** Corrected `Requests` from object to array in the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Bug** Corrected `Name` as required property of `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) +* **Bug** Corrected `DeleteNotificationsSettings` response code and payload. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) * **Enhancement** Added `Numbers` array to the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `PhoneDeliverySettings` array to the `EntityArray` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) diff --git a/management/api/openapi.yaml b/management/api/openapi.yaml index 8926ad5a..ab6f5f64 100644 --- a/management/api/openapi.yaml +++ b/management/api/openapi.yaml @@ -14166,7 +14166,11 @@ paths: schema: $ref: '#/components/schemas/P1Error' description: Uncaught error occurred. Platform outage - "204": + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationsSettings' description: Successful response summary: DELETE Notifications Settings tags: diff --git a/management/api_notifications_settings.go b/management/api_notifications_settings.go index f0ffda72..a1984441 100644 --- a/management/api_notifications_settings.go +++ b/management/api_notifications_settings.go @@ -29,7 +29,7 @@ type ApiDeleteNotificationsSettingsRequest struct { environmentID string } -func (r ApiDeleteNotificationsSettingsRequest) Execute() (*http.Response, error) { +func (r ApiDeleteNotificationsSettingsRequest) Execute() (*NotificationsSettings, *http.Response, error) { return r.ApiService.DeleteNotificationsSettingsExecute(r) } @@ -49,26 +49,27 @@ func (a *NotificationsSettingsApiService) DeleteNotificationsSettings(ctx contex } // Execute executes the request -func (a *NotificationsSettingsApiService) DeleteNotificationsSettingsExecute(r ApiDeleteNotificationsSettingsRequest) (*http.Response, error) { - _, response, error := processResponse( +// @return NotificationsSettings +func (a *NotificationsSettingsApiService) DeleteNotificationsSettingsExecute(r ApiDeleteNotificationsSettingsRequest) (*NotificationsSettings, *http.Response, error) { + obj, response, error := processResponse( func() (interface{}, *http.Response, error) { - resp, err := r.ApiService.internalDeleteNotificationsSettingsExecute(r) - return nil, resp, err + return r.ApiService.internalDeleteNotificationsSettingsExecute(r) }, ) - return response, error + return obj.(*NotificationsSettings), response, error } -func (a *NotificationsSettingsApiService) internalDeleteNotificationsSettingsExecute(r ApiDeleteNotificationsSettingsRequest) (*http.Response, error) { +func (a *NotificationsSettingsApiService) internalDeleteNotificationsSettingsExecute(r ApiDeleteNotificationsSettingsRequest) (*NotificationsSettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile + localVarReturnValue *NotificationsSettings ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationsSettingsApiService.DeleteNotificationsSettings") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/v1/environments/{environmentID}/notificationsSettings" @@ -97,19 +98,19 @@ func (a *NotificationsSettingsApiService) internalDeleteNotificationsSettingsExe } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) _ = localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -122,71 +123,80 @@ func (a *NotificationsSettingsApiService) internalDeleteNotificationsSettingsExe err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v P1Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v P1Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v P1Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v P1Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v P1Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } type ApiReadNotificationsSettingsRequest struct { diff --git a/management/docs/NotificationsSettingsApi.md b/management/docs/NotificationsSettingsApi.md index 8d3aa89e..33c26885 100644 --- a/management/docs/NotificationsSettingsApi.md +++ b/management/docs/NotificationsSettingsApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description ## DeleteNotificationsSettings -> DeleteNotificationsSettings(ctx, environmentID).Execute() +> NotificationsSettings DeleteNotificationsSettings(ctx, environmentID).Execute() DELETE Notifications Settings @@ -33,11 +33,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.NotificationsSettingsApi.DeleteNotificationsSettings(context.Background(), environmentID).Execute() + resp, r, err := apiClient.NotificationsSettingsApi.DeleteNotificationsSettings(context.Background(), environmentID).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `NotificationsSettingsApi.DeleteNotificationsSettings``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `DeleteNotificationsSettings`: NotificationsSettings + fmt.Fprintf(os.Stdout, "Response from `NotificationsSettingsApi.DeleteNotificationsSettings`: %v\n", resp) } ``` @@ -60,7 +62,7 @@ Name | Type | Description | Notes ### Return type - (empty response body) +[**NotificationsSettings**](NotificationsSettings.md) ### Authorization diff --git a/management/go.mod b/management/go.mod index 3d1d1201..c70fbf46 100644 --- a/management/go.mod +++ b/management/go.mod @@ -2,4 +2,4 @@ module github.com/patrickcping/pingone-go-sdk-v2/management go 1.18 -require golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 +require golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df diff --git a/management/go.sum b/management/go.sum index 001575fc..252d9f00 100644 --- a/management/go.sum +++ b/management/go.sum @@ -1,2 +1,2 @@ -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= diff --git a/pingone-management.yml b/pingone-management.yml index 248aabef..71885245 100644 --- a/pingone-management.yml +++ b/pingone-management.yml @@ -13979,8 +13979,12 @@ paths: $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' - '204': + '200': description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationsSettings' /v1/environments/{environmentID}/notificationsSettings/emailDeliverySettings: get: tags: From 954e0e5399e677945c092a3fede839cd9b296da7 Mon Sep 17 00:00:00 2001 From: Patrick Cowland Date: Tue, 27 Jun 2023 15:03:00 +0100 Subject: [PATCH 4/4] changelog --- CHANGELOG.md | 1 + management/CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39b169ff..be116906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * **Bug** Corrected `Requests` from object to array in the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Bug** Corrected `Name` as required property of `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Bug** Corrected `DeleteNotificationsSettings` response code and payload. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) + * **Bug** Corrected `UpdateNotificationsSettings` request payload. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) * **Enhancement** Added `Numbers` array to the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `PhoneDeliverySettings` array to the `EntityArray` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) diff --git a/management/CHANGELOG.md b/management/CHANGELOG.md index fc91999b..24d1ffa2 100644 --- a/management/CHANGELOG.md +++ b/management/CHANGELOG.md @@ -4,6 +4,7 @@ * **Bug** Corrected `Requests` from object to array in the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Bug** Corrected `Name` as required property of `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Bug** Corrected `DeleteNotificationsSettings` response code and payload. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) +* **Bug** Corrected `UpdateNotificationsSettings` request payload. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203) * **Enhancement** Added `Numbers` array to the `NotificationsSettingsPhoneDeliverySettingsCustom` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `PhoneDeliverySettings` array to the `EntityArray` object. [#195](https://github.com/patrickcping/pingone-go-sdk-v2/pull/195) * **Enhancement** Added `Environment`, `DeliveryMode` and `Whitelist` attributes to the `NotificationsSettings` object. [#203](https://github.com/patrickcping/pingone-go-sdk-v2/pull/203)