From 144e76f679b567b515a7b132805b501353c5bc48 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Wed, 26 Aug 2026 12:16:59 +0000 Subject: [PATCH] Generate dns --- services/dns/api_default.go | 23 ++- .../dns/model_create_move_code_payload.go | 153 +++++++++++++++++ .../model_create_move_code_payload_test.go | 11 ++ .../model_domain_observability_extension.go | 140 +++++++++++++++- ...del_domain_observability_extension_test.go | 54 ++++++ .../dns/model_zone_observability_extension.go | 58 ------- services/dns/oas_commit | 2 +- services/dns/v1api/api_default.go | 19 ++- .../v1api/model_create_move_code_payload.go | 155 ++++++++++++++++++ .../model_domain_observability_extension.go | 14 +- ...el_domain_observability_extension_state.go | 116 +++++++++++++ .../model_zone_observability_extension.go | 39 +---- 12 files changed, 662 insertions(+), 122 deletions(-) create mode 100644 services/dns/model_create_move_code_payload.go create mode 100644 services/dns/model_create_move_code_payload_test.go create mode 100644 services/dns/v1api/model_create_move_code_payload.go create mode 100644 services/dns/v1api/model_domain_observability_extension_state.go diff --git a/services/dns/api_default.go b/services/dns/api_default.go index f0e649654..2a9590afd 100644 --- a/services/dns/api_default.go +++ b/services/dns/api_default.go @@ -606,6 +606,9 @@ type ApiCreateLabelRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateMoveCodeRequest interface { + // information about the movecode + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CreateMoveCodePayload(createMoveCodePayload CreateMoveCodePayload) ApiCreateMoveCodeRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*MoveCodeResponse, error) } @@ -1384,10 +1387,18 @@ func (a *APIClient) CreateLabelExecute(ctx context.Context, projectId string, zo // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateMoveCodeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - zoneId string + ctx context.Context + apiService *DefaultApiService + projectId string + zoneId string + createMoveCodePayload *CreateMoveCodePayload +} + +// information about the movecode +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateMoveCodeRequest) CreateMoveCodePayload(createMoveCodePayload CreateMoveCodePayload) ApiCreateMoveCodeRequest { + r.createMoveCodePayload = &createMoveCodePayload + return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1417,7 +1428,7 @@ func (r CreateMoveCodeRequest) Execute() (*MoveCodeResponse, error) { localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1433,6 +1444,8 @@ func (r CreateMoveCodeRequest) Execute() (*MoveCodeResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createMoveCodePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err diff --git a/services/dns/model_create_move_code_payload.go b/services/dns/model_create_move_code_payload.go new file mode 100644 index 000000000..024af06c9 --- /dev/null +++ b/services/dns/model_create_move_code_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package dns + +import ( + "encoding/json" +) + +// checks if the CreateMoveCodePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateMoveCodePayload{} + +/* + types and functions for ttl +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateMoveCodePayloadGetTtlAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateMoveCodePayloadGetTtlArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateMoveCodePayloadGetTtlRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateMoveCodePayloadGetTtlAttributeTypeOk(arg CreateMoveCodePayloadGetTtlAttributeType) (ret CreateMoveCodePayloadGetTtlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateMoveCodePayloadGetTtlAttributeType(arg *CreateMoveCodePayloadGetTtlAttributeType, val CreateMoveCodePayloadGetTtlRetType) { + *arg = &val +} + +// CreateMoveCodePayload options for generating a move code. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateMoveCodePayload struct { + // TTL is the duration for which the move code is valid, represented as seconds. Min: 1, Max: 2592000 (30 days). + // Can be cast to int32 without loss of precision. + Ttl CreateMoveCodePayloadGetTtlAttributeType `json:"ttl,omitempty"` +} + +// NewCreateMoveCodePayload instantiates a new CreateMoveCodePayload 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateMoveCodePayload() *CreateMoveCodePayload { + this := CreateMoveCodePayload{} + return &this +} + +// NewCreateMoveCodePayloadWithDefaults instantiates a new CreateMoveCodePayload 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateMoveCodePayloadWithDefaults() *CreateMoveCodePayload { + this := CreateMoveCodePayload{} + return &this +} + +// GetTtl returns the Ttl field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateMoveCodePayload) GetTtl() (res CreateMoveCodePayloadGetTtlRetType) { + res, _ = o.GetTtlOk() + return +} + +// GetTtlOk returns a tuple with the Ttl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateMoveCodePayload) GetTtlOk() (ret CreateMoveCodePayloadGetTtlRetType, ok bool) { + return getCreateMoveCodePayloadGetTtlAttributeTypeOk(o.Ttl) +} + +// HasTtl returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateMoveCodePayload) HasTtl() bool { + _, ok := o.GetTtlOk() + return ok +} + +// SetTtl gets a reference to the given int64 and assigns it to the Ttl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateMoveCodePayload) SetTtl(v CreateMoveCodePayloadGetTtlRetType) { + setCreateMoveCodePayloadGetTtlAttributeType(&o.Ttl, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateMoveCodePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateMoveCodePayloadGetTtlAttributeTypeOk(o.Ttl); ok { + toSerialize["Ttl"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateMoveCodePayload struct { + value *CreateMoveCodePayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateMoveCodePayload) Get() *CreateMoveCodePayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateMoveCodePayload) Set(val *CreateMoveCodePayload) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateMoveCodePayload) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateMoveCodePayload) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCreateMoveCodePayload(val *CreateMoveCodePayload) *NullableCreateMoveCodePayload { + return &NullableCreateMoveCodePayload{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateMoveCodePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateMoveCodePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/model_create_move_code_payload_test.go b/services/dns/model_create_move_code_payload_test.go new file mode 100644 index 000000000..ffa42b7e8 --- /dev/null +++ b/services/dns/model_create_move_code_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package dns diff --git a/services/dns/model_domain_observability_extension.go b/services/dns/model_domain_observability_extension.go index bd6054533..5647ad5ce 100644 --- a/services/dns/model_domain_observability_extension.go +++ b/services/dns/model_domain_observability_extension.go @@ -13,6 +13,7 @@ package dns import ( "encoding/json" + "fmt" ) // checks if the DomainObservabilityExtension type satisfies the MappedNullable interface at compile time @@ -49,9 +50,138 @@ type DomainObservabilityExtensionGetObservabilityInstanceIdRetType = string types and functions for state */ -// isNotNullableString +// isEnum + +// DomainObservabilityExtensionState the model 'DomainObservabilityExtension' +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DomainObservabilityExtensionState string + +// List of State +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DOMAINOBSERVABILITYEXTENSIONSTATE_CREATING DomainObservabilityExtensionState = "CREATING" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DOMAINOBSERVABILITYEXTENSIONSTATE_CREATE_SUCCEEDED DomainObservabilityExtensionState = "CREATE_SUCCEEDED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DOMAINOBSERVABILITYEXTENSIONSTATE_ERROR DomainObservabilityExtensionState = "ERROR" +) + +// All allowed values of DomainObservabilityExtension enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedDomainObservabilityExtensionStateEnumValues = []DomainObservabilityExtensionState{ + "CREATING", + "CREATE_SUCCEEDED", + "ERROR", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *DomainObservabilityExtensionState) 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 DomainObservabilityExtensionState + 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 := DomainObservabilityExtensionState(value) + for _, existing := range AllowedDomainObservabilityExtensionStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DomainObservabilityExtension", value) +} + +// NewDomainObservabilityExtensionStateFromValue returns a pointer to a valid DomainObservabilityExtensionState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewDomainObservabilityExtensionStateFromValue(v DomainObservabilityExtensionState) (*DomainObservabilityExtensionState, error) { + ev := DomainObservabilityExtensionState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DomainObservabilityExtensionState: valid values are %v", v, AllowedDomainObservabilityExtensionStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v DomainObservabilityExtensionState) IsValid() bool { + for _, existing := range AllowedDomainObservabilityExtensionStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StateState value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v DomainObservabilityExtensionState) Ptr() *DomainObservabilityExtensionState { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableDomainObservabilityExtensionState struct { + value *DomainObservabilityExtensionState + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableDomainObservabilityExtensionState) Get() *DomainObservabilityExtensionState { + return v.value +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type DomainObservabilityExtensionGetStateAttributeType = *string +func (v *NullableDomainObservabilityExtensionState) Set(val *DomainObservabilityExtensionState) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableDomainObservabilityExtensionState) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableDomainObservabilityExtensionState) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableDomainObservabilityExtensionState(val *DomainObservabilityExtensionState) *NullableDomainObservabilityExtensionState { + return &NullableDomainObservabilityExtensionState{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableDomainObservabilityExtensionState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableDomainObservabilityExtensionState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DomainObservabilityExtensionGetStateAttributeType = *DomainObservabilityExtensionState + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DomainObservabilityExtensionGetStateArgType = DomainObservabilityExtensionState + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DomainObservabilityExtensionGetStateRetType = DomainObservabilityExtensionState // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDomainObservabilityExtensionGetStateAttributeTypeOk(arg DomainObservabilityExtensionGetStateAttributeType) (ret DomainObservabilityExtensionGetStateRetType, ok bool) { @@ -66,12 +196,6 @@ func setDomainObservabilityExtensionGetStateAttributeType(arg *DomainObservabili *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type DomainObservabilityExtensionGetStateArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type DomainObservabilityExtensionGetStateRetType = string - // DomainObservabilityExtension struct for DomainObservabilityExtension // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainObservabilityExtension struct { diff --git a/services/dns/model_domain_observability_extension_test.go b/services/dns/model_domain_observability_extension_test.go index ffa42b7e8..88929ced0 100644 --- a/services/dns/model_domain_observability_extension_test.go +++ b/services/dns/model_domain_observability_extension_test.go @@ -9,3 +9,57 @@ API version: 1.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package dns + +import ( + "testing" +) + +// isEnum + +func TestDomainObservabilityExtensionState_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(`"CREATING"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 2`, + args: args{ + src: []byte(`"CREATE_SUCCEEDED"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 3`, + args: args{ + src: []byte(`"ERROR"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := DomainObservabilityExtensionState("") + 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/dns/model_zone_observability_extension.go b/services/dns/model_zone_observability_extension.go index 9fb3f1c13..51c441d8a 100644 --- a/services/dns/model_zone_observability_extension.go +++ b/services/dns/model_zone_observability_extension.go @@ -45,39 +45,11 @@ type ZoneObservabilityExtensionGetObservabilityInstanceIdArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ZoneObservabilityExtensionGetObservabilityInstanceIdRetType = string -/* - types and functions for state -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ZoneObservabilityExtensionGetStateAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getZoneObservabilityExtensionGetStateAttributeTypeOk(arg ZoneObservabilityExtensionGetStateAttributeType) (ret ZoneObservabilityExtensionGetStateRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setZoneObservabilityExtensionGetStateAttributeType(arg *ZoneObservabilityExtensionGetStateAttributeType, val ZoneObservabilityExtensionGetStateRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ZoneObservabilityExtensionGetStateArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ZoneObservabilityExtensionGetStateRetType = string - // ZoneObservabilityExtension struct for ZoneObservabilityExtension // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ZoneObservabilityExtension struct { // REQUIRED ObservabilityInstanceId ZoneObservabilityExtensionGetObservabilityInstanceIdAttributeType `json:"observabilityInstanceId" required:"true"` - State ZoneObservabilityExtensionGetStateAttributeType `json:"state,omitempty"` } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -123,42 +95,12 @@ func (o *ZoneObservabilityExtension) SetObservabilityInstanceId(v ZoneObservabil setZoneObservabilityExtensionGetObservabilityInstanceIdAttributeType(&o.ObservabilityInstanceId, v) } -// GetState returns the State field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ZoneObservabilityExtension) GetState() (res ZoneObservabilityExtensionGetStateRetType) { - res, _ = o.GetStateOk() - return -} - -// GetStateOk returns a tuple with the State field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ZoneObservabilityExtension) GetStateOk() (ret ZoneObservabilityExtensionGetStateRetType, ok bool) { - return getZoneObservabilityExtensionGetStateAttributeTypeOk(o.State) -} - -// HasState returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ZoneObservabilityExtension) HasState() bool { - _, ok := o.GetStateOk() - return ok -} - -// SetState gets a reference to the given string and assigns it to the State field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ZoneObservabilityExtension) SetState(v ZoneObservabilityExtensionGetStateRetType) { - setZoneObservabilityExtensionGetStateAttributeType(&o.State, v) -} - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ZoneObservabilityExtension) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getZoneObservabilityExtensionGetObservabilityInstanceIdAttributeTypeOk(o.ObservabilityInstanceId); ok { toSerialize["ObservabilityInstanceId"] = val } - if val, ok := getZoneObservabilityExtensionGetStateAttributeTypeOk(o.State); ok { - toSerialize["State"] = val - } return toSerialize, nil } diff --git a/services/dns/oas_commit b/services/dns/oas_commit index 8ae9a8db5..e05d493f3 100644 --- a/services/dns/oas_commit +++ b/services/dns/oas_commit @@ -1 +1 @@ -e9fe931e91e0b8f067d5c12518398a52062ca794 +da4701b7dbe20e984aef89711bb9ba716e19fcba diff --git a/services/dns/v1api/api_default.go b/services/dns/v1api/api_default.go index 255ccfdda..028f79bfd 100644 --- a/services/dns/v1api/api_default.go +++ b/services/dns/v1api/api_default.go @@ -775,10 +775,17 @@ func (a *DefaultAPIService) CreateLabelExecute(r ApiCreateLabelRequest) (*Create } type ApiCreateMoveCodeRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - zoneId string + ctx context.Context + ApiService DefaultAPI + projectId string + zoneId string + createMoveCodePayload *CreateMoveCodePayload +} + +// information about the movecode +func (r ApiCreateMoveCodeRequest) CreateMoveCodePayload(createMoveCodePayload CreateMoveCodePayload) ApiCreateMoveCodeRequest { + r.createMoveCodePayload = &createMoveCodePayload + return r } func (r ApiCreateMoveCodeRequest) Execute() (*MoveCodeResponse, error) { @@ -829,7 +836,7 @@ func (a *DefaultAPIService) CreateMoveCodeExecute(r ApiCreateMoveCodeRequest) (* localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -845,6 +852,8 @@ func (a *DefaultAPIService) CreateMoveCodeExecute(r ApiCreateMoveCodeRequest) (* if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createMoveCodePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err diff --git a/services/dns/v1api/model_create_move_code_payload.go b/services/dns/v1api/model_create_move_code_payload.go new file mode 100644 index 000000000..5401eb7eb --- /dev/null +++ b/services/dns/v1api/model_create_move_code_payload.go @@ -0,0 +1,155 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateMoveCodePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateMoveCodePayload{} + +// CreateMoveCodePayload options for generating a move code. +type CreateMoveCodePayload struct { + // TTL is the duration for which the move code is valid, represented as seconds. Min: 1, Max: 2592000 (30 days). + Ttl *int32 `json:"ttl,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateMoveCodePayload CreateMoveCodePayload + +// NewCreateMoveCodePayload instantiates a new CreateMoveCodePayload 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 NewCreateMoveCodePayload() *CreateMoveCodePayload { + this := CreateMoveCodePayload{} + return &this +} + +// NewCreateMoveCodePayloadWithDefaults instantiates a new CreateMoveCodePayload 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 NewCreateMoveCodePayloadWithDefaults() *CreateMoveCodePayload { + this := CreateMoveCodePayload{} + return &this +} + +// GetTtl returns the Ttl field value if set, zero value otherwise. +func (o *CreateMoveCodePayload) GetTtl() int32 { + if o == nil || IsNil(o.Ttl) { + var ret int32 + return ret + } + return *o.Ttl +} + +// GetTtlOk returns a tuple with the Ttl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateMoveCodePayload) GetTtlOk() (*int32, bool) { + if o == nil || IsNil(o.Ttl) { + return nil, false + } + return o.Ttl, true +} + +// HasTtl returns a boolean if a field has been set. +func (o *CreateMoveCodePayload) HasTtl() bool { + if o != nil && !IsNil(o.Ttl) { + return true + } + + return false +} + +// SetTtl gets a reference to the given int32 and assigns it to the Ttl field. +func (o *CreateMoveCodePayload) SetTtl(v int32) { + o.Ttl = &v +} + +func (o CreateMoveCodePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateMoveCodePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ttl) { + toSerialize["ttl"] = o.Ttl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateMoveCodePayload) UnmarshalJSON(data []byte) (err error) { + varCreateMoveCodePayload := _CreateMoveCodePayload{} + + err = json.Unmarshal(data, &varCreateMoveCodePayload) + + if err != nil { + return err + } + + *o = CreateMoveCodePayload(varCreateMoveCodePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "ttl") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateMoveCodePayload struct { + value *CreateMoveCodePayload + isSet bool +} + +func (v NullableCreateMoveCodePayload) Get() *CreateMoveCodePayload { + return v.value +} + +func (v *NullableCreateMoveCodePayload) Set(val *CreateMoveCodePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateMoveCodePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateMoveCodePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateMoveCodePayload(val *CreateMoveCodePayload) *NullableCreateMoveCodePayload { + return &NullableCreateMoveCodePayload{value: val, isSet: true} +} + +func (v NullableCreateMoveCodePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateMoveCodePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_domain_observability_extension.go b/services/dns/v1api/model_domain_observability_extension.go index f220e1727..d87f340e9 100644 --- a/services/dns/v1api/model_domain_observability_extension.go +++ b/services/dns/v1api/model_domain_observability_extension.go @@ -21,8 +21,8 @@ var _ MappedNullable = &DomainObservabilityExtension{} // DomainObservabilityExtension struct for DomainObservabilityExtension type DomainObservabilityExtension struct { - ObservabilityInstanceId string `json:"observabilityInstanceId"` - State *string `json:"state,omitempty"` + ObservabilityInstanceId string `json:"observabilityInstanceId"` + State *DomainObservabilityExtensionState `json:"state,omitempty"` AdditionalProperties map[string]interface{} } @@ -71,9 +71,9 @@ func (o *DomainObservabilityExtension) SetObservabilityInstanceId(v string) { } // GetState returns the State field value if set, zero value otherwise. -func (o *DomainObservabilityExtension) GetState() string { +func (o *DomainObservabilityExtension) GetState() DomainObservabilityExtensionState { if o == nil || IsNil(o.State) { - var ret string + var ret DomainObservabilityExtensionState return ret } return *o.State @@ -81,7 +81,7 @@ func (o *DomainObservabilityExtension) GetState() string { // GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DomainObservabilityExtension) GetStateOk() (*string, bool) { +func (o *DomainObservabilityExtension) GetStateOk() (*DomainObservabilityExtensionState, bool) { if o == nil || IsNil(o.State) { return nil, false } @@ -97,8 +97,8 @@ func (o *DomainObservabilityExtension) HasState() bool { return false } -// SetState gets a reference to the given string and assigns it to the State field. -func (o *DomainObservabilityExtension) SetState(v string) { +// SetState gets a reference to the given DomainObservabilityExtensionState and assigns it to the State field. +func (o *DomainObservabilityExtension) SetState(v DomainObservabilityExtensionState) { o.State = &v } diff --git a/services/dns/v1api/model_domain_observability_extension_state.go b/services/dns/v1api/model_domain_observability_extension_state.go new file mode 100644 index 000000000..bc549356d --- /dev/null +++ b/services/dns/v1api/model_domain_observability_extension_state.go @@ -0,0 +1,116 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// DomainObservabilityExtensionState the model 'DomainObservabilityExtensionState' +type DomainObservabilityExtensionState string + +// List of domain_ObservabilityExtension_state +const ( + DOMAINOBSERVABILITYEXTENSIONSTATE_CREATING DomainObservabilityExtensionState = "CREATING" + DOMAINOBSERVABILITYEXTENSIONSTATE_CREATE_SUCCEEDED DomainObservabilityExtensionState = "CREATE_SUCCEEDED" + DOMAINOBSERVABILITYEXTENSIONSTATE_ERROR DomainObservabilityExtensionState = "ERROR" + DOMAINOBSERVABILITYEXTENSIONSTATE_UNKNOWN_DEFAULT_OPEN_API DomainObservabilityExtensionState = "unknown_default_open_api" +) + +// All allowed values of DomainObservabilityExtensionState enum +var AllowedDomainObservabilityExtensionStateEnumValues = []DomainObservabilityExtensionState{ + "CREATING", + "CREATE_SUCCEEDED", + "ERROR", + "unknown_default_open_api", +} + +func (v *DomainObservabilityExtensionState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DomainObservabilityExtensionState(value) + for _, existing := range AllowedDomainObservabilityExtensionStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DOMAINOBSERVABILITYEXTENSIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDomainObservabilityExtensionStateFromValue returns a pointer to a valid DomainObservabilityExtensionState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDomainObservabilityExtensionStateFromValue(v string) (*DomainObservabilityExtensionState, error) { + ev := DomainObservabilityExtensionState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DomainObservabilityExtensionState: valid values are %v", v, AllowedDomainObservabilityExtensionStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DomainObservabilityExtensionState) IsValid() bool { + for _, existing := range AllowedDomainObservabilityExtensionStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to domain_ObservabilityExtension_state value +func (v DomainObservabilityExtensionState) Ptr() *DomainObservabilityExtensionState { + return &v +} + +type NullableDomainObservabilityExtensionState struct { + value *DomainObservabilityExtensionState + isSet bool +} + +func (v NullableDomainObservabilityExtensionState) Get() *DomainObservabilityExtensionState { + return v.value +} + +func (v *NullableDomainObservabilityExtensionState) Set(val *DomainObservabilityExtensionState) { + v.value = val + v.isSet = true +} + +func (v NullableDomainObservabilityExtensionState) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainObservabilityExtensionState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainObservabilityExtensionState(val *DomainObservabilityExtensionState) *NullableDomainObservabilityExtensionState { + return &NullableDomainObservabilityExtensionState{value: val, isSet: true} +} + +func (v NullableDomainObservabilityExtensionState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainObservabilityExtensionState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_zone_observability_extension.go b/services/dns/v1api/model_zone_observability_extension.go index fc67632a4..b113ed34c 100644 --- a/services/dns/v1api/model_zone_observability_extension.go +++ b/services/dns/v1api/model_zone_observability_extension.go @@ -21,8 +21,7 @@ var _ MappedNullable = &ZoneObservabilityExtension{} // ZoneObservabilityExtension struct for ZoneObservabilityExtension type ZoneObservabilityExtension struct { - ObservabilityInstanceId string `json:"observabilityInstanceId"` - State *string `json:"state,omitempty"` + ObservabilityInstanceId string `json:"observabilityInstanceId"` AdditionalProperties map[string]interface{} } @@ -70,38 +69,6 @@ func (o *ZoneObservabilityExtension) SetObservabilityInstanceId(v string) { o.ObservabilityInstanceId = v } -// GetState returns the State field value if set, zero value otherwise. -func (o *ZoneObservabilityExtension) GetState() string { - if o == nil || IsNil(o.State) { - var ret string - return ret - } - return *o.State -} - -// GetStateOk returns a tuple with the State field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ZoneObservabilityExtension) GetStateOk() (*string, bool) { - if o == nil || IsNil(o.State) { - return nil, false - } - return o.State, true -} - -// HasState returns a boolean if a field has been set. -func (o *ZoneObservabilityExtension) HasState() bool { - if o != nil && !IsNil(o.State) { - return true - } - - return false -} - -// SetState gets a reference to the given string and assigns it to the State field. -func (o *ZoneObservabilityExtension) SetState(v string) { - o.State = &v -} - func (o ZoneObservabilityExtension) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -113,9 +80,6 @@ func (o ZoneObservabilityExtension) MarshalJSON() ([]byte, error) { func (o ZoneObservabilityExtension) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["observabilityInstanceId"] = o.ObservabilityInstanceId - if !IsNil(o.State) { - toSerialize["state"] = o.State - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -160,7 +124,6 @@ func (o *ZoneObservabilityExtension) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "observabilityInstanceId") - delete(additionalProperties, "state") o.AdditionalProperties = additionalProperties }