diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ab4d04d2..0ba3aa606 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## Release (2025-XX-XX) +- `opensearch`: [v0.24.0](services/opensearch/CHANGELOG.md#v0240) + - **Breaking change:** `InstanceParametersTlsProtocols` is now a string array instead of a single string + - Add `required:"true"` tags to model structs - `sqlserverflex`: [v1.3.0](services/sqlserverflex/CHANGELOG.md#v130) - Add `required:"true"` tags to model structs - `postgresflex`: [v1.2.0](services/postgresflex/CHANGELOG.md#v120) diff --git a/services/opensearch/CHANGELOG.md b/services/opensearch/CHANGELOG.md index 4f55137e6..cac14a76f 100644 --- a/services/opensearch/CHANGELOG.md +++ b/services/opensearch/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.24.0 +- **Breaking change:** `InstanceParametersTlsProtocols` is now a string array instead of a single string +- Add `required:"true"` tags to model structs + ## v0.23.1 (2025-06-04) - **Bugfix:** Adjusted `UnmarshalJSON` function to use enum types and added tests for enums diff --git a/services/opensearch/model_backup.go b/services/opensearch/model_backup.go index 93281fcb2..02c87b9ac 100644 --- a/services/opensearch/model_backup.go +++ b/services/opensearch/model_backup.go @@ -144,12 +144,12 @@ type BackupGetTriggeredAtRetType = string type Backup struct { Downloadable BackupgetDownloadableAttributeType `json:"downloadable,omitempty"` // REQUIRED - FinishedAt BackupGetFinishedAtAttributeType `json:"finished_at"` + FinishedAt BackupGetFinishedAtAttributeType `json:"finished_at" required:"true"` // REQUIRED - Id BackupGetIdAttributeType `json:"id"` + Id BackupGetIdAttributeType `json:"id" required:"true"` Size BackupGetSizeAttributeType `json:"size,omitempty"` // REQUIRED - Status BackupGetStatusAttributeType `json:"status"` + Status BackupGetStatusAttributeType `json:"status" required:"true"` TriggeredAt BackupGetTriggeredAtAttributeType `json:"triggered_at,omitempty"` } diff --git a/services/opensearch/model_create_backup_response_item.go b/services/opensearch/model_create_backup_response_item.go index 27079e916..4f8676680 100644 --- a/services/opensearch/model_create_backup_response_item.go +++ b/services/opensearch/model_create_backup_response_item.go @@ -61,9 +61,9 @@ type CreateBackupResponseItemGetMessageRetType = string // CreateBackupResponseItem struct for CreateBackupResponseItem type CreateBackupResponseItem struct { // REQUIRED - Id CreateBackupResponseItemGetIdAttributeType `json:"id"` + Id CreateBackupResponseItemGetIdAttributeType `json:"id" required:"true"` // REQUIRED - Message CreateBackupResponseItemGetMessageAttributeType `json:"message"` + Message CreateBackupResponseItemGetMessageAttributeType `json:"message" required:"true"` } type _CreateBackupResponseItem CreateBackupResponseItem diff --git a/services/opensearch/model_create_instance_payload.go b/services/opensearch/model_create_instance_payload.go index 19460c399..fb379073e 100644 --- a/services/opensearch/model_create_instance_payload.go +++ b/services/opensearch/model_create_instance_payload.go @@ -82,10 +82,10 @@ type CreateInstancePayloadGetPlanIdRetType = string // CreateInstancePayload struct for CreateInstancePayload type CreateInstancePayload struct { // REQUIRED - InstanceName CreateInstancePayloadGetInstanceNameAttributeType `json:"instanceName"` + InstanceName CreateInstancePayloadGetInstanceNameAttributeType `json:"instanceName" required:"true"` Parameters CreateInstancePayloadGetParametersAttributeType `json:"parameters,omitempty"` // REQUIRED - PlanId CreateInstancePayloadGetPlanIdAttributeType `json:"planId"` + PlanId CreateInstancePayloadGetPlanIdAttributeType `json:"planId" required:"true"` } type _CreateInstancePayload CreateInstancePayload diff --git a/services/opensearch/model_create_instance_response.go b/services/opensearch/model_create_instance_response.go index 447026be3..84fa17ce1 100644 --- a/services/opensearch/model_create_instance_response.go +++ b/services/opensearch/model_create_instance_response.go @@ -41,7 +41,7 @@ type CreateInstanceResponseGetInstanceIdRetType = string // CreateInstanceResponse struct for CreateInstanceResponse type CreateInstanceResponse struct { // REQUIRED - InstanceId CreateInstanceResponseGetInstanceIdAttributeType `json:"instanceId"` + InstanceId CreateInstanceResponseGetInstanceIdAttributeType `json:"instanceId" required:"true"` } type _CreateInstanceResponse CreateInstanceResponse diff --git a/services/opensearch/model_credentials.go b/services/opensearch/model_credentials.go index 90ddaee9d..d7f3c5f97 100644 --- a/services/opensearch/model_credentials.go +++ b/services/opensearch/model_credentials.go @@ -165,16 +165,16 @@ type CredentialsGetUsernameRetType = string // Credentials struct for Credentials type Credentials struct { // REQUIRED - Host CredentialsGetHostAttributeType `json:"host"` + Host CredentialsGetHostAttributeType `json:"host" required:"true"` Hosts CredentialsGetHostsAttributeType `json:"hosts,omitempty"` // REQUIRED - Password CredentialsGetPasswordAttributeType `json:"password"` + Password CredentialsGetPasswordAttributeType `json:"password" required:"true"` // Can be cast to int32 without loss of precision. Port CredentialsGetPortAttributeType `json:"port,omitempty"` Scheme CredentialsGetSchemeAttributeType `json:"scheme,omitempty"` Uri CredentialsGetUriAttributeType `json:"uri,omitempty"` // REQUIRED - Username CredentialsGetUsernameAttributeType `json:"username"` + Username CredentialsGetUsernameAttributeType `json:"username" required:"true"` } type _Credentials Credentials diff --git a/services/opensearch/model_credentials_list_item.go b/services/opensearch/model_credentials_list_item.go index 6220ca445..40969b490 100644 --- a/services/opensearch/model_credentials_list_item.go +++ b/services/opensearch/model_credentials_list_item.go @@ -41,7 +41,7 @@ type CredentialsListItemGetIdRetType = string // CredentialsListItem struct for CredentialsListItem type CredentialsListItem struct { // REQUIRED - Id CredentialsListItemGetIdAttributeType `json:"id"` + Id CredentialsListItemGetIdAttributeType `json:"id" required:"true"` } type _CredentialsListItem CredentialsListItem diff --git a/services/opensearch/model_credentials_response.go b/services/opensearch/model_credentials_response.go index 351685970..bac4e38f4 100644 --- a/services/opensearch/model_credentials_response.go +++ b/services/opensearch/model_credentials_response.go @@ -82,10 +82,10 @@ type CredentialsResponseGetUriRetType = string // CredentialsResponse struct for CredentialsResponse type CredentialsResponse struct { // REQUIRED - Id CredentialsResponseGetIdAttributeType `json:"id"` + Id CredentialsResponseGetIdAttributeType `json:"id" required:"true"` Raw CredentialsResponseGetRawAttributeType `json:"raw,omitempty"` // REQUIRED - Uri CredentialsResponseGetUriAttributeType `json:"uri"` + Uri CredentialsResponseGetUriAttributeType `json:"uri" required:"true"` } type _CredentialsResponse CredentialsResponse diff --git a/services/opensearch/model_error.go b/services/opensearch/model_error.go index da9f35587..85f595669 100644 --- a/services/opensearch/model_error.go +++ b/services/opensearch/model_error.go @@ -62,9 +62,9 @@ type ErrorGetErrorRetType = string // Error struct for Error type Error struct { // REQUIRED - Description ErrorGetDescriptionAttributeType `json:"description"` + Description ErrorGetDescriptionAttributeType `json:"description" required:"true"` // REQUIRED - Error ErrorGetErrorAttributeType `json:"error"` + Error ErrorGetErrorAttributeType `json:"error" required:"true"` } type _Error Error diff --git a/services/opensearch/model_get_metrics_response.go b/services/opensearch/model_get_metrics_response.go index 10c74a045..753059228 100644 --- a/services/opensearch/model_get_metrics_response.go +++ b/services/opensearch/model_get_metrics_response.go @@ -481,47 +481,47 @@ func setGetMetricsResponseGetParachuteDiskPersistentUsedThresholdAttributeType(a type GetMetricsResponse struct { CpuIdleTime GetMetricsResponseGetCpuIdleTimeAttributeType `json:"cpuIdleTime,omitempty"` // REQUIRED - CpuLoadPercent GetMetricsResponseGetCpuLoadPercentAttributeType `json:"cpuLoadPercent"` + CpuLoadPercent GetMetricsResponseGetCpuLoadPercentAttributeType `json:"cpuLoadPercent" required:"true"` CpuSystemTime GetMetricsResponseGetCpuSystemTimeAttributeType `json:"cpuSystemTime,omitempty"` CpuUserTime GetMetricsResponseGetCpuUserTimeAttributeType `json:"cpuUserTime,omitempty"` // REQUIRED - DiskEphemeralTotal GetMetricsResponseGetDiskEphemeralTotalAttributeType `json:"diskEphemeralTotal"` + DiskEphemeralTotal GetMetricsResponseGetDiskEphemeralTotalAttributeType `json:"diskEphemeralTotal" required:"true"` // REQUIRED - DiskEphemeralUsed GetMetricsResponseGetDiskEphemeralUsedAttributeType `json:"diskEphemeralUsed"` + DiskEphemeralUsed GetMetricsResponseGetDiskEphemeralUsedAttributeType `json:"diskEphemeralUsed" required:"true"` // REQUIRED - DiskPersistentTotal GetMetricsResponseGetDiskPersistentTotalAttributeType `json:"diskPersistentTotal"` + DiskPersistentTotal GetMetricsResponseGetDiskPersistentTotalAttributeType `json:"diskPersistentTotal" required:"true"` // REQUIRED - DiskPersistentUsed GetMetricsResponseGetDiskPersistentUsedAttributeType `json:"diskPersistentUsed"` + DiskPersistentUsed GetMetricsResponseGetDiskPersistentUsedAttributeType `json:"diskPersistentUsed" required:"true"` // REQUIRED - Load1 GetMetricsResponseGetLoad1AttributeType `json:"load1"` + Load1 GetMetricsResponseGetLoad1AttributeType `json:"load1" required:"true"` // REQUIRED - Load15 GetMetricsResponseGetLoad15AttributeType `json:"load15"` + Load15 GetMetricsResponseGetLoad15AttributeType `json:"load15" required:"true"` // REQUIRED - Load5 GetMetricsResponseGetLoad5AttributeType `json:"load5"` + Load5 GetMetricsResponseGetLoad5AttributeType `json:"load5" required:"true"` // REQUIRED - MemoryTotal GetMetricsResponseGetMemoryTotalAttributeType `json:"memoryTotal"` + MemoryTotal GetMetricsResponseGetMemoryTotalAttributeType `json:"memoryTotal" required:"true"` // REQUIRED - MemoryUsed GetMetricsResponseGetMemoryUsedAttributeType `json:"memoryUsed"` + MemoryUsed GetMetricsResponseGetMemoryUsedAttributeType `json:"memoryUsed" required:"true"` // REQUIRED - ParachuteDiskEphemeralActivated GetMetricsResponsegetParachuteDiskEphemeralActivatedAttributeType `json:"parachuteDiskEphemeralActivated"` + ParachuteDiskEphemeralActivated GetMetricsResponsegetParachuteDiskEphemeralActivatedAttributeType `json:"parachuteDiskEphemeralActivated" required:"true"` // REQUIRED - ParachuteDiskEphemeralTotal GetMetricsResponseGetParachuteDiskEphemeralTotalAttributeType `json:"parachuteDiskEphemeralTotal"` + ParachuteDiskEphemeralTotal GetMetricsResponseGetParachuteDiskEphemeralTotalAttributeType `json:"parachuteDiskEphemeralTotal" required:"true"` // REQUIRED - ParachuteDiskEphemeralUsed GetMetricsResponseGetParachuteDiskEphemeralUsedAttributeType `json:"parachuteDiskEphemeralUsed"` + ParachuteDiskEphemeralUsed GetMetricsResponseGetParachuteDiskEphemeralUsedAttributeType `json:"parachuteDiskEphemeralUsed" required:"true"` // REQUIRED - ParachuteDiskEphemeralUsedPercent GetMetricsResponseGetParachuteDiskEphemeralUsedPercentAttributeType `json:"parachuteDiskEphemeralUsedPercent"` + ParachuteDiskEphemeralUsedPercent GetMetricsResponseGetParachuteDiskEphemeralUsedPercentAttributeType `json:"parachuteDiskEphemeralUsedPercent" required:"true"` // REQUIRED - ParachuteDiskEphemeralUsedThreshold GetMetricsResponseGetParachuteDiskEphemeralUsedThresholdAttributeType `json:"parachuteDiskEphemeralUsedThreshold"` + ParachuteDiskEphemeralUsedThreshold GetMetricsResponseGetParachuteDiskEphemeralUsedThresholdAttributeType `json:"parachuteDiskEphemeralUsedThreshold" required:"true"` // REQUIRED - ParachuteDiskPersistentActivated GetMetricsResponsegetParachuteDiskPersistentActivatedAttributeType `json:"parachuteDiskPersistentActivated"` + ParachuteDiskPersistentActivated GetMetricsResponsegetParachuteDiskPersistentActivatedAttributeType `json:"parachuteDiskPersistentActivated" required:"true"` // REQUIRED - ParachuteDiskPersistentTotal GetMetricsResponseGetParachuteDiskPersistentTotalAttributeType `json:"parachuteDiskPersistentTotal"` + ParachuteDiskPersistentTotal GetMetricsResponseGetParachuteDiskPersistentTotalAttributeType `json:"parachuteDiskPersistentTotal" required:"true"` // REQUIRED - ParachuteDiskPersistentUsed GetMetricsResponseGetParachuteDiskPersistentUsedAttributeType `json:"parachuteDiskPersistentUsed"` + ParachuteDiskPersistentUsed GetMetricsResponseGetParachuteDiskPersistentUsedAttributeType `json:"parachuteDiskPersistentUsed" required:"true"` // REQUIRED - ParachuteDiskPersistentUsedPercent GetMetricsResponseGetParachuteDiskPersistentUsedPercentAttributeType `json:"parachuteDiskPersistentUsedPercent"` + ParachuteDiskPersistentUsedPercent GetMetricsResponseGetParachuteDiskPersistentUsedPercentAttributeType `json:"parachuteDiskPersistentUsedPercent" required:"true"` // REQUIRED - ParachuteDiskPersistentUsedThreshold GetMetricsResponseGetParachuteDiskPersistentUsedThresholdAttributeType `json:"parachuteDiskPersistentUsedThreshold"` + ParachuteDiskPersistentUsedThreshold GetMetricsResponseGetParachuteDiskPersistentUsedThresholdAttributeType `json:"parachuteDiskPersistentUsedThreshold" required:"true"` } type _GetMetricsResponse GetMetricsResponse diff --git a/services/opensearch/model_instance.go b/services/opensearch/model_instance.go index aff658692..3cf973fa1 100644 --- a/services/opensearch/model_instance.go +++ b/services/opensearch/model_instance.go @@ -424,31 +424,31 @@ func setInstanceGetStatusAttributeType(arg *InstanceGetStatusAttributeType, val // Instance struct for Instance type Instance struct { // REQUIRED - CfGuid InstanceGetCfGuidAttributeType `json:"cfGuid"` + CfGuid InstanceGetCfGuidAttributeType `json:"cfGuid" required:"true"` // REQUIRED - CfOrganizationGuid InstanceGetCfOrganizationGuidAttributeType `json:"cfOrganizationGuid"` + CfOrganizationGuid InstanceGetCfOrganizationGuidAttributeType `json:"cfOrganizationGuid" required:"true"` // REQUIRED - CfSpaceGuid InstanceGetCfSpaceGuidAttributeType `json:"cfSpaceGuid"` + CfSpaceGuid InstanceGetCfSpaceGuidAttributeType `json:"cfSpaceGuid" required:"true"` // REQUIRED - DashboardUrl InstanceGetDashboardUrlAttributeType `json:"dashboardUrl"` + DashboardUrl InstanceGetDashboardUrlAttributeType `json:"dashboardUrl" required:"true"` // REQUIRED - ImageUrl InstanceGetImageUrlAttributeType `json:"imageUrl"` + ImageUrl InstanceGetImageUrlAttributeType `json:"imageUrl" required:"true"` InstanceId InstanceGetInstanceIdAttributeType `json:"instanceId,omitempty"` // REQUIRED - LastOperation InstanceGetLastOperationAttributeType `json:"lastOperation"` + LastOperation InstanceGetLastOperationAttributeType `json:"lastOperation" required:"true"` // REQUIRED - Name InstanceGetNameAttributeType `json:"name"` + Name InstanceGetNameAttributeType `json:"name" required:"true"` // Deprecated: Check the GitHub changelog for alternatives // REQUIRED - OfferingName InstanceGetOfferingNameAttributeType `json:"offeringName"` + OfferingName InstanceGetOfferingNameAttributeType `json:"offeringName" required:"true"` // REQUIRED - OfferingVersion InstanceGetOfferingVersionAttributeType `json:"offeringVersion"` + OfferingVersion InstanceGetOfferingVersionAttributeType `json:"offeringVersion" required:"true"` // REQUIRED - Parameters InstanceGetParametersAttributeType `json:"parameters"` + Parameters InstanceGetParametersAttributeType `json:"parameters" required:"true"` // REQUIRED - PlanId InstanceGetPlanIdAttributeType `json:"planId"` + PlanId InstanceGetPlanIdAttributeType `json:"planId" required:"true"` // REQUIRED - PlanName InstanceGetPlanNameAttributeType `json:"planName"` + PlanName InstanceGetPlanNameAttributeType `json:"planName" required:"true"` Status InstanceGetStatusAttributeType `json:"status,omitempty"` } diff --git a/services/opensearch/model_instance_last_operation.go b/services/opensearch/model_instance_last_operation.go index 893c843db..9ca174fe1 100644 --- a/services/opensearch/model_instance_last_operation.go +++ b/services/opensearch/model_instance_last_operation.go @@ -294,11 +294,11 @@ func setInstanceLastOperationGetTypeAttributeType(arg *InstanceLastOperationGetT // InstanceLastOperation struct for InstanceLastOperation type InstanceLastOperation struct { // REQUIRED - Description InstanceLastOperationGetDescriptionAttributeType `json:"description"` + Description InstanceLastOperationGetDescriptionAttributeType `json:"description" required:"true"` // REQUIRED - State InstanceLastOperationGetStateAttributeType `json:"state"` + State InstanceLastOperationGetStateAttributeType `json:"state" required:"true"` // REQUIRED - Type InstanceLastOperationGetTypeAttributeType `json:"type"` + Type InstanceLastOperationGetTypeAttributeType `json:"type" required:"true"` } type _InstanceLastOperation InstanceLastOperation diff --git a/services/opensearch/model_instance_parameters.go b/services/opensearch/model_instance_parameters.go index e2e4eaf12..3e07df129 100644 --- a/services/opensearch/model_instance_parameters.go +++ b/services/opensearch/model_instance_parameters.go @@ -394,114 +394,10 @@ func setInstanceParametersGetTlsCiphersAttributeType(arg *InstanceParametersGetT types and functions for tls-protocols */ -// isEnum - -// InstanceParametersTlsProtocols the model 'InstanceParameters' -// value type for enums -type InstanceParametersTlsProtocols string - -// List of TlsProtocols -const ( - INSTANCEPARAMETERSTLS_PROTOCOLS__2 InstanceParametersTlsProtocols = "TLSv1.2" - INSTANCEPARAMETERSTLS_PROTOCOLS__3 InstanceParametersTlsProtocols = "TLSv1.3" -) - -// All allowed values of InstanceParameters enum -var AllowedInstanceParametersTlsProtocolsEnumValues = []InstanceParametersTlsProtocols{ - "TLSv1.2", - "TLSv1.3", -} - -func (v *InstanceParametersTlsProtocols) UnmarshalJSON(src []byte) error { - // use a type alias to prevent infinite recursion during unmarshal, - // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers - type TmpJson InstanceParametersTlsProtocols - var value TmpJson - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - // Allow unmarshalling zero value for testing purposes - var zeroValue TmpJson - if value == zeroValue { - return nil - } - enumTypeValue := InstanceParametersTlsProtocols(value) - for _, existing := range AllowedInstanceParametersTlsProtocolsEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid InstanceParameters", value) -} - -// NewInstanceParametersTlsProtocolsFromValue returns a pointer to a valid InstanceParametersTlsProtocols -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewInstanceParametersTlsProtocolsFromValue(v InstanceParametersTlsProtocols) (*InstanceParametersTlsProtocols, error) { - ev := InstanceParametersTlsProtocols(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for InstanceParametersTlsProtocols: valid values are %v", v, AllowedInstanceParametersTlsProtocolsEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v InstanceParametersTlsProtocols) IsValid() bool { - for _, existing := range AllowedInstanceParametersTlsProtocolsEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to TlsProtocolsTlsProtocols value -func (v InstanceParametersTlsProtocols) Ptr() *InstanceParametersTlsProtocols { - return &v -} - -type NullableInstanceParametersTlsProtocols struct { - value *InstanceParametersTlsProtocols - isSet bool -} - -func (v NullableInstanceParametersTlsProtocols) Get() *InstanceParametersTlsProtocols { - return v.value -} - -func (v *NullableInstanceParametersTlsProtocols) Set(val *InstanceParametersTlsProtocols) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceParametersTlsProtocols) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceParametersTlsProtocols) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceParametersTlsProtocols(val *InstanceParametersTlsProtocols) *NullableInstanceParametersTlsProtocols { - return &NullableInstanceParametersTlsProtocols{value: val, isSet: true} -} - -func (v NullableInstanceParametersTlsProtocols) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceParametersTlsProtocols) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type InstanceParametersGetTlsProtocolsAttributeType = *InstanceParametersTlsProtocols -type InstanceParametersGetTlsProtocolsArgType = InstanceParametersTlsProtocols -type InstanceParametersGetTlsProtocolsRetType = InstanceParametersTlsProtocols +// isArray +type InstanceParametersGetTlsProtocolsAttributeType = *[]string +type InstanceParametersGetTlsProtocolsArgType = []string +type InstanceParametersGetTlsProtocolsRetType = []string func getInstanceParametersGetTlsProtocolsAttributeTypeOk(arg InstanceParametersGetTlsProtocolsAttributeType) (ret InstanceParametersGetTlsProtocolsRetType, ok bool) { if arg == nil { @@ -889,7 +785,7 @@ func (o *InstanceParameters) HasTlsProtocols() bool { return ok } -// SetTlsProtocols gets a reference to the given string and assigns it to the TlsProtocols field. +// SetTlsProtocols gets a reference to the given []string and assigns it to the TlsProtocols field. func (o *InstanceParameters) SetTlsProtocols(v InstanceParametersGetTlsProtocolsRetType) { setInstanceParametersGetTlsProtocolsAttributeType(&o.TlsProtocols, v) } diff --git a/services/opensearch/model_instance_parameters_test.go b/services/opensearch/model_instance_parameters_test.go index a7d276f1b..2a588634c 100644 --- a/services/opensearch/model_instance_parameters_test.go +++ b/services/opensearch/model_instance_parameters_test.go @@ -70,46 +70,3 @@ func TestInstanceParametersJavaGarbageCollector_UnmarshalJSON(t *testing.T) { }) } } - -// isEnum - -func TestInstanceParametersTlsProtocols_UnmarshalJSON(t *testing.T) { - type args struct { - src []byte - } - tests := []struct { - name string - args args - wantErr bool - }{ - { - name: `success - possible enum value no. 1`, - args: args{ - src: []byte(`"TLSv1.2"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 2`, - args: args{ - src: []byte(`"TLSv1.3"`), - }, - wantErr: false, - }, - { - name: "fail", - args: args{ - src: []byte("\"FOOBAR\""), - }, - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := InstanceParametersTlsProtocols("") - if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { - t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} diff --git a/services/opensearch/model_instance_schema.go b/services/opensearch/model_instance_schema.go index c9beecb2d..39a12d3a5 100644 --- a/services/opensearch/model_instance_schema.go +++ b/services/opensearch/model_instance_schema.go @@ -60,9 +60,9 @@ func setInstanceSchemaGetUpdateAttributeType(arg *InstanceSchemaGetUpdateAttribu // InstanceSchema struct for InstanceSchema type InstanceSchema struct { // REQUIRED - Create InstanceSchemaGetCreateAttributeType `json:"create"` + Create InstanceSchemaGetCreateAttributeType `json:"create" required:"true"` // REQUIRED - Update InstanceSchemaGetUpdateAttributeType `json:"update"` + Update InstanceSchemaGetUpdateAttributeType `json:"update" required:"true"` } type _InstanceSchema InstanceSchema diff --git a/services/opensearch/model_list_backups_response.go b/services/opensearch/model_list_backups_response.go index 932d4fe9b..b1b59b758 100644 --- a/services/opensearch/model_list_backups_response.go +++ b/services/opensearch/model_list_backups_response.go @@ -40,7 +40,7 @@ func setListBackupsResponseGetInstanceBackupsAttributeType(arg *ListBackupsRespo // ListBackupsResponse struct for ListBackupsResponse type ListBackupsResponse struct { // REQUIRED - InstanceBackups ListBackupsResponseGetInstanceBackupsAttributeType `json:"instanceBackups"` + InstanceBackups ListBackupsResponseGetInstanceBackupsAttributeType `json:"instanceBackups" required:"true"` } type _ListBackupsResponse ListBackupsResponse diff --git a/services/opensearch/model_list_credentials_response.go b/services/opensearch/model_list_credentials_response.go index bb5a41668..f7f6b723c 100644 --- a/services/opensearch/model_list_credentials_response.go +++ b/services/opensearch/model_list_credentials_response.go @@ -40,7 +40,7 @@ func setListCredentialsResponseGetCredentialsListAttributeType(arg *ListCredenti // ListCredentialsResponse struct for ListCredentialsResponse type ListCredentialsResponse struct { // REQUIRED - CredentialsList ListCredentialsResponseGetCredentialsListAttributeType `json:"credentialsList"` + CredentialsList ListCredentialsResponseGetCredentialsListAttributeType `json:"credentialsList" required:"true"` } type _ListCredentialsResponse ListCredentialsResponse diff --git a/services/opensearch/model_list_instances_response.go b/services/opensearch/model_list_instances_response.go index 817bc4ffd..98be01a36 100644 --- a/services/opensearch/model_list_instances_response.go +++ b/services/opensearch/model_list_instances_response.go @@ -40,7 +40,7 @@ func setListInstancesResponseGetInstancesAttributeType(arg *ListInstancesRespons // ListInstancesResponse struct for ListInstancesResponse type ListInstancesResponse struct { // REQUIRED - Instances ListInstancesResponseGetInstancesAttributeType `json:"instances"` + Instances ListInstancesResponseGetInstancesAttributeType `json:"instances" required:"true"` } type _ListInstancesResponse ListInstancesResponse diff --git a/services/opensearch/model_list_offerings_response.go b/services/opensearch/model_list_offerings_response.go index 47b68f053..8b29fdc32 100644 --- a/services/opensearch/model_list_offerings_response.go +++ b/services/opensearch/model_list_offerings_response.go @@ -40,7 +40,7 @@ func setListOfferingsResponseGetOfferingsAttributeType(arg *ListOfferingsRespons // ListOfferingsResponse struct for ListOfferingsResponse type ListOfferingsResponse struct { // REQUIRED - Offerings ListOfferingsResponseGetOfferingsAttributeType `json:"offerings"` + Offerings ListOfferingsResponseGetOfferingsAttributeType `json:"offerings" required:"true"` } type _ListOfferingsResponse ListOfferingsResponse diff --git a/services/opensearch/model_list_restores_response.go b/services/opensearch/model_list_restores_response.go index 1252afd86..4d3a6f3d7 100644 --- a/services/opensearch/model_list_restores_response.go +++ b/services/opensearch/model_list_restores_response.go @@ -40,7 +40,7 @@ func setListRestoresResponseGetInstanceRestoresAttributeType(arg *ListRestoresRe // ListRestoresResponse struct for ListRestoresResponse type ListRestoresResponse struct { // REQUIRED - InstanceRestores ListRestoresResponseGetInstanceRestoresAttributeType `json:"instanceRestores"` + InstanceRestores ListRestoresResponseGetInstanceRestoresAttributeType `json:"instanceRestores" required:"true"` } type _ListRestoresResponse ListRestoresResponse diff --git a/services/opensearch/model_offering.go b/services/opensearch/model_offering.go index e2ac71592..9e694176b 100644 --- a/services/opensearch/model_offering.go +++ b/services/opensearch/model_offering.go @@ -226,23 +226,23 @@ type OfferingGetVersionRetType = string // Offering struct for Offering type Offering struct { // REQUIRED - Description OfferingGetDescriptionAttributeType `json:"description"` + Description OfferingGetDescriptionAttributeType `json:"description" required:"true"` // REQUIRED - DocumentationUrl OfferingGetDocumentationUrlAttributeType `json:"documentationUrl"` + DocumentationUrl OfferingGetDocumentationUrlAttributeType `json:"documentationUrl" required:"true"` // REQUIRED - ImageUrl OfferingGetImageUrlAttributeType `json:"imageUrl"` + ImageUrl OfferingGetImageUrlAttributeType `json:"imageUrl" required:"true"` // REQUIRED - Latest OfferinggetLatestAttributeType `json:"latest"` + Latest OfferinggetLatestAttributeType `json:"latest" required:"true"` Lifecycle OfferingGetLifecycleAttributeType `json:"lifecycle,omitempty"` // REQUIRED - Name OfferingGetNameAttributeType `json:"name"` + Name OfferingGetNameAttributeType `json:"name" required:"true"` // REQUIRED - Plans OfferingGetPlansAttributeType `json:"plans"` + Plans OfferingGetPlansAttributeType `json:"plans" required:"true"` // REQUIRED - QuotaCount OfferingGetQuotaCountAttributeType `json:"quotaCount"` + QuotaCount OfferingGetQuotaCountAttributeType `json:"quotaCount" required:"true"` Schema OfferingGetSchemaAttributeType `json:"schema,omitempty"` // REQUIRED - Version OfferingGetVersionAttributeType `json:"version"` + Version OfferingGetVersionAttributeType `json:"version" required:"true"` } type _Offering Offering diff --git a/services/opensearch/model_plan.go b/services/opensearch/model_plan.go index 02cf8e24f..9be418f03 100644 --- a/services/opensearch/model_plan.go +++ b/services/opensearch/model_plan.go @@ -124,15 +124,15 @@ type PlanGetSkuNameRetType = string // Plan struct for Plan type Plan struct { // REQUIRED - Description PlanGetDescriptionAttributeType `json:"description"` + Description PlanGetDescriptionAttributeType `json:"description" required:"true"` // REQUIRED - Free PlangetFreeAttributeType `json:"free"` + Free PlangetFreeAttributeType `json:"free" required:"true"` // REQUIRED - Id PlanGetIdAttributeType `json:"id"` + Id PlanGetIdAttributeType `json:"id" required:"true"` // REQUIRED - Name PlanGetNameAttributeType `json:"name"` + Name PlanGetNameAttributeType `json:"name" required:"true"` // REQUIRED - SkuName PlanGetSkuNameAttributeType `json:"skuName"` + SkuName PlanGetSkuNameAttributeType `json:"skuName" required:"true"` } type _Plan Plan diff --git a/services/opensearch/model_raw_credentials.go b/services/opensearch/model_raw_credentials.go index c8e20f9fa..4b436768f 100644 --- a/services/opensearch/model_raw_credentials.go +++ b/services/opensearch/model_raw_credentials.go @@ -40,7 +40,7 @@ func setRawCredentialsGetCredentialsAttributeType(arg *RawCredentialsGetCredenti // RawCredentials struct for RawCredentials type RawCredentials struct { // REQUIRED - Credentials RawCredentialsGetCredentialsAttributeType `json:"credentials"` + Credentials RawCredentialsGetCredentialsAttributeType `json:"credentials" required:"true"` } type _RawCredentials RawCredentials diff --git a/services/opensearch/model_restore.go b/services/opensearch/model_restore.go index c0f0d3489..f67ed164a 100644 --- a/services/opensearch/model_restore.go +++ b/services/opensearch/model_restore.go @@ -123,13 +123,13 @@ type RestoreGetTriggeredAtRetType = string // Restore struct for Restore type Restore struct { // REQUIRED - BackupId RestoreGetBackupIdAttributeType `json:"backup_id"` + BackupId RestoreGetBackupIdAttributeType `json:"backup_id" required:"true"` // REQUIRED - FinishedAt RestoreGetFinishedAtAttributeType `json:"finished_at"` + FinishedAt RestoreGetFinishedAtAttributeType `json:"finished_at" required:"true"` // REQUIRED - Id RestoreGetIdAttributeType `json:"id"` + Id RestoreGetIdAttributeType `json:"id" required:"true"` // REQUIRED - Status RestoreGetStatusAttributeType `json:"status"` + Status RestoreGetStatusAttributeType `json:"status" required:"true"` TriggeredAt RestoreGetTriggeredAtAttributeType `json:"triggered_at,omitempty"` } diff --git a/services/opensearch/model_schema.go b/services/opensearch/model_schema.go index 3450dc8e0..5b69e8f59 100644 --- a/services/opensearch/model_schema.go +++ b/services/opensearch/model_schema.go @@ -40,7 +40,7 @@ func setSchemaGetParametersAttributeType(arg *SchemaGetParametersAttributeType, // Schema struct for Schema type Schema struct { // REQUIRED - Parameters SchemaGetParametersAttributeType `json:"parameters"` + Parameters SchemaGetParametersAttributeType `json:"parameters" required:"true"` } type _Schema Schema diff --git a/services/opensearch/model_trigger_restore_response.go b/services/opensearch/model_trigger_restore_response.go index eff9ee3ae..49ffa6cfb 100644 --- a/services/opensearch/model_trigger_restore_response.go +++ b/services/opensearch/model_trigger_restore_response.go @@ -40,7 +40,7 @@ func setTriggerRestoreResponseGetIdAttributeType(arg *TriggerRestoreResponseGetI // TriggerRestoreResponse struct for TriggerRestoreResponse type TriggerRestoreResponse struct { // REQUIRED - Id TriggerRestoreResponseGetIdAttributeType `json:"id"` + Id TriggerRestoreResponseGetIdAttributeType `json:"id" required:"true"` } type _TriggerRestoreResponse TriggerRestoreResponse diff --git a/services/opensearch/model_update_backups_config_response.go b/services/opensearch/model_update_backups_config_response.go index a4083124e..d879bd365 100644 --- a/services/opensearch/model_update_backups_config_response.go +++ b/services/opensearch/model_update_backups_config_response.go @@ -41,7 +41,7 @@ type UpdateBackupsConfigResponseGetMessageRetType = string // UpdateBackupsConfigResponse struct for UpdateBackupsConfigResponse type UpdateBackupsConfigResponse struct { // REQUIRED - Message UpdateBackupsConfigResponseGetMessageAttributeType `json:"message"` + Message UpdateBackupsConfigResponseGetMessageAttributeType `json:"message" required:"true"` } type _UpdateBackupsConfigResponse UpdateBackupsConfigResponse