From f3d59a2b9bdfd4bd3bac09bb4a17bb3434742053 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Mon, 18 May 2026 16:52:55 +0200 Subject: [PATCH 01/66] refac(alb): refactor waiters to use new enums --- CHANGELOG.md | 2 + services/alb/CHANGELOG.md | 3 + services/alb/VERSION | 2 +- .../model_create_load_balancer_payload.go | 14 +- ...del_create_load_balancer_payload_status.go | 119 ++++++++++++++++ services/alb/v2api/model_listener.go | 15 +-- services/alb/v2api/model_listener_protocol.go | 115 ++++++++++++++++ services/alb/v2api/model_load_balancer.go | 14 +- .../alb/v2api/model_load_balancer_error.go | 15 +-- .../v2api/model_load_balancer_error_type.go | 127 ++++++++++++++++++ .../alb/v2api/model_load_balancer_status.go | 119 ++++++++++++++++ services/alb/v2api/model_network.go | 15 +-- services/alb/v2api/model_network_role.go | 117 ++++++++++++++++ .../model_update_load_balancer_payload.go | 14 +- ...del_update_load_balancer_payload_status.go | 119 ++++++++++++++++ services/alb/v2api/wait/wait.go | 16 +-- services/alb/v2api/wait/wait_test.go | 56 ++++---- .../model_create_load_balancer_payload.go | 14 +- ...del_create_load_balancer_payload_status.go | 119 ++++++++++++++++ services/alb/v2beta2api/model_listener.go | 15 +-- .../alb/v2beta2api/model_listener_protocol.go | 115 ++++++++++++++++ .../alb/v2beta2api/model_load_balancer.go | 14 +- .../v2beta2api/model_load_balancer_error.go | 15 +-- .../model_load_balancer_error_type.go | 127 ++++++++++++++++++ .../v2beta2api/model_load_balancer_status.go | 119 ++++++++++++++++ services/alb/v2beta2api/model_network.go | 15 +-- services/alb/v2beta2api/model_network_role.go | 117 ++++++++++++++++ .../model_update_load_balancer_payload.go | 14 +- ...del_update_load_balancer_payload_status.go | 119 ++++++++++++++++ 29 files changed, 1558 insertions(+), 127 deletions(-) create mode 100644 services/alb/v2api/model_create_load_balancer_payload_status.go create mode 100644 services/alb/v2api/model_listener_protocol.go create mode 100644 services/alb/v2api/model_load_balancer_error_type.go create mode 100644 services/alb/v2api/model_load_balancer_status.go create mode 100644 services/alb/v2api/model_network_role.go create mode 100644 services/alb/v2api/model_update_load_balancer_payload_status.go create mode 100644 services/alb/v2beta2api/model_create_load_balancer_payload_status.go create mode 100644 services/alb/v2beta2api/model_listener_protocol.go create mode 100644 services/alb/v2beta2api/model_load_balancer_error_type.go create mode 100644 services/alb/v2beta2api/model_load_balancer_status.go create mode 100644 services/alb/v2beta2api/model_network_role.go create mode 100644 services/alb/v2beta2api/model_update_load_balancer_payload_status.go diff --git a/CHANGELOG.md b/CHANGELOG.md index de37f1cf1..78a16a3f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ - [v0.14.2](services/alb/CHANGELOG.md#v0142) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` - `v2api`: **Improvement**: Use new `WaiterHandler` struct in the ALB WaitHandler + - [v0.15.0](services/alb/CHANGELOG.md#v0150) + - **Feature:** Introduce enums for various attributes - `albwaf`: - [v0.3.2](services/albwaf/CHANGELOG.md#v032) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/alb/CHANGELOG.md b/services/alb/CHANGELOG.md index e59d28f55..762683f7a 100644 --- a/services/alb/CHANGELOG.md +++ b/services/alb/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.15.0 +- **Feature:** Introduce enums for various attributes + ## v0.14.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` - `v2api`: **Improvement**: Use new `WaiterHandler` struct in the ALB WaitHandler diff --git a/services/alb/VERSION b/services/alb/VERSION index b0d2e474f..86dd09abc 100644 --- a/services/alb/VERSION +++ b/services/alb/VERSION @@ -1 +1 @@ -v0.14.2 +v0.15.0 diff --git a/services/alb/v2api/model_create_load_balancer_payload.go b/services/alb/v2api/model_create_load_balancer_payload.go index 35fc1d35f..65bd2f5da 100644 --- a/services/alb/v2api/model_create_load_balancer_payload.go +++ b/services/alb/v2api/model_create_load_balancer_payload.go @@ -41,8 +41,8 @@ type CreateLoadBalancerPayload struct { // Transient private Application Load Balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` // Region of the LoadBalancer. - Region *string `json:"region,omitempty"` - Status *string `json:"status,omitempty"` + Region *string `json:"region,omitempty"` + Status *CreateLoadBalancerPayloadStatus `json:"status,omitempty"` // List of all target pools which will be used in the Application Load Balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets. @@ -456,9 +456,9 @@ func (o *CreateLoadBalancerPayload) SetRegion(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateLoadBalancerPayload) GetStatus() string { +func (o *CreateLoadBalancerPayload) GetStatus() CreateLoadBalancerPayloadStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CreateLoadBalancerPayloadStatus return ret } return *o.Status @@ -466,7 +466,7 @@ func (o *CreateLoadBalancerPayload) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateLoadBalancerPayload) GetStatusOk() (*string, bool) { +func (o *CreateLoadBalancerPayload) GetStatusOk() (*CreateLoadBalancerPayloadStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -482,8 +482,8 @@ func (o *CreateLoadBalancerPayload) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateLoadBalancerPayload) SetStatus(v string) { +// SetStatus gets a reference to the given CreateLoadBalancerPayloadStatus and assigns it to the Status field. +func (o *CreateLoadBalancerPayload) SetStatus(v CreateLoadBalancerPayloadStatus) { o.Status = &v } diff --git a/services/alb/v2api/model_create_load_balancer_payload_status.go b/services/alb/v2api/model_create_load_balancer_payload_status.go new file mode 100644 index 000000000..248c63903 --- /dev/null +++ b/services/alb/v2api/model_create_load_balancer_payload_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Application Load Balancer API + +This API offers an interface to provision and manage Application Load Balancers in your STACKIT project.This solution offers modern L7 load balancing. Current features include TLS, path and prefix based routing aswell as routing based on headers, query parameters and keeping connections persistent with cookies and web sockets. For each Application Load Balancer provided, two VMs are deployed in your STACKIT project and are subject to fees. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateLoadBalancerPayloadStatus the model 'CreateLoadBalancerPayloadStatus' +type CreateLoadBalancerPayloadStatus string + +// List of CreateLoadBalancerPayload_status +const ( + CREATELOADBALANCERPAYLOADSTATUS_STATUS_UNSPECIFIED CreateLoadBalancerPayloadStatus = "STATUS_UNSPECIFIED" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_PENDING CreateLoadBalancerPayloadStatus = "STATUS_PENDING" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_READY CreateLoadBalancerPayloadStatus = "STATUS_READY" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_ERROR CreateLoadBalancerPayloadStatus = "STATUS_ERROR" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_TERMINATING CreateLoadBalancerPayloadStatus = "STATUS_TERMINATING" + CREATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API CreateLoadBalancerPayloadStatus = "unknown_default_open_api" +) + +// All allowed values of CreateLoadBalancerPayloadStatus enum +var AllowedCreateLoadBalancerPayloadStatusEnumValues = []CreateLoadBalancerPayloadStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *CreateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateLoadBalancerPayloadStatus(value) + for _, existing := range AllowedCreateLoadBalancerPayloadStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateLoadBalancerPayloadStatusFromValue returns a pointer to a valid CreateLoadBalancerPayloadStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateLoadBalancerPayloadStatusFromValue(v string) (*CreateLoadBalancerPayloadStatus, error) { + ev := CreateLoadBalancerPayloadStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateLoadBalancerPayloadStatus: valid values are %v", v, AllowedCreateLoadBalancerPayloadStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateLoadBalancerPayloadStatus) IsValid() bool { + for _, existing := range AllowedCreateLoadBalancerPayloadStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateLoadBalancerPayload_status value +func (v CreateLoadBalancerPayloadStatus) Ptr() *CreateLoadBalancerPayloadStatus { + return &v +} + +type NullableCreateLoadBalancerPayloadStatus struct { + value *CreateLoadBalancerPayloadStatus + isSet bool +} + +func (v NullableCreateLoadBalancerPayloadStatus) Get() *CreateLoadBalancerPayloadStatus { + return v.value +} + +func (v *NullableCreateLoadBalancerPayloadStatus) Set(val *CreateLoadBalancerPayloadStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCreateLoadBalancerPayloadStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateLoadBalancerPayloadStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateLoadBalancerPayloadStatus(val *CreateLoadBalancerPayloadStatus) *NullableCreateLoadBalancerPayloadStatus { + return &NullableCreateLoadBalancerPayloadStatus{value: val, isSet: true} +} + +func (v NullableCreateLoadBalancerPayloadStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2api/model_listener.go b/services/alb/v2api/model_listener.go index a8126b757..d829d1a76 100644 --- a/services/alb/v2api/model_listener.go +++ b/services/alb/v2api/model_listener.go @@ -24,9 +24,8 @@ type Listener struct { // A unique listener name. Name *string `json:"name,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` // Port number on which the listener receives incoming traffic. - Port *int32 `json:"port,omitempty"` - // Protocol is the highest network protocol we understand to load balance. Currently PROTOCOL_HTTP and PROTOCOL_HTTPS are supported. - Protocol *string `json:"protocol,omitempty"` + Port *int32 `json:"port,omitempty"` + Protocol *ListenerProtocol `json:"protocol,omitempty"` // Enable Web Application Firewall (WAF), referenced by name. See \"Application Load Balancer - Web Application Firewall API\" for more information. WafConfigName *string `json:"wafConfigName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` AdditionalProperties map[string]interface{} @@ -180,9 +179,9 @@ func (o *Listener) SetPort(v int32) { } // GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *Listener) GetProtocol() string { +func (o *Listener) GetProtocol() ListenerProtocol { if o == nil || IsNil(o.Protocol) { - var ret string + var ret ListenerProtocol return ret } return *o.Protocol @@ -190,7 +189,7 @@ func (o *Listener) GetProtocol() string { // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Listener) GetProtocolOk() (*string, bool) { +func (o *Listener) GetProtocolOk() (*ListenerProtocol, bool) { if o == nil || IsNil(o.Protocol) { return nil, false } @@ -206,8 +205,8 @@ func (o *Listener) HasProtocol() bool { return false } -// SetProtocol gets a reference to the given string and assigns it to the Protocol field. -func (o *Listener) SetProtocol(v string) { +// SetProtocol gets a reference to the given ListenerProtocol and assigns it to the Protocol field. +func (o *Listener) SetProtocol(v ListenerProtocol) { o.Protocol = &v } diff --git a/services/alb/v2api/model_listener_protocol.go b/services/alb/v2api/model_listener_protocol.go new file mode 100644 index 000000000..867692410 --- /dev/null +++ b/services/alb/v2api/model_listener_protocol.go @@ -0,0 +1,115 @@ +/* +STACKIT Application Load Balancer API + +This API offers an interface to provision and manage Application Load Balancers in your STACKIT project.This solution offers modern L7 load balancing. Current features include TLS, path and prefix based routing aswell as routing based on headers, query parameters and keeping connections persistent with cookies and web sockets. For each Application Load Balancer provided, two VMs are deployed in your STACKIT project and are subject to fees. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListenerProtocol Protocol is the highest network protocol we understand to load balance. Currently PROTOCOL_HTTP and PROTOCOL_HTTPS are supported. +type ListenerProtocol string + +// List of Listener_protocol +const ( + LISTENERPROTOCOL_PROTOCOL_UNSPECIFIED ListenerProtocol = "PROTOCOL_UNSPECIFIED" + LISTENERPROTOCOL_PROTOCOL_HTTP ListenerProtocol = "PROTOCOL_HTTP" + LISTENERPROTOCOL_PROTOCOL_HTTPS ListenerProtocol = "PROTOCOL_HTTPS" + LISTENERPROTOCOL_UNKNOWN_DEFAULT_OPEN_API ListenerProtocol = "unknown_default_open_api" +) + +// All allowed values of ListenerProtocol enum +var AllowedListenerProtocolEnumValues = []ListenerProtocol{ + "PROTOCOL_UNSPECIFIED", + "PROTOCOL_HTTP", + "PROTOCOL_HTTPS", + "unknown_default_open_api", +} + +func (v *ListenerProtocol) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListenerProtocol(value) + for _, existing := range AllowedListenerProtocolEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTENERPROTOCOL_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListenerProtocolFromValue returns a pointer to a valid ListenerProtocol +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListenerProtocolFromValue(v string) (*ListenerProtocol, error) { + ev := ListenerProtocol(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListenerProtocol: valid values are %v", v, AllowedListenerProtocolEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListenerProtocol) IsValid() bool { + for _, existing := range AllowedListenerProtocolEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Listener_protocol value +func (v ListenerProtocol) Ptr() *ListenerProtocol { + return &v +} + +type NullableListenerProtocol struct { + value *ListenerProtocol + isSet bool +} + +func (v NullableListenerProtocol) Get() *ListenerProtocol { + return v.value +} + +func (v *NullableListenerProtocol) Set(val *ListenerProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableListenerProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableListenerProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListenerProtocol(val *ListenerProtocol) *NullableListenerProtocol { + return &NullableListenerProtocol{value: val, isSet: true} +} + +func (v NullableListenerProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListenerProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2api/model_load_balancer.go b/services/alb/v2api/model_load_balancer.go index ca8369973..962b89226 100644 --- a/services/alb/v2api/model_load_balancer.go +++ b/services/alb/v2api/model_load_balancer.go @@ -41,8 +41,8 @@ type LoadBalancer struct { // Transient private Application Load Balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` // Region of the LoadBalancer. - Region *string `json:"region,omitempty"` - Status *string `json:"status,omitempty"` + Region *string `json:"region,omitempty"` + Status *LoadBalancerStatus `json:"status,omitempty"` // List of all target pools which will be used in the Application Load Balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets. @@ -456,9 +456,9 @@ func (o *LoadBalancer) SetRegion(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *LoadBalancer) GetStatus() string { +func (o *LoadBalancer) GetStatus() LoadBalancerStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret LoadBalancerStatus return ret } return *o.Status @@ -466,7 +466,7 @@ func (o *LoadBalancer) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LoadBalancer) GetStatusOk() (*string, bool) { +func (o *LoadBalancer) GetStatusOk() (*LoadBalancerStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -482,8 +482,8 @@ func (o *LoadBalancer) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *LoadBalancer) SetStatus(v string) { +// SetStatus gets a reference to the given LoadBalancerStatus and assigns it to the Status field. +func (o *LoadBalancer) SetStatus(v LoadBalancerStatus) { o.Status = &v } diff --git a/services/alb/v2api/model_load_balancer_error.go b/services/alb/v2api/model_load_balancer_error.go index 6a7d548b1..3bb6b063f 100644 --- a/services/alb/v2api/model_load_balancer_error.go +++ b/services/alb/v2api/model_load_balancer_error.go @@ -20,9 +20,8 @@ var _ MappedNullable = &LoadBalancerError{} // LoadBalancerError struct for LoadBalancerError type LoadBalancerError struct { // The error description contains additional helpful user information to fix the error state of the Application Load Balancer. For example the IP 45.135.247.139 does not exist in the project, then the description will report: Floating IP \"45.135.247.139\" could not be found. - Description *string `json:"description,omitempty"` - // The error type specifies which part of the Application Load Balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the Application Load Balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error. - Type *string `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + Type *LoadBalancerErrorType `json:"type,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +77,9 @@ func (o *LoadBalancerError) SetDescription(v string) { } // GetType returns the Type field value if set, zero value otherwise. -func (o *LoadBalancerError) GetType() string { +func (o *LoadBalancerError) GetType() LoadBalancerErrorType { if o == nil || IsNil(o.Type) { - var ret string + var ret LoadBalancerErrorType return ret } return *o.Type @@ -88,7 +87,7 @@ func (o *LoadBalancerError) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LoadBalancerError) GetTypeOk() (*string, bool) { +func (o *LoadBalancerError) GetTypeOk() (*LoadBalancerErrorType, bool) { if o == nil || IsNil(o.Type) { return nil, false } @@ -104,8 +103,8 @@ func (o *LoadBalancerError) HasType() bool { return false } -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *LoadBalancerError) SetType(v string) { +// SetType gets a reference to the given LoadBalancerErrorType and assigns it to the Type field. +func (o *LoadBalancerError) SetType(v LoadBalancerErrorType) { o.Type = &v } diff --git a/services/alb/v2api/model_load_balancer_error_type.go b/services/alb/v2api/model_load_balancer_error_type.go new file mode 100644 index 000000000..47640c9b6 --- /dev/null +++ b/services/alb/v2api/model_load_balancer_error_type.go @@ -0,0 +1,127 @@ +/* +STACKIT Application Load Balancer API + +This API offers an interface to provision and manage Application Load Balancers in your STACKIT project.This solution offers modern L7 load balancing. Current features include TLS, path and prefix based routing aswell as routing based on headers, query parameters and keeping connections persistent with cookies and web sockets. For each Application Load Balancer provided, two VMs are deployed in your STACKIT project and are subject to fees. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// LoadBalancerErrorType The error type specifies which part of the Application Load Balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the Application Load Balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error. +type LoadBalancerErrorType string + +// List of LoadBalancerError_type +const ( + LOADBALANCERERRORTYPE_TYPE_UNSPECIFIED LoadBalancerErrorType = "TYPE_UNSPECIFIED" + LOADBALANCERERRORTYPE_TYPE_INTERNAL LoadBalancerErrorType = "TYPE_INTERNAL" + LOADBALANCERERRORTYPE_TYPE_QUOTA_SECGROUP_EXCEEDED LoadBalancerErrorType = "TYPE_QUOTA_SECGROUP_EXCEEDED" + LOADBALANCERERRORTYPE_TYPE_QUOTA_SECGROUPRULE_EXCEEDED LoadBalancerErrorType = "TYPE_QUOTA_SECGROUPRULE_EXCEEDED" + LOADBALANCERERRORTYPE_TYPE_PORT_NOT_CONFIGURED LoadBalancerErrorType = "TYPE_PORT_NOT_CONFIGURED" + LOADBALANCERERRORTYPE_TYPE_FIP_NOT_CONFIGURED LoadBalancerErrorType = "TYPE_FIP_NOT_CONFIGURED" + LOADBALANCERERRORTYPE_TYPE_TARGET_NOT_ACTIVE LoadBalancerErrorType = "TYPE_TARGET_NOT_ACTIVE" + LOADBALANCERERRORTYPE_TYPE_METRICS_MISCONFIGURED LoadBalancerErrorType = "TYPE_METRICS_MISCONFIGURED" + LOADBALANCERERRORTYPE_TYPE_LOGS_MISCONFIGURED LoadBalancerErrorType = "TYPE_LOGS_MISCONFIGURED" + LOADBALANCERERRORTYPE_UNKNOWN_DEFAULT_OPEN_API LoadBalancerErrorType = "unknown_default_open_api" +) + +// All allowed values of LoadBalancerErrorType enum +var AllowedLoadBalancerErrorTypeEnumValues = []LoadBalancerErrorType{ + "TYPE_UNSPECIFIED", + "TYPE_INTERNAL", + "TYPE_QUOTA_SECGROUP_EXCEEDED", + "TYPE_QUOTA_SECGROUPRULE_EXCEEDED", + "TYPE_PORT_NOT_CONFIGURED", + "TYPE_FIP_NOT_CONFIGURED", + "TYPE_TARGET_NOT_ACTIVE", + "TYPE_METRICS_MISCONFIGURED", + "TYPE_LOGS_MISCONFIGURED", + "unknown_default_open_api", +} + +func (v *LoadBalancerErrorType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LoadBalancerErrorType(value) + for _, existing := range AllowedLoadBalancerErrorTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOADBALANCERERRORTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLoadBalancerErrorTypeFromValue returns a pointer to a valid LoadBalancerErrorType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLoadBalancerErrorTypeFromValue(v string) (*LoadBalancerErrorType, error) { + ev := LoadBalancerErrorType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LoadBalancerErrorType: valid values are %v", v, AllowedLoadBalancerErrorTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LoadBalancerErrorType) IsValid() bool { + for _, existing := range AllowedLoadBalancerErrorTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LoadBalancerError_type value +func (v LoadBalancerErrorType) Ptr() *LoadBalancerErrorType { + return &v +} + +type NullableLoadBalancerErrorType struct { + value *LoadBalancerErrorType + isSet bool +} + +func (v NullableLoadBalancerErrorType) Get() *LoadBalancerErrorType { + return v.value +} + +func (v *NullableLoadBalancerErrorType) Set(val *LoadBalancerErrorType) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerErrorType) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerErrorType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerErrorType(val *LoadBalancerErrorType) *NullableLoadBalancerErrorType { + return &NullableLoadBalancerErrorType{value: val, isSet: true} +} + +func (v NullableLoadBalancerErrorType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerErrorType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2api/model_load_balancer_status.go b/services/alb/v2api/model_load_balancer_status.go new file mode 100644 index 000000000..0a755c40c --- /dev/null +++ b/services/alb/v2api/model_load_balancer_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Application Load Balancer API + +This API offers an interface to provision and manage Application Load Balancers in your STACKIT project.This solution offers modern L7 load balancing. Current features include TLS, path and prefix based routing aswell as routing based on headers, query parameters and keeping connections persistent with cookies and web sockets. For each Application Load Balancer provided, two VMs are deployed in your STACKIT project and are subject to fees. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// LoadBalancerStatus the model 'LoadBalancerStatus' +type LoadBalancerStatus string + +// List of LoadBalancer_status +const ( + LOADBALANCERSTATUS_STATUS_UNSPECIFIED LoadBalancerStatus = "STATUS_UNSPECIFIED" + LOADBALANCERSTATUS_STATUS_PENDING LoadBalancerStatus = "STATUS_PENDING" + LOADBALANCERSTATUS_STATUS_READY LoadBalancerStatus = "STATUS_READY" + LOADBALANCERSTATUS_STATUS_ERROR LoadBalancerStatus = "STATUS_ERROR" + LOADBALANCERSTATUS_STATUS_TERMINATING LoadBalancerStatus = "STATUS_TERMINATING" + LOADBALANCERSTATUS_UNKNOWN_DEFAULT_OPEN_API LoadBalancerStatus = "unknown_default_open_api" +) + +// All allowed values of LoadBalancerStatus enum +var AllowedLoadBalancerStatusEnumValues = []LoadBalancerStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *LoadBalancerStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LoadBalancerStatus(value) + for _, existing := range AllowedLoadBalancerStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOADBALANCERSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLoadBalancerStatusFromValue returns a pointer to a valid LoadBalancerStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLoadBalancerStatusFromValue(v string) (*LoadBalancerStatus, error) { + ev := LoadBalancerStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LoadBalancerStatus: valid values are %v", v, AllowedLoadBalancerStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LoadBalancerStatus) IsValid() bool { + for _, existing := range AllowedLoadBalancerStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LoadBalancer_status value +func (v LoadBalancerStatus) Ptr() *LoadBalancerStatus { + return &v +} + +type NullableLoadBalancerStatus struct { + value *LoadBalancerStatus + isSet bool +} + +func (v NullableLoadBalancerStatus) Get() *LoadBalancerStatus { + return v.value +} + +func (v *NullableLoadBalancerStatus) Set(val *LoadBalancerStatus) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerStatus(val *LoadBalancerStatus) *NullableLoadBalancerStatus { + return &NullableLoadBalancerStatus{value: val, isSet: true} +} + +func (v NullableLoadBalancerStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2api/model_network.go b/services/alb/v2api/model_network.go index e4e7d2890..1b897ac08 100644 --- a/services/alb/v2api/model_network.go +++ b/services/alb/v2api/model_network.go @@ -20,9 +20,8 @@ var _ MappedNullable = &Network{} // Network struct for Network type Network struct { // STACKIT network ID the Application Load Balancer and/or targets are in. - NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` - // The role defines how the Application Load Balancer is using the network. Currently only ROLE_LISTENERS_AND_TARGETS is supported. - Role *string `json:"role,omitempty"` + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` + Role *NetworkRole `json:"role,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +77,9 @@ func (o *Network) SetNetworkId(v string) { } // GetRole returns the Role field value if set, zero value otherwise. -func (o *Network) GetRole() string { +func (o *Network) GetRole() NetworkRole { if o == nil || IsNil(o.Role) { - var ret string + var ret NetworkRole return ret } return *o.Role @@ -88,7 +87,7 @@ func (o *Network) GetRole() string { // GetRoleOk returns a tuple with the Role field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetRoleOk() (*string, bool) { +func (o *Network) GetRoleOk() (*NetworkRole, bool) { if o == nil || IsNil(o.Role) { return nil, false } @@ -104,8 +103,8 @@ func (o *Network) HasRole() bool { return false } -// SetRole gets a reference to the given string and assigns it to the Role field. -func (o *Network) SetRole(v string) { +// SetRole gets a reference to the given NetworkRole and assigns it to the Role field. +func (o *Network) SetRole(v NetworkRole) { o.Role = &v } diff --git a/services/alb/v2api/model_network_role.go b/services/alb/v2api/model_network_role.go new file mode 100644 index 000000000..15e8100d5 --- /dev/null +++ b/services/alb/v2api/model_network_role.go @@ -0,0 +1,117 @@ +/* +STACKIT Application Load Balancer API + +This API offers an interface to provision and manage Application Load Balancers in your STACKIT project.This solution offers modern L7 load balancing. Current features include TLS, path and prefix based routing aswell as routing based on headers, query parameters and keeping connections persistent with cookies and web sockets. For each Application Load Balancer provided, two VMs are deployed in your STACKIT project and are subject to fees. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// NetworkRole The role defines how the Application Load Balancer is using the network. Currently only ROLE_LISTENERS_AND_TARGETS is supported. +type NetworkRole string + +// List of Network_role +const ( + NETWORKROLE_ROLE_UNSPECIFIED NetworkRole = "ROLE_UNSPECIFIED" + NETWORKROLE_ROLE_LISTENERS_AND_TARGETS NetworkRole = "ROLE_LISTENERS_AND_TARGETS" + NETWORKROLE_ROLE_LISTENERS NetworkRole = "ROLE_LISTENERS" + NETWORKROLE_ROLE_TARGETS NetworkRole = "ROLE_TARGETS" + NETWORKROLE_UNKNOWN_DEFAULT_OPEN_API NetworkRole = "unknown_default_open_api" +) + +// All allowed values of NetworkRole enum +var AllowedNetworkRoleEnumValues = []NetworkRole{ + "ROLE_UNSPECIFIED", + "ROLE_LISTENERS_AND_TARGETS", + "ROLE_LISTENERS", + "ROLE_TARGETS", + "unknown_default_open_api", +} + +func (v *NetworkRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NetworkRole(value) + for _, existing := range AllowedNetworkRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = NETWORKROLE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewNetworkRoleFromValue returns a pointer to a valid NetworkRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewNetworkRoleFromValue(v string) (*NetworkRole, error) { + ev := NetworkRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for NetworkRole: valid values are %v", v, AllowedNetworkRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v NetworkRole) IsValid() bool { + for _, existing := range AllowedNetworkRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Network_role value +func (v NetworkRole) Ptr() *NetworkRole { + return &v +} + +type NullableNetworkRole struct { + value *NetworkRole + isSet bool +} + +func (v NullableNetworkRole) Get() *NetworkRole { + return v.value +} + +func (v *NullableNetworkRole) Set(val *NetworkRole) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRole) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRole(val *NetworkRole) *NullableNetworkRole { + return &NullableNetworkRole{value: val, isSet: true} +} + +func (v NullableNetworkRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2api/model_update_load_balancer_payload.go b/services/alb/v2api/model_update_load_balancer_payload.go index 116b72c56..d6cd21f9e 100644 --- a/services/alb/v2api/model_update_load_balancer_payload.go +++ b/services/alb/v2api/model_update_load_balancer_payload.go @@ -41,8 +41,8 @@ type UpdateLoadBalancerPayload struct { // Transient private Application Load Balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` // Region of the LoadBalancer. - Region *string `json:"region,omitempty"` - Status *string `json:"status,omitempty"` + Region *string `json:"region,omitempty"` + Status *UpdateLoadBalancerPayloadStatus `json:"status,omitempty"` // List of all target pools which will be used in the Application Load Balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets. @@ -456,9 +456,9 @@ func (o *UpdateLoadBalancerPayload) SetRegion(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *UpdateLoadBalancerPayload) GetStatus() string { +func (o *UpdateLoadBalancerPayload) GetStatus() UpdateLoadBalancerPayloadStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret UpdateLoadBalancerPayloadStatus return ret } return *o.Status @@ -466,7 +466,7 @@ func (o *UpdateLoadBalancerPayload) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateLoadBalancerPayload) GetStatusOk() (*string, bool) { +func (o *UpdateLoadBalancerPayload) GetStatusOk() (*UpdateLoadBalancerPayloadStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -482,8 +482,8 @@ func (o *UpdateLoadBalancerPayload) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *UpdateLoadBalancerPayload) SetStatus(v string) { +// SetStatus gets a reference to the given UpdateLoadBalancerPayloadStatus and assigns it to the Status field. +func (o *UpdateLoadBalancerPayload) SetStatus(v UpdateLoadBalancerPayloadStatus) { o.Status = &v } diff --git a/services/alb/v2api/model_update_load_balancer_payload_status.go b/services/alb/v2api/model_update_load_balancer_payload_status.go new file mode 100644 index 000000000..37014c25a --- /dev/null +++ b/services/alb/v2api/model_update_load_balancer_payload_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Application Load Balancer API + +This API offers an interface to provision and manage Application Load Balancers in your STACKIT project.This solution offers modern L7 load balancing. Current features include TLS, path and prefix based routing aswell as routing based on headers, query parameters and keeping connections persistent with cookies and web sockets. For each Application Load Balancer provided, two VMs are deployed in your STACKIT project and are subject to fees. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// UpdateLoadBalancerPayloadStatus the model 'UpdateLoadBalancerPayloadStatus' +type UpdateLoadBalancerPayloadStatus string + +// List of UpdateLoadBalancerPayload_status +const ( + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_UNSPECIFIED UpdateLoadBalancerPayloadStatus = "STATUS_UNSPECIFIED" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_PENDING UpdateLoadBalancerPayloadStatus = "STATUS_PENDING" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_READY UpdateLoadBalancerPayloadStatus = "STATUS_READY" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_ERROR UpdateLoadBalancerPayloadStatus = "STATUS_ERROR" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_TERMINATING UpdateLoadBalancerPayloadStatus = "STATUS_TERMINATING" + UPDATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API UpdateLoadBalancerPayloadStatus = "unknown_default_open_api" +) + +// All allowed values of UpdateLoadBalancerPayloadStatus enum +var AllowedUpdateLoadBalancerPayloadStatusEnumValues = []UpdateLoadBalancerPayloadStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *UpdateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateLoadBalancerPayloadStatus(value) + for _, existing := range AllowedUpdateLoadBalancerPayloadStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateLoadBalancerPayloadStatusFromValue returns a pointer to a valid UpdateLoadBalancerPayloadStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateLoadBalancerPayloadStatusFromValue(v string) (*UpdateLoadBalancerPayloadStatus, error) { + ev := UpdateLoadBalancerPayloadStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateLoadBalancerPayloadStatus: valid values are %v", v, AllowedUpdateLoadBalancerPayloadStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateLoadBalancerPayloadStatus) IsValid() bool { + for _, existing := range AllowedUpdateLoadBalancerPayloadStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateLoadBalancerPayload_status value +func (v UpdateLoadBalancerPayloadStatus) Ptr() *UpdateLoadBalancerPayloadStatus { + return &v +} + +type NullableUpdateLoadBalancerPayloadStatus struct { + value *UpdateLoadBalancerPayloadStatus + isSet bool +} + +func (v NullableUpdateLoadBalancerPayloadStatus) Get() *UpdateLoadBalancerPayloadStatus { + return v.value +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) Set(val *UpdateLoadBalancerPayloadStatus) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateLoadBalancerPayloadStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateLoadBalancerPayloadStatus(val *UpdateLoadBalancerPayloadStatus) *NullableUpdateLoadBalancerPayloadStatus { + return &NullableUpdateLoadBalancerPayloadStatus{value: val, isSet: true} +} + +func (v NullableUpdateLoadBalancerPayloadStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2api/wait/wait.go b/services/alb/v2api/wait/wait.go index d6b34ab96..23e38358b 100644 --- a/services/alb/v2api/wait/wait.go +++ b/services/alb/v2api/wait/wait.go @@ -18,9 +18,9 @@ const ( ) func CreateOrUpdateLoadbalancerWaitHandler(ctx context.Context, client alb.DefaultAPI, projectId, region, name string) *wait.AsyncActionHandler[alb.LoadBalancer] { - waitConfig := wait.WaiterHelper[alb.LoadBalancer, string]{ + waitConfig := wait.WaiterHelper[alb.LoadBalancer, alb.LoadBalancerStatus]{ FetchInstance: client.GetLoadBalancer(ctx, projectId, region, name).Execute, - GetState: func(response *alb.LoadBalancer) (string, error) { + GetState: func(response *alb.LoadBalancer) (alb.LoadBalancerStatus, error) { if response == nil { return "", errors.New("empty response") } @@ -29,8 +29,8 @@ func CreateOrUpdateLoadbalancerWaitHandler(ctx context.Context, client alb.Defau } return *response.Status, nil }, - ActiveState: []string{LOADBALANCERSTATUS_READY}, - ErrorState: []string{LOADBALANCERSTATUS_ERROR}, + ActiveState: []alb.LoadBalancerStatus{alb.LOADBALANCERSTATUS_STATUS_READY}, + ErrorState: []alb.LoadBalancerStatus{alb.LOADBALANCERSTATUS_STATUS_ERROR}, } handler := wait.New(waitConfig.Wait()) @@ -39,9 +39,9 @@ func CreateOrUpdateLoadbalancerWaitHandler(ctx context.Context, client alb.Defau } func DeleteLoadbalancerWaitHandler(ctx context.Context, client alb.DefaultAPI, projectId, region, name string) *wait.AsyncActionHandler[alb.LoadBalancer] { - waitConfig := wait.WaiterHelper[alb.LoadBalancer, string]{ + waitConfig := wait.WaiterHelper[alb.LoadBalancer, alb.LoadBalancerStatus]{ FetchInstance: client.GetLoadBalancer(ctx, projectId, region, name).Execute, - GetState: func(response *alb.LoadBalancer) (string, error) { + GetState: func(response *alb.LoadBalancer) (alb.LoadBalancerStatus, error) { if response == nil { return "", errors.New("empty response") } @@ -50,8 +50,8 @@ func DeleteLoadbalancerWaitHandler(ctx context.Context, client alb.DefaultAPI, p } return *response.Status, nil }, - ActiveState: []string{}, - ErrorState: []string{LOADBALANCERSTATUS_ERROR}, + ActiveState: []alb.LoadBalancerStatus{}, + ErrorState: []alb.LoadBalancerStatus{LOADBALANCERSTATUS_ERROR}, } handler := wait.New(waitConfig.Wait()) diff --git a/services/alb/v2api/wait/wait_test.go b/services/alb/v2api/wait/wait_test.go index 21a86461f..de7392c86 100644 --- a/services/alb/v2api/wait/wait_test.go +++ b/services/alb/v2api/wait/wait_test.go @@ -57,42 +57,42 @@ func TestCreateOrUpdateLoadbalancerWaitHandler(t *testing.T) { []response{ { loadbalancer: &alb.LoadBalancer{ - Status: utils.Ptr(LOADBALANCERSTATUS_READY), + Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_READY), }, err: nil, }, }, &alb.LoadBalancer{ - Status: utils.Ptr(LOADBALANCERSTATUS_READY), + Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_READY), }, false, }, { "create succeeded delayed", []response{ - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_READY)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_READY)}, nil}, }, - &alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_READY)}, + &alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_READY)}, false, }, { "create failed delayed", []response{ - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_ERROR)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_ERROR)}, nil}, }, - &alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_ERROR)}, + &alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_ERROR)}, true, }, { "timeout", []response{ - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, }, nil, true, @@ -100,7 +100,7 @@ func TestCreateOrUpdateLoadbalancerWaitHandler(t *testing.T) { { "broken state", []response{ - {&alb.LoadBalancer{Status: utils.Ptr("bogus")}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LoadBalancerStatus("bogus"))}, nil}, }, nil, true, @@ -154,9 +154,9 @@ func TestDeleteLoadbalancerWaitHandler(t *testing.T) { { "Delete with '404' delayed", []response{ - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, {nil, oapierror.NewError(http.StatusNotFound, "not found")}, }, false, @@ -171,9 +171,9 @@ func TestDeleteLoadbalancerWaitHandler(t *testing.T) { { "Delete with 'gone' delayed", []response{ - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, {nil, oapierror.NewError(http.StatusGone, "not found")}, }, false, @@ -181,20 +181,20 @@ func TestDeleteLoadbalancerWaitHandler(t *testing.T) { { "Delete with error delayed", []response{ - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_ERROR)}, oapierror.NewError(http.StatusInternalServerError, "kapow")}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_ERROR)}, oapierror.NewError(http.StatusInternalServerError, "kapow")}, }, true, }, { "Cannot delete", []response{ - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_PENDING)}, nil}, - {&alb.LoadBalancer{Status: utils.Ptr(LOADBALANCERSTATUS_ERROR)}, oapierror.NewError(http.StatusOK, "ok")}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_PENDING)}, nil}, + {&alb.LoadBalancer{Status: utils.Ptr(alb.LOADBALANCERSTATUS_STATUS_ERROR)}, oapierror.NewError(http.StatusOK, "ok")}, }, true, }, diff --git a/services/alb/v2beta2api/model_create_load_balancer_payload.go b/services/alb/v2beta2api/model_create_load_balancer_payload.go index a02010b1c..fc59d60f8 100644 --- a/services/alb/v2beta2api/model_create_load_balancer_payload.go +++ b/services/alb/v2beta2api/model_create_load_balancer_payload.go @@ -41,8 +41,8 @@ type CreateLoadBalancerPayload struct { // Transient private application load balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` // Region of the LoadBalancer. - Region *string `json:"region,omitempty"` - Status *string `json:"status,omitempty"` + Region *string `json:"region,omitempty"` + Status *CreateLoadBalancerPayloadStatus `json:"status,omitempty"` // List of all target pools which will be used in the application load balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets. @@ -456,9 +456,9 @@ func (o *CreateLoadBalancerPayload) SetRegion(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateLoadBalancerPayload) GetStatus() string { +func (o *CreateLoadBalancerPayload) GetStatus() CreateLoadBalancerPayloadStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CreateLoadBalancerPayloadStatus return ret } return *o.Status @@ -466,7 +466,7 @@ func (o *CreateLoadBalancerPayload) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateLoadBalancerPayload) GetStatusOk() (*string, bool) { +func (o *CreateLoadBalancerPayload) GetStatusOk() (*CreateLoadBalancerPayloadStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -482,8 +482,8 @@ func (o *CreateLoadBalancerPayload) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateLoadBalancerPayload) SetStatus(v string) { +// SetStatus gets a reference to the given CreateLoadBalancerPayloadStatus and assigns it to the Status field. +func (o *CreateLoadBalancerPayload) SetStatus(v CreateLoadBalancerPayloadStatus) { o.Status = &v } diff --git a/services/alb/v2beta2api/model_create_load_balancer_payload_status.go b/services/alb/v2beta2api/model_create_load_balancer_payload_status.go new file mode 100644 index 000000000..5a11b1378 --- /dev/null +++ b/services/alb/v2beta2api/model_create_load_balancer_payload_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Application Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta2api + +import ( + "encoding/json" + "fmt" +) + +// CreateLoadBalancerPayloadStatus the model 'CreateLoadBalancerPayloadStatus' +type CreateLoadBalancerPayloadStatus string + +// List of CreateLoadBalancerPayload_status +const ( + CREATELOADBALANCERPAYLOADSTATUS_STATUS_UNSPECIFIED CreateLoadBalancerPayloadStatus = "STATUS_UNSPECIFIED" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_PENDING CreateLoadBalancerPayloadStatus = "STATUS_PENDING" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_READY CreateLoadBalancerPayloadStatus = "STATUS_READY" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_ERROR CreateLoadBalancerPayloadStatus = "STATUS_ERROR" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_TERMINATING CreateLoadBalancerPayloadStatus = "STATUS_TERMINATING" + CREATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API CreateLoadBalancerPayloadStatus = "unknown_default_open_api" +) + +// All allowed values of CreateLoadBalancerPayloadStatus enum +var AllowedCreateLoadBalancerPayloadStatusEnumValues = []CreateLoadBalancerPayloadStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *CreateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateLoadBalancerPayloadStatus(value) + for _, existing := range AllowedCreateLoadBalancerPayloadStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateLoadBalancerPayloadStatusFromValue returns a pointer to a valid CreateLoadBalancerPayloadStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateLoadBalancerPayloadStatusFromValue(v string) (*CreateLoadBalancerPayloadStatus, error) { + ev := CreateLoadBalancerPayloadStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateLoadBalancerPayloadStatus: valid values are %v", v, AllowedCreateLoadBalancerPayloadStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateLoadBalancerPayloadStatus) IsValid() bool { + for _, existing := range AllowedCreateLoadBalancerPayloadStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateLoadBalancerPayload_status value +func (v CreateLoadBalancerPayloadStatus) Ptr() *CreateLoadBalancerPayloadStatus { + return &v +} + +type NullableCreateLoadBalancerPayloadStatus struct { + value *CreateLoadBalancerPayloadStatus + isSet bool +} + +func (v NullableCreateLoadBalancerPayloadStatus) Get() *CreateLoadBalancerPayloadStatus { + return v.value +} + +func (v *NullableCreateLoadBalancerPayloadStatus) Set(val *CreateLoadBalancerPayloadStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCreateLoadBalancerPayloadStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateLoadBalancerPayloadStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateLoadBalancerPayloadStatus(val *CreateLoadBalancerPayloadStatus) *NullableCreateLoadBalancerPayloadStatus { + return &NullableCreateLoadBalancerPayloadStatus{value: val, isSet: true} +} + +func (v NullableCreateLoadBalancerPayloadStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2beta2api/model_listener.go b/services/alb/v2beta2api/model_listener.go index 3c68b3c2f..c84ae5610 100644 --- a/services/alb/v2beta2api/model_listener.go +++ b/services/alb/v2beta2api/model_listener.go @@ -24,9 +24,8 @@ type Listener struct { // Unique, system-generated identifier for the listener. It is derived from the protocol and port. Name *string `json:"name,omitempty"` // Port number on which the listener receives incoming traffic. - Port *int32 `json:"port,omitempty"` - // Protocol is the highest network protocol we understand to load balance. Currently PROTOCOL_HTTP and PROTOCOL_HTTPS are supported. - Protocol *string `json:"protocol,omitempty"` + Port *int32 `json:"port,omitempty"` + Protocol *ListenerProtocol `json:"protocol,omitempty"` // Enable Web Application Firewall (WAF), referenced by name. See \"Application Load Balancer - Web Application Firewall API\" for more information. WafConfigName *string `json:"wafConfigName,omitempty" validate:"regexp=^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$"` AdditionalProperties map[string]interface{} @@ -180,9 +179,9 @@ func (o *Listener) SetPort(v int32) { } // GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *Listener) GetProtocol() string { +func (o *Listener) GetProtocol() ListenerProtocol { if o == nil || IsNil(o.Protocol) { - var ret string + var ret ListenerProtocol return ret } return *o.Protocol @@ -190,7 +189,7 @@ func (o *Listener) GetProtocol() string { // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Listener) GetProtocolOk() (*string, bool) { +func (o *Listener) GetProtocolOk() (*ListenerProtocol, bool) { if o == nil || IsNil(o.Protocol) { return nil, false } @@ -206,8 +205,8 @@ func (o *Listener) HasProtocol() bool { return false } -// SetProtocol gets a reference to the given string and assigns it to the Protocol field. -func (o *Listener) SetProtocol(v string) { +// SetProtocol gets a reference to the given ListenerProtocol and assigns it to the Protocol field. +func (o *Listener) SetProtocol(v ListenerProtocol) { o.Protocol = &v } diff --git a/services/alb/v2beta2api/model_listener_protocol.go b/services/alb/v2beta2api/model_listener_protocol.go new file mode 100644 index 000000000..fe7d391ee --- /dev/null +++ b/services/alb/v2beta2api/model_listener_protocol.go @@ -0,0 +1,115 @@ +/* +STACKIT Application Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta2api + +import ( + "encoding/json" + "fmt" +) + +// ListenerProtocol Protocol is the highest network protocol we understand to load balance. Currently PROTOCOL_HTTP and PROTOCOL_HTTPS are supported. +type ListenerProtocol string + +// List of Listener_protocol +const ( + LISTENERPROTOCOL_PROTOCOL_UNSPECIFIED ListenerProtocol = "PROTOCOL_UNSPECIFIED" + LISTENERPROTOCOL_PROTOCOL_HTTP ListenerProtocol = "PROTOCOL_HTTP" + LISTENERPROTOCOL_PROTOCOL_HTTPS ListenerProtocol = "PROTOCOL_HTTPS" + LISTENERPROTOCOL_UNKNOWN_DEFAULT_OPEN_API ListenerProtocol = "unknown_default_open_api" +) + +// All allowed values of ListenerProtocol enum +var AllowedListenerProtocolEnumValues = []ListenerProtocol{ + "PROTOCOL_UNSPECIFIED", + "PROTOCOL_HTTP", + "PROTOCOL_HTTPS", + "unknown_default_open_api", +} + +func (v *ListenerProtocol) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListenerProtocol(value) + for _, existing := range AllowedListenerProtocolEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTENERPROTOCOL_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListenerProtocolFromValue returns a pointer to a valid ListenerProtocol +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListenerProtocolFromValue(v string) (*ListenerProtocol, error) { + ev := ListenerProtocol(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListenerProtocol: valid values are %v", v, AllowedListenerProtocolEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListenerProtocol) IsValid() bool { + for _, existing := range AllowedListenerProtocolEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Listener_protocol value +func (v ListenerProtocol) Ptr() *ListenerProtocol { + return &v +} + +type NullableListenerProtocol struct { + value *ListenerProtocol + isSet bool +} + +func (v NullableListenerProtocol) Get() *ListenerProtocol { + return v.value +} + +func (v *NullableListenerProtocol) Set(val *ListenerProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableListenerProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableListenerProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListenerProtocol(val *ListenerProtocol) *NullableListenerProtocol { + return &NullableListenerProtocol{value: val, isSet: true} +} + +func (v NullableListenerProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListenerProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2beta2api/model_load_balancer.go b/services/alb/v2beta2api/model_load_balancer.go index 77230f96c..24a69a77b 100644 --- a/services/alb/v2beta2api/model_load_balancer.go +++ b/services/alb/v2beta2api/model_load_balancer.go @@ -41,8 +41,8 @@ type LoadBalancer struct { // Transient private application load balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` // Region of the LoadBalancer. - Region *string `json:"region,omitempty"` - Status *string `json:"status,omitempty"` + Region *string `json:"region,omitempty"` + Status *LoadBalancerStatus `json:"status,omitempty"` // List of all target pools which will be used in the application load balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets. @@ -456,9 +456,9 @@ func (o *LoadBalancer) SetRegion(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *LoadBalancer) GetStatus() string { +func (o *LoadBalancer) GetStatus() LoadBalancerStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret LoadBalancerStatus return ret } return *o.Status @@ -466,7 +466,7 @@ func (o *LoadBalancer) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LoadBalancer) GetStatusOk() (*string, bool) { +func (o *LoadBalancer) GetStatusOk() (*LoadBalancerStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -482,8 +482,8 @@ func (o *LoadBalancer) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *LoadBalancer) SetStatus(v string) { +// SetStatus gets a reference to the given LoadBalancerStatus and assigns it to the Status field. +func (o *LoadBalancer) SetStatus(v LoadBalancerStatus) { o.Status = &v } diff --git a/services/alb/v2beta2api/model_load_balancer_error.go b/services/alb/v2beta2api/model_load_balancer_error.go index 4d454fcdf..88beb574d 100644 --- a/services/alb/v2beta2api/model_load_balancer_error.go +++ b/services/alb/v2beta2api/model_load_balancer_error.go @@ -20,9 +20,8 @@ var _ MappedNullable = &LoadBalancerError{} // LoadBalancerError struct for LoadBalancerError type LoadBalancerError struct { // The error description contains additional helpful user information to fix the error state of the application load balancer. For example the IP 45.135.247.139 does not exist in the project, then the description will report: Floating IP \"45.135.247.139\" could not be found. - Description *string `json:"description,omitempty"` - // The error type specifies which part of the application load balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the application load balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error. - Type *string `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + Type *LoadBalancerErrorType `json:"type,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +77,9 @@ func (o *LoadBalancerError) SetDescription(v string) { } // GetType returns the Type field value if set, zero value otherwise. -func (o *LoadBalancerError) GetType() string { +func (o *LoadBalancerError) GetType() LoadBalancerErrorType { if o == nil || IsNil(o.Type) { - var ret string + var ret LoadBalancerErrorType return ret } return *o.Type @@ -88,7 +87,7 @@ func (o *LoadBalancerError) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LoadBalancerError) GetTypeOk() (*string, bool) { +func (o *LoadBalancerError) GetTypeOk() (*LoadBalancerErrorType, bool) { if o == nil || IsNil(o.Type) { return nil, false } @@ -104,8 +103,8 @@ func (o *LoadBalancerError) HasType() bool { return false } -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *LoadBalancerError) SetType(v string) { +// SetType gets a reference to the given LoadBalancerErrorType and assigns it to the Type field. +func (o *LoadBalancerError) SetType(v LoadBalancerErrorType) { o.Type = &v } diff --git a/services/alb/v2beta2api/model_load_balancer_error_type.go b/services/alb/v2beta2api/model_load_balancer_error_type.go new file mode 100644 index 000000000..d698b94c8 --- /dev/null +++ b/services/alb/v2beta2api/model_load_balancer_error_type.go @@ -0,0 +1,127 @@ +/* +STACKIT Application Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta2api + +import ( + "encoding/json" + "fmt" +) + +// LoadBalancerErrorType The error type specifies which part of the application load balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the application load balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error. +type LoadBalancerErrorType string + +// List of LoadBalancerError_type +const ( + LOADBALANCERERRORTYPE_TYPE_UNSPECIFIED LoadBalancerErrorType = "TYPE_UNSPECIFIED" + LOADBALANCERERRORTYPE_TYPE_INTERNAL LoadBalancerErrorType = "TYPE_INTERNAL" + LOADBALANCERERRORTYPE_TYPE_QUOTA_SECGROUP_EXCEEDED LoadBalancerErrorType = "TYPE_QUOTA_SECGROUP_EXCEEDED" + LOADBALANCERERRORTYPE_TYPE_QUOTA_SECGROUPRULE_EXCEEDED LoadBalancerErrorType = "TYPE_QUOTA_SECGROUPRULE_EXCEEDED" + LOADBALANCERERRORTYPE_TYPE_PORT_NOT_CONFIGURED LoadBalancerErrorType = "TYPE_PORT_NOT_CONFIGURED" + LOADBALANCERERRORTYPE_TYPE_FIP_NOT_CONFIGURED LoadBalancerErrorType = "TYPE_FIP_NOT_CONFIGURED" + LOADBALANCERERRORTYPE_TYPE_TARGET_NOT_ACTIVE LoadBalancerErrorType = "TYPE_TARGET_NOT_ACTIVE" + LOADBALANCERERRORTYPE_TYPE_METRICS_MISCONFIGURED LoadBalancerErrorType = "TYPE_METRICS_MISCONFIGURED" + LOADBALANCERERRORTYPE_TYPE_LOGS_MISCONFIGURED LoadBalancerErrorType = "TYPE_LOGS_MISCONFIGURED" + LOADBALANCERERRORTYPE_UNKNOWN_DEFAULT_OPEN_API LoadBalancerErrorType = "unknown_default_open_api" +) + +// All allowed values of LoadBalancerErrorType enum +var AllowedLoadBalancerErrorTypeEnumValues = []LoadBalancerErrorType{ + "TYPE_UNSPECIFIED", + "TYPE_INTERNAL", + "TYPE_QUOTA_SECGROUP_EXCEEDED", + "TYPE_QUOTA_SECGROUPRULE_EXCEEDED", + "TYPE_PORT_NOT_CONFIGURED", + "TYPE_FIP_NOT_CONFIGURED", + "TYPE_TARGET_NOT_ACTIVE", + "TYPE_METRICS_MISCONFIGURED", + "TYPE_LOGS_MISCONFIGURED", + "unknown_default_open_api", +} + +func (v *LoadBalancerErrorType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LoadBalancerErrorType(value) + for _, existing := range AllowedLoadBalancerErrorTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOADBALANCERERRORTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLoadBalancerErrorTypeFromValue returns a pointer to a valid LoadBalancerErrorType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLoadBalancerErrorTypeFromValue(v string) (*LoadBalancerErrorType, error) { + ev := LoadBalancerErrorType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LoadBalancerErrorType: valid values are %v", v, AllowedLoadBalancerErrorTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LoadBalancerErrorType) IsValid() bool { + for _, existing := range AllowedLoadBalancerErrorTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LoadBalancerError_type value +func (v LoadBalancerErrorType) Ptr() *LoadBalancerErrorType { + return &v +} + +type NullableLoadBalancerErrorType struct { + value *LoadBalancerErrorType + isSet bool +} + +func (v NullableLoadBalancerErrorType) Get() *LoadBalancerErrorType { + return v.value +} + +func (v *NullableLoadBalancerErrorType) Set(val *LoadBalancerErrorType) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerErrorType) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerErrorType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerErrorType(val *LoadBalancerErrorType) *NullableLoadBalancerErrorType { + return &NullableLoadBalancerErrorType{value: val, isSet: true} +} + +func (v NullableLoadBalancerErrorType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerErrorType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2beta2api/model_load_balancer_status.go b/services/alb/v2beta2api/model_load_balancer_status.go new file mode 100644 index 000000000..deae9fd98 --- /dev/null +++ b/services/alb/v2beta2api/model_load_balancer_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Application Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta2api + +import ( + "encoding/json" + "fmt" +) + +// LoadBalancerStatus the model 'LoadBalancerStatus' +type LoadBalancerStatus string + +// List of LoadBalancer_status +const ( + LOADBALANCERSTATUS_STATUS_UNSPECIFIED LoadBalancerStatus = "STATUS_UNSPECIFIED" + LOADBALANCERSTATUS_STATUS_PENDING LoadBalancerStatus = "STATUS_PENDING" + LOADBALANCERSTATUS_STATUS_READY LoadBalancerStatus = "STATUS_READY" + LOADBALANCERSTATUS_STATUS_ERROR LoadBalancerStatus = "STATUS_ERROR" + LOADBALANCERSTATUS_STATUS_TERMINATING LoadBalancerStatus = "STATUS_TERMINATING" + LOADBALANCERSTATUS_UNKNOWN_DEFAULT_OPEN_API LoadBalancerStatus = "unknown_default_open_api" +) + +// All allowed values of LoadBalancerStatus enum +var AllowedLoadBalancerStatusEnumValues = []LoadBalancerStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *LoadBalancerStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LoadBalancerStatus(value) + for _, existing := range AllowedLoadBalancerStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOADBALANCERSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLoadBalancerStatusFromValue returns a pointer to a valid LoadBalancerStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLoadBalancerStatusFromValue(v string) (*LoadBalancerStatus, error) { + ev := LoadBalancerStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LoadBalancerStatus: valid values are %v", v, AllowedLoadBalancerStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LoadBalancerStatus) IsValid() bool { + for _, existing := range AllowedLoadBalancerStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LoadBalancer_status value +func (v LoadBalancerStatus) Ptr() *LoadBalancerStatus { + return &v +} + +type NullableLoadBalancerStatus struct { + value *LoadBalancerStatus + isSet bool +} + +func (v NullableLoadBalancerStatus) Get() *LoadBalancerStatus { + return v.value +} + +func (v *NullableLoadBalancerStatus) Set(val *LoadBalancerStatus) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerStatus(val *LoadBalancerStatus) *NullableLoadBalancerStatus { + return &NullableLoadBalancerStatus{value: val, isSet: true} +} + +func (v NullableLoadBalancerStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2beta2api/model_network.go b/services/alb/v2beta2api/model_network.go index 37265b049..55e6554a5 100644 --- a/services/alb/v2beta2api/model_network.go +++ b/services/alb/v2beta2api/model_network.go @@ -20,9 +20,8 @@ var _ MappedNullable = &Network{} // Network struct for Network type Network struct { // Openstack network ID - NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` - // The role defines how the Application Load Balancer is using the network. Currently only ROLE_LISTENERS_AND_TARGETS is supported. - Role *string `json:"role,omitempty"` + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` + Role *NetworkRole `json:"role,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +77,9 @@ func (o *Network) SetNetworkId(v string) { } // GetRole returns the Role field value if set, zero value otherwise. -func (o *Network) GetRole() string { +func (o *Network) GetRole() NetworkRole { if o == nil || IsNil(o.Role) { - var ret string + var ret NetworkRole return ret } return *o.Role @@ -88,7 +87,7 @@ func (o *Network) GetRole() string { // GetRoleOk returns a tuple with the Role field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetRoleOk() (*string, bool) { +func (o *Network) GetRoleOk() (*NetworkRole, bool) { if o == nil || IsNil(o.Role) { return nil, false } @@ -104,8 +103,8 @@ func (o *Network) HasRole() bool { return false } -// SetRole gets a reference to the given string and assigns it to the Role field. -func (o *Network) SetRole(v string) { +// SetRole gets a reference to the given NetworkRole and assigns it to the Role field. +func (o *Network) SetRole(v NetworkRole) { o.Role = &v } diff --git a/services/alb/v2beta2api/model_network_role.go b/services/alb/v2beta2api/model_network_role.go new file mode 100644 index 000000000..10d996ede --- /dev/null +++ b/services/alb/v2beta2api/model_network_role.go @@ -0,0 +1,117 @@ +/* +STACKIT Application Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta2api + +import ( + "encoding/json" + "fmt" +) + +// NetworkRole The role defines how the Application Load Balancer is using the network. Currently only ROLE_LISTENERS_AND_TARGETS is supported. +type NetworkRole string + +// List of Network_role +const ( + NETWORKROLE_ROLE_UNSPECIFIED NetworkRole = "ROLE_UNSPECIFIED" + NETWORKROLE_ROLE_LISTENERS_AND_TARGETS NetworkRole = "ROLE_LISTENERS_AND_TARGETS" + NETWORKROLE_ROLE_LISTENERS NetworkRole = "ROLE_LISTENERS" + NETWORKROLE_ROLE_TARGETS NetworkRole = "ROLE_TARGETS" + NETWORKROLE_UNKNOWN_DEFAULT_OPEN_API NetworkRole = "unknown_default_open_api" +) + +// All allowed values of NetworkRole enum +var AllowedNetworkRoleEnumValues = []NetworkRole{ + "ROLE_UNSPECIFIED", + "ROLE_LISTENERS_AND_TARGETS", + "ROLE_LISTENERS", + "ROLE_TARGETS", + "unknown_default_open_api", +} + +func (v *NetworkRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NetworkRole(value) + for _, existing := range AllowedNetworkRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = NETWORKROLE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewNetworkRoleFromValue returns a pointer to a valid NetworkRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewNetworkRoleFromValue(v string) (*NetworkRole, error) { + ev := NetworkRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for NetworkRole: valid values are %v", v, AllowedNetworkRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v NetworkRole) IsValid() bool { + for _, existing := range AllowedNetworkRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Network_role value +func (v NetworkRole) Ptr() *NetworkRole { + return &v +} + +type NullableNetworkRole struct { + value *NetworkRole + isSet bool +} + +func (v NullableNetworkRole) Get() *NetworkRole { + return v.value +} + +func (v *NullableNetworkRole) Set(val *NetworkRole) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRole) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRole(val *NetworkRole) *NullableNetworkRole { + return &NullableNetworkRole{value: val, isSet: true} +} + +func (v NullableNetworkRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/alb/v2beta2api/model_update_load_balancer_payload.go b/services/alb/v2beta2api/model_update_load_balancer_payload.go index 7aa5f6a0f..724b6ac8f 100644 --- a/services/alb/v2beta2api/model_update_load_balancer_payload.go +++ b/services/alb/v2beta2api/model_update_load_balancer_payload.go @@ -41,8 +41,8 @@ type UpdateLoadBalancerPayload struct { // Transient private application load balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` // Region of the LoadBalancer. - Region *string `json:"region,omitempty"` - Status *string `json:"status,omitempty"` + Region *string `json:"region,omitempty"` + Status *UpdateLoadBalancerPayloadStatus `json:"status,omitempty"` // List of all target pools which will be used in the application load balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets. @@ -456,9 +456,9 @@ func (o *UpdateLoadBalancerPayload) SetRegion(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *UpdateLoadBalancerPayload) GetStatus() string { +func (o *UpdateLoadBalancerPayload) GetStatus() UpdateLoadBalancerPayloadStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret UpdateLoadBalancerPayloadStatus return ret } return *o.Status @@ -466,7 +466,7 @@ func (o *UpdateLoadBalancerPayload) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateLoadBalancerPayload) GetStatusOk() (*string, bool) { +func (o *UpdateLoadBalancerPayload) GetStatusOk() (*UpdateLoadBalancerPayloadStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -482,8 +482,8 @@ func (o *UpdateLoadBalancerPayload) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *UpdateLoadBalancerPayload) SetStatus(v string) { +// SetStatus gets a reference to the given UpdateLoadBalancerPayloadStatus and assigns it to the Status field. +func (o *UpdateLoadBalancerPayload) SetStatus(v UpdateLoadBalancerPayloadStatus) { o.Status = &v } diff --git a/services/alb/v2beta2api/model_update_load_balancer_payload_status.go b/services/alb/v2beta2api/model_update_load_balancer_payload_status.go new file mode 100644 index 000000000..a2a64b43c --- /dev/null +++ b/services/alb/v2beta2api/model_update_load_balancer_payload_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Application Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta2api + +import ( + "encoding/json" + "fmt" +) + +// UpdateLoadBalancerPayloadStatus the model 'UpdateLoadBalancerPayloadStatus' +type UpdateLoadBalancerPayloadStatus string + +// List of UpdateLoadBalancerPayload_status +const ( + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_UNSPECIFIED UpdateLoadBalancerPayloadStatus = "STATUS_UNSPECIFIED" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_PENDING UpdateLoadBalancerPayloadStatus = "STATUS_PENDING" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_READY UpdateLoadBalancerPayloadStatus = "STATUS_READY" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_ERROR UpdateLoadBalancerPayloadStatus = "STATUS_ERROR" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_TERMINATING UpdateLoadBalancerPayloadStatus = "STATUS_TERMINATING" + UPDATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API UpdateLoadBalancerPayloadStatus = "unknown_default_open_api" +) + +// All allowed values of UpdateLoadBalancerPayloadStatus enum +var AllowedUpdateLoadBalancerPayloadStatusEnumValues = []UpdateLoadBalancerPayloadStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *UpdateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateLoadBalancerPayloadStatus(value) + for _, existing := range AllowedUpdateLoadBalancerPayloadStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateLoadBalancerPayloadStatusFromValue returns a pointer to a valid UpdateLoadBalancerPayloadStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateLoadBalancerPayloadStatusFromValue(v string) (*UpdateLoadBalancerPayloadStatus, error) { + ev := UpdateLoadBalancerPayloadStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateLoadBalancerPayloadStatus: valid values are %v", v, AllowedUpdateLoadBalancerPayloadStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateLoadBalancerPayloadStatus) IsValid() bool { + for _, existing := range AllowedUpdateLoadBalancerPayloadStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateLoadBalancerPayload_status value +func (v UpdateLoadBalancerPayloadStatus) Ptr() *UpdateLoadBalancerPayloadStatus { + return &v +} + +type NullableUpdateLoadBalancerPayloadStatus struct { + value *UpdateLoadBalancerPayloadStatus + isSet bool +} + +func (v NullableUpdateLoadBalancerPayloadStatus) Get() *UpdateLoadBalancerPayloadStatus { + return v.value +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) Set(val *UpdateLoadBalancerPayloadStatus) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateLoadBalancerPayloadStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateLoadBalancerPayloadStatus(val *UpdateLoadBalancerPayloadStatus) *NullableUpdateLoadBalancerPayloadStatus { + return &NullableUpdateLoadBalancerPayloadStatus{value: val, isSet: true} +} + +func (v NullableUpdateLoadBalancerPayloadStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 003ad7c755435fe76c799396c62bed0d83438292 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Mon, 18 May 2026 17:11:20 +0200 Subject: [PATCH 02/66] refac(albwaf): introduce inline enums --- CHANGELOG.md | 2 + services/albwaf/CHANGELOG.md | 3 + services/albwaf/VERSION | 2 +- services/albwaf/v1alphaapi/model_crs_rule.go | 15 ++- .../v1alphaapi/model_owasp_core_rule_set.go | 117 ++++++++++++++++++ .../v1alphaapi/model_owasp_core_rule_set_1.go | 117 ++++++++++++++++++ .../albwaf/v1alphaapi/model_patch_crs_rule.go | 13 +- 7 files changed, 253 insertions(+), 16 deletions(-) create mode 100644 services/albwaf/v1alphaapi/model_owasp_core_rule_set.go create mode 100644 services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 78a16a3f0..b5bf2d624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ - `v1alphaapi`: Align package to latest API specification - [v0.6.0](services/albwaf/CHANGELOG.md#v060) - `v1alphaapi`: Align package to latest API specification + - [v0.7.0](services/albwaf/CHANGELOG.md#v070) + - **Feature:** Introduce enums for various attributes - `archiving`: - [v0.2.6](services/archiving/CHANGELOG.md#v026) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/albwaf/CHANGELOG.md b/services/albwaf/CHANGELOG.md index 7b2b4aa0c..64c1e91e9 100644 --- a/services/albwaf/CHANGELOG.md +++ b/services/albwaf/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.7.0 +- **Feature:** Introduce enums for various attributes + ## v0.6.0 - `v1alphaapi`: Align package to latest API specification diff --git a/services/albwaf/VERSION b/services/albwaf/VERSION index 60f634328..8b20e4852 100644 --- a/services/albwaf/VERSION +++ b/services/albwaf/VERSION @@ -1 +1 @@ -v0.6.0 +v0.7.0 diff --git a/services/albwaf/v1alphaapi/model_crs_rule.go b/services/albwaf/v1alphaapi/model_crs_rule.go index 33d78541f..d42cbe48e 100644 --- a/services/albwaf/v1alphaapi/model_crs_rule.go +++ b/services/albwaf/v1alphaapi/model_crs_rule.go @@ -20,9 +20,8 @@ var _ MappedNullable = &CRSRule{} // CRSRule Rule represents an individual security or validation rule. type CRSRule struct { // SQL Injection Attack Detected via libinjection - Description *string `json:"description,omitempty"` - // The current mode of the rule. - Mode *string `json:"mode,omitempty" validate:"regexp=^(MODE_ENABLED|MODE_DISABLED|MODE_LOG_ONLY)$"` + Description *string `json:"description,omitempty"` + Mode *OWASPCoreRuleSet `json:"mode,omitempty"` // Impact level. Severity *string `json:"severity,omitempty" validate:"regexp=^(CRITICAL|ERROR|WARNING|INFO)$"` AdditionalProperties map[string]interface{} @@ -80,9 +79,9 @@ func (o *CRSRule) SetDescription(v string) { } // GetMode returns the Mode field value if set, zero value otherwise. -func (o *CRSRule) GetMode() string { +func (o *CRSRule) GetMode() OWASPCoreRuleSet { if o == nil || IsNil(o.Mode) { - var ret string + var ret OWASPCoreRuleSet return ret } return *o.Mode @@ -90,7 +89,7 @@ func (o *CRSRule) GetMode() string { // GetModeOk returns a tuple with the Mode field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CRSRule) GetModeOk() (*string, bool) { +func (o *CRSRule) GetModeOk() (*OWASPCoreRuleSet, bool) { if o == nil || IsNil(o.Mode) { return nil, false } @@ -106,8 +105,8 @@ func (o *CRSRule) HasMode() bool { return false } -// SetMode gets a reference to the given string and assigns it to the Mode field. -func (o *CRSRule) SetMode(v string) { +// SetMode gets a reference to the given OWASPCoreRuleSet and assigns it to the Mode field. +func (o *CRSRule) SetMode(v OWASPCoreRuleSet) { o.Mode = &v } diff --git a/services/albwaf/v1alphaapi/model_owasp_core_rule_set.go b/services/albwaf/v1alphaapi/model_owasp_core_rule_set.go new file mode 100644 index 000000000..fe718d520 --- /dev/null +++ b/services/albwaf/v1alphaapi/model_owasp_core_rule_set.go @@ -0,0 +1,117 @@ +/* +STACKIT Application Load Balancer Web Application Firewall API + +Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted. + +API version: 1alpha.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// OWASPCoreRuleSet The current mode of the rule. +type OWASPCoreRuleSet string + +// List of OWASP_Core_Rule_Set +const ( + OWASPCORERULESET_MODE_UNSPECIFIED OWASPCoreRuleSet = "MODE_UNSPECIFIED" + OWASPCORERULESET_MODE_ENABLED OWASPCoreRuleSet = "MODE_ENABLED" + OWASPCORERULESET_MODE_DISABLED OWASPCoreRuleSet = "MODE_DISABLED" + OWASPCORERULESET_MODE_LOG_ONLY OWASPCoreRuleSet = "MODE_LOG_ONLY" + OWASPCORERULESET_UNKNOWN_DEFAULT_OPEN_API OWASPCoreRuleSet = "unknown_default_open_api" +) + +// All allowed values of OWASPCoreRuleSet enum +var AllowedOWASPCoreRuleSetEnumValues = []OWASPCoreRuleSet{ + "MODE_UNSPECIFIED", + "MODE_ENABLED", + "MODE_DISABLED", + "MODE_LOG_ONLY", + "unknown_default_open_api", +} + +func (v *OWASPCoreRuleSet) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OWASPCoreRuleSet(value) + for _, existing := range AllowedOWASPCoreRuleSetEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = OWASPCORERULESET_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewOWASPCoreRuleSetFromValue returns a pointer to a valid OWASPCoreRuleSet +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOWASPCoreRuleSetFromValue(v string) (*OWASPCoreRuleSet, error) { + ev := OWASPCoreRuleSet(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OWASPCoreRuleSet: valid values are %v", v, AllowedOWASPCoreRuleSetEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OWASPCoreRuleSet) IsValid() bool { + for _, existing := range AllowedOWASPCoreRuleSetEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OWASP_Core_Rule_Set value +func (v OWASPCoreRuleSet) Ptr() *OWASPCoreRuleSet { + return &v +} + +type NullableOWASPCoreRuleSet struct { + value *OWASPCoreRuleSet + isSet bool +} + +func (v NullableOWASPCoreRuleSet) Get() *OWASPCoreRuleSet { + return v.value +} + +func (v *NullableOWASPCoreRuleSet) Set(val *OWASPCoreRuleSet) { + v.value = val + v.isSet = true +} + +func (v NullableOWASPCoreRuleSet) IsSet() bool { + return v.isSet +} + +func (v *NullableOWASPCoreRuleSet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOWASPCoreRuleSet(val *OWASPCoreRuleSet) *NullableOWASPCoreRuleSet { + return &NullableOWASPCoreRuleSet{value: val, isSet: true} +} + +func (v NullableOWASPCoreRuleSet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOWASPCoreRuleSet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go b/services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go new file mode 100644 index 000000000..99afc94c1 --- /dev/null +++ b/services/albwaf/v1alphaapi/model_owasp_core_rule_set_1.go @@ -0,0 +1,117 @@ +/* +STACKIT Application Load Balancer Web Application Firewall API + +Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted. + +API version: 1alpha.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// OWASPCoreRuleSet1 The current mode of the rule. +type OWASPCoreRuleSet1 string + +// List of OWASP_Core_Rule_Set_1 +const ( + OWASPCORERULESET1_MODE_UNSPECIFIED OWASPCoreRuleSet1 = "MODE_UNSPECIFIED" + OWASPCORERULESET1_MODE_ENABLED OWASPCoreRuleSet1 = "MODE_ENABLED" + OWASPCORERULESET1_MODE_DISABLED OWASPCoreRuleSet1 = "MODE_DISABLED" + OWASPCORERULESET1_MODE_LOG_ONLY OWASPCoreRuleSet1 = "MODE_LOG_ONLY" + OWASPCORERULESET1_UNKNOWN_DEFAULT_OPEN_API OWASPCoreRuleSet1 = "unknown_default_open_api" +) + +// All allowed values of OWASPCoreRuleSet1 enum +var AllowedOWASPCoreRuleSet1EnumValues = []OWASPCoreRuleSet1{ + "MODE_UNSPECIFIED", + "MODE_ENABLED", + "MODE_DISABLED", + "MODE_LOG_ONLY", + "unknown_default_open_api", +} + +func (v *OWASPCoreRuleSet1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OWASPCoreRuleSet1(value) + for _, existing := range AllowedOWASPCoreRuleSet1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = OWASPCORERULESET1_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewOWASPCoreRuleSet1FromValue returns a pointer to a valid OWASPCoreRuleSet1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOWASPCoreRuleSet1FromValue(v string) (*OWASPCoreRuleSet1, error) { + ev := OWASPCoreRuleSet1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OWASPCoreRuleSet1: valid values are %v", v, AllowedOWASPCoreRuleSet1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OWASPCoreRuleSet1) IsValid() bool { + for _, existing := range AllowedOWASPCoreRuleSet1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OWASP_Core_Rule_Set_1 value +func (v OWASPCoreRuleSet1) Ptr() *OWASPCoreRuleSet1 { + return &v +} + +type NullableOWASPCoreRuleSet1 struct { + value *OWASPCoreRuleSet1 + isSet bool +} + +func (v NullableOWASPCoreRuleSet1) Get() *OWASPCoreRuleSet1 { + return v.value +} + +func (v *NullableOWASPCoreRuleSet1) Set(val *OWASPCoreRuleSet1) { + v.value = val + v.isSet = true +} + +func (v NullableOWASPCoreRuleSet1) IsSet() bool { + return v.isSet +} + +func (v *NullableOWASPCoreRuleSet1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOWASPCoreRuleSet1(val *OWASPCoreRuleSet1) *NullableOWASPCoreRuleSet1 { + return &NullableOWASPCoreRuleSet1{value: val, isSet: true} +} + +func (v NullableOWASPCoreRuleSet1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOWASPCoreRuleSet1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/albwaf/v1alphaapi/model_patch_crs_rule.go b/services/albwaf/v1alphaapi/model_patch_crs_rule.go index 3d19cffcf..af12dc8c0 100644 --- a/services/albwaf/v1alphaapi/model_patch_crs_rule.go +++ b/services/albwaf/v1alphaapi/model_patch_crs_rule.go @@ -19,8 +19,7 @@ var _ MappedNullable = &PatchCRSRule{} // PatchCRSRule struct for PatchCRSRule type PatchCRSRule struct { - // The current mode of the rule. - Mode *string `json:"mode,omitempty" validate:"regexp=^(MODE_ENABLED|MODE_DISABLED|MODE_LOG_ONLY)$"` + Mode *OWASPCoreRuleSet1 `json:"mode,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,9 +43,9 @@ func NewPatchCRSRuleWithDefaults() *PatchCRSRule { } // GetMode returns the Mode field value if set, zero value otherwise. -func (o *PatchCRSRule) GetMode() string { +func (o *PatchCRSRule) GetMode() OWASPCoreRuleSet1 { if o == nil || IsNil(o.Mode) { - var ret string + var ret OWASPCoreRuleSet1 return ret } return *o.Mode @@ -54,7 +53,7 @@ func (o *PatchCRSRule) GetMode() string { // GetModeOk returns a tuple with the Mode field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PatchCRSRule) GetModeOk() (*string, bool) { +func (o *PatchCRSRule) GetModeOk() (*OWASPCoreRuleSet1, bool) { if o == nil || IsNil(o.Mode) { return nil, false } @@ -70,8 +69,8 @@ func (o *PatchCRSRule) HasMode() bool { return false } -// SetMode gets a reference to the given string and assigns it to the Mode field. -func (o *PatchCRSRule) SetMode(v string) { +// SetMode gets a reference to the given OWASPCoreRuleSet1 and assigns it to the Mode field. +func (o *PatchCRSRule) SetMode(v OWASPCoreRuleSet1) { o.Mode = &v } From 124811b210d322f1db5280e4e82a3175d9e3fb02 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Mon, 18 May 2026 17:23:00 +0200 Subject: [PATCH 03/66] refac(cdn): introduce inline enums --- CHANGELOG.md | 2 + services/cdn/CHANGELOG.md | 3 + services/cdn/v1api/api_default.go | 24 ++-- services/cdn/v1api/model_distribution.go | 19 ++- .../cdn/v1api/model_distribution_status.go | 119 +++++++++++++++++ services/cdn/v1api/model_domain.go | 27 ++-- .../v1api/model_domain_certificate_type.go | 113 ++++++++++++++++ services/cdn/v1api/model_domain_type.go | 113 ++++++++++++++++ services/cdn/v1api/model_error_details.go | 14 +- services/cdn/v1api/model_error_details_key.go | 117 ++++++++++++++++ ...l_get_cache_info_response_history_entry.go | 14 +- ..._cache_info_response_history_entry_type.go | 113 ++++++++++++++++ .../model_get_logs_search_filters_response.go | 12 +- ...ogs_search_filters_response_cache_inner.go | 113 ++++++++++++++++ .../v1api/model_get_logs_sort_by_parameter.go | 125 ++++++++++++++++++ .../model_get_logs_sort_order_parameter.go | 113 ++++++++++++++++ ...model_get_statistics_interval_parameter.go | 117 ++++++++++++++++ ...el_list_distributions_sort_by_parameter.go | 121 +++++++++++++++++ ...list_distributions_sort_order_parameter.go | 113 ++++++++++++++++ services/cdn/v1api/model_redirect_rule.go | 17 ++- .../v1api/model_redirect_rule_status_code.go | 119 +++++++++++++++++ services/cdn/v1api/model_status_error.go | 15 +-- services/cdn/v1api/model_status_error_key.go | 121 +++++++++++++++++ services/cdn/v1api/wait/wait.go | 25 ++-- services/cdn/v1api/wait/wait_test.go | 30 ++--- services/cdn/v1beta2api/api_default.go | 24 ++-- services/cdn/v1beta2api/model_distribution.go | 19 ++- .../v1beta2api/model_distribution_status.go | 119 +++++++++++++++++ services/cdn/v1beta2api/model_domain.go | 17 ++- services/cdn/v1beta2api/model_domain_type.go | 113 ++++++++++++++++ .../cdn/v1beta2api/model_error_details.go | 14 +- .../cdn/v1beta2api/model_error_details_key.go | 117 ++++++++++++++++ ...l_get_cache_info_response_history_entry.go | 14 +- ..._cache_info_response_history_entry_type.go | 113 ++++++++++++++++ .../model_get_logs_search_filters_response.go | 12 +- ...ogs_search_filters_response_cache_inner.go | 113 ++++++++++++++++ .../model_get_logs_sort_by_parameter.go | 125 ++++++++++++++++++ .../model_get_logs_sort_order_parameter.go | 113 ++++++++++++++++ ...model_get_statistics_interval_parameter.go | 117 ++++++++++++++++ ...el_list_distributions_sort_by_parameter.go | 121 +++++++++++++++++ ...list_distributions_sort_order_parameter.go | 113 ++++++++++++++++ services/cdn/v1beta2api/model_status_error.go | 15 +-- .../cdn/v1beta2api/model_status_error_key.go | 121 +++++++++++++++++ services/cdn/v1betaapi/api_default.go | 24 ++-- services/cdn/v1betaapi/model_distribution.go | 19 ++- .../v1betaapi/model_distribution_status.go | 119 +++++++++++++++++ services/cdn/v1betaapi/model_domain.go | 17 ++- services/cdn/v1betaapi/model_domain_type.go | 113 ++++++++++++++++ services/cdn/v1betaapi/model_error_details.go | 14 +- .../cdn/v1betaapi/model_error_details_key.go | 117 ++++++++++++++++ ...l_get_cache_info_response_history_entry.go | 16 +-- ..._cache_info_response_history_entry_type.go | 113 ++++++++++++++++ .../model_get_logs_sort_by_parameter.go | 125 ++++++++++++++++++ .../model_get_logs_sort_order_parameter.go | 113 ++++++++++++++++ ...model_get_statistics_interval_parameter.go | 117 ++++++++++++++++ ...el_list_distributions_sort_by_parameter.go | 121 +++++++++++++++++ ...list_distributions_sort_order_parameter.go | 113 ++++++++++++++++ services/cdn/v1betaapi/model_status_error.go | 15 +-- .../cdn/v1betaapi/model_status_error_key.go | 121 +++++++++++++++++ 59 files changed, 4178 insertions(+), 218 deletions(-) create mode 100644 services/cdn/v1api/model_distribution_status.go create mode 100644 services/cdn/v1api/model_domain_certificate_type.go create mode 100644 services/cdn/v1api/model_domain_type.go create mode 100644 services/cdn/v1api/model_error_details_key.go create mode 100644 services/cdn/v1api/model_get_cache_info_response_history_entry_type.go create mode 100644 services/cdn/v1api/model_get_logs_search_filters_response_cache_inner.go create mode 100644 services/cdn/v1api/model_get_logs_sort_by_parameter.go create mode 100644 services/cdn/v1api/model_get_logs_sort_order_parameter.go create mode 100644 services/cdn/v1api/model_get_statistics_interval_parameter.go create mode 100644 services/cdn/v1api/model_list_distributions_sort_by_parameter.go create mode 100644 services/cdn/v1api/model_list_distributions_sort_order_parameter.go create mode 100644 services/cdn/v1api/model_redirect_rule_status_code.go create mode 100644 services/cdn/v1api/model_status_error_key.go create mode 100644 services/cdn/v1beta2api/model_distribution_status.go create mode 100644 services/cdn/v1beta2api/model_domain_type.go create mode 100644 services/cdn/v1beta2api/model_error_details_key.go create mode 100644 services/cdn/v1beta2api/model_get_cache_info_response_history_entry_type.go create mode 100644 services/cdn/v1beta2api/model_get_logs_search_filters_response_cache_inner.go create mode 100644 services/cdn/v1beta2api/model_get_logs_sort_by_parameter.go create mode 100644 services/cdn/v1beta2api/model_get_logs_sort_order_parameter.go create mode 100644 services/cdn/v1beta2api/model_get_statistics_interval_parameter.go create mode 100644 services/cdn/v1beta2api/model_list_distributions_sort_by_parameter.go create mode 100644 services/cdn/v1beta2api/model_list_distributions_sort_order_parameter.go create mode 100644 services/cdn/v1beta2api/model_status_error_key.go create mode 100644 services/cdn/v1betaapi/model_distribution_status.go create mode 100644 services/cdn/v1betaapi/model_domain_type.go create mode 100644 services/cdn/v1betaapi/model_error_details_key.go create mode 100644 services/cdn/v1betaapi/model_get_cache_info_response_history_entry_type.go create mode 100644 services/cdn/v1betaapi/model_get_logs_sort_by_parameter.go create mode 100644 services/cdn/v1betaapi/model_get_logs_sort_order_parameter.go create mode 100644 services/cdn/v1betaapi/model_get_statistics_interval_parameter.go create mode 100644 services/cdn/v1betaapi/model_list_distributions_sort_by_parameter.go create mode 100644 services/cdn/v1betaapi/model_list_distributions_sort_order_parameter.go create mode 100644 services/cdn/v1betaapi/model_status_error_key.go diff --git a/CHANGELOG.md b/CHANGELOG.md index b5bf2d624..97601b6ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,8 @@ - **Dependencies:** Bump STACKIT SDK core module to `v0.26.0` - [v1.16.0](services/cdn/CHANGELOG.md#v1160) - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. + - [v1.17.0](services/cdn/CHANGELOG.md#v1170) + - **Feature:** Introduce enums for various attributes - `certificates`: - [v1.5.2](services/certificates/CHANGELOG.md#v152) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/cdn/CHANGELOG.md b/services/cdn/CHANGELOG.md index c47e02034..031412cfe 100644 --- a/services/cdn/CHANGELOG.md +++ b/services/cdn/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.17.0 +- **Feature:** Introduce enums for various attributes + ## v1.16.0 - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. diff --git a/services/cdn/v1api/api_default.go b/services/cdn/v1api/api_default.go index 5fdb3f11e..0191aa0ef 100644 --- a/services/cdn/v1api/api_default.go +++ b/services/cdn/v1api/api_default.go @@ -1553,8 +1553,8 @@ type ApiGetLogsRequest struct { to *time.Time pageSize *int32 pageIdentifier *string - sortBy *string - sortOrder *string + sortBy *GetLogsSortByParameter + sortOrder *GetLogsSortOrderParameter wafAction *WAFRuleAction dataCenterRegion *string requestCountryCode *string @@ -1587,12 +1587,12 @@ func (r ApiGetLogsRequest) PageIdentifier(pageIdentifier string) ApiGetLogsReque } // Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host` -func (r ApiGetLogsRequest) SortBy(sortBy string) ApiGetLogsRequest { +func (r ApiGetLogsRequest) SortBy(sortBy GetLogsSortByParameter) ApiGetLogsRequest { r.sortBy = &sortBy return r } -func (r ApiGetLogsRequest) SortOrder(sortOrder string) ApiGetLogsRequest { +func (r ApiGetLogsRequest) SortOrder(sortOrder GetLogsSortOrderParameter) ApiGetLogsRequest { r.sortOrder = &sortOrder return r } @@ -1691,7 +1691,7 @@ func (a *DefaultAPIService) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsRespons if r.sortBy != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") } else { - var defaultValue string = "timestamp" + var defaultValue GetLogsSortByParameter = "timestamp" parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") r.sortBy = &defaultValue } @@ -2005,7 +2005,7 @@ type ApiGetStatisticsRequest struct { distributionId string from *time.Time to *time.Time - interval *string + interval *GetStatisticsIntervalParameter } // the start of the time range for which statistics should be returned @@ -2021,7 +2021,7 @@ func (r ApiGetStatisticsRequest) To(to time.Time) ApiGetStatisticsRequest { } // Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z` -func (r ApiGetStatisticsRequest) Interval(interval string) ApiGetStatisticsRequest { +func (r ApiGetStatisticsRequest) Interval(interval GetStatisticsIntervalParameter) ApiGetStatisticsRequest { r.interval = &interval return r } @@ -2206,8 +2206,8 @@ type ApiListDistributionsRequest struct { pageSize *int32 withWafStatus *bool pageIdentifier *string - sortBy *string - sortOrder *string + sortBy *ListDistributionsSortByParameter + sortOrder *ListDistributionsSortOrderParameter } // Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) @@ -2229,12 +2229,12 @@ func (r ApiListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiLi } // The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. -func (r ApiListDistributionsRequest) SortBy(sortBy string) ApiListDistributionsRequest { +func (r ApiListDistributionsRequest) SortBy(sortBy ListDistributionsSortByParameter) ApiListDistributionsRequest { r.sortBy = &sortBy return r } -func (r ApiListDistributionsRequest) SortOrder(sortOrder string) ApiListDistributionsRequest { +func (r ApiListDistributionsRequest) SortOrder(sortOrder ListDistributionsSortOrderParameter) ApiListDistributionsRequest { r.sortOrder = &sortOrder return r } @@ -2304,7 +2304,7 @@ func (a *DefaultAPIService) ListDistributionsExecute(r ApiListDistributionsReque if r.sortBy != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") } else { - var defaultValue string = "createdAt" + var defaultValue ListDistributionsSortByParameter = "createdAt" parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") r.sortBy = &defaultValue } diff --git a/services/cdn/v1api/model_distribution.go b/services/cdn/v1api/model_distribution.go index 3b31a7d25..b081f88a7 100644 --- a/services/cdn/v1api/model_distribution.go +++ b/services/cdn/v1api/model_distribution.go @@ -26,11 +26,10 @@ type Distribution struct { CreatedAt time.Time `json:"createdAt"` Domains []Domain `json:"domains"` // This object may be present if, and only if the distribution has encountered an error state. - Errors []StatusError `json:"errors,omitempty"` - Id string `json:"id"` - ProjectId string `json:"projectId"` - // - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. - Status string `json:"status"` + Errors []StatusError `json:"errors,omitempty"` + Id string `json:"id"` + ProjectId string `json:"projectId"` + Status DistributionStatus `json:"status"` // RFC3339 string which returns the last time the distribution configuration was modified. UpdatedAt time.Time `json:"updatedAt"` Waf *DistributionWaf `json:"waf,omitempty"` @@ -43,7 +42,7 @@ type _Distribution Distribution // 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 NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status string, updatedAt time.Time) *Distribution { +func NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status DistributionStatus, updatedAt time.Time) *Distribution { this := Distribution{} this.Config = config this.CreatedAt = createdAt @@ -216,9 +215,9 @@ func (o *Distribution) SetProjectId(v string) { } // GetStatus returns the Status field value -func (o *Distribution) GetStatus() string { +func (o *Distribution) GetStatus() DistributionStatus { if o == nil { - var ret string + var ret DistributionStatus return ret } @@ -227,7 +226,7 @@ func (o *Distribution) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *Distribution) GetStatusOk() (*string, bool) { +func (o *Distribution) GetStatusOk() (*DistributionStatus, bool) { if o == nil { return nil, false } @@ -235,7 +234,7 @@ func (o *Distribution) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *Distribution) SetStatus(v string) { +func (o *Distribution) SetStatus(v DistributionStatus) { o.Status = v } diff --git a/services/cdn/v1api/model_distribution_status.go b/services/cdn/v1api/model_distribution_status.go new file mode 100644 index 000000000..1880b8c30 --- /dev/null +++ b/services/cdn/v1api/model_distribution_status.go @@ -0,0 +1,119 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// DistributionStatus - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. +type DistributionStatus string + +// List of Distribution_status +const ( + DISTRIBUTIONSTATUS_CREATING DistributionStatus = "CREATING" + DISTRIBUTIONSTATUS_ACTIVE DistributionStatus = "ACTIVE" + DISTRIBUTIONSTATUS_UPDATING DistributionStatus = "UPDATING" + DISTRIBUTIONSTATUS_DELETING DistributionStatus = "DELETING" + DISTRIBUTIONSTATUS_ERROR DistributionStatus = "ERROR" + DISTRIBUTIONSTATUS_UNKNOWN_DEFAULT_OPEN_API DistributionStatus = "unknown_default_open_api" +) + +// All allowed values of DistributionStatus enum +var AllowedDistributionStatusEnumValues = []DistributionStatus{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "ERROR", + "unknown_default_open_api", +} + +func (v *DistributionStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DistributionStatus(value) + for _, existing := range AllowedDistributionStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DISTRIBUTIONSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDistributionStatusFromValue returns a pointer to a valid DistributionStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDistributionStatusFromValue(v string) (*DistributionStatus, error) { + ev := DistributionStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DistributionStatus: valid values are %v", v, AllowedDistributionStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DistributionStatus) IsValid() bool { + for _, existing := range AllowedDistributionStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Distribution_status value +func (v DistributionStatus) Ptr() *DistributionStatus { + return &v +} + +type NullableDistributionStatus struct { + value *DistributionStatus + isSet bool +} + +func (v NullableDistributionStatus) Get() *DistributionStatus { + return v.value +} + +func (v *NullableDistributionStatus) Set(val *DistributionStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatus(val *DistributionStatus) *NullableDistributionStatus { + return &NullableDistributionStatus{value: val, isSet: true} +} + +func (v NullableDistributionStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_domain.go b/services/cdn/v1api/model_domain.go index d7e4f891c..6594008b9 100644 --- a/services/cdn/v1api/model_domain.go +++ b/services/cdn/v1api/model_domain.go @@ -20,14 +20,13 @@ var _ MappedNullable = &Domain{} // Domain Definition of a custom or managed domain without any certificates or keys type Domain struct { - CertificateType string `json:"certificateType"` + CertificateType DomainCertificateType `json:"certificateType"` // This object is present if the custom domain has errors. Errors []StatusError `json:"errors,omitempty"` // The domain. If this is a custom domain, you can call the GetCustomDomain Endpoint - Name string `json:"name"` - Status DomainStatus `json:"status"` - // Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint - Type string `json:"type"` + Name string `json:"name"` + Status DomainStatus `json:"status"` + Type DomainType `json:"type"` AdditionalProperties map[string]interface{} } @@ -37,7 +36,7 @@ type _Domain Domain // 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 NewDomain(certificateType string, name string, status DomainStatus, types string) *Domain { +func NewDomain(certificateType DomainCertificateType, name string, status DomainStatus, types DomainType) *Domain { this := Domain{} this.CertificateType = certificateType this.Name = name @@ -55,9 +54,9 @@ func NewDomainWithDefaults() *Domain { } // GetCertificateType returns the CertificateType field value -func (o *Domain) GetCertificateType() string { +func (o *Domain) GetCertificateType() DomainCertificateType { if o == nil { - var ret string + var ret DomainCertificateType return ret } @@ -66,7 +65,7 @@ func (o *Domain) GetCertificateType() string { // GetCertificateTypeOk returns a tuple with the CertificateType field value // and a boolean to check if the value has been set. -func (o *Domain) GetCertificateTypeOk() (*string, bool) { +func (o *Domain) GetCertificateTypeOk() (*DomainCertificateType, bool) { if o == nil { return nil, false } @@ -74,7 +73,7 @@ func (o *Domain) GetCertificateTypeOk() (*string, bool) { } // SetCertificateType sets field value -func (o *Domain) SetCertificateType(v string) { +func (o *Domain) SetCertificateType(v DomainCertificateType) { o.CertificateType = v } @@ -159,9 +158,9 @@ func (o *Domain) SetStatus(v DomainStatus) { } // GetType returns the Type field value -func (o *Domain) GetType() string { +func (o *Domain) GetType() DomainType { if o == nil { - var ret string + var ret DomainType return ret } @@ -170,7 +169,7 @@ func (o *Domain) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *Domain) GetTypeOk() (*string, bool) { +func (o *Domain) GetTypeOk() (*DomainType, bool) { if o == nil { return nil, false } @@ -178,7 +177,7 @@ func (o *Domain) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *Domain) SetType(v string) { +func (o *Domain) SetType(v DomainType) { o.Type = v } diff --git a/services/cdn/v1api/model_domain_certificate_type.go b/services/cdn/v1api/model_domain_certificate_type.go new file mode 100644 index 000000000..f44f581b6 --- /dev/null +++ b/services/cdn/v1api/model_domain_certificate_type.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// DomainCertificateType the model 'DomainCertificateType' +type DomainCertificateType string + +// List of Domain_certificateType +const ( + DOMAINCERTIFICATETYPE_MANAGED DomainCertificateType = "managed" + DOMAINCERTIFICATETYPE_CUSTOM DomainCertificateType = "custom" + DOMAINCERTIFICATETYPE_UNKNOWN_DEFAULT_OPEN_API DomainCertificateType = "unknown_default_open_api" +) + +// All allowed values of DomainCertificateType enum +var AllowedDomainCertificateTypeEnumValues = []DomainCertificateType{ + "managed", + "custom", + "unknown_default_open_api", +} + +func (v *DomainCertificateType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DomainCertificateType(value) + for _, existing := range AllowedDomainCertificateTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DOMAINCERTIFICATETYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDomainCertificateTypeFromValue returns a pointer to a valid DomainCertificateType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDomainCertificateTypeFromValue(v string) (*DomainCertificateType, error) { + ev := DomainCertificateType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DomainCertificateType: valid values are %v", v, AllowedDomainCertificateTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DomainCertificateType) IsValid() bool { + for _, existing := range AllowedDomainCertificateTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Domain_certificateType value +func (v DomainCertificateType) Ptr() *DomainCertificateType { + return &v +} + +type NullableDomainCertificateType struct { + value *DomainCertificateType + isSet bool +} + +func (v NullableDomainCertificateType) Get() *DomainCertificateType { + return v.value +} + +func (v *NullableDomainCertificateType) Set(val *DomainCertificateType) { + v.value = val + v.isSet = true +} + +func (v NullableDomainCertificateType) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainCertificateType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainCertificateType(val *DomainCertificateType) *NullableDomainCertificateType { + return &NullableDomainCertificateType{value: val, isSet: true} +} + +func (v NullableDomainCertificateType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainCertificateType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_domain_type.go b/services/cdn/v1api/model_domain_type.go new file mode 100644 index 000000000..4d741c102 --- /dev/null +++ b/services/cdn/v1api/model_domain_type.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// DomainType Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint +type DomainType string + +// List of Domain_type +const ( + DOMAINTYPE_MANAGED DomainType = "managed" + DOMAINTYPE_CUSTOM DomainType = "custom" + DOMAINTYPE_UNKNOWN_DEFAULT_OPEN_API DomainType = "unknown_default_open_api" +) + +// All allowed values of DomainType enum +var AllowedDomainTypeEnumValues = []DomainType{ + "managed", + "custom", + "unknown_default_open_api", +} + +func (v *DomainType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DomainType(value) + for _, existing := range AllowedDomainTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DOMAINTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDomainTypeFromValue returns a pointer to a valid DomainType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDomainTypeFromValue(v string) (*DomainType, error) { + ev := DomainType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DomainType: valid values are %v", v, AllowedDomainTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DomainType) IsValid() bool { + for _, existing := range AllowedDomainTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Domain_type value +func (v DomainType) Ptr() *DomainType { + return &v +} + +type NullableDomainType struct { + value *DomainType + isSet bool +} + +func (v NullableDomainType) Get() *DomainType { + return v.value +} + +func (v *NullableDomainType) Set(val *DomainType) { + v.value = val + v.isSet = true +} + +func (v NullableDomainType) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainType(val *DomainType) *NullableDomainType { + return &NullableDomainType{value: val, isSet: true} +} + +func (v NullableDomainType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_error_details.go b/services/cdn/v1api/model_error_details.go index 58569035c..acc26b259 100644 --- a/services/cdn/v1api/model_error_details.go +++ b/services/cdn/v1api/model_error_details.go @@ -25,8 +25,8 @@ type ErrorDetails struct { // English description of the error En string `json:"en"` // Optional field in the request this error detail refers to - Field *string `json:"field,omitempty"` - Key string `json:"key"` + Field *string `json:"field,omitempty"` + Key ErrorDetailsKey `json:"key"` AdditionalProperties map[string]interface{} } @@ -36,7 +36,7 @@ type _ErrorDetails ErrorDetails // 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 NewErrorDetails(en string, key string) *ErrorDetails { +func NewErrorDetails(en string, key ErrorDetailsKey) *ErrorDetails { this := ErrorDetails{} this.En = en this.Key = key @@ -140,9 +140,9 @@ func (o *ErrorDetails) SetField(v string) { } // GetKey returns the Key field value -func (o *ErrorDetails) GetKey() string { +func (o *ErrorDetails) GetKey() ErrorDetailsKey { if o == nil { - var ret string + var ret ErrorDetailsKey return ret } @@ -151,7 +151,7 @@ func (o *ErrorDetails) GetKey() string { // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. -func (o *ErrorDetails) GetKeyOk() (*string, bool) { +func (o *ErrorDetails) GetKeyOk() (*ErrorDetailsKey, bool) { if o == nil { return nil, false } @@ -159,7 +159,7 @@ func (o *ErrorDetails) GetKeyOk() (*string, bool) { } // SetKey sets field value -func (o *ErrorDetails) SetKey(v string) { +func (o *ErrorDetails) SetKey(v ErrorDetailsKey) { o.Key = v } diff --git a/services/cdn/v1api/model_error_details_key.go b/services/cdn/v1api/model_error_details_key.go new file mode 100644 index 000000000..e0598e33f --- /dev/null +++ b/services/cdn/v1api/model_error_details_key.go @@ -0,0 +1,117 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ErrorDetailsKey the model 'ErrorDetailsKey' +type ErrorDetailsKey string + +// List of ErrorDetails_key +const ( + ERRORDETAILSKEY_UNKNOWN ErrorDetailsKey = "UNKNOWN" + ERRORDETAILSKEY_CUSTOM_DOMAIN_CNAME_MISSING ErrorDetailsKey = "CUSTOM_DOMAIN_CNAME_MISSING" + ERRORDETAILSKEY_INVALID_ARGUMENT ErrorDetailsKey = "INVALID_ARGUMENT" + ERRORDETAILSKEY_LOG_SINK_INSTANCE_UNAVAILABLE ErrorDetailsKey = "LOG_SINK_INSTANCE_UNAVAILABLE" + ERRORDETAILSKEY_UNKNOWN_DEFAULT_OPEN_API ErrorDetailsKey = "unknown_default_open_api" +) + +// All allowed values of ErrorDetailsKey enum +var AllowedErrorDetailsKeyEnumValues = []ErrorDetailsKey{ + "UNKNOWN", + "CUSTOM_DOMAIN_CNAME_MISSING", + "INVALID_ARGUMENT", + "LOG_SINK_INSTANCE_UNAVAILABLE", + "unknown_default_open_api", +} + +func (v *ErrorDetailsKey) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ErrorDetailsKey(value) + for _, existing := range AllowedErrorDetailsKeyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ERRORDETAILSKEY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewErrorDetailsKeyFromValue returns a pointer to a valid ErrorDetailsKey +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewErrorDetailsKeyFromValue(v string) (*ErrorDetailsKey, error) { + ev := ErrorDetailsKey(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ErrorDetailsKey: valid values are %v", v, AllowedErrorDetailsKeyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ErrorDetailsKey) IsValid() bool { + for _, existing := range AllowedErrorDetailsKeyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ErrorDetails_key value +func (v ErrorDetailsKey) Ptr() *ErrorDetailsKey { + return &v +} + +type NullableErrorDetailsKey struct { + value *ErrorDetailsKey + isSet bool +} + +func (v NullableErrorDetailsKey) Get() *ErrorDetailsKey { + return v.value +} + +func (v *NullableErrorDetailsKey) Set(val *ErrorDetailsKey) { + v.value = val + v.isSet = true +} + +func (v NullableErrorDetailsKey) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorDetailsKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorDetailsKey(val *ErrorDetailsKey) *NullableErrorDetailsKey { + return &NullableErrorDetailsKey{value: val, isSet: true} +} + +func (v NullableErrorDetailsKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorDetailsKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_cache_info_response_history_entry.go b/services/cdn/v1api/model_get_cache_info_response_history_entry.go index f70b259cf..12b9ee082 100644 --- a/services/cdn/v1api/model_get_cache_info_response_history_entry.go +++ b/services/cdn/v1api/model_get_cache_info_response_history_entry.go @@ -21,8 +21,8 @@ var _ MappedNullable = &GetCacheInfoResponseHistoryEntry{} // GetCacheInfoResponseHistoryEntry struct for GetCacheInfoResponseHistoryEntry type GetCacheInfoResponseHistoryEntry struct { - OccurredAt time.Time `json:"occurredAt"` - Type string `json:"type"` + OccurredAt time.Time `json:"occurredAt"` + Type GetCacheInfoResponseHistoryEntryType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +32,7 @@ type _GetCacheInfoResponseHistoryEntry GetCacheInfoResponseHistoryEntry // 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 NewGetCacheInfoResponseHistoryEntry(occurredAt time.Time, types string) *GetCacheInfoResponseHistoryEntry { +func NewGetCacheInfoResponseHistoryEntry(occurredAt time.Time, types GetCacheInfoResponseHistoryEntryType) *GetCacheInfoResponseHistoryEntry { this := GetCacheInfoResponseHistoryEntry{} this.OccurredAt = occurredAt this.Type = types @@ -72,9 +72,9 @@ func (o *GetCacheInfoResponseHistoryEntry) SetOccurredAt(v time.Time) { } // GetType returns the Type field value -func (o *GetCacheInfoResponseHistoryEntry) GetType() string { +func (o *GetCacheInfoResponseHistoryEntry) GetType() GetCacheInfoResponseHistoryEntryType { if o == nil { - var ret string + var ret GetCacheInfoResponseHistoryEntryType return ret } @@ -83,7 +83,7 @@ func (o *GetCacheInfoResponseHistoryEntry) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*string, bool) { +func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*GetCacheInfoResponseHistoryEntryType, bool) { if o == nil { return nil, false } @@ -91,7 +91,7 @@ func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *GetCacheInfoResponseHistoryEntry) SetType(v string) { +func (o *GetCacheInfoResponseHistoryEntry) SetType(v GetCacheInfoResponseHistoryEntryType) { o.Type = v } diff --git a/services/cdn/v1api/model_get_cache_info_response_history_entry_type.go b/services/cdn/v1api/model_get_cache_info_response_history_entry_type.go new file mode 100644 index 000000000..c5475504b --- /dev/null +++ b/services/cdn/v1api/model_get_cache_info_response_history_entry_type.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// GetCacheInfoResponseHistoryEntryType the model 'GetCacheInfoResponseHistoryEntryType' +type GetCacheInfoResponseHistoryEntryType string + +// List of GetCacheInfoResponseHistoryEntry_type +const ( + GETCACHEINFORESPONSEHISTORYENTRYTYPE_FULL GetCacheInfoResponseHistoryEntryType = "full" + GETCACHEINFORESPONSEHISTORYENTRYTYPE_GRANULAR GetCacheInfoResponseHistoryEntryType = "granular" + GETCACHEINFORESPONSEHISTORYENTRYTYPE_UNKNOWN_DEFAULT_OPEN_API GetCacheInfoResponseHistoryEntryType = "unknown_default_open_api" +) + +// All allowed values of GetCacheInfoResponseHistoryEntryType enum +var AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues = []GetCacheInfoResponseHistoryEntryType{ + "full", + "granular", + "unknown_default_open_api", +} + +func (v *GetCacheInfoResponseHistoryEntryType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetCacheInfoResponseHistoryEntryType(value) + for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETCACHEINFORESPONSEHISTORYENTRYTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetCacheInfoResponseHistoryEntryTypeFromValue returns a pointer to a valid GetCacheInfoResponseHistoryEntryType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetCacheInfoResponseHistoryEntryTypeFromValue(v string) (*GetCacheInfoResponseHistoryEntryType, error) { + ev := GetCacheInfoResponseHistoryEntryType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetCacheInfoResponseHistoryEntryType: valid values are %v", v, AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetCacheInfoResponseHistoryEntryType) IsValid() bool { + for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetCacheInfoResponseHistoryEntry_type value +func (v GetCacheInfoResponseHistoryEntryType) Ptr() *GetCacheInfoResponseHistoryEntryType { + return &v +} + +type NullableGetCacheInfoResponseHistoryEntryType struct { + value *GetCacheInfoResponseHistoryEntryType + isSet bool +} + +func (v NullableGetCacheInfoResponseHistoryEntryType) Get() *GetCacheInfoResponseHistoryEntryType { + return v.value +} + +func (v *NullableGetCacheInfoResponseHistoryEntryType) Set(val *GetCacheInfoResponseHistoryEntryType) { + v.value = val + v.isSet = true +} + +func (v NullableGetCacheInfoResponseHistoryEntryType) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCacheInfoResponseHistoryEntryType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCacheInfoResponseHistoryEntryType(val *GetCacheInfoResponseHistoryEntryType) *NullableGetCacheInfoResponseHistoryEntryType { + return &NullableGetCacheInfoResponseHistoryEntryType{value: val, isSet: true} +} + +func (v NullableGetCacheInfoResponseHistoryEntryType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCacheInfoResponseHistoryEntryType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_logs_search_filters_response.go b/services/cdn/v1api/model_get_logs_search_filters_response.go index 5d0423311..53b899827 100644 --- a/services/cdn/v1api/model_get_logs_search_filters_response.go +++ b/services/cdn/v1api/model_get_logs_search_filters_response.go @@ -20,7 +20,7 @@ var _ MappedNullable = &GetLogsSearchFiltersResponse{} // GetLogsSearchFiltersResponse struct for GetLogsSearchFiltersResponse type GetLogsSearchFiltersResponse struct { - Cache []string `json:"cache"` + Cache []GetLogsSearchFiltersResponseCacheInner `json:"cache"` DataCenter GetLogsSearchFiltersResponseDatacenterBlock `json:"dataCenter"` // List of ISO-3166 Alpha2 Country Codes matching the input filter. Response is ordered in ascending order. For more Info about the country codes, see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 RemoteCountry []string `json:"remoteCountry"` @@ -35,7 +35,7 @@ type _GetLogsSearchFiltersResponse GetLogsSearchFiltersResponse // 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 NewGetLogsSearchFiltersResponse(cache []string, dataCenter GetLogsSearchFiltersResponseDatacenterBlock, remoteCountry []string, status []int32) *GetLogsSearchFiltersResponse { +func NewGetLogsSearchFiltersResponse(cache []GetLogsSearchFiltersResponseCacheInner, dataCenter GetLogsSearchFiltersResponseDatacenterBlock, remoteCountry []string, status []int32) *GetLogsSearchFiltersResponse { this := GetLogsSearchFiltersResponse{} this.Cache = cache this.DataCenter = dataCenter @@ -53,9 +53,9 @@ func NewGetLogsSearchFiltersResponseWithDefaults() *GetLogsSearchFiltersResponse } // GetCache returns the Cache field value -func (o *GetLogsSearchFiltersResponse) GetCache() []string { +func (o *GetLogsSearchFiltersResponse) GetCache() []GetLogsSearchFiltersResponseCacheInner { if o == nil { - var ret []string + var ret []GetLogsSearchFiltersResponseCacheInner return ret } @@ -64,7 +64,7 @@ func (o *GetLogsSearchFiltersResponse) GetCache() []string { // GetCacheOk returns a tuple with the Cache field value // and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponse) GetCacheOk() ([]string, bool) { +func (o *GetLogsSearchFiltersResponse) GetCacheOk() ([]GetLogsSearchFiltersResponseCacheInner, bool) { if o == nil { return nil, false } @@ -72,7 +72,7 @@ func (o *GetLogsSearchFiltersResponse) GetCacheOk() ([]string, bool) { } // SetCache sets field value -func (o *GetLogsSearchFiltersResponse) SetCache(v []string) { +func (o *GetLogsSearchFiltersResponse) SetCache(v []GetLogsSearchFiltersResponseCacheInner) { o.Cache = v } diff --git a/services/cdn/v1api/model_get_logs_search_filters_response_cache_inner.go b/services/cdn/v1api/model_get_logs_search_filters_response_cache_inner.go new file mode 100644 index 000000000..a65b10f54 --- /dev/null +++ b/services/cdn/v1api/model_get_logs_search_filters_response_cache_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// GetLogsSearchFiltersResponseCacheInner the model 'GetLogsSearchFiltersResponseCacheInner' +type GetLogsSearchFiltersResponseCacheInner string + +// List of GetLogsSearchFiltersResponse_cache_inner +const ( + GETLOGSSEARCHFILTERSRESPONSECACHEINNER_HIT GetLogsSearchFiltersResponseCacheInner = "HIT" + GETLOGSSEARCHFILTERSRESPONSECACHEINNER_MISS GetLogsSearchFiltersResponseCacheInner = "MISS" + GETLOGSSEARCHFILTERSRESPONSECACHEINNER_UNKNOWN_DEFAULT_OPEN_API GetLogsSearchFiltersResponseCacheInner = "unknown_default_open_api" +) + +// All allowed values of GetLogsSearchFiltersResponseCacheInner enum +var AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues = []GetLogsSearchFiltersResponseCacheInner{ + "HIT", + "MISS", + "unknown_default_open_api", +} + +func (v *GetLogsSearchFiltersResponseCacheInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetLogsSearchFiltersResponseCacheInner(value) + for _, existing := range AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETLOGSSEARCHFILTERSRESPONSECACHEINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetLogsSearchFiltersResponseCacheInnerFromValue returns a pointer to a valid GetLogsSearchFiltersResponseCacheInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetLogsSearchFiltersResponseCacheInnerFromValue(v string) (*GetLogsSearchFiltersResponseCacheInner, error) { + ev := GetLogsSearchFiltersResponseCacheInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetLogsSearchFiltersResponseCacheInner: valid values are %v", v, AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetLogsSearchFiltersResponseCacheInner) IsValid() bool { + for _, existing := range AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetLogsSearchFiltersResponse_cache_inner value +func (v GetLogsSearchFiltersResponseCacheInner) Ptr() *GetLogsSearchFiltersResponseCacheInner { + return &v +} + +type NullableGetLogsSearchFiltersResponseCacheInner struct { + value *GetLogsSearchFiltersResponseCacheInner + isSet bool +} + +func (v NullableGetLogsSearchFiltersResponseCacheInner) Get() *GetLogsSearchFiltersResponseCacheInner { + return v.value +} + +func (v *NullableGetLogsSearchFiltersResponseCacheInner) Set(val *GetLogsSearchFiltersResponseCacheInner) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSearchFiltersResponseCacheInner) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSearchFiltersResponseCacheInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSearchFiltersResponseCacheInner(val *GetLogsSearchFiltersResponseCacheInner) *NullableGetLogsSearchFiltersResponseCacheInner { + return &NullableGetLogsSearchFiltersResponseCacheInner{value: val, isSet: true} +} + +func (v NullableGetLogsSearchFiltersResponseCacheInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSearchFiltersResponseCacheInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_logs_sort_by_parameter.go b/services/cdn/v1api/model_get_logs_sort_by_parameter.go new file mode 100644 index 000000000..9ff583675 --- /dev/null +++ b/services/cdn/v1api/model_get_logs_sort_by_parameter.go @@ -0,0 +1,125 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// GetLogsSortByParameter the model 'GetLogsSortByParameter' +type GetLogsSortByParameter string + +// List of GetLogs_sortBy_parameter +const ( + GETLOGSSORTBYPARAMETER_TIMESTAMP GetLogsSortByParameter = "timestamp" + GETLOGSSORTBYPARAMETER_DATA_CENTER_REGION GetLogsSortByParameter = "dataCenterRegion" + GETLOGSSORTBYPARAMETER_REQUEST_COUNTRY_CODE GetLogsSortByParameter = "requestCountryCode" + GETLOGSSORTBYPARAMETER_STATUS_CODE GetLogsSortByParameter = "statusCode" + GETLOGSSORTBYPARAMETER_CACHE_HIT GetLogsSortByParameter = "cacheHit" + GETLOGSSORTBYPARAMETER_SIZE GetLogsSortByParameter = "size" + GETLOGSSORTBYPARAMETER_PATH GetLogsSortByParameter = "path" + GETLOGSSORTBYPARAMETER_HOST GetLogsSortByParameter = "host" + GETLOGSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetLogsSortByParameter = "unknown_default_open_api" +) + +// All allowed values of GetLogsSortByParameter enum +var AllowedGetLogsSortByParameterEnumValues = []GetLogsSortByParameter{ + "timestamp", + "dataCenterRegion", + "requestCountryCode", + "statusCode", + "cacheHit", + "size", + "path", + "host", + "unknown_default_open_api", +} + +func (v *GetLogsSortByParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetLogsSortByParameter(value) + for _, existing := range AllowedGetLogsSortByParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETLOGSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetLogsSortByParameterFromValue returns a pointer to a valid GetLogsSortByParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetLogsSortByParameterFromValue(v string) (*GetLogsSortByParameter, error) { + ev := GetLogsSortByParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetLogsSortByParameter: valid values are %v", v, AllowedGetLogsSortByParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetLogsSortByParameter) IsValid() bool { + for _, existing := range AllowedGetLogsSortByParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetLogs_sortBy_parameter value +func (v GetLogsSortByParameter) Ptr() *GetLogsSortByParameter { + return &v +} + +type NullableGetLogsSortByParameter struct { + value *GetLogsSortByParameter + isSet bool +} + +func (v NullableGetLogsSortByParameter) Get() *GetLogsSortByParameter { + return v.value +} + +func (v *NullableGetLogsSortByParameter) Set(val *GetLogsSortByParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSortByParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSortByParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSortByParameter(val *GetLogsSortByParameter) *NullableGetLogsSortByParameter { + return &NullableGetLogsSortByParameter{value: val, isSet: true} +} + +func (v NullableGetLogsSortByParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSortByParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_logs_sort_order_parameter.go b/services/cdn/v1api/model_get_logs_sort_order_parameter.go new file mode 100644 index 000000000..080f995e0 --- /dev/null +++ b/services/cdn/v1api/model_get_logs_sort_order_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// GetLogsSortOrderParameter the model 'GetLogsSortOrderParameter' +type GetLogsSortOrderParameter string + +// List of GetLogs_sortOrder_parameter +const ( + GETLOGSSORTORDERPARAMETER_ASCENDING GetLogsSortOrderParameter = "ascending" + GETLOGSSORTORDERPARAMETER_DESCENDING GetLogsSortOrderParameter = "descending" + GETLOGSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetLogsSortOrderParameter = "unknown_default_open_api" +) + +// All allowed values of GetLogsSortOrderParameter enum +var AllowedGetLogsSortOrderParameterEnumValues = []GetLogsSortOrderParameter{ + "ascending", + "descending", + "unknown_default_open_api", +} + +func (v *GetLogsSortOrderParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetLogsSortOrderParameter(value) + for _, existing := range AllowedGetLogsSortOrderParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETLOGSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetLogsSortOrderParameterFromValue returns a pointer to a valid GetLogsSortOrderParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetLogsSortOrderParameterFromValue(v string) (*GetLogsSortOrderParameter, error) { + ev := GetLogsSortOrderParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetLogsSortOrderParameter: valid values are %v", v, AllowedGetLogsSortOrderParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetLogsSortOrderParameter) IsValid() bool { + for _, existing := range AllowedGetLogsSortOrderParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetLogs_sortOrder_parameter value +func (v GetLogsSortOrderParameter) Ptr() *GetLogsSortOrderParameter { + return &v +} + +type NullableGetLogsSortOrderParameter struct { + value *GetLogsSortOrderParameter + isSet bool +} + +func (v NullableGetLogsSortOrderParameter) Get() *GetLogsSortOrderParameter { + return v.value +} + +func (v *NullableGetLogsSortOrderParameter) Set(val *GetLogsSortOrderParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSortOrderParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSortOrderParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSortOrderParameter(val *GetLogsSortOrderParameter) *NullableGetLogsSortOrderParameter { + return &NullableGetLogsSortOrderParameter{value: val, isSet: true} +} + +func (v NullableGetLogsSortOrderParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSortOrderParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_statistics_interval_parameter.go b/services/cdn/v1api/model_get_statistics_interval_parameter.go new file mode 100644 index 000000000..68196de0d --- /dev/null +++ b/services/cdn/v1api/model_get_statistics_interval_parameter.go @@ -0,0 +1,117 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// GetStatisticsIntervalParameter the model 'GetStatisticsIntervalParameter' +type GetStatisticsIntervalParameter string + +// List of GetStatistics_interval_parameter +const ( + GETSTATISTICSINTERVALPARAMETER_HOURLY GetStatisticsIntervalParameter = "hourly" + GETSTATISTICSINTERVALPARAMETER_DAILY GetStatisticsIntervalParameter = "daily" + GETSTATISTICSINTERVALPARAMETER_MONTHLY GetStatisticsIntervalParameter = "monthly" + GETSTATISTICSINTERVALPARAMETER_YEARLY GetStatisticsIntervalParameter = "yearly" + GETSTATISTICSINTERVALPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetStatisticsIntervalParameter = "unknown_default_open_api" +) + +// All allowed values of GetStatisticsIntervalParameter enum +var AllowedGetStatisticsIntervalParameterEnumValues = []GetStatisticsIntervalParameter{ + "hourly", + "daily", + "monthly", + "yearly", + "unknown_default_open_api", +} + +func (v *GetStatisticsIntervalParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetStatisticsIntervalParameter(value) + for _, existing := range AllowedGetStatisticsIntervalParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETSTATISTICSINTERVALPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetStatisticsIntervalParameterFromValue returns a pointer to a valid GetStatisticsIntervalParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetStatisticsIntervalParameterFromValue(v string) (*GetStatisticsIntervalParameter, error) { + ev := GetStatisticsIntervalParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetStatisticsIntervalParameter: valid values are %v", v, AllowedGetStatisticsIntervalParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetStatisticsIntervalParameter) IsValid() bool { + for _, existing := range AllowedGetStatisticsIntervalParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetStatistics_interval_parameter value +func (v GetStatisticsIntervalParameter) Ptr() *GetStatisticsIntervalParameter { + return &v +} + +type NullableGetStatisticsIntervalParameter struct { + value *GetStatisticsIntervalParameter + isSet bool +} + +func (v NullableGetStatisticsIntervalParameter) Get() *GetStatisticsIntervalParameter { + return v.value +} + +func (v *NullableGetStatisticsIntervalParameter) Set(val *GetStatisticsIntervalParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetStatisticsIntervalParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStatisticsIntervalParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStatisticsIntervalParameter(val *GetStatisticsIntervalParameter) *NullableGetStatisticsIntervalParameter { + return &NullableGetStatisticsIntervalParameter{value: val, isSet: true} +} + +func (v NullableGetStatisticsIntervalParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStatisticsIntervalParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_list_distributions_sort_by_parameter.go b/services/cdn/v1api/model_list_distributions_sort_by_parameter.go new file mode 100644 index 000000000..36abcb2a9 --- /dev/null +++ b/services/cdn/v1api/model_list_distributions_sort_by_parameter.go @@ -0,0 +1,121 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ListDistributionsSortByParameter the model 'ListDistributionsSortByParameter' +type ListDistributionsSortByParameter string + +// List of ListDistributions_sortBy_parameter +const ( + LISTDISTRIBUTIONSSORTBYPARAMETER_ID ListDistributionsSortByParameter = "id" + LISTDISTRIBUTIONSSORTBYPARAMETER_UPDATED_AT ListDistributionsSortByParameter = "updatedAt" + LISTDISTRIBUTIONSSORTBYPARAMETER_CREATED_AT ListDistributionsSortByParameter = "createdAt" + LISTDISTRIBUTIONSSORTBYPARAMETER_ORIGIN_URL ListDistributionsSortByParameter = "originUrl" + LISTDISTRIBUTIONSSORTBYPARAMETER_STATUS ListDistributionsSortByParameter = "status" + LISTDISTRIBUTIONSSORTBYPARAMETER_ORIGIN_URL_RELATED ListDistributionsSortByParameter = "originUrlRelated" + LISTDISTRIBUTIONSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDistributionsSortByParameter = "unknown_default_open_api" +) + +// All allowed values of ListDistributionsSortByParameter enum +var AllowedListDistributionsSortByParameterEnumValues = []ListDistributionsSortByParameter{ + "id", + "updatedAt", + "createdAt", + "originUrl", + "status", + "originUrlRelated", + "unknown_default_open_api", +} + +func (v *ListDistributionsSortByParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListDistributionsSortByParameter(value) + for _, existing := range AllowedListDistributionsSortByParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTDISTRIBUTIONSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListDistributionsSortByParameterFromValue returns a pointer to a valid ListDistributionsSortByParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListDistributionsSortByParameterFromValue(v string) (*ListDistributionsSortByParameter, error) { + ev := ListDistributionsSortByParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListDistributionsSortByParameter: valid values are %v", v, AllowedListDistributionsSortByParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListDistributionsSortByParameter) IsValid() bool { + for _, existing := range AllowedListDistributionsSortByParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListDistributions_sortBy_parameter value +func (v ListDistributionsSortByParameter) Ptr() *ListDistributionsSortByParameter { + return &v +} + +type NullableListDistributionsSortByParameter struct { + value *ListDistributionsSortByParameter + isSet bool +} + +func (v NullableListDistributionsSortByParameter) Get() *ListDistributionsSortByParameter { + return v.value +} + +func (v *NullableListDistributionsSortByParameter) Set(val *ListDistributionsSortByParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListDistributionsSortByParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListDistributionsSortByParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDistributionsSortByParameter(val *ListDistributionsSortByParameter) *NullableListDistributionsSortByParameter { + return &NullableListDistributionsSortByParameter{value: val, isSet: true} +} + +func (v NullableListDistributionsSortByParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDistributionsSortByParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_list_distributions_sort_order_parameter.go b/services/cdn/v1api/model_list_distributions_sort_order_parameter.go new file mode 100644 index 000000000..134f0f760 --- /dev/null +++ b/services/cdn/v1api/model_list_distributions_sort_order_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ListDistributionsSortOrderParameter the model 'ListDistributionsSortOrderParameter' +type ListDistributionsSortOrderParameter string + +// List of ListDistributions_sortOrder_parameter +const ( + LISTDISTRIBUTIONSSORTORDERPARAMETER_ASCENDING ListDistributionsSortOrderParameter = "ascending" + LISTDISTRIBUTIONSSORTORDERPARAMETER_DESCENDING ListDistributionsSortOrderParameter = "descending" + LISTDISTRIBUTIONSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDistributionsSortOrderParameter = "unknown_default_open_api" +) + +// All allowed values of ListDistributionsSortOrderParameter enum +var AllowedListDistributionsSortOrderParameterEnumValues = []ListDistributionsSortOrderParameter{ + "ascending", + "descending", + "unknown_default_open_api", +} + +func (v *ListDistributionsSortOrderParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListDistributionsSortOrderParameter(value) + for _, existing := range AllowedListDistributionsSortOrderParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTDISTRIBUTIONSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListDistributionsSortOrderParameterFromValue returns a pointer to a valid ListDistributionsSortOrderParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListDistributionsSortOrderParameterFromValue(v string) (*ListDistributionsSortOrderParameter, error) { + ev := ListDistributionsSortOrderParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListDistributionsSortOrderParameter: valid values are %v", v, AllowedListDistributionsSortOrderParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListDistributionsSortOrderParameter) IsValid() bool { + for _, existing := range AllowedListDistributionsSortOrderParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListDistributions_sortOrder_parameter value +func (v ListDistributionsSortOrderParameter) Ptr() *ListDistributionsSortOrderParameter { + return &v +} + +type NullableListDistributionsSortOrderParameter struct { + value *ListDistributionsSortOrderParameter + isSet bool +} + +func (v NullableListDistributionsSortOrderParameter) Get() *ListDistributionsSortOrderParameter { + return v.value +} + +func (v *NullableListDistributionsSortOrderParameter) Set(val *ListDistributionsSortOrderParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListDistributionsSortOrderParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListDistributionsSortOrderParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDistributionsSortOrderParameter(val *ListDistributionsSortOrderParameter) *NullableListDistributionsSortOrderParameter { + return &NullableListDistributionsSortOrderParameter{value: val, isSet: true} +} + +func (v NullableListDistributionsSortOrderParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDistributionsSortOrderParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_redirect_rule.go b/services/cdn/v1api/model_redirect_rule.go index fb4216c3d..8145b440e 100644 --- a/services/cdn/v1api/model_redirect_rule.go +++ b/services/cdn/v1api/model_redirect_rule.go @@ -25,10 +25,9 @@ type RedirectRule struct { // A toggle to enable or disable the redirect rule. Enabled *bool `json:"enabled,omitempty"` // A list of matchers that define when this rule should apply. At least one matcher is required. - Matchers []Matcher `json:"matchers"` - RuleMatchCondition *MatchCondition `json:"ruleMatchCondition,omitempty"` - // The HTTP status code for the redirect. Must be one of 301, 302, 303, 307, or 308. - StatusCode int32 `json:"statusCode"` + Matchers []Matcher `json:"matchers"` + RuleMatchCondition *MatchCondition `json:"ruleMatchCondition,omitempty"` + StatusCode RedirectRuleStatusCode `json:"statusCode"` // The target URL to redirect to. Must be a valid URI. TargetUrl string `json:"targetUrl"` AdditionalProperties map[string]interface{} @@ -40,7 +39,7 @@ type _RedirectRule RedirectRule // 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 NewRedirectRule(matchers []Matcher, statusCode int32, targetUrl string) *RedirectRule { +func NewRedirectRule(matchers []Matcher, statusCode RedirectRuleStatusCode, targetUrl string) *RedirectRule { this := RedirectRule{} var enabled bool = true this.Enabled = &enabled @@ -185,9 +184,9 @@ func (o *RedirectRule) SetRuleMatchCondition(v MatchCondition) { } // GetStatusCode returns the StatusCode field value -func (o *RedirectRule) GetStatusCode() int32 { +func (o *RedirectRule) GetStatusCode() RedirectRuleStatusCode { if o == nil { - var ret int32 + var ret RedirectRuleStatusCode return ret } @@ -196,7 +195,7 @@ func (o *RedirectRule) GetStatusCode() int32 { // GetStatusCodeOk returns a tuple with the StatusCode field value // and a boolean to check if the value has been set. -func (o *RedirectRule) GetStatusCodeOk() (*int32, bool) { +func (o *RedirectRule) GetStatusCodeOk() (*RedirectRuleStatusCode, bool) { if o == nil { return nil, false } @@ -204,7 +203,7 @@ func (o *RedirectRule) GetStatusCodeOk() (*int32, bool) { } // SetStatusCode sets field value -func (o *RedirectRule) SetStatusCode(v int32) { +func (o *RedirectRule) SetStatusCode(v RedirectRuleStatusCode) { o.StatusCode = v } diff --git a/services/cdn/v1api/model_redirect_rule_status_code.go b/services/cdn/v1api/model_redirect_rule_status_code.go new file mode 100644 index 000000000..979aaa0d2 --- /dev/null +++ b/services/cdn/v1api/model_redirect_rule_status_code.go @@ -0,0 +1,119 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// RedirectRuleStatusCode The HTTP status code for the redirect. Must be one of 301, 302, 303, 307, or 308. +type RedirectRuleStatusCode int32 + +// List of RedirectRule_statusCode +const ( + REDIRECTRULESTATUSCODE__301 RedirectRuleStatusCode = 301 + REDIRECTRULESTATUSCODE__302 RedirectRuleStatusCode = 302 + REDIRECTRULESTATUSCODE__303 RedirectRuleStatusCode = 303 + REDIRECTRULESTATUSCODE__307 RedirectRuleStatusCode = 307 + REDIRECTRULESTATUSCODE__308 RedirectRuleStatusCode = 308 + REDIRECTRULESTATUSCODE__unknown_default_open_api RedirectRuleStatusCode = 11184809 +) + +// All allowed values of RedirectRuleStatusCode enum +var AllowedRedirectRuleStatusCodeEnumValues = []RedirectRuleStatusCode{ + 301, + 302, + 303, + 307, + 308, + 11184809, +} + +func (v *RedirectRuleStatusCode) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RedirectRuleStatusCode(value) + for _, existing := range AllowedRedirectRuleStatusCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = REDIRECTRULESTATUSCODE__unknown_default_open_api + return nil +} + +// NewRedirectRuleStatusCodeFromValue returns a pointer to a valid RedirectRuleStatusCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRedirectRuleStatusCodeFromValue(v int32) (*RedirectRuleStatusCode, error) { + ev := RedirectRuleStatusCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RedirectRuleStatusCode: valid values are %v", v, AllowedRedirectRuleStatusCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RedirectRuleStatusCode) IsValid() bool { + for _, existing := range AllowedRedirectRuleStatusCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RedirectRule_statusCode value +func (v RedirectRuleStatusCode) Ptr() *RedirectRuleStatusCode { + return &v +} + +type NullableRedirectRuleStatusCode struct { + value *RedirectRuleStatusCode + isSet bool +} + +func (v NullableRedirectRuleStatusCode) Get() *RedirectRuleStatusCode { + return v.value +} + +func (v *NullableRedirectRuleStatusCode) Set(val *RedirectRuleStatusCode) { + v.value = val + v.isSet = true +} + +func (v NullableRedirectRuleStatusCode) IsSet() bool { + return v.isSet +} + +func (v *NullableRedirectRuleStatusCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedirectRuleStatusCode(val *RedirectRuleStatusCode) *NullableRedirectRuleStatusCode { + return &NullableRedirectRuleStatusCode{value: val, isSet: true} +} + +func (v NullableRedirectRuleStatusCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedirectRuleStatusCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_status_error.go b/services/cdn/v1api/model_status_error.go index 91b645d6a..969f1f406 100644 --- a/services/cdn/v1api/model_status_error.go +++ b/services/cdn/v1api/model_status_error.go @@ -23,9 +23,8 @@ type StatusError struct { // A german translation string corresponding to the error key. Note that we do not guarantee german translations are present. De *string `json:"de,omitempty"` // An english translation string corresponding to the error key. An english translation key is always present. - En string `json:"en"` - // An enum value that describes a Status Error. - Key string `json:"key"` + En string `json:"en"` + Key StatusErrorKey `json:"key"` AdditionalProperties map[string]interface{} } @@ -35,7 +34,7 @@ type _StatusError StatusError // 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 NewStatusError(en string, key string) *StatusError { +func NewStatusError(en string, key StatusErrorKey) *StatusError { this := StatusError{} this.En = en this.Key = key @@ -107,9 +106,9 @@ func (o *StatusError) SetEn(v string) { } // GetKey returns the Key field value -func (o *StatusError) GetKey() string { +func (o *StatusError) GetKey() StatusErrorKey { if o == nil { - var ret string + var ret StatusErrorKey return ret } @@ -118,7 +117,7 @@ func (o *StatusError) GetKey() string { // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. -func (o *StatusError) GetKeyOk() (*string, bool) { +func (o *StatusError) GetKeyOk() (*StatusErrorKey, bool) { if o == nil { return nil, false } @@ -126,7 +125,7 @@ func (o *StatusError) GetKeyOk() (*string, bool) { } // SetKey sets field value -func (o *StatusError) SetKey(v string) { +func (o *StatusError) SetKey(v StatusErrorKey) { o.Key = v } diff --git a/services/cdn/v1api/model_status_error_key.go b/services/cdn/v1api/model_status_error_key.go new file mode 100644 index 000000000..e8fb45067 --- /dev/null +++ b/services/cdn/v1api/model_status_error_key.go @@ -0,0 +1,121 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// StatusErrorKey An enum value that describes a Status Error. +type StatusErrorKey string + +// List of StatusError_key +const ( + STATUSERRORKEY_UNKNOWN StatusErrorKey = "UNKNOWN" + STATUSERRORKEY_CUSTOM_DOMAIN_CNAME_MISSING StatusErrorKey = "CUSTOM_DOMAIN_CNAME_MISSING" + STATUSERRORKEY_CUSTOM_DOMAIN_ALREADY_IN_USE StatusErrorKey = "CUSTOM_DOMAIN_ALREADY_IN_USE" + STATUSERRORKEY_PUBLIC_BETA_QUOTA_REACHED StatusErrorKey = "PUBLIC_BETA_QUOTA_REACHED" + STATUSERRORKEY_LOG_SINK_INSTANCE_UNAVAILABLE StatusErrorKey = "LOG_SINK_INSTANCE_UNAVAILABLE" + STATUSERRORKEY_EXTERNAL_QUOTA_REACHED StatusErrorKey = "EXTERNAL_QUOTA_REACHED" + STATUSERRORKEY_UNKNOWN_DEFAULT_OPEN_API StatusErrorKey = "unknown_default_open_api" +) + +// All allowed values of StatusErrorKey enum +var AllowedStatusErrorKeyEnumValues = []StatusErrorKey{ + "UNKNOWN", + "CUSTOM_DOMAIN_CNAME_MISSING", + "CUSTOM_DOMAIN_ALREADY_IN_USE", + "PUBLIC_BETA_QUOTA_REACHED", + "LOG_SINK_INSTANCE_UNAVAILABLE", + "EXTERNAL_QUOTA_REACHED", + "unknown_default_open_api", +} + +func (v *StatusErrorKey) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := StatusErrorKey(value) + for _, existing := range AllowedStatusErrorKeyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = STATUSERRORKEY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewStatusErrorKeyFromValue returns a pointer to a valid StatusErrorKey +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStatusErrorKeyFromValue(v string) (*StatusErrorKey, error) { + ev := StatusErrorKey(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for StatusErrorKey: valid values are %v", v, AllowedStatusErrorKeyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v StatusErrorKey) IsValid() bool { + for _, existing := range AllowedStatusErrorKeyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StatusError_key value +func (v StatusErrorKey) Ptr() *StatusErrorKey { + return &v +} + +type NullableStatusErrorKey struct { + value *StatusErrorKey + isSet bool +} + +func (v NullableStatusErrorKey) Get() *StatusErrorKey { + return v.value +} + +func (v *NullableStatusErrorKey) Set(val *StatusErrorKey) { + v.value = val + v.isSet = true +} + +func (v NullableStatusErrorKey) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusErrorKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusErrorKey(val *StatusErrorKey) *NullableStatusErrorKey { + return &NullableStatusErrorKey{value: val, isSet: true} +} + +func (v NullableStatusErrorKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusErrorKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/wait/wait.go b/services/cdn/v1api/wait/wait.go index 0ae5fd475..7373c87b2 100644 --- a/services/cdn/v1api/wait/wait.go +++ b/services/cdn/v1api/wait/wait.go @@ -12,14 +12,6 @@ import ( cdn "github.com/stackitcloud/stackit-sdk-go/services/cdn/v1api" ) -const ( - DISTRIBUTIONSTATUS_CREATING = "CREATING" - DISTRIBUTIONSTATUS_ACTIVE = "ACTIVE" - DISTRIBUTIONSTATUS_UPDATING = "UPDATING" - DISTRIBUTIONSTATUS_DELETING = "DELETING" - DISTRIBUTIONSTATUS_ERROR = "ERROR" -) - func CreateDistributionPoolWaitHandler(ctx context.Context, api cdn.DefaultAPI, projectId, distributionId string) *wait.AsyncActionHandler[cdn.GetDistributionResponse] { handler := wait.New(func() (waitFinished bool, distribution *cdn.GetDistributionResponse, err error) { distribution, err = api.GetDistribution(ctx, projectId, distributionId).Execute() @@ -31,13 +23,13 @@ func CreateDistributionPoolWaitHandler(ctx context.Context, api cdn.DefaultAPI, } if distribution.Distribution.Id == distributionId { switch distribution.Distribution.Status { - case DISTRIBUTIONSTATUS_ACTIVE: + case cdn.DISTRIBUTIONSTATUS_ACTIVE: return true, distribution, nil - case DISTRIBUTIONSTATUS_CREATING, DISTRIBUTIONSTATUS_UPDATING: + case cdn.DISTRIBUTIONSTATUS_CREATING, cdn.DISTRIBUTIONSTATUS_UPDATING: return false, nil, nil - case DISTRIBUTIONSTATUS_DELETING: + case cdn.DISTRIBUTIONSTATUS_DELETING: return true, nil, fmt.Errorf("creating CDN distribution failed") - case DISTRIBUTIONSTATUS_ERROR: + case cdn.DISTRIBUTIONSTATUS_ERROR: return true, nil, fmt.Errorf("creating CDN distribution failed") default: return true, nil, fmt.Errorf("CDNDistributionWaitHandler: unexpected status %s", distribution.Distribution.Status) @@ -60,13 +52,13 @@ func UpdateDistributionWaitHandler(ctx context.Context, api cdn.DefaultAPI, proj } if distribution.Distribution.Id == distributionId { switch distribution.Distribution.Status { - case DISTRIBUTIONSTATUS_ACTIVE: + case cdn.DISTRIBUTIONSTATUS_ACTIVE: return true, distribution, err - case DISTRIBUTIONSTATUS_UPDATING: + case cdn.DISTRIBUTIONSTATUS_UPDATING: return false, nil, nil - case DISTRIBUTIONSTATUS_DELETING: + case cdn.DISTRIBUTIONSTATUS_DELETING: return true, nil, fmt.Errorf("updating CDN distribution failed") - case DISTRIBUTIONSTATUS_ERROR: + case cdn.DISTRIBUTIONSTATUS_ERROR: return true, nil, fmt.Errorf("updating CDN distribution failed") default: return true, nil, fmt.Errorf("UpdateDistributionWaitHandler: unexpected status %s", distribution.Distribution.Status) @@ -79,7 +71,6 @@ func UpdateDistributionWaitHandler(ctx context.Context, api cdn.DefaultAPI, proj handler.SetTimeout(10 * time.Minute) return handler } - func DeleteDistributionWaitHandler(ctx context.Context, api cdn.DefaultAPI, projectId, distributionId string) *wait.AsyncActionHandler[cdn.GetDistributionResponse] { handler := wait.New(func() (waitFinished bool, distribution *cdn.GetDistributionResponse, err error) { _, err = api.GetDistribution(ctx, projectId, distributionId).Execute() diff --git a/services/cdn/v1api/wait/wait_test.go b/services/cdn/v1api/wait/wait_test.go index 7500de772..6dd42e1f7 100644 --- a/services/cdn/v1api/wait/wait_test.go +++ b/services/cdn/v1api/wait/wait_test.go @@ -72,11 +72,11 @@ func isNil(t *testing.T, err error) { func TestCreateDistributionWaitHandler(t *testing.T) { projectId := "test-project-id" distributionId := "test-distribution-id" - statusActive := DISTRIBUTIONSTATUS_ACTIVE - statusUpdating := DISTRIBUTIONSTATUS_UPDATING - statusCreating := DISTRIBUTIONSTATUS_CREATING - statusError := DISTRIBUTIONSTATUS_ERROR - statusDeleting := DISTRIBUTIONSTATUS_DELETING + statusActive := cdn.DISTRIBUTIONSTATUS_ACTIVE + statusUpdating := cdn.DISTRIBUTIONSTATUS_UPDATING + statusCreating := cdn.DISTRIBUTIONSTATUS_CREATING + statusError := cdn.DISTRIBUTIONSTATUS_ERROR + statusDeleting := cdn.DISTRIBUTIONSTATUS_DELETING mockClientFixture := func(patches ...func(settings *mockSettings)) cdn.DefaultAPI { settings := mockSettings{ @@ -189,11 +189,11 @@ func TestCreateDistributionWaitHandler(t *testing.T) { func TestDeleteDistributionWaitHandler(t *testing.T) { projectId := "test-project-id" distributionId := "test-distribution-id" - statusActive := DISTRIBUTIONSTATUS_ACTIVE - statusUpdating := DISTRIBUTIONSTATUS_UPDATING - statusCreating := DISTRIBUTIONSTATUS_CREATING - statusError := DISTRIBUTIONSTATUS_ERROR - statusDeleting := DISTRIBUTIONSTATUS_DELETING + statusActive := cdn.DISTRIBUTIONSTATUS_ACTIVE + statusUpdating := cdn.DISTRIBUTIONSTATUS_UPDATING + statusCreating := cdn.DISTRIBUTIONSTATUS_CREATING + statusError := cdn.DISTRIBUTIONSTATUS_ERROR + statusDeleting := cdn.DISTRIBUTIONSTATUS_DELETING mockClientFixture := func(patches ...func(settings *mockSettings)) cdn.DefaultAPI { settings := mockSettings{ @@ -305,11 +305,11 @@ func TestDeleteDistributionWaitHandler(t *testing.T) { func TestUpdateDistributionWaitHandler(t *testing.T) { projectId := "test-project-id" distributionId := "test-distribution-id" - statusActive := DISTRIBUTIONSTATUS_ACTIVE - statusUpdating := DISTRIBUTIONSTATUS_UPDATING - statusCreating := DISTRIBUTIONSTATUS_CREATING - statusError := DISTRIBUTIONSTATUS_ERROR - statusDeleting := DISTRIBUTIONSTATUS_DELETING + statusActive := cdn.DISTRIBUTIONSTATUS_ACTIVE + statusUpdating := cdn.DISTRIBUTIONSTATUS_UPDATING + statusCreating := cdn.DISTRIBUTIONSTATUS_CREATING + statusError := cdn.DISTRIBUTIONSTATUS_ERROR + statusDeleting := cdn.DISTRIBUTIONSTATUS_DELETING mockClientFixture := func(patches ...func(settings *mockSettings)) cdn.DefaultAPI { settings := mockSettings{ diff --git a/services/cdn/v1beta2api/api_default.go b/services/cdn/v1beta2api/api_default.go index 05e8dfdc2..fb2d0f6bf 100644 --- a/services/cdn/v1beta2api/api_default.go +++ b/services/cdn/v1beta2api/api_default.go @@ -1553,8 +1553,8 @@ type ApiGetLogsRequest struct { to *time.Time pageSize *int32 pageIdentifier *string - sortBy *string - sortOrder *string + sortBy *GetLogsSortByParameter + sortOrder *GetLogsSortOrderParameter wafAction *WAFRuleAction dataCenterRegion *string requestCountryCode *string @@ -1587,12 +1587,12 @@ func (r ApiGetLogsRequest) PageIdentifier(pageIdentifier string) ApiGetLogsReque } // Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host` -func (r ApiGetLogsRequest) SortBy(sortBy string) ApiGetLogsRequest { +func (r ApiGetLogsRequest) SortBy(sortBy GetLogsSortByParameter) ApiGetLogsRequest { r.sortBy = &sortBy return r } -func (r ApiGetLogsRequest) SortOrder(sortOrder string) ApiGetLogsRequest { +func (r ApiGetLogsRequest) SortOrder(sortOrder GetLogsSortOrderParameter) ApiGetLogsRequest { r.sortOrder = &sortOrder return r } @@ -1691,7 +1691,7 @@ func (a *DefaultAPIService) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsRespons if r.sortBy != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") } else { - var defaultValue string = "timestamp" + var defaultValue GetLogsSortByParameter = "timestamp" parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") r.sortBy = &defaultValue } @@ -2005,7 +2005,7 @@ type ApiGetStatisticsRequest struct { distributionId string from *time.Time to *time.Time - interval *string + interval *GetStatisticsIntervalParameter } // the start of the time range for which statistics should be returned @@ -2021,7 +2021,7 @@ func (r ApiGetStatisticsRequest) To(to time.Time) ApiGetStatisticsRequest { } // Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z` -func (r ApiGetStatisticsRequest) Interval(interval string) ApiGetStatisticsRequest { +func (r ApiGetStatisticsRequest) Interval(interval GetStatisticsIntervalParameter) ApiGetStatisticsRequest { r.interval = &interval return r } @@ -2206,8 +2206,8 @@ type ApiListDistributionsRequest struct { pageSize *int32 withWafStatus *bool pageIdentifier *string - sortBy *string - sortOrder *string + sortBy *ListDistributionsSortByParameter + sortOrder *ListDistributionsSortOrderParameter } // Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) @@ -2229,12 +2229,12 @@ func (r ApiListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiLi } // The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. -func (r ApiListDistributionsRequest) SortBy(sortBy string) ApiListDistributionsRequest { +func (r ApiListDistributionsRequest) SortBy(sortBy ListDistributionsSortByParameter) ApiListDistributionsRequest { r.sortBy = &sortBy return r } -func (r ApiListDistributionsRequest) SortOrder(sortOrder string) ApiListDistributionsRequest { +func (r ApiListDistributionsRequest) SortOrder(sortOrder ListDistributionsSortOrderParameter) ApiListDistributionsRequest { r.sortOrder = &sortOrder return r } @@ -2304,7 +2304,7 @@ func (a *DefaultAPIService) ListDistributionsExecute(r ApiListDistributionsReque if r.sortBy != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") } else { - var defaultValue string = "createdAt" + var defaultValue ListDistributionsSortByParameter = "createdAt" parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") r.sortBy = &defaultValue } diff --git a/services/cdn/v1beta2api/model_distribution.go b/services/cdn/v1beta2api/model_distribution.go index 30ec6852c..d0869ed57 100644 --- a/services/cdn/v1beta2api/model_distribution.go +++ b/services/cdn/v1beta2api/model_distribution.go @@ -26,11 +26,10 @@ type Distribution struct { CreatedAt time.Time `json:"createdAt"` Domains []Domain `json:"domains"` // This object may be present if, and only if the distribution has encountered an error state. - Errors []StatusError `json:"errors,omitempty"` - Id string `json:"id"` - ProjectId string `json:"projectId"` - // - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. - Status string `json:"status"` + Errors []StatusError `json:"errors,omitempty"` + Id string `json:"id"` + ProjectId string `json:"projectId"` + Status DistributionStatus `json:"status"` // RFC3339 string which returns the last time the distribution configuration was modified. UpdatedAt time.Time `json:"updatedAt"` Waf *DistributionWaf `json:"waf,omitempty"` @@ -43,7 +42,7 @@ type _Distribution Distribution // 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 NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status string, updatedAt time.Time) *Distribution { +func NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status DistributionStatus, updatedAt time.Time) *Distribution { this := Distribution{} this.Config = config this.CreatedAt = createdAt @@ -216,9 +215,9 @@ func (o *Distribution) SetProjectId(v string) { } // GetStatus returns the Status field value -func (o *Distribution) GetStatus() string { +func (o *Distribution) GetStatus() DistributionStatus { if o == nil { - var ret string + var ret DistributionStatus return ret } @@ -227,7 +226,7 @@ func (o *Distribution) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *Distribution) GetStatusOk() (*string, bool) { +func (o *Distribution) GetStatusOk() (*DistributionStatus, bool) { if o == nil { return nil, false } @@ -235,7 +234,7 @@ func (o *Distribution) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *Distribution) SetStatus(v string) { +func (o *Distribution) SetStatus(v DistributionStatus) { o.Status = v } diff --git a/services/cdn/v1beta2api/model_distribution_status.go b/services/cdn/v1beta2api/model_distribution_status.go new file mode 100644 index 000000000..c6abe8b83 --- /dev/null +++ b/services/cdn/v1beta2api/model_distribution_status.go @@ -0,0 +1,119 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// DistributionStatus - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. +type DistributionStatus string + +// List of Distribution_status +const ( + DISTRIBUTIONSTATUS_CREATING DistributionStatus = "CREATING" + DISTRIBUTIONSTATUS_ACTIVE DistributionStatus = "ACTIVE" + DISTRIBUTIONSTATUS_UPDATING DistributionStatus = "UPDATING" + DISTRIBUTIONSTATUS_DELETING DistributionStatus = "DELETING" + DISTRIBUTIONSTATUS_ERROR DistributionStatus = "ERROR" + DISTRIBUTIONSTATUS_UNKNOWN_DEFAULT_OPEN_API DistributionStatus = "unknown_default_open_api" +) + +// All allowed values of DistributionStatus enum +var AllowedDistributionStatusEnumValues = []DistributionStatus{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "ERROR", + "unknown_default_open_api", +} + +func (v *DistributionStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DistributionStatus(value) + for _, existing := range AllowedDistributionStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DISTRIBUTIONSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDistributionStatusFromValue returns a pointer to a valid DistributionStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDistributionStatusFromValue(v string) (*DistributionStatus, error) { + ev := DistributionStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DistributionStatus: valid values are %v", v, AllowedDistributionStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DistributionStatus) IsValid() bool { + for _, existing := range AllowedDistributionStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Distribution_status value +func (v DistributionStatus) Ptr() *DistributionStatus { + return &v +} + +type NullableDistributionStatus struct { + value *DistributionStatus + isSet bool +} + +func (v NullableDistributionStatus) Get() *DistributionStatus { + return v.value +} + +func (v *NullableDistributionStatus) Set(val *DistributionStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatus(val *DistributionStatus) *NullableDistributionStatus { + return &NullableDistributionStatus{value: val, isSet: true} +} + +func (v NullableDistributionStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_domain.go b/services/cdn/v1beta2api/model_domain.go index 82f2251fa..8748bec99 100644 --- a/services/cdn/v1beta2api/model_domain.go +++ b/services/cdn/v1beta2api/model_domain.go @@ -23,10 +23,9 @@ type Domain struct { // This object is present if the custom domain has errors. Errors []StatusError `json:"errors,omitempty"` // The domain. If this is a custom domain, you can call the GetCustomDomain Endpoint - Name string `json:"name"` - Status DomainStatus `json:"status"` - // Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint - Type string `json:"type"` + Name string `json:"name"` + Status DomainStatus `json:"status"` + Type DomainType `json:"type"` AdditionalProperties map[string]interface{} } @@ -36,7 +35,7 @@ type _Domain Domain // 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 NewDomain(name string, status DomainStatus, types string) *Domain { +func NewDomain(name string, status DomainStatus, types DomainType) *Domain { this := Domain{} this.Name = name this.Status = status @@ -133,9 +132,9 @@ func (o *Domain) SetStatus(v DomainStatus) { } // GetType returns the Type field value -func (o *Domain) GetType() string { +func (o *Domain) GetType() DomainType { if o == nil { - var ret string + var ret DomainType return ret } @@ -144,7 +143,7 @@ func (o *Domain) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *Domain) GetTypeOk() (*string, bool) { +func (o *Domain) GetTypeOk() (*DomainType, bool) { if o == nil { return nil, false } @@ -152,7 +151,7 @@ func (o *Domain) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *Domain) SetType(v string) { +func (o *Domain) SetType(v DomainType) { o.Type = v } diff --git a/services/cdn/v1beta2api/model_domain_type.go b/services/cdn/v1beta2api/model_domain_type.go new file mode 100644 index 000000000..d67d1a1e8 --- /dev/null +++ b/services/cdn/v1beta2api/model_domain_type.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// DomainType Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint +type DomainType string + +// List of Domain_type +const ( + DOMAINTYPE_MANAGED DomainType = "managed" + DOMAINTYPE_CUSTOM DomainType = "custom" + DOMAINTYPE_UNKNOWN_DEFAULT_OPEN_API DomainType = "unknown_default_open_api" +) + +// All allowed values of DomainType enum +var AllowedDomainTypeEnumValues = []DomainType{ + "managed", + "custom", + "unknown_default_open_api", +} + +func (v *DomainType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DomainType(value) + for _, existing := range AllowedDomainTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DOMAINTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDomainTypeFromValue returns a pointer to a valid DomainType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDomainTypeFromValue(v string) (*DomainType, error) { + ev := DomainType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DomainType: valid values are %v", v, AllowedDomainTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DomainType) IsValid() bool { + for _, existing := range AllowedDomainTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Domain_type value +func (v DomainType) Ptr() *DomainType { + return &v +} + +type NullableDomainType struct { + value *DomainType + isSet bool +} + +func (v NullableDomainType) Get() *DomainType { + return v.value +} + +func (v *NullableDomainType) Set(val *DomainType) { + v.value = val + v.isSet = true +} + +func (v NullableDomainType) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainType(val *DomainType) *NullableDomainType { + return &NullableDomainType{value: val, isSet: true} +} + +func (v NullableDomainType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_error_details.go b/services/cdn/v1beta2api/model_error_details.go index 484c03705..690a48801 100644 --- a/services/cdn/v1beta2api/model_error_details.go +++ b/services/cdn/v1beta2api/model_error_details.go @@ -25,8 +25,8 @@ type ErrorDetails struct { // English description of the error En string `json:"en"` // Optional field in the request this error detail refers to - Field *string `json:"field,omitempty"` - Key string `json:"key"` + Field *string `json:"field,omitempty"` + Key ErrorDetailsKey `json:"key"` AdditionalProperties map[string]interface{} } @@ -36,7 +36,7 @@ type _ErrorDetails ErrorDetails // 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 NewErrorDetails(en string, key string) *ErrorDetails { +func NewErrorDetails(en string, key ErrorDetailsKey) *ErrorDetails { this := ErrorDetails{} this.En = en this.Key = key @@ -140,9 +140,9 @@ func (o *ErrorDetails) SetField(v string) { } // GetKey returns the Key field value -func (o *ErrorDetails) GetKey() string { +func (o *ErrorDetails) GetKey() ErrorDetailsKey { if o == nil { - var ret string + var ret ErrorDetailsKey return ret } @@ -151,7 +151,7 @@ func (o *ErrorDetails) GetKey() string { // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. -func (o *ErrorDetails) GetKeyOk() (*string, bool) { +func (o *ErrorDetails) GetKeyOk() (*ErrorDetailsKey, bool) { if o == nil { return nil, false } @@ -159,7 +159,7 @@ func (o *ErrorDetails) GetKeyOk() (*string, bool) { } // SetKey sets field value -func (o *ErrorDetails) SetKey(v string) { +func (o *ErrorDetails) SetKey(v ErrorDetailsKey) { o.Key = v } diff --git a/services/cdn/v1beta2api/model_error_details_key.go b/services/cdn/v1beta2api/model_error_details_key.go new file mode 100644 index 000000000..750050bfd --- /dev/null +++ b/services/cdn/v1beta2api/model_error_details_key.go @@ -0,0 +1,117 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// ErrorDetailsKey the model 'ErrorDetailsKey' +type ErrorDetailsKey string + +// List of ErrorDetails_key +const ( + ERRORDETAILSKEY_UNKNOWN ErrorDetailsKey = "UNKNOWN" + ERRORDETAILSKEY_CUSTOM_DOMAIN_CNAME_MISSING ErrorDetailsKey = "CUSTOM_DOMAIN_CNAME_MISSING" + ERRORDETAILSKEY_INVALID_ARGUMENT ErrorDetailsKey = "INVALID_ARGUMENT" + ERRORDETAILSKEY_LOG_SINK_INSTANCE_UNAVAILABLE ErrorDetailsKey = "LOG_SINK_INSTANCE_UNAVAILABLE" + ERRORDETAILSKEY_UNKNOWN_DEFAULT_OPEN_API ErrorDetailsKey = "unknown_default_open_api" +) + +// All allowed values of ErrorDetailsKey enum +var AllowedErrorDetailsKeyEnumValues = []ErrorDetailsKey{ + "UNKNOWN", + "CUSTOM_DOMAIN_CNAME_MISSING", + "INVALID_ARGUMENT", + "LOG_SINK_INSTANCE_UNAVAILABLE", + "unknown_default_open_api", +} + +func (v *ErrorDetailsKey) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ErrorDetailsKey(value) + for _, existing := range AllowedErrorDetailsKeyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ERRORDETAILSKEY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewErrorDetailsKeyFromValue returns a pointer to a valid ErrorDetailsKey +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewErrorDetailsKeyFromValue(v string) (*ErrorDetailsKey, error) { + ev := ErrorDetailsKey(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ErrorDetailsKey: valid values are %v", v, AllowedErrorDetailsKeyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ErrorDetailsKey) IsValid() bool { + for _, existing := range AllowedErrorDetailsKeyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ErrorDetails_key value +func (v ErrorDetailsKey) Ptr() *ErrorDetailsKey { + return &v +} + +type NullableErrorDetailsKey struct { + value *ErrorDetailsKey + isSet bool +} + +func (v NullableErrorDetailsKey) Get() *ErrorDetailsKey { + return v.value +} + +func (v *NullableErrorDetailsKey) Set(val *ErrorDetailsKey) { + v.value = val + v.isSet = true +} + +func (v NullableErrorDetailsKey) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorDetailsKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorDetailsKey(val *ErrorDetailsKey) *NullableErrorDetailsKey { + return &NullableErrorDetailsKey{value: val, isSet: true} +} + +func (v NullableErrorDetailsKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorDetailsKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_cache_info_response_history_entry.go b/services/cdn/v1beta2api/model_get_cache_info_response_history_entry.go index e73df6cea..478e8b6eb 100644 --- a/services/cdn/v1beta2api/model_get_cache_info_response_history_entry.go +++ b/services/cdn/v1beta2api/model_get_cache_info_response_history_entry.go @@ -21,8 +21,8 @@ var _ MappedNullable = &GetCacheInfoResponseHistoryEntry{} // GetCacheInfoResponseHistoryEntry struct for GetCacheInfoResponseHistoryEntry type GetCacheInfoResponseHistoryEntry struct { - OccurredAt time.Time `json:"occurredAt"` - Type string `json:"type"` + OccurredAt time.Time `json:"occurredAt"` + Type GetCacheInfoResponseHistoryEntryType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +32,7 @@ type _GetCacheInfoResponseHistoryEntry GetCacheInfoResponseHistoryEntry // 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 NewGetCacheInfoResponseHistoryEntry(occurredAt time.Time, types string) *GetCacheInfoResponseHistoryEntry { +func NewGetCacheInfoResponseHistoryEntry(occurredAt time.Time, types GetCacheInfoResponseHistoryEntryType) *GetCacheInfoResponseHistoryEntry { this := GetCacheInfoResponseHistoryEntry{} this.OccurredAt = occurredAt this.Type = types @@ -72,9 +72,9 @@ func (o *GetCacheInfoResponseHistoryEntry) SetOccurredAt(v time.Time) { } // GetType returns the Type field value -func (o *GetCacheInfoResponseHistoryEntry) GetType() string { +func (o *GetCacheInfoResponseHistoryEntry) GetType() GetCacheInfoResponseHistoryEntryType { if o == nil { - var ret string + var ret GetCacheInfoResponseHistoryEntryType return ret } @@ -83,7 +83,7 @@ func (o *GetCacheInfoResponseHistoryEntry) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*string, bool) { +func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*GetCacheInfoResponseHistoryEntryType, bool) { if o == nil { return nil, false } @@ -91,7 +91,7 @@ func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *GetCacheInfoResponseHistoryEntry) SetType(v string) { +func (o *GetCacheInfoResponseHistoryEntry) SetType(v GetCacheInfoResponseHistoryEntryType) { o.Type = v } diff --git a/services/cdn/v1beta2api/model_get_cache_info_response_history_entry_type.go b/services/cdn/v1beta2api/model_get_cache_info_response_history_entry_type.go new file mode 100644 index 000000000..817cfc517 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_cache_info_response_history_entry_type.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// GetCacheInfoResponseHistoryEntryType the model 'GetCacheInfoResponseHistoryEntryType' +type GetCacheInfoResponseHistoryEntryType string + +// List of GetCacheInfoResponseHistoryEntry_type +const ( + GETCACHEINFORESPONSEHISTORYENTRYTYPE_FULL GetCacheInfoResponseHistoryEntryType = "full" + GETCACHEINFORESPONSEHISTORYENTRYTYPE_GRANULAR GetCacheInfoResponseHistoryEntryType = "granular" + GETCACHEINFORESPONSEHISTORYENTRYTYPE_UNKNOWN_DEFAULT_OPEN_API GetCacheInfoResponseHistoryEntryType = "unknown_default_open_api" +) + +// All allowed values of GetCacheInfoResponseHistoryEntryType enum +var AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues = []GetCacheInfoResponseHistoryEntryType{ + "full", + "granular", + "unknown_default_open_api", +} + +func (v *GetCacheInfoResponseHistoryEntryType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetCacheInfoResponseHistoryEntryType(value) + for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETCACHEINFORESPONSEHISTORYENTRYTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetCacheInfoResponseHistoryEntryTypeFromValue returns a pointer to a valid GetCacheInfoResponseHistoryEntryType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetCacheInfoResponseHistoryEntryTypeFromValue(v string) (*GetCacheInfoResponseHistoryEntryType, error) { + ev := GetCacheInfoResponseHistoryEntryType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetCacheInfoResponseHistoryEntryType: valid values are %v", v, AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetCacheInfoResponseHistoryEntryType) IsValid() bool { + for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetCacheInfoResponseHistoryEntry_type value +func (v GetCacheInfoResponseHistoryEntryType) Ptr() *GetCacheInfoResponseHistoryEntryType { + return &v +} + +type NullableGetCacheInfoResponseHistoryEntryType struct { + value *GetCacheInfoResponseHistoryEntryType + isSet bool +} + +func (v NullableGetCacheInfoResponseHistoryEntryType) Get() *GetCacheInfoResponseHistoryEntryType { + return v.value +} + +func (v *NullableGetCacheInfoResponseHistoryEntryType) Set(val *GetCacheInfoResponseHistoryEntryType) { + v.value = val + v.isSet = true +} + +func (v NullableGetCacheInfoResponseHistoryEntryType) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCacheInfoResponseHistoryEntryType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCacheInfoResponseHistoryEntryType(val *GetCacheInfoResponseHistoryEntryType) *NullableGetCacheInfoResponseHistoryEntryType { + return &NullableGetCacheInfoResponseHistoryEntryType{value: val, isSet: true} +} + +func (v NullableGetCacheInfoResponseHistoryEntryType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCacheInfoResponseHistoryEntryType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_logs_search_filters_response.go b/services/cdn/v1beta2api/model_get_logs_search_filters_response.go index c99251b08..ed9131d9c 100644 --- a/services/cdn/v1beta2api/model_get_logs_search_filters_response.go +++ b/services/cdn/v1beta2api/model_get_logs_search_filters_response.go @@ -20,7 +20,7 @@ var _ MappedNullable = &GetLogsSearchFiltersResponse{} // GetLogsSearchFiltersResponse struct for GetLogsSearchFiltersResponse type GetLogsSearchFiltersResponse struct { - Cache []string `json:"cache"` + Cache []GetLogsSearchFiltersResponseCacheInner `json:"cache"` DataCenter GetLogsSearchFiltersResponseDatacenterBlock `json:"dataCenter"` // List of ISO-3166 Alpha2 Country Codes matching the input filter. Response is ordered in ascending order. For more Info about the country codes, see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 RemoteCountry []string `json:"remoteCountry"` @@ -35,7 +35,7 @@ type _GetLogsSearchFiltersResponse GetLogsSearchFiltersResponse // 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 NewGetLogsSearchFiltersResponse(cache []string, dataCenter GetLogsSearchFiltersResponseDatacenterBlock, remoteCountry []string, status []int32) *GetLogsSearchFiltersResponse { +func NewGetLogsSearchFiltersResponse(cache []GetLogsSearchFiltersResponseCacheInner, dataCenter GetLogsSearchFiltersResponseDatacenterBlock, remoteCountry []string, status []int32) *GetLogsSearchFiltersResponse { this := GetLogsSearchFiltersResponse{} this.Cache = cache this.DataCenter = dataCenter @@ -53,9 +53,9 @@ func NewGetLogsSearchFiltersResponseWithDefaults() *GetLogsSearchFiltersResponse } // GetCache returns the Cache field value -func (o *GetLogsSearchFiltersResponse) GetCache() []string { +func (o *GetLogsSearchFiltersResponse) GetCache() []GetLogsSearchFiltersResponseCacheInner { if o == nil { - var ret []string + var ret []GetLogsSearchFiltersResponseCacheInner return ret } @@ -64,7 +64,7 @@ func (o *GetLogsSearchFiltersResponse) GetCache() []string { // GetCacheOk returns a tuple with the Cache field value // and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponse) GetCacheOk() ([]string, bool) { +func (o *GetLogsSearchFiltersResponse) GetCacheOk() ([]GetLogsSearchFiltersResponseCacheInner, bool) { if o == nil { return nil, false } @@ -72,7 +72,7 @@ func (o *GetLogsSearchFiltersResponse) GetCacheOk() ([]string, bool) { } // SetCache sets field value -func (o *GetLogsSearchFiltersResponse) SetCache(v []string) { +func (o *GetLogsSearchFiltersResponse) SetCache(v []GetLogsSearchFiltersResponseCacheInner) { o.Cache = v } diff --git a/services/cdn/v1beta2api/model_get_logs_search_filters_response_cache_inner.go b/services/cdn/v1beta2api/model_get_logs_search_filters_response_cache_inner.go new file mode 100644 index 000000000..5eb52ffb6 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_logs_search_filters_response_cache_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// GetLogsSearchFiltersResponseCacheInner the model 'GetLogsSearchFiltersResponseCacheInner' +type GetLogsSearchFiltersResponseCacheInner string + +// List of GetLogsSearchFiltersResponse_cache_inner +const ( + GETLOGSSEARCHFILTERSRESPONSECACHEINNER_HIT GetLogsSearchFiltersResponseCacheInner = "HIT" + GETLOGSSEARCHFILTERSRESPONSECACHEINNER_MISS GetLogsSearchFiltersResponseCacheInner = "MISS" + GETLOGSSEARCHFILTERSRESPONSECACHEINNER_UNKNOWN_DEFAULT_OPEN_API GetLogsSearchFiltersResponseCacheInner = "unknown_default_open_api" +) + +// All allowed values of GetLogsSearchFiltersResponseCacheInner enum +var AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues = []GetLogsSearchFiltersResponseCacheInner{ + "HIT", + "MISS", + "unknown_default_open_api", +} + +func (v *GetLogsSearchFiltersResponseCacheInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetLogsSearchFiltersResponseCacheInner(value) + for _, existing := range AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETLOGSSEARCHFILTERSRESPONSECACHEINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetLogsSearchFiltersResponseCacheInnerFromValue returns a pointer to a valid GetLogsSearchFiltersResponseCacheInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetLogsSearchFiltersResponseCacheInnerFromValue(v string) (*GetLogsSearchFiltersResponseCacheInner, error) { + ev := GetLogsSearchFiltersResponseCacheInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetLogsSearchFiltersResponseCacheInner: valid values are %v", v, AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetLogsSearchFiltersResponseCacheInner) IsValid() bool { + for _, existing := range AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetLogsSearchFiltersResponse_cache_inner value +func (v GetLogsSearchFiltersResponseCacheInner) Ptr() *GetLogsSearchFiltersResponseCacheInner { + return &v +} + +type NullableGetLogsSearchFiltersResponseCacheInner struct { + value *GetLogsSearchFiltersResponseCacheInner + isSet bool +} + +func (v NullableGetLogsSearchFiltersResponseCacheInner) Get() *GetLogsSearchFiltersResponseCacheInner { + return v.value +} + +func (v *NullableGetLogsSearchFiltersResponseCacheInner) Set(val *GetLogsSearchFiltersResponseCacheInner) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSearchFiltersResponseCacheInner) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSearchFiltersResponseCacheInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSearchFiltersResponseCacheInner(val *GetLogsSearchFiltersResponseCacheInner) *NullableGetLogsSearchFiltersResponseCacheInner { + return &NullableGetLogsSearchFiltersResponseCacheInner{value: val, isSet: true} +} + +func (v NullableGetLogsSearchFiltersResponseCacheInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSearchFiltersResponseCacheInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_logs_sort_by_parameter.go b/services/cdn/v1beta2api/model_get_logs_sort_by_parameter.go new file mode 100644 index 000000000..b125a44e0 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_logs_sort_by_parameter.go @@ -0,0 +1,125 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// GetLogsSortByParameter the model 'GetLogsSortByParameter' +type GetLogsSortByParameter string + +// List of GetLogs_sortBy_parameter +const ( + GETLOGSSORTBYPARAMETER_TIMESTAMP GetLogsSortByParameter = "timestamp" + GETLOGSSORTBYPARAMETER_DATA_CENTER_REGION GetLogsSortByParameter = "dataCenterRegion" + GETLOGSSORTBYPARAMETER_REQUEST_COUNTRY_CODE GetLogsSortByParameter = "requestCountryCode" + GETLOGSSORTBYPARAMETER_STATUS_CODE GetLogsSortByParameter = "statusCode" + GETLOGSSORTBYPARAMETER_CACHE_HIT GetLogsSortByParameter = "cacheHit" + GETLOGSSORTBYPARAMETER_SIZE GetLogsSortByParameter = "size" + GETLOGSSORTBYPARAMETER_PATH GetLogsSortByParameter = "path" + GETLOGSSORTBYPARAMETER_HOST GetLogsSortByParameter = "host" + GETLOGSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetLogsSortByParameter = "unknown_default_open_api" +) + +// All allowed values of GetLogsSortByParameter enum +var AllowedGetLogsSortByParameterEnumValues = []GetLogsSortByParameter{ + "timestamp", + "dataCenterRegion", + "requestCountryCode", + "statusCode", + "cacheHit", + "size", + "path", + "host", + "unknown_default_open_api", +} + +func (v *GetLogsSortByParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetLogsSortByParameter(value) + for _, existing := range AllowedGetLogsSortByParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETLOGSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetLogsSortByParameterFromValue returns a pointer to a valid GetLogsSortByParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetLogsSortByParameterFromValue(v string) (*GetLogsSortByParameter, error) { + ev := GetLogsSortByParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetLogsSortByParameter: valid values are %v", v, AllowedGetLogsSortByParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetLogsSortByParameter) IsValid() bool { + for _, existing := range AllowedGetLogsSortByParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetLogs_sortBy_parameter value +func (v GetLogsSortByParameter) Ptr() *GetLogsSortByParameter { + return &v +} + +type NullableGetLogsSortByParameter struct { + value *GetLogsSortByParameter + isSet bool +} + +func (v NullableGetLogsSortByParameter) Get() *GetLogsSortByParameter { + return v.value +} + +func (v *NullableGetLogsSortByParameter) Set(val *GetLogsSortByParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSortByParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSortByParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSortByParameter(val *GetLogsSortByParameter) *NullableGetLogsSortByParameter { + return &NullableGetLogsSortByParameter{value: val, isSet: true} +} + +func (v NullableGetLogsSortByParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSortByParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_logs_sort_order_parameter.go b/services/cdn/v1beta2api/model_get_logs_sort_order_parameter.go new file mode 100644 index 000000000..8cccf9cb6 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_logs_sort_order_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// GetLogsSortOrderParameter the model 'GetLogsSortOrderParameter' +type GetLogsSortOrderParameter string + +// List of GetLogs_sortOrder_parameter +const ( + GETLOGSSORTORDERPARAMETER_ASCENDING GetLogsSortOrderParameter = "ascending" + GETLOGSSORTORDERPARAMETER_DESCENDING GetLogsSortOrderParameter = "descending" + GETLOGSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetLogsSortOrderParameter = "unknown_default_open_api" +) + +// All allowed values of GetLogsSortOrderParameter enum +var AllowedGetLogsSortOrderParameterEnumValues = []GetLogsSortOrderParameter{ + "ascending", + "descending", + "unknown_default_open_api", +} + +func (v *GetLogsSortOrderParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetLogsSortOrderParameter(value) + for _, existing := range AllowedGetLogsSortOrderParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETLOGSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetLogsSortOrderParameterFromValue returns a pointer to a valid GetLogsSortOrderParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetLogsSortOrderParameterFromValue(v string) (*GetLogsSortOrderParameter, error) { + ev := GetLogsSortOrderParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetLogsSortOrderParameter: valid values are %v", v, AllowedGetLogsSortOrderParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetLogsSortOrderParameter) IsValid() bool { + for _, existing := range AllowedGetLogsSortOrderParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetLogs_sortOrder_parameter value +func (v GetLogsSortOrderParameter) Ptr() *GetLogsSortOrderParameter { + return &v +} + +type NullableGetLogsSortOrderParameter struct { + value *GetLogsSortOrderParameter + isSet bool +} + +func (v NullableGetLogsSortOrderParameter) Get() *GetLogsSortOrderParameter { + return v.value +} + +func (v *NullableGetLogsSortOrderParameter) Set(val *GetLogsSortOrderParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSortOrderParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSortOrderParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSortOrderParameter(val *GetLogsSortOrderParameter) *NullableGetLogsSortOrderParameter { + return &NullableGetLogsSortOrderParameter{value: val, isSet: true} +} + +func (v NullableGetLogsSortOrderParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSortOrderParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_statistics_interval_parameter.go b/services/cdn/v1beta2api/model_get_statistics_interval_parameter.go new file mode 100644 index 000000000..c29155567 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_statistics_interval_parameter.go @@ -0,0 +1,117 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// GetStatisticsIntervalParameter the model 'GetStatisticsIntervalParameter' +type GetStatisticsIntervalParameter string + +// List of GetStatistics_interval_parameter +const ( + GETSTATISTICSINTERVALPARAMETER_HOURLY GetStatisticsIntervalParameter = "hourly" + GETSTATISTICSINTERVALPARAMETER_DAILY GetStatisticsIntervalParameter = "daily" + GETSTATISTICSINTERVALPARAMETER_MONTHLY GetStatisticsIntervalParameter = "monthly" + GETSTATISTICSINTERVALPARAMETER_YEARLY GetStatisticsIntervalParameter = "yearly" + GETSTATISTICSINTERVALPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetStatisticsIntervalParameter = "unknown_default_open_api" +) + +// All allowed values of GetStatisticsIntervalParameter enum +var AllowedGetStatisticsIntervalParameterEnumValues = []GetStatisticsIntervalParameter{ + "hourly", + "daily", + "monthly", + "yearly", + "unknown_default_open_api", +} + +func (v *GetStatisticsIntervalParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetStatisticsIntervalParameter(value) + for _, existing := range AllowedGetStatisticsIntervalParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETSTATISTICSINTERVALPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetStatisticsIntervalParameterFromValue returns a pointer to a valid GetStatisticsIntervalParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetStatisticsIntervalParameterFromValue(v string) (*GetStatisticsIntervalParameter, error) { + ev := GetStatisticsIntervalParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetStatisticsIntervalParameter: valid values are %v", v, AllowedGetStatisticsIntervalParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetStatisticsIntervalParameter) IsValid() bool { + for _, existing := range AllowedGetStatisticsIntervalParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetStatistics_interval_parameter value +func (v GetStatisticsIntervalParameter) Ptr() *GetStatisticsIntervalParameter { + return &v +} + +type NullableGetStatisticsIntervalParameter struct { + value *GetStatisticsIntervalParameter + isSet bool +} + +func (v NullableGetStatisticsIntervalParameter) Get() *GetStatisticsIntervalParameter { + return v.value +} + +func (v *NullableGetStatisticsIntervalParameter) Set(val *GetStatisticsIntervalParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetStatisticsIntervalParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStatisticsIntervalParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStatisticsIntervalParameter(val *GetStatisticsIntervalParameter) *NullableGetStatisticsIntervalParameter { + return &NullableGetStatisticsIntervalParameter{value: val, isSet: true} +} + +func (v NullableGetStatisticsIntervalParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStatisticsIntervalParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_list_distributions_sort_by_parameter.go b/services/cdn/v1beta2api/model_list_distributions_sort_by_parameter.go new file mode 100644 index 000000000..9a21c258f --- /dev/null +++ b/services/cdn/v1beta2api/model_list_distributions_sort_by_parameter.go @@ -0,0 +1,121 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// ListDistributionsSortByParameter the model 'ListDistributionsSortByParameter' +type ListDistributionsSortByParameter string + +// List of ListDistributions_sortBy_parameter +const ( + LISTDISTRIBUTIONSSORTBYPARAMETER_ID ListDistributionsSortByParameter = "id" + LISTDISTRIBUTIONSSORTBYPARAMETER_UPDATED_AT ListDistributionsSortByParameter = "updatedAt" + LISTDISTRIBUTIONSSORTBYPARAMETER_CREATED_AT ListDistributionsSortByParameter = "createdAt" + LISTDISTRIBUTIONSSORTBYPARAMETER_ORIGIN_URL ListDistributionsSortByParameter = "originUrl" + LISTDISTRIBUTIONSSORTBYPARAMETER_STATUS ListDistributionsSortByParameter = "status" + LISTDISTRIBUTIONSSORTBYPARAMETER_ORIGIN_URL_RELATED ListDistributionsSortByParameter = "originUrlRelated" + LISTDISTRIBUTIONSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDistributionsSortByParameter = "unknown_default_open_api" +) + +// All allowed values of ListDistributionsSortByParameter enum +var AllowedListDistributionsSortByParameterEnumValues = []ListDistributionsSortByParameter{ + "id", + "updatedAt", + "createdAt", + "originUrl", + "status", + "originUrlRelated", + "unknown_default_open_api", +} + +func (v *ListDistributionsSortByParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListDistributionsSortByParameter(value) + for _, existing := range AllowedListDistributionsSortByParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTDISTRIBUTIONSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListDistributionsSortByParameterFromValue returns a pointer to a valid ListDistributionsSortByParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListDistributionsSortByParameterFromValue(v string) (*ListDistributionsSortByParameter, error) { + ev := ListDistributionsSortByParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListDistributionsSortByParameter: valid values are %v", v, AllowedListDistributionsSortByParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListDistributionsSortByParameter) IsValid() bool { + for _, existing := range AllowedListDistributionsSortByParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListDistributions_sortBy_parameter value +func (v ListDistributionsSortByParameter) Ptr() *ListDistributionsSortByParameter { + return &v +} + +type NullableListDistributionsSortByParameter struct { + value *ListDistributionsSortByParameter + isSet bool +} + +func (v NullableListDistributionsSortByParameter) Get() *ListDistributionsSortByParameter { + return v.value +} + +func (v *NullableListDistributionsSortByParameter) Set(val *ListDistributionsSortByParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListDistributionsSortByParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListDistributionsSortByParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDistributionsSortByParameter(val *ListDistributionsSortByParameter) *NullableListDistributionsSortByParameter { + return &NullableListDistributionsSortByParameter{value: val, isSet: true} +} + +func (v NullableListDistributionsSortByParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDistributionsSortByParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_list_distributions_sort_order_parameter.go b/services/cdn/v1beta2api/model_list_distributions_sort_order_parameter.go new file mode 100644 index 000000000..d15513105 --- /dev/null +++ b/services/cdn/v1beta2api/model_list_distributions_sort_order_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// ListDistributionsSortOrderParameter the model 'ListDistributionsSortOrderParameter' +type ListDistributionsSortOrderParameter string + +// List of ListDistributions_sortOrder_parameter +const ( + LISTDISTRIBUTIONSSORTORDERPARAMETER_ASCENDING ListDistributionsSortOrderParameter = "ascending" + LISTDISTRIBUTIONSSORTORDERPARAMETER_DESCENDING ListDistributionsSortOrderParameter = "descending" + LISTDISTRIBUTIONSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDistributionsSortOrderParameter = "unknown_default_open_api" +) + +// All allowed values of ListDistributionsSortOrderParameter enum +var AllowedListDistributionsSortOrderParameterEnumValues = []ListDistributionsSortOrderParameter{ + "ascending", + "descending", + "unknown_default_open_api", +} + +func (v *ListDistributionsSortOrderParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListDistributionsSortOrderParameter(value) + for _, existing := range AllowedListDistributionsSortOrderParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTDISTRIBUTIONSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListDistributionsSortOrderParameterFromValue returns a pointer to a valid ListDistributionsSortOrderParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListDistributionsSortOrderParameterFromValue(v string) (*ListDistributionsSortOrderParameter, error) { + ev := ListDistributionsSortOrderParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListDistributionsSortOrderParameter: valid values are %v", v, AllowedListDistributionsSortOrderParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListDistributionsSortOrderParameter) IsValid() bool { + for _, existing := range AllowedListDistributionsSortOrderParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListDistributions_sortOrder_parameter value +func (v ListDistributionsSortOrderParameter) Ptr() *ListDistributionsSortOrderParameter { + return &v +} + +type NullableListDistributionsSortOrderParameter struct { + value *ListDistributionsSortOrderParameter + isSet bool +} + +func (v NullableListDistributionsSortOrderParameter) Get() *ListDistributionsSortOrderParameter { + return v.value +} + +func (v *NullableListDistributionsSortOrderParameter) Set(val *ListDistributionsSortOrderParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListDistributionsSortOrderParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListDistributionsSortOrderParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDistributionsSortOrderParameter(val *ListDistributionsSortOrderParameter) *NullableListDistributionsSortOrderParameter { + return &NullableListDistributionsSortOrderParameter{value: val, isSet: true} +} + +func (v NullableListDistributionsSortOrderParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDistributionsSortOrderParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_status_error.go b/services/cdn/v1beta2api/model_status_error.go index 335c7c0fd..ef7d575d1 100644 --- a/services/cdn/v1beta2api/model_status_error.go +++ b/services/cdn/v1beta2api/model_status_error.go @@ -23,9 +23,8 @@ type StatusError struct { // A german translation string corresponding to the error key. Note that we do not guarantee german translations are present. De *string `json:"de,omitempty"` // An english translation string corresponding to the error key. An english translation key is always present. - En string `json:"en"` - // An enum value that describes a Status Error. - Key string `json:"key"` + En string `json:"en"` + Key StatusErrorKey `json:"key"` AdditionalProperties map[string]interface{} } @@ -35,7 +34,7 @@ type _StatusError StatusError // 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 NewStatusError(en string, key string) *StatusError { +func NewStatusError(en string, key StatusErrorKey) *StatusError { this := StatusError{} this.En = en this.Key = key @@ -107,9 +106,9 @@ func (o *StatusError) SetEn(v string) { } // GetKey returns the Key field value -func (o *StatusError) GetKey() string { +func (o *StatusError) GetKey() StatusErrorKey { if o == nil { - var ret string + var ret StatusErrorKey return ret } @@ -118,7 +117,7 @@ func (o *StatusError) GetKey() string { // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. -func (o *StatusError) GetKeyOk() (*string, bool) { +func (o *StatusError) GetKeyOk() (*StatusErrorKey, bool) { if o == nil { return nil, false } @@ -126,7 +125,7 @@ func (o *StatusError) GetKeyOk() (*string, bool) { } // SetKey sets field value -func (o *StatusError) SetKey(v string) { +func (o *StatusError) SetKey(v StatusErrorKey) { o.Key = v } diff --git a/services/cdn/v1beta2api/model_status_error_key.go b/services/cdn/v1beta2api/model_status_error_key.go new file mode 100644 index 000000000..65f98df46 --- /dev/null +++ b/services/cdn/v1beta2api/model_status_error_key.go @@ -0,0 +1,121 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// StatusErrorKey An enum value that describes a Status Error. +type StatusErrorKey string + +// List of StatusError_key +const ( + STATUSERRORKEY_UNKNOWN StatusErrorKey = "UNKNOWN" + STATUSERRORKEY_CUSTOM_DOMAIN_CNAME_MISSING StatusErrorKey = "CUSTOM_DOMAIN_CNAME_MISSING" + STATUSERRORKEY_CUSTOM_DOMAIN_ALREADY_IN_USE StatusErrorKey = "CUSTOM_DOMAIN_ALREADY_IN_USE" + STATUSERRORKEY_PUBLIC_BETA_QUOTA_REACHED StatusErrorKey = "PUBLIC_BETA_QUOTA_REACHED" + STATUSERRORKEY_LOG_SINK_INSTANCE_UNAVAILABLE StatusErrorKey = "LOG_SINK_INSTANCE_UNAVAILABLE" + STATUSERRORKEY_EXTERNAL_QUOTA_REACHED StatusErrorKey = "EXTERNAL_QUOTA_REACHED" + STATUSERRORKEY_UNKNOWN_DEFAULT_OPEN_API StatusErrorKey = "unknown_default_open_api" +) + +// All allowed values of StatusErrorKey enum +var AllowedStatusErrorKeyEnumValues = []StatusErrorKey{ + "UNKNOWN", + "CUSTOM_DOMAIN_CNAME_MISSING", + "CUSTOM_DOMAIN_ALREADY_IN_USE", + "PUBLIC_BETA_QUOTA_REACHED", + "LOG_SINK_INSTANCE_UNAVAILABLE", + "EXTERNAL_QUOTA_REACHED", + "unknown_default_open_api", +} + +func (v *StatusErrorKey) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := StatusErrorKey(value) + for _, existing := range AllowedStatusErrorKeyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = STATUSERRORKEY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewStatusErrorKeyFromValue returns a pointer to a valid StatusErrorKey +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStatusErrorKeyFromValue(v string) (*StatusErrorKey, error) { + ev := StatusErrorKey(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for StatusErrorKey: valid values are %v", v, AllowedStatusErrorKeyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v StatusErrorKey) IsValid() bool { + for _, existing := range AllowedStatusErrorKeyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StatusError_key value +func (v StatusErrorKey) Ptr() *StatusErrorKey { + return &v +} + +type NullableStatusErrorKey struct { + value *StatusErrorKey + isSet bool +} + +func (v NullableStatusErrorKey) Get() *StatusErrorKey { + return v.value +} + +func (v *NullableStatusErrorKey) Set(val *StatusErrorKey) { + v.value = val + v.isSet = true +} + +func (v NullableStatusErrorKey) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusErrorKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusErrorKey(val *StatusErrorKey) *NullableStatusErrorKey { + return &NullableStatusErrorKey{value: val, isSet: true} +} + +func (v NullableStatusErrorKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusErrorKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/api_default.go b/services/cdn/v1betaapi/api_default.go index fa83c432f..eb355e84c 100644 --- a/services/cdn/v1betaapi/api_default.go +++ b/services/cdn/v1betaapi/api_default.go @@ -1627,8 +1627,8 @@ type ApiGetLogsRequest struct { wafAction *WAFRuleAction pageSize *int32 pageIdentifier *string - sortBy *string - sortOrder *string + sortBy *GetLogsSortByParameter + sortOrder *GetLogsSortOrderParameter dataCenterRegion *string requestCountryCode *string statusCode *int32 @@ -1666,12 +1666,12 @@ func (r ApiGetLogsRequest) PageIdentifier(pageIdentifier string) ApiGetLogsReque } // Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host` -func (r ApiGetLogsRequest) SortBy(sortBy string) ApiGetLogsRequest { +func (r ApiGetLogsRequest) SortBy(sortBy GetLogsSortByParameter) ApiGetLogsRequest { r.sortBy = &sortBy return r } -func (r ApiGetLogsRequest) SortOrder(sortOrder string) ApiGetLogsRequest { +func (r ApiGetLogsRequest) SortOrder(sortOrder GetLogsSortOrderParameter) ApiGetLogsRequest { r.sortOrder = &sortOrder return r } @@ -1771,7 +1771,7 @@ func (a *DefaultAPIService) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsRespons if r.sortBy != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") } else { - var defaultValue string = "timestamp" + var defaultValue GetLogsSortByParameter = "timestamp" parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") r.sortBy = &defaultValue } @@ -2087,7 +2087,7 @@ type ApiGetStatisticsRequest struct { distributionId string from *time.Time to *time.Time - interval *string + interval *GetStatisticsIntervalParameter } // the start of the time range for which statistics should be returned @@ -2103,7 +2103,7 @@ func (r ApiGetStatisticsRequest) To(to time.Time) ApiGetStatisticsRequest { } // Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z` -func (r ApiGetStatisticsRequest) Interval(interval string) ApiGetStatisticsRequest { +func (r ApiGetStatisticsRequest) Interval(interval GetStatisticsIntervalParameter) ApiGetStatisticsRequest { r.interval = &interval return r } @@ -2292,8 +2292,8 @@ type ApiListDistributionsRequest struct { pageSize *int32 withWafStatus *bool pageIdentifier *string - sortBy *string - sortOrder *string + sortBy *ListDistributionsSortByParameter + sortOrder *ListDistributionsSortOrderParameter } // Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) @@ -2315,12 +2315,12 @@ func (r ApiListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiLi } // The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. -func (r ApiListDistributionsRequest) SortBy(sortBy string) ApiListDistributionsRequest { +func (r ApiListDistributionsRequest) SortBy(sortBy ListDistributionsSortByParameter) ApiListDistributionsRequest { r.sortBy = &sortBy return r } -func (r ApiListDistributionsRequest) SortOrder(sortOrder string) ApiListDistributionsRequest { +func (r ApiListDistributionsRequest) SortOrder(sortOrder ListDistributionsSortOrderParameter) ApiListDistributionsRequest { r.sortOrder = &sortOrder return r } @@ -2394,7 +2394,7 @@ func (a *DefaultAPIService) ListDistributionsExecute(r ApiListDistributionsReque if r.sortBy != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") } else { - var defaultValue string = "createdAt" + var defaultValue ListDistributionsSortByParameter = "createdAt" parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") r.sortBy = &defaultValue } diff --git a/services/cdn/v1betaapi/model_distribution.go b/services/cdn/v1betaapi/model_distribution.go index f8aefbbdb..7f2f4cef4 100644 --- a/services/cdn/v1betaapi/model_distribution.go +++ b/services/cdn/v1betaapi/model_distribution.go @@ -26,11 +26,10 @@ type Distribution struct { CreatedAt time.Time `json:"createdAt"` Domains []Domain `json:"domains"` // This object may be present if, and only if the distribution has encountered an error state. - Errors []StatusError `json:"errors,omitempty"` - Id string `json:"id"` - ProjectId string `json:"projectId"` - // - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. - Status string `json:"status"` + Errors []StatusError `json:"errors,omitempty"` + Id string `json:"id"` + ProjectId string `json:"projectId"` + Status DistributionStatus `json:"status"` // RFC3339 string which returns the last time the distribution configuration was modified. UpdatedAt time.Time `json:"updatedAt"` Waf *DistributionWaf `json:"waf,omitempty"` @@ -43,7 +42,7 @@ type _Distribution Distribution // 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 NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status string, updatedAt time.Time) *Distribution { +func NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status DistributionStatus, updatedAt time.Time) *Distribution { this := Distribution{} this.Config = config this.CreatedAt = createdAt @@ -216,9 +215,9 @@ func (o *Distribution) SetProjectId(v string) { } // GetStatus returns the Status field value -func (o *Distribution) GetStatus() string { +func (o *Distribution) GetStatus() DistributionStatus { if o == nil { - var ret string + var ret DistributionStatus return ret } @@ -227,7 +226,7 @@ func (o *Distribution) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *Distribution) GetStatusOk() (*string, bool) { +func (o *Distribution) GetStatusOk() (*DistributionStatus, bool) { if o == nil { return nil, false } @@ -235,7 +234,7 @@ func (o *Distribution) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *Distribution) SetStatus(v string) { +func (o *Distribution) SetStatus(v DistributionStatus) { o.Status = v } diff --git a/services/cdn/v1betaapi/model_distribution_status.go b/services/cdn/v1betaapi/model_distribution_status.go new file mode 100644 index 000000000..53d65e5ad --- /dev/null +++ b/services/cdn/v1betaapi/model_distribution_status.go @@ -0,0 +1,119 @@ +/* +STACKIT CDN API (DEPRECATED) + +**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// DistributionStatus - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. +type DistributionStatus string + +// List of Distribution_status +const ( + DISTRIBUTIONSTATUS_CREATING DistributionStatus = "CREATING" + DISTRIBUTIONSTATUS_ACTIVE DistributionStatus = "ACTIVE" + DISTRIBUTIONSTATUS_UPDATING DistributionStatus = "UPDATING" + DISTRIBUTIONSTATUS_DELETING DistributionStatus = "DELETING" + DISTRIBUTIONSTATUS_ERROR DistributionStatus = "ERROR" + DISTRIBUTIONSTATUS_UNKNOWN_DEFAULT_OPEN_API DistributionStatus = "unknown_default_open_api" +) + +// All allowed values of DistributionStatus enum +var AllowedDistributionStatusEnumValues = []DistributionStatus{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "ERROR", + "unknown_default_open_api", +} + +func (v *DistributionStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DistributionStatus(value) + for _, existing := range AllowedDistributionStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DISTRIBUTIONSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDistributionStatusFromValue returns a pointer to a valid DistributionStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDistributionStatusFromValue(v string) (*DistributionStatus, error) { + ev := DistributionStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DistributionStatus: valid values are %v", v, AllowedDistributionStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DistributionStatus) IsValid() bool { + for _, existing := range AllowedDistributionStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Distribution_status value +func (v DistributionStatus) Ptr() *DistributionStatus { + return &v +} + +type NullableDistributionStatus struct { + value *DistributionStatus + isSet bool +} + +func (v NullableDistributionStatus) Get() *DistributionStatus { + return v.value +} + +func (v *NullableDistributionStatus) Set(val *DistributionStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatus(val *DistributionStatus) *NullableDistributionStatus { + return &NullableDistributionStatus{value: val, isSet: true} +} + +func (v NullableDistributionStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_domain.go b/services/cdn/v1betaapi/model_domain.go index 384d08e61..76d329d1e 100644 --- a/services/cdn/v1betaapi/model_domain.go +++ b/services/cdn/v1betaapi/model_domain.go @@ -23,10 +23,9 @@ type Domain struct { // This object is present if the custom domain has errors. Errors []StatusError `json:"errors,omitempty"` // The domain. If this is a custom domain, you can call the GetCustomDomain Endpoint - Name string `json:"name"` - Status DomainStatus `json:"status"` - // Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint - Type string `json:"type"` + Name string `json:"name"` + Status DomainStatus `json:"status"` + Type DomainType `json:"type"` AdditionalProperties map[string]interface{} } @@ -36,7 +35,7 @@ type _Domain Domain // 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 NewDomain(name string, status DomainStatus, types string) *Domain { +func NewDomain(name string, status DomainStatus, types DomainType) *Domain { this := Domain{} this.Name = name this.Status = status @@ -133,9 +132,9 @@ func (o *Domain) SetStatus(v DomainStatus) { } // GetType returns the Type field value -func (o *Domain) GetType() string { +func (o *Domain) GetType() DomainType { if o == nil { - var ret string + var ret DomainType return ret } @@ -144,7 +143,7 @@ func (o *Domain) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *Domain) GetTypeOk() (*string, bool) { +func (o *Domain) GetTypeOk() (*DomainType, bool) { if o == nil { return nil, false } @@ -152,7 +151,7 @@ func (o *Domain) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *Domain) SetType(v string) { +func (o *Domain) SetType(v DomainType) { o.Type = v } diff --git a/services/cdn/v1betaapi/model_domain_type.go b/services/cdn/v1betaapi/model_domain_type.go new file mode 100644 index 000000000..bc0fcd9aa --- /dev/null +++ b/services/cdn/v1betaapi/model_domain_type.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API (DEPRECATED) + +**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// DomainType Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint +type DomainType string + +// List of Domain_type +const ( + DOMAINTYPE_MANAGED DomainType = "managed" + DOMAINTYPE_CUSTOM DomainType = "custom" + DOMAINTYPE_UNKNOWN_DEFAULT_OPEN_API DomainType = "unknown_default_open_api" +) + +// All allowed values of DomainType enum +var AllowedDomainTypeEnumValues = []DomainType{ + "managed", + "custom", + "unknown_default_open_api", +} + +func (v *DomainType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DomainType(value) + for _, existing := range AllowedDomainTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DOMAINTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDomainTypeFromValue returns a pointer to a valid DomainType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDomainTypeFromValue(v string) (*DomainType, error) { + ev := DomainType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DomainType: valid values are %v", v, AllowedDomainTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DomainType) IsValid() bool { + for _, existing := range AllowedDomainTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Domain_type value +func (v DomainType) Ptr() *DomainType { + return &v +} + +type NullableDomainType struct { + value *DomainType + isSet bool +} + +func (v NullableDomainType) Get() *DomainType { + return v.value +} + +func (v *NullableDomainType) Set(val *DomainType) { + v.value = val + v.isSet = true +} + +func (v NullableDomainType) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainType(val *DomainType) *NullableDomainType { + return &NullableDomainType{value: val, isSet: true} +} + +func (v NullableDomainType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_error_details.go b/services/cdn/v1betaapi/model_error_details.go index dfe0c26c7..d58cc27aa 100644 --- a/services/cdn/v1betaapi/model_error_details.go +++ b/services/cdn/v1betaapi/model_error_details.go @@ -27,8 +27,8 @@ type ErrorDetails struct { // English description of the error En string `json:"en"` // Optional field in the request this error detail refers to - Field *string `json:"field,omitempty"` - Key string `json:"key"` + Field *string `json:"field,omitempty"` + Key ErrorDetailsKey `json:"key"` AdditionalProperties map[string]interface{} } @@ -38,7 +38,7 @@ type _ErrorDetails ErrorDetails // 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 NewErrorDetails(description string, en string, key string) *ErrorDetails { +func NewErrorDetails(description string, en string, key ErrorDetailsKey) *ErrorDetails { this := ErrorDetails{} this.Description = description this.En = en @@ -170,9 +170,9 @@ func (o *ErrorDetails) SetField(v string) { } // GetKey returns the Key field value -func (o *ErrorDetails) GetKey() string { +func (o *ErrorDetails) GetKey() ErrorDetailsKey { if o == nil { - var ret string + var ret ErrorDetailsKey return ret } @@ -181,7 +181,7 @@ func (o *ErrorDetails) GetKey() string { // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. -func (o *ErrorDetails) GetKeyOk() (*string, bool) { +func (o *ErrorDetails) GetKeyOk() (*ErrorDetailsKey, bool) { if o == nil { return nil, false } @@ -189,7 +189,7 @@ func (o *ErrorDetails) GetKeyOk() (*string, bool) { } // SetKey sets field value -func (o *ErrorDetails) SetKey(v string) { +func (o *ErrorDetails) SetKey(v ErrorDetailsKey) { o.Key = v } diff --git a/services/cdn/v1betaapi/model_error_details_key.go b/services/cdn/v1betaapi/model_error_details_key.go new file mode 100644 index 000000000..17f40fe25 --- /dev/null +++ b/services/cdn/v1betaapi/model_error_details_key.go @@ -0,0 +1,117 @@ +/* +STACKIT CDN API (DEPRECATED) + +**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ErrorDetailsKey the model 'ErrorDetailsKey' +type ErrorDetailsKey string + +// List of ErrorDetails_key +const ( + ERRORDETAILSKEY_UNKNOWN ErrorDetailsKey = "UNKNOWN" + ERRORDETAILSKEY_CUSTOM_DOMAIN_CNAME_MISSING ErrorDetailsKey = "CUSTOM_DOMAIN_CNAME_MISSING" + ERRORDETAILSKEY_INVALID_ARGUMENT ErrorDetailsKey = "INVALID_ARGUMENT" + ERRORDETAILSKEY_LOG_SINK_INSTANCE_UNAVAILABLE ErrorDetailsKey = "LOG_SINK_INSTANCE_UNAVAILABLE" + ERRORDETAILSKEY_UNKNOWN_DEFAULT_OPEN_API ErrorDetailsKey = "unknown_default_open_api" +) + +// All allowed values of ErrorDetailsKey enum +var AllowedErrorDetailsKeyEnumValues = []ErrorDetailsKey{ + "UNKNOWN", + "CUSTOM_DOMAIN_CNAME_MISSING", + "INVALID_ARGUMENT", + "LOG_SINK_INSTANCE_UNAVAILABLE", + "unknown_default_open_api", +} + +func (v *ErrorDetailsKey) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ErrorDetailsKey(value) + for _, existing := range AllowedErrorDetailsKeyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ERRORDETAILSKEY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewErrorDetailsKeyFromValue returns a pointer to a valid ErrorDetailsKey +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewErrorDetailsKeyFromValue(v string) (*ErrorDetailsKey, error) { + ev := ErrorDetailsKey(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ErrorDetailsKey: valid values are %v", v, AllowedErrorDetailsKeyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ErrorDetailsKey) IsValid() bool { + for _, existing := range AllowedErrorDetailsKeyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ErrorDetails_key value +func (v ErrorDetailsKey) Ptr() *ErrorDetailsKey { + return &v +} + +type NullableErrorDetailsKey struct { + value *ErrorDetailsKey + isSet bool +} + +func (v NullableErrorDetailsKey) Get() *ErrorDetailsKey { + return v.value +} + +func (v *NullableErrorDetailsKey) Set(val *ErrorDetailsKey) { + v.value = val + v.isSet = true +} + +func (v NullableErrorDetailsKey) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorDetailsKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorDetailsKey(val *ErrorDetailsKey) *NullableErrorDetailsKey { + return &NullableErrorDetailsKey{value: val, isSet: true} +} + +func (v NullableErrorDetailsKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorDetailsKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_cache_info_response_history_entry.go b/services/cdn/v1betaapi/model_get_cache_info_response_history_entry.go index d132265ea..e2856a6bf 100644 --- a/services/cdn/v1betaapi/model_get_cache_info_response_history_entry.go +++ b/services/cdn/v1betaapi/model_get_cache_info_response_history_entry.go @@ -22,9 +22,9 @@ var _ MappedNullable = &GetCacheInfoResponseHistoryEntry{} // GetCacheInfoResponseHistoryEntry struct for GetCacheInfoResponseHistoryEntry type GetCacheInfoResponseHistoryEntry struct { // Deprecated - OccuredAt time.Time `json:"occuredAt"` - OccurredAt time.Time `json:"occurredAt"` - Type string `json:"type"` + OccuredAt time.Time `json:"occuredAt"` + OccurredAt time.Time `json:"occurredAt"` + Type GetCacheInfoResponseHistoryEntryType `json:"type"` AdditionalProperties map[string]interface{} } @@ -34,7 +34,7 @@ type _GetCacheInfoResponseHistoryEntry GetCacheInfoResponseHistoryEntry // 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 NewGetCacheInfoResponseHistoryEntry(occuredAt time.Time, occurredAt time.Time, types string) *GetCacheInfoResponseHistoryEntry { +func NewGetCacheInfoResponseHistoryEntry(occuredAt time.Time, occurredAt time.Time, types GetCacheInfoResponseHistoryEntryType) *GetCacheInfoResponseHistoryEntry { this := GetCacheInfoResponseHistoryEntry{} this.OccuredAt = occuredAt this.OccurredAt = occurredAt @@ -102,9 +102,9 @@ func (o *GetCacheInfoResponseHistoryEntry) SetOccurredAt(v time.Time) { } // GetType returns the Type field value -func (o *GetCacheInfoResponseHistoryEntry) GetType() string { +func (o *GetCacheInfoResponseHistoryEntry) GetType() GetCacheInfoResponseHistoryEntryType { if o == nil { - var ret string + var ret GetCacheInfoResponseHistoryEntryType return ret } @@ -113,7 +113,7 @@ func (o *GetCacheInfoResponseHistoryEntry) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*string, bool) { +func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*GetCacheInfoResponseHistoryEntryType, bool) { if o == nil { return nil, false } @@ -121,7 +121,7 @@ func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *GetCacheInfoResponseHistoryEntry) SetType(v string) { +func (o *GetCacheInfoResponseHistoryEntry) SetType(v GetCacheInfoResponseHistoryEntryType) { o.Type = v } diff --git a/services/cdn/v1betaapi/model_get_cache_info_response_history_entry_type.go b/services/cdn/v1betaapi/model_get_cache_info_response_history_entry_type.go new file mode 100644 index 000000000..bef997ddd --- /dev/null +++ b/services/cdn/v1betaapi/model_get_cache_info_response_history_entry_type.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API (DEPRECATED) + +**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// GetCacheInfoResponseHistoryEntryType the model 'GetCacheInfoResponseHistoryEntryType' +type GetCacheInfoResponseHistoryEntryType string + +// List of GetCacheInfoResponseHistoryEntry_type +const ( + GETCACHEINFORESPONSEHISTORYENTRYTYPE_FULL GetCacheInfoResponseHistoryEntryType = "full" + GETCACHEINFORESPONSEHISTORYENTRYTYPE_GRANULAR GetCacheInfoResponseHistoryEntryType = "granular" + GETCACHEINFORESPONSEHISTORYENTRYTYPE_UNKNOWN_DEFAULT_OPEN_API GetCacheInfoResponseHistoryEntryType = "unknown_default_open_api" +) + +// All allowed values of GetCacheInfoResponseHistoryEntryType enum +var AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues = []GetCacheInfoResponseHistoryEntryType{ + "full", + "granular", + "unknown_default_open_api", +} + +func (v *GetCacheInfoResponseHistoryEntryType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetCacheInfoResponseHistoryEntryType(value) + for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETCACHEINFORESPONSEHISTORYENTRYTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetCacheInfoResponseHistoryEntryTypeFromValue returns a pointer to a valid GetCacheInfoResponseHistoryEntryType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetCacheInfoResponseHistoryEntryTypeFromValue(v string) (*GetCacheInfoResponseHistoryEntryType, error) { + ev := GetCacheInfoResponseHistoryEntryType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetCacheInfoResponseHistoryEntryType: valid values are %v", v, AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetCacheInfoResponseHistoryEntryType) IsValid() bool { + for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetCacheInfoResponseHistoryEntry_type value +func (v GetCacheInfoResponseHistoryEntryType) Ptr() *GetCacheInfoResponseHistoryEntryType { + return &v +} + +type NullableGetCacheInfoResponseHistoryEntryType struct { + value *GetCacheInfoResponseHistoryEntryType + isSet bool +} + +func (v NullableGetCacheInfoResponseHistoryEntryType) Get() *GetCacheInfoResponseHistoryEntryType { + return v.value +} + +func (v *NullableGetCacheInfoResponseHistoryEntryType) Set(val *GetCacheInfoResponseHistoryEntryType) { + v.value = val + v.isSet = true +} + +func (v NullableGetCacheInfoResponseHistoryEntryType) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCacheInfoResponseHistoryEntryType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCacheInfoResponseHistoryEntryType(val *GetCacheInfoResponseHistoryEntryType) *NullableGetCacheInfoResponseHistoryEntryType { + return &NullableGetCacheInfoResponseHistoryEntryType{value: val, isSet: true} +} + +func (v NullableGetCacheInfoResponseHistoryEntryType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCacheInfoResponseHistoryEntryType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_logs_sort_by_parameter.go b/services/cdn/v1betaapi/model_get_logs_sort_by_parameter.go new file mode 100644 index 000000000..73c898df9 --- /dev/null +++ b/services/cdn/v1betaapi/model_get_logs_sort_by_parameter.go @@ -0,0 +1,125 @@ +/* +STACKIT CDN API (DEPRECATED) + +**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// GetLogsSortByParameter the model 'GetLogsSortByParameter' +type GetLogsSortByParameter string + +// List of GetLogs_sortBy_parameter +const ( + GETLOGSSORTBYPARAMETER_TIMESTAMP GetLogsSortByParameter = "timestamp" + GETLOGSSORTBYPARAMETER_DATA_CENTER_REGION GetLogsSortByParameter = "dataCenterRegion" + GETLOGSSORTBYPARAMETER_REQUEST_COUNTRY_CODE GetLogsSortByParameter = "requestCountryCode" + GETLOGSSORTBYPARAMETER_STATUS_CODE GetLogsSortByParameter = "statusCode" + GETLOGSSORTBYPARAMETER_CACHE_HIT GetLogsSortByParameter = "cacheHit" + GETLOGSSORTBYPARAMETER_SIZE GetLogsSortByParameter = "size" + GETLOGSSORTBYPARAMETER_PATH GetLogsSortByParameter = "path" + GETLOGSSORTBYPARAMETER_HOST GetLogsSortByParameter = "host" + GETLOGSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetLogsSortByParameter = "unknown_default_open_api" +) + +// All allowed values of GetLogsSortByParameter enum +var AllowedGetLogsSortByParameterEnumValues = []GetLogsSortByParameter{ + "timestamp", + "dataCenterRegion", + "requestCountryCode", + "statusCode", + "cacheHit", + "size", + "path", + "host", + "unknown_default_open_api", +} + +func (v *GetLogsSortByParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetLogsSortByParameter(value) + for _, existing := range AllowedGetLogsSortByParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETLOGSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetLogsSortByParameterFromValue returns a pointer to a valid GetLogsSortByParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetLogsSortByParameterFromValue(v string) (*GetLogsSortByParameter, error) { + ev := GetLogsSortByParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetLogsSortByParameter: valid values are %v", v, AllowedGetLogsSortByParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetLogsSortByParameter) IsValid() bool { + for _, existing := range AllowedGetLogsSortByParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetLogs_sortBy_parameter value +func (v GetLogsSortByParameter) Ptr() *GetLogsSortByParameter { + return &v +} + +type NullableGetLogsSortByParameter struct { + value *GetLogsSortByParameter + isSet bool +} + +func (v NullableGetLogsSortByParameter) Get() *GetLogsSortByParameter { + return v.value +} + +func (v *NullableGetLogsSortByParameter) Set(val *GetLogsSortByParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSortByParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSortByParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSortByParameter(val *GetLogsSortByParameter) *NullableGetLogsSortByParameter { + return &NullableGetLogsSortByParameter{value: val, isSet: true} +} + +func (v NullableGetLogsSortByParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSortByParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_logs_sort_order_parameter.go b/services/cdn/v1betaapi/model_get_logs_sort_order_parameter.go new file mode 100644 index 000000000..b6653de5f --- /dev/null +++ b/services/cdn/v1betaapi/model_get_logs_sort_order_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API (DEPRECATED) + +**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// GetLogsSortOrderParameter the model 'GetLogsSortOrderParameter' +type GetLogsSortOrderParameter string + +// List of GetLogs_sortOrder_parameter +const ( + GETLOGSSORTORDERPARAMETER_ASCENDING GetLogsSortOrderParameter = "ascending" + GETLOGSSORTORDERPARAMETER_DESCENDING GetLogsSortOrderParameter = "descending" + GETLOGSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetLogsSortOrderParameter = "unknown_default_open_api" +) + +// All allowed values of GetLogsSortOrderParameter enum +var AllowedGetLogsSortOrderParameterEnumValues = []GetLogsSortOrderParameter{ + "ascending", + "descending", + "unknown_default_open_api", +} + +func (v *GetLogsSortOrderParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetLogsSortOrderParameter(value) + for _, existing := range AllowedGetLogsSortOrderParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETLOGSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetLogsSortOrderParameterFromValue returns a pointer to a valid GetLogsSortOrderParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetLogsSortOrderParameterFromValue(v string) (*GetLogsSortOrderParameter, error) { + ev := GetLogsSortOrderParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetLogsSortOrderParameter: valid values are %v", v, AllowedGetLogsSortOrderParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetLogsSortOrderParameter) IsValid() bool { + for _, existing := range AllowedGetLogsSortOrderParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetLogs_sortOrder_parameter value +func (v GetLogsSortOrderParameter) Ptr() *GetLogsSortOrderParameter { + return &v +} + +type NullableGetLogsSortOrderParameter struct { + value *GetLogsSortOrderParameter + isSet bool +} + +func (v NullableGetLogsSortOrderParameter) Get() *GetLogsSortOrderParameter { + return v.value +} + +func (v *NullableGetLogsSortOrderParameter) Set(val *GetLogsSortOrderParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSortOrderParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSortOrderParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSortOrderParameter(val *GetLogsSortOrderParameter) *NullableGetLogsSortOrderParameter { + return &NullableGetLogsSortOrderParameter{value: val, isSet: true} +} + +func (v NullableGetLogsSortOrderParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSortOrderParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_statistics_interval_parameter.go b/services/cdn/v1betaapi/model_get_statistics_interval_parameter.go new file mode 100644 index 000000000..e7efdfc0d --- /dev/null +++ b/services/cdn/v1betaapi/model_get_statistics_interval_parameter.go @@ -0,0 +1,117 @@ +/* +STACKIT CDN API (DEPRECATED) + +**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// GetStatisticsIntervalParameter the model 'GetStatisticsIntervalParameter' +type GetStatisticsIntervalParameter string + +// List of GetStatistics_interval_parameter +const ( + GETSTATISTICSINTERVALPARAMETER_HOURLY GetStatisticsIntervalParameter = "hourly" + GETSTATISTICSINTERVALPARAMETER_DAILY GetStatisticsIntervalParameter = "daily" + GETSTATISTICSINTERVALPARAMETER_MONTHLY GetStatisticsIntervalParameter = "monthly" + GETSTATISTICSINTERVALPARAMETER_YEARLY GetStatisticsIntervalParameter = "yearly" + GETSTATISTICSINTERVALPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetStatisticsIntervalParameter = "unknown_default_open_api" +) + +// All allowed values of GetStatisticsIntervalParameter enum +var AllowedGetStatisticsIntervalParameterEnumValues = []GetStatisticsIntervalParameter{ + "hourly", + "daily", + "monthly", + "yearly", + "unknown_default_open_api", +} + +func (v *GetStatisticsIntervalParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetStatisticsIntervalParameter(value) + for _, existing := range AllowedGetStatisticsIntervalParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETSTATISTICSINTERVALPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetStatisticsIntervalParameterFromValue returns a pointer to a valid GetStatisticsIntervalParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetStatisticsIntervalParameterFromValue(v string) (*GetStatisticsIntervalParameter, error) { + ev := GetStatisticsIntervalParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetStatisticsIntervalParameter: valid values are %v", v, AllowedGetStatisticsIntervalParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetStatisticsIntervalParameter) IsValid() bool { + for _, existing := range AllowedGetStatisticsIntervalParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetStatistics_interval_parameter value +func (v GetStatisticsIntervalParameter) Ptr() *GetStatisticsIntervalParameter { + return &v +} + +type NullableGetStatisticsIntervalParameter struct { + value *GetStatisticsIntervalParameter + isSet bool +} + +func (v NullableGetStatisticsIntervalParameter) Get() *GetStatisticsIntervalParameter { + return v.value +} + +func (v *NullableGetStatisticsIntervalParameter) Set(val *GetStatisticsIntervalParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetStatisticsIntervalParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStatisticsIntervalParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStatisticsIntervalParameter(val *GetStatisticsIntervalParameter) *NullableGetStatisticsIntervalParameter { + return &NullableGetStatisticsIntervalParameter{value: val, isSet: true} +} + +func (v NullableGetStatisticsIntervalParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStatisticsIntervalParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_list_distributions_sort_by_parameter.go b/services/cdn/v1betaapi/model_list_distributions_sort_by_parameter.go new file mode 100644 index 000000000..9de425752 --- /dev/null +++ b/services/cdn/v1betaapi/model_list_distributions_sort_by_parameter.go @@ -0,0 +1,121 @@ +/* +STACKIT CDN API (DEPRECATED) + +**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ListDistributionsSortByParameter the model 'ListDistributionsSortByParameter' +type ListDistributionsSortByParameter string + +// List of ListDistributions_sortBy_parameter +const ( + LISTDISTRIBUTIONSSORTBYPARAMETER_ID ListDistributionsSortByParameter = "id" + LISTDISTRIBUTIONSSORTBYPARAMETER_UPDATED_AT ListDistributionsSortByParameter = "updatedAt" + LISTDISTRIBUTIONSSORTBYPARAMETER_CREATED_AT ListDistributionsSortByParameter = "createdAt" + LISTDISTRIBUTIONSSORTBYPARAMETER_ORIGIN_URL ListDistributionsSortByParameter = "originUrl" + LISTDISTRIBUTIONSSORTBYPARAMETER_STATUS ListDistributionsSortByParameter = "status" + LISTDISTRIBUTIONSSORTBYPARAMETER_ORIGIN_URL_RELATED ListDistributionsSortByParameter = "originUrlRelated" + LISTDISTRIBUTIONSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDistributionsSortByParameter = "unknown_default_open_api" +) + +// All allowed values of ListDistributionsSortByParameter enum +var AllowedListDistributionsSortByParameterEnumValues = []ListDistributionsSortByParameter{ + "id", + "updatedAt", + "createdAt", + "originUrl", + "status", + "originUrlRelated", + "unknown_default_open_api", +} + +func (v *ListDistributionsSortByParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListDistributionsSortByParameter(value) + for _, existing := range AllowedListDistributionsSortByParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTDISTRIBUTIONSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListDistributionsSortByParameterFromValue returns a pointer to a valid ListDistributionsSortByParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListDistributionsSortByParameterFromValue(v string) (*ListDistributionsSortByParameter, error) { + ev := ListDistributionsSortByParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListDistributionsSortByParameter: valid values are %v", v, AllowedListDistributionsSortByParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListDistributionsSortByParameter) IsValid() bool { + for _, existing := range AllowedListDistributionsSortByParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListDistributions_sortBy_parameter value +func (v ListDistributionsSortByParameter) Ptr() *ListDistributionsSortByParameter { + return &v +} + +type NullableListDistributionsSortByParameter struct { + value *ListDistributionsSortByParameter + isSet bool +} + +func (v NullableListDistributionsSortByParameter) Get() *ListDistributionsSortByParameter { + return v.value +} + +func (v *NullableListDistributionsSortByParameter) Set(val *ListDistributionsSortByParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListDistributionsSortByParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListDistributionsSortByParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDistributionsSortByParameter(val *ListDistributionsSortByParameter) *NullableListDistributionsSortByParameter { + return &NullableListDistributionsSortByParameter{value: val, isSet: true} +} + +func (v NullableListDistributionsSortByParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDistributionsSortByParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_list_distributions_sort_order_parameter.go b/services/cdn/v1betaapi/model_list_distributions_sort_order_parameter.go new file mode 100644 index 000000000..d8f96d62c --- /dev/null +++ b/services/cdn/v1betaapi/model_list_distributions_sort_order_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT CDN API (DEPRECATED) + +**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ListDistributionsSortOrderParameter the model 'ListDistributionsSortOrderParameter' +type ListDistributionsSortOrderParameter string + +// List of ListDistributions_sortOrder_parameter +const ( + LISTDISTRIBUTIONSSORTORDERPARAMETER_ASCENDING ListDistributionsSortOrderParameter = "ascending" + LISTDISTRIBUTIONSSORTORDERPARAMETER_DESCENDING ListDistributionsSortOrderParameter = "descending" + LISTDISTRIBUTIONSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDistributionsSortOrderParameter = "unknown_default_open_api" +) + +// All allowed values of ListDistributionsSortOrderParameter enum +var AllowedListDistributionsSortOrderParameterEnumValues = []ListDistributionsSortOrderParameter{ + "ascending", + "descending", + "unknown_default_open_api", +} + +func (v *ListDistributionsSortOrderParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListDistributionsSortOrderParameter(value) + for _, existing := range AllowedListDistributionsSortOrderParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTDISTRIBUTIONSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListDistributionsSortOrderParameterFromValue returns a pointer to a valid ListDistributionsSortOrderParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListDistributionsSortOrderParameterFromValue(v string) (*ListDistributionsSortOrderParameter, error) { + ev := ListDistributionsSortOrderParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListDistributionsSortOrderParameter: valid values are %v", v, AllowedListDistributionsSortOrderParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListDistributionsSortOrderParameter) IsValid() bool { + for _, existing := range AllowedListDistributionsSortOrderParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListDistributions_sortOrder_parameter value +func (v ListDistributionsSortOrderParameter) Ptr() *ListDistributionsSortOrderParameter { + return &v +} + +type NullableListDistributionsSortOrderParameter struct { + value *ListDistributionsSortOrderParameter + isSet bool +} + +func (v NullableListDistributionsSortOrderParameter) Get() *ListDistributionsSortOrderParameter { + return v.value +} + +func (v *NullableListDistributionsSortOrderParameter) Set(val *ListDistributionsSortOrderParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListDistributionsSortOrderParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListDistributionsSortOrderParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDistributionsSortOrderParameter(val *ListDistributionsSortOrderParameter) *NullableListDistributionsSortOrderParameter { + return &NullableListDistributionsSortOrderParameter{value: val, isSet: true} +} + +func (v NullableListDistributionsSortOrderParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDistributionsSortOrderParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_status_error.go b/services/cdn/v1betaapi/model_status_error.go index c92e72406..dc4a3b6b5 100644 --- a/services/cdn/v1betaapi/model_status_error.go +++ b/services/cdn/v1betaapi/model_status_error.go @@ -23,9 +23,8 @@ type StatusError struct { // A german translation string corresponding to the error key. Note that we do not guarantee german translations are present. De *string `json:"de,omitempty"` // An english translation string corresponding to the error key. An english translation key is always present. - En string `json:"en"` - // An enum value that describes a Status Error. - Key string `json:"key"` + En string `json:"en"` + Key StatusErrorKey `json:"key"` AdditionalProperties map[string]interface{} } @@ -35,7 +34,7 @@ type _StatusError StatusError // 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 NewStatusError(en string, key string) *StatusError { +func NewStatusError(en string, key StatusErrorKey) *StatusError { this := StatusError{} this.En = en this.Key = key @@ -107,9 +106,9 @@ func (o *StatusError) SetEn(v string) { } // GetKey returns the Key field value -func (o *StatusError) GetKey() string { +func (o *StatusError) GetKey() StatusErrorKey { if o == nil { - var ret string + var ret StatusErrorKey return ret } @@ -118,7 +117,7 @@ func (o *StatusError) GetKey() string { // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. -func (o *StatusError) GetKeyOk() (*string, bool) { +func (o *StatusError) GetKeyOk() (*StatusErrorKey, bool) { if o == nil { return nil, false } @@ -126,7 +125,7 @@ func (o *StatusError) GetKeyOk() (*string, bool) { } // SetKey sets field value -func (o *StatusError) SetKey(v string) { +func (o *StatusError) SetKey(v StatusErrorKey) { o.Key = v } diff --git a/services/cdn/v1betaapi/model_status_error_key.go b/services/cdn/v1betaapi/model_status_error_key.go new file mode 100644 index 000000000..dead865dd --- /dev/null +++ b/services/cdn/v1betaapi/model_status_error_key.go @@ -0,0 +1,121 @@ +/* +STACKIT CDN API (DEPRECATED) + +**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// StatusErrorKey An enum value that describes a Status Error. +type StatusErrorKey string + +// List of StatusError_key +const ( + STATUSERRORKEY_UNKNOWN StatusErrorKey = "UNKNOWN" + STATUSERRORKEY_CUSTOM_DOMAIN_CNAME_MISSING StatusErrorKey = "CUSTOM_DOMAIN_CNAME_MISSING" + STATUSERRORKEY_CUSTOM_DOMAIN_ALREADY_IN_USE StatusErrorKey = "CUSTOM_DOMAIN_ALREADY_IN_USE" + STATUSERRORKEY_PUBLIC_BETA_QUOTA_REACHED StatusErrorKey = "PUBLIC_BETA_QUOTA_REACHED" + STATUSERRORKEY_LOG_SINK_INSTANCE_UNAVAILABLE StatusErrorKey = "LOG_SINK_INSTANCE_UNAVAILABLE" + STATUSERRORKEY_EXTERNAL_QUOTA_REACHED StatusErrorKey = "EXTERNAL_QUOTA_REACHED" + STATUSERRORKEY_UNKNOWN_DEFAULT_OPEN_API StatusErrorKey = "unknown_default_open_api" +) + +// All allowed values of StatusErrorKey enum +var AllowedStatusErrorKeyEnumValues = []StatusErrorKey{ + "UNKNOWN", + "CUSTOM_DOMAIN_CNAME_MISSING", + "CUSTOM_DOMAIN_ALREADY_IN_USE", + "PUBLIC_BETA_QUOTA_REACHED", + "LOG_SINK_INSTANCE_UNAVAILABLE", + "EXTERNAL_QUOTA_REACHED", + "unknown_default_open_api", +} + +func (v *StatusErrorKey) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := StatusErrorKey(value) + for _, existing := range AllowedStatusErrorKeyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = STATUSERRORKEY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewStatusErrorKeyFromValue returns a pointer to a valid StatusErrorKey +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStatusErrorKeyFromValue(v string) (*StatusErrorKey, error) { + ev := StatusErrorKey(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for StatusErrorKey: valid values are %v", v, AllowedStatusErrorKeyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v StatusErrorKey) IsValid() bool { + for _, existing := range AllowedStatusErrorKeyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StatusError_key value +func (v StatusErrorKey) Ptr() *StatusErrorKey { + return &v +} + +type NullableStatusErrorKey struct { + value *StatusErrorKey + isSet bool +} + +func (v NullableStatusErrorKey) Get() *StatusErrorKey { + return v.value +} + +func (v *NullableStatusErrorKey) Set(val *StatusErrorKey) { + v.value = val + v.isSet = true +} + +func (v NullableStatusErrorKey) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusErrorKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusErrorKey(val *StatusErrorKey) *NullableStatusErrorKey { + return &NullableStatusErrorKey{value: val, isSet: true} +} + +func (v NullableStatusErrorKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusErrorKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 3f3b40bf287c83f602af2f0dc6e9492c6a7ad613 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Mon, 18 May 2026 17:26:08 +0200 Subject: [PATCH 04/66] refac(cost): introduce inline enums --- services/cost/v3api/api_default.go | 48 +++---- ..._get_costs_for_project_accept_parameter.go | 113 +++++++++++++++++ ...ist_costs_for_customer_accept_parameter.go | 113 +++++++++++++++++ ...list_costs_for_customer_depth_parameter.go | 115 +++++++++++++++++ ...osts_for_customer_granularity_parameter.go | 119 ++++++++++++++++++ ...ist_costs_for_reseller_accept_parameter.go | 113 +++++++++++++++++ 6 files changed, 597 insertions(+), 24 deletions(-) create mode 100644 services/cost/v3api/model_get_costs_for_project_accept_parameter.go create mode 100644 services/cost/v3api/model_list_costs_for_customer_accept_parameter.go create mode 100644 services/cost/v3api/model_list_costs_for_customer_depth_parameter.go create mode 100644 services/cost/v3api/model_list_costs_for_customer_granularity_parameter.go create mode 100644 services/cost/v3api/model_list_costs_for_reseller_accept_parameter.go diff --git a/services/cost/v3api/api_default.go b/services/cost/v3api/api_default.go index 804ae1ef1..5c27f8e10 100644 --- a/services/cost/v3api/api_default.go +++ b/services/cost/v3api/api_default.go @@ -80,10 +80,10 @@ type ApiGetCostsForProjectRequest struct { projectId string from *string to *string - depth *string - granularity *string + depth *ListCostsForCustomerDepthParameter + granularity *ListCostsForCustomerGranularityParameter includeZeroCosts *bool - accept *string + accept *GetCostsForProjectAcceptParameter } // Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. @@ -99,13 +99,13 @@ func (r ApiGetCostsForProjectRequest) To(to string) ApiGetCostsForProjectRequest } // Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level. -func (r ApiGetCostsForProjectRequest) Depth(depth string) ApiGetCostsForProjectRequest { +func (r ApiGetCostsForProjectRequest) Depth(depth ListCostsForCustomerDepthParameter) ApiGetCostsForProjectRequest { r.depth = &depth return r } // Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days. -func (r ApiGetCostsForProjectRequest) Granularity(granularity string) ApiGetCostsForProjectRequest { +func (r ApiGetCostsForProjectRequest) Granularity(granularity ListCostsForCustomerGranularityParameter) ApiGetCostsForProjectRequest { r.granularity = &granularity return r } @@ -117,7 +117,7 @@ func (r ApiGetCostsForProjectRequest) IncludeZeroCosts(includeZeroCosts bool) Ap } // Desired content type -func (r ApiGetCostsForProjectRequest) Accept(accept string) ApiGetCostsForProjectRequest { +func (r ApiGetCostsForProjectRequest) Accept(accept GetCostsForProjectAcceptParameter) ApiGetCostsForProjectRequest { r.accept = &accept return r } @@ -180,14 +180,14 @@ func (a *DefaultAPIService) GetCostsForProjectExecute(r ApiGetCostsForProjectReq if r.depth != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "depth", r.depth, "form", "") } else { - var defaultValue string = "auto" + var defaultValue ListCostsForCustomerDepthParameter = "auto" parameterAddToHeaderOrQuery(localVarQueryParams, "depth", defaultValue, "form", "") r.depth = &defaultValue } if r.granularity != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") } else { - var defaultValue string = "none" + var defaultValue ListCostsForCustomerGranularityParameter = "none" parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", defaultValue, "form", "") r.granularity = &defaultValue } @@ -315,10 +315,10 @@ type ApiListCostsForCustomerRequest struct { customerAccountId string from *string to *string - depth *string - granularity *string + depth *ListCostsForCustomerDepthParameter + granularity *ListCostsForCustomerGranularityParameter includeZeroCosts *bool - accept *string + accept *ListCostsForCustomerAcceptParameter } // Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. @@ -334,13 +334,13 @@ func (r ApiListCostsForCustomerRequest) To(to string) ApiListCostsForCustomerReq } // Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level. -func (r ApiListCostsForCustomerRequest) Depth(depth string) ApiListCostsForCustomerRequest { +func (r ApiListCostsForCustomerRequest) Depth(depth ListCostsForCustomerDepthParameter) ApiListCostsForCustomerRequest { r.depth = &depth return r } // Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days. -func (r ApiListCostsForCustomerRequest) Granularity(granularity string) ApiListCostsForCustomerRequest { +func (r ApiListCostsForCustomerRequest) Granularity(granularity ListCostsForCustomerGranularityParameter) ApiListCostsForCustomerRequest { r.granularity = &granularity return r } @@ -352,7 +352,7 @@ func (r ApiListCostsForCustomerRequest) IncludeZeroCosts(includeZeroCosts bool) } // Desired content type -func (r ApiListCostsForCustomerRequest) Accept(accept string) ApiListCostsForCustomerRequest { +func (r ApiListCostsForCustomerRequest) Accept(accept ListCostsForCustomerAcceptParameter) ApiListCostsForCustomerRequest { r.accept = &accept return r } @@ -412,14 +412,14 @@ func (a *DefaultAPIService) ListCostsForCustomerExecute(r ApiListCostsForCustome if r.depth != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "depth", r.depth, "form", "") } else { - var defaultValue string = "auto" + var defaultValue ListCostsForCustomerDepthParameter = "auto" parameterAddToHeaderOrQuery(localVarQueryParams, "depth", defaultValue, "form", "") r.depth = &defaultValue } if r.granularity != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") } else { - var defaultValue string = "none" + var defaultValue ListCostsForCustomerGranularityParameter = "none" parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", defaultValue, "form", "") r.granularity = &defaultValue } @@ -547,10 +547,10 @@ type ApiListCostsForResellerRequest struct { customerAccountId string from *string to *string - depth *string - granularity *string + depth *ListCostsForCustomerDepthParameter + granularity *ListCostsForCustomerGranularityParameter includeZeroCosts *bool - accept *string + accept *ListCostsForResellerAcceptParameter } // Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. @@ -566,13 +566,13 @@ func (r ApiListCostsForResellerRequest) To(to string) ApiListCostsForResellerReq } // Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level. -func (r ApiListCostsForResellerRequest) Depth(depth string) ApiListCostsForResellerRequest { +func (r ApiListCostsForResellerRequest) Depth(depth ListCostsForCustomerDepthParameter) ApiListCostsForResellerRequest { r.depth = &depth return r } // Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days. -func (r ApiListCostsForResellerRequest) Granularity(granularity string) ApiListCostsForResellerRequest { +func (r ApiListCostsForResellerRequest) Granularity(granularity ListCostsForCustomerGranularityParameter) ApiListCostsForResellerRequest { r.granularity = &granularity return r } @@ -584,7 +584,7 @@ func (r ApiListCostsForResellerRequest) IncludeZeroCosts(includeZeroCosts bool) } // Desired content type -func (r ApiListCostsForResellerRequest) Accept(accept string) ApiListCostsForResellerRequest { +func (r ApiListCostsForResellerRequest) Accept(accept ListCostsForResellerAcceptParameter) ApiListCostsForResellerRequest { r.accept = &accept return r } @@ -644,14 +644,14 @@ func (a *DefaultAPIService) ListCostsForResellerExecute(r ApiListCostsForReselle if r.depth != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "depth", r.depth, "form", "") } else { - var defaultValue string = "auto" + var defaultValue ListCostsForCustomerDepthParameter = "auto" parameterAddToHeaderOrQuery(localVarQueryParams, "depth", defaultValue, "form", "") r.depth = &defaultValue } if r.granularity != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") } else { - var defaultValue string = "none" + var defaultValue ListCostsForCustomerGranularityParameter = "none" parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", defaultValue, "form", "") r.granularity = &defaultValue } diff --git a/services/cost/v3api/model_get_costs_for_project_accept_parameter.go b/services/cost/v3api/model_get_costs_for_project_accept_parameter.go new file mode 100644 index 000000000..6c1a1a90d --- /dev/null +++ b/services/cost/v3api/model_get_costs_for_project_accept_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Cost API + +The cost API provides detailed reports on the costs for a customer or project over a certain amount of time + +API version: 3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// GetCostsForProjectAcceptParameter the model 'GetCostsForProjectAcceptParameter' +type GetCostsForProjectAcceptParameter string + +// List of GetCostsForProject_Accept_parameter +const ( + GETCOSTSFORPROJECTACCEPTPARAMETER_APPLICATION_JSON GetCostsForProjectAcceptParameter = "application/json" + GETCOSTSFORPROJECTACCEPTPARAMETER_TEXT_CSV GetCostsForProjectAcceptParameter = "text/csv" + GETCOSTSFORPROJECTACCEPTPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetCostsForProjectAcceptParameter = "unknown_default_open_api" +) + +// All allowed values of GetCostsForProjectAcceptParameter enum +var AllowedGetCostsForProjectAcceptParameterEnumValues = []GetCostsForProjectAcceptParameter{ + "application/json", + "text/csv", + "unknown_default_open_api", +} + +func (v *GetCostsForProjectAcceptParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetCostsForProjectAcceptParameter(value) + for _, existing := range AllowedGetCostsForProjectAcceptParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETCOSTSFORPROJECTACCEPTPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetCostsForProjectAcceptParameterFromValue returns a pointer to a valid GetCostsForProjectAcceptParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetCostsForProjectAcceptParameterFromValue(v string) (*GetCostsForProjectAcceptParameter, error) { + ev := GetCostsForProjectAcceptParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetCostsForProjectAcceptParameter: valid values are %v", v, AllowedGetCostsForProjectAcceptParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetCostsForProjectAcceptParameter) IsValid() bool { + for _, existing := range AllowedGetCostsForProjectAcceptParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetCostsForProject_Accept_parameter value +func (v GetCostsForProjectAcceptParameter) Ptr() *GetCostsForProjectAcceptParameter { + return &v +} + +type NullableGetCostsForProjectAcceptParameter struct { + value *GetCostsForProjectAcceptParameter + isSet bool +} + +func (v NullableGetCostsForProjectAcceptParameter) Get() *GetCostsForProjectAcceptParameter { + return v.value +} + +func (v *NullableGetCostsForProjectAcceptParameter) Set(val *GetCostsForProjectAcceptParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetCostsForProjectAcceptParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCostsForProjectAcceptParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCostsForProjectAcceptParameter(val *GetCostsForProjectAcceptParameter) *NullableGetCostsForProjectAcceptParameter { + return &NullableGetCostsForProjectAcceptParameter{value: val, isSet: true} +} + +func (v NullableGetCostsForProjectAcceptParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCostsForProjectAcceptParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cost/v3api/model_list_costs_for_customer_accept_parameter.go b/services/cost/v3api/model_list_costs_for_customer_accept_parameter.go new file mode 100644 index 000000000..9addac39b --- /dev/null +++ b/services/cost/v3api/model_list_costs_for_customer_accept_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Cost API + +The cost API provides detailed reports on the costs for a customer or project over a certain amount of time + +API version: 3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// ListCostsForCustomerAcceptParameter the model 'ListCostsForCustomerAcceptParameter' +type ListCostsForCustomerAcceptParameter string + +// List of ListCostsForCustomer_Accept_parameter +const ( + LISTCOSTSFORCUSTOMERACCEPTPARAMETER_APPLICATION_JSON ListCostsForCustomerAcceptParameter = "application/json" + LISTCOSTSFORCUSTOMERACCEPTPARAMETER_TEXT_CSV ListCostsForCustomerAcceptParameter = "text/csv" + LISTCOSTSFORCUSTOMERACCEPTPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListCostsForCustomerAcceptParameter = "unknown_default_open_api" +) + +// All allowed values of ListCostsForCustomerAcceptParameter enum +var AllowedListCostsForCustomerAcceptParameterEnumValues = []ListCostsForCustomerAcceptParameter{ + "application/json", + "text/csv", + "unknown_default_open_api", +} + +func (v *ListCostsForCustomerAcceptParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListCostsForCustomerAcceptParameter(value) + for _, existing := range AllowedListCostsForCustomerAcceptParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTCOSTSFORCUSTOMERACCEPTPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListCostsForCustomerAcceptParameterFromValue returns a pointer to a valid ListCostsForCustomerAcceptParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListCostsForCustomerAcceptParameterFromValue(v string) (*ListCostsForCustomerAcceptParameter, error) { + ev := ListCostsForCustomerAcceptParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListCostsForCustomerAcceptParameter: valid values are %v", v, AllowedListCostsForCustomerAcceptParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListCostsForCustomerAcceptParameter) IsValid() bool { + for _, existing := range AllowedListCostsForCustomerAcceptParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListCostsForCustomer_Accept_parameter value +func (v ListCostsForCustomerAcceptParameter) Ptr() *ListCostsForCustomerAcceptParameter { + return &v +} + +type NullableListCostsForCustomerAcceptParameter struct { + value *ListCostsForCustomerAcceptParameter + isSet bool +} + +func (v NullableListCostsForCustomerAcceptParameter) Get() *ListCostsForCustomerAcceptParameter { + return v.value +} + +func (v *NullableListCostsForCustomerAcceptParameter) Set(val *ListCostsForCustomerAcceptParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListCostsForCustomerAcceptParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListCostsForCustomerAcceptParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCostsForCustomerAcceptParameter(val *ListCostsForCustomerAcceptParameter) *NullableListCostsForCustomerAcceptParameter { + return &NullableListCostsForCustomerAcceptParameter{value: val, isSet: true} +} + +func (v NullableListCostsForCustomerAcceptParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCostsForCustomerAcceptParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cost/v3api/model_list_costs_for_customer_depth_parameter.go b/services/cost/v3api/model_list_costs_for_customer_depth_parameter.go new file mode 100644 index 000000000..0e95b12ba --- /dev/null +++ b/services/cost/v3api/model_list_costs_for_customer_depth_parameter.go @@ -0,0 +1,115 @@ +/* +STACKIT Cost API + +The cost API provides detailed reports on the costs for a customer or project over a certain amount of time + +API version: 3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// ListCostsForCustomerDepthParameter the model 'ListCostsForCustomerDepthParameter' +type ListCostsForCustomerDepthParameter string + +// List of ListCostsForCustomer_depth_parameter +const ( + LISTCOSTSFORCUSTOMERDEPTHPARAMETER_PROJECT ListCostsForCustomerDepthParameter = "project" + LISTCOSTSFORCUSTOMERDEPTHPARAMETER_SERVICE ListCostsForCustomerDepthParameter = "service" + LISTCOSTSFORCUSTOMERDEPTHPARAMETER_AUTO ListCostsForCustomerDepthParameter = "auto" + LISTCOSTSFORCUSTOMERDEPTHPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListCostsForCustomerDepthParameter = "unknown_default_open_api" +) + +// All allowed values of ListCostsForCustomerDepthParameter enum +var AllowedListCostsForCustomerDepthParameterEnumValues = []ListCostsForCustomerDepthParameter{ + "project", + "service", + "auto", + "unknown_default_open_api", +} + +func (v *ListCostsForCustomerDepthParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListCostsForCustomerDepthParameter(value) + for _, existing := range AllowedListCostsForCustomerDepthParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTCOSTSFORCUSTOMERDEPTHPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListCostsForCustomerDepthParameterFromValue returns a pointer to a valid ListCostsForCustomerDepthParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListCostsForCustomerDepthParameterFromValue(v string) (*ListCostsForCustomerDepthParameter, error) { + ev := ListCostsForCustomerDepthParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListCostsForCustomerDepthParameter: valid values are %v", v, AllowedListCostsForCustomerDepthParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListCostsForCustomerDepthParameter) IsValid() bool { + for _, existing := range AllowedListCostsForCustomerDepthParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListCostsForCustomer_depth_parameter value +func (v ListCostsForCustomerDepthParameter) Ptr() *ListCostsForCustomerDepthParameter { + return &v +} + +type NullableListCostsForCustomerDepthParameter struct { + value *ListCostsForCustomerDepthParameter + isSet bool +} + +func (v NullableListCostsForCustomerDepthParameter) Get() *ListCostsForCustomerDepthParameter { + return v.value +} + +func (v *NullableListCostsForCustomerDepthParameter) Set(val *ListCostsForCustomerDepthParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListCostsForCustomerDepthParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListCostsForCustomerDepthParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCostsForCustomerDepthParameter(val *ListCostsForCustomerDepthParameter) *NullableListCostsForCustomerDepthParameter { + return &NullableListCostsForCustomerDepthParameter{value: val, isSet: true} +} + +func (v NullableListCostsForCustomerDepthParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCostsForCustomerDepthParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cost/v3api/model_list_costs_for_customer_granularity_parameter.go b/services/cost/v3api/model_list_costs_for_customer_granularity_parameter.go new file mode 100644 index 000000000..5edfb3f30 --- /dev/null +++ b/services/cost/v3api/model_list_costs_for_customer_granularity_parameter.go @@ -0,0 +1,119 @@ +/* +STACKIT Cost API + +The cost API provides detailed reports on the costs for a customer or project over a certain amount of time + +API version: 3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// ListCostsForCustomerGranularityParameter the model 'ListCostsForCustomerGranularityParameter' +type ListCostsForCustomerGranularityParameter string + +// List of ListCostsForCustomer_granularity_parameter +const ( + LISTCOSTSFORCUSTOMERGRANULARITYPARAMETER_DAILY ListCostsForCustomerGranularityParameter = "daily" + LISTCOSTSFORCUSTOMERGRANULARITYPARAMETER_WEEKLY ListCostsForCustomerGranularityParameter = "weekly" + LISTCOSTSFORCUSTOMERGRANULARITYPARAMETER_MONTHLY ListCostsForCustomerGranularityParameter = "monthly" + LISTCOSTSFORCUSTOMERGRANULARITYPARAMETER_YEARLY ListCostsForCustomerGranularityParameter = "yearly" + LISTCOSTSFORCUSTOMERGRANULARITYPARAMETER_NONE ListCostsForCustomerGranularityParameter = "none" + LISTCOSTSFORCUSTOMERGRANULARITYPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListCostsForCustomerGranularityParameter = "unknown_default_open_api" +) + +// All allowed values of ListCostsForCustomerGranularityParameter enum +var AllowedListCostsForCustomerGranularityParameterEnumValues = []ListCostsForCustomerGranularityParameter{ + "daily", + "weekly", + "monthly", + "yearly", + "none", + "unknown_default_open_api", +} + +func (v *ListCostsForCustomerGranularityParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListCostsForCustomerGranularityParameter(value) + for _, existing := range AllowedListCostsForCustomerGranularityParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTCOSTSFORCUSTOMERGRANULARITYPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListCostsForCustomerGranularityParameterFromValue returns a pointer to a valid ListCostsForCustomerGranularityParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListCostsForCustomerGranularityParameterFromValue(v string) (*ListCostsForCustomerGranularityParameter, error) { + ev := ListCostsForCustomerGranularityParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListCostsForCustomerGranularityParameter: valid values are %v", v, AllowedListCostsForCustomerGranularityParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListCostsForCustomerGranularityParameter) IsValid() bool { + for _, existing := range AllowedListCostsForCustomerGranularityParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListCostsForCustomer_granularity_parameter value +func (v ListCostsForCustomerGranularityParameter) Ptr() *ListCostsForCustomerGranularityParameter { + return &v +} + +type NullableListCostsForCustomerGranularityParameter struct { + value *ListCostsForCustomerGranularityParameter + isSet bool +} + +func (v NullableListCostsForCustomerGranularityParameter) Get() *ListCostsForCustomerGranularityParameter { + return v.value +} + +func (v *NullableListCostsForCustomerGranularityParameter) Set(val *ListCostsForCustomerGranularityParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListCostsForCustomerGranularityParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListCostsForCustomerGranularityParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCostsForCustomerGranularityParameter(val *ListCostsForCustomerGranularityParameter) *NullableListCostsForCustomerGranularityParameter { + return &NullableListCostsForCustomerGranularityParameter{value: val, isSet: true} +} + +func (v NullableListCostsForCustomerGranularityParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCostsForCustomerGranularityParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cost/v3api/model_list_costs_for_reseller_accept_parameter.go b/services/cost/v3api/model_list_costs_for_reseller_accept_parameter.go new file mode 100644 index 000000000..87f121e56 --- /dev/null +++ b/services/cost/v3api/model_list_costs_for_reseller_accept_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Cost API + +The cost API provides detailed reports on the costs for a customer or project over a certain amount of time + +API version: 3.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// ListCostsForResellerAcceptParameter the model 'ListCostsForResellerAcceptParameter' +type ListCostsForResellerAcceptParameter string + +// List of ListCostsForReseller_Accept_parameter +const ( + LISTCOSTSFORRESELLERACCEPTPARAMETER_APPLICATION_JSON ListCostsForResellerAcceptParameter = "application/json" + LISTCOSTSFORRESELLERACCEPTPARAMETER_TEXT_CSV ListCostsForResellerAcceptParameter = "text/csv" + LISTCOSTSFORRESELLERACCEPTPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListCostsForResellerAcceptParameter = "unknown_default_open_api" +) + +// All allowed values of ListCostsForResellerAcceptParameter enum +var AllowedListCostsForResellerAcceptParameterEnumValues = []ListCostsForResellerAcceptParameter{ + "application/json", + "text/csv", + "unknown_default_open_api", +} + +func (v *ListCostsForResellerAcceptParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListCostsForResellerAcceptParameter(value) + for _, existing := range AllowedListCostsForResellerAcceptParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTCOSTSFORRESELLERACCEPTPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListCostsForResellerAcceptParameterFromValue returns a pointer to a valid ListCostsForResellerAcceptParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListCostsForResellerAcceptParameterFromValue(v string) (*ListCostsForResellerAcceptParameter, error) { + ev := ListCostsForResellerAcceptParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListCostsForResellerAcceptParameter: valid values are %v", v, AllowedListCostsForResellerAcceptParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListCostsForResellerAcceptParameter) IsValid() bool { + for _, existing := range AllowedListCostsForResellerAcceptParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListCostsForReseller_Accept_parameter value +func (v ListCostsForResellerAcceptParameter) Ptr() *ListCostsForResellerAcceptParameter { + return &v +} + +type NullableListCostsForResellerAcceptParameter struct { + value *ListCostsForResellerAcceptParameter + isSet bool +} + +func (v NullableListCostsForResellerAcceptParameter) Get() *ListCostsForResellerAcceptParameter { + return v.value +} + +func (v *NullableListCostsForResellerAcceptParameter) Set(val *ListCostsForResellerAcceptParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListCostsForResellerAcceptParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListCostsForResellerAcceptParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCostsForResellerAcceptParameter(val *ListCostsForResellerAcceptParameter) *NullableListCostsForResellerAcceptParameter { + return &NullableListCostsForResellerAcceptParameter{value: val, isSet: true} +} + +func (v NullableListCostsForResellerAcceptParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCostsForResellerAcceptParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From f81ea92c5c0559f0615c279fcf27884c7150c2e8 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Mon, 18 May 2026 17:31:24 +0200 Subject: [PATCH 05/66] chore(cost): write changelog, bump version --- CHANGELOG.md | 2 ++ services/cost/CHANGELOG.md | 3 +++ services/cost/VERSION | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97601b6ce..c7496ee90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,6 +95,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v0.3.2](services/cost/CHANGELOG.md#v032) - **Dependencies:** Bump STACKIT SDK core module to `v0.26.0` + - [v0.4.0](services/cost/CHANGELOG.md#v040) + - **Feature:** Introduce enums for various attributes - `dns`: - [v0.19.3](services/dns/CHANGELOG.md#v0193) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/cost/CHANGELOG.md b/services/cost/CHANGELOG.md index ef4aad822..7a7440625 100644 --- a/services/cost/CHANGELOG.md +++ b/services/cost/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.4.0 +- **Feature:** Introduce enums for various attributes + ## v0.3.2 - **Dependencies:** Bump STACKIT SDK core module to `v0.26.0` diff --git a/services/cost/VERSION b/services/cost/VERSION index 7becae11d..fb7a04cff 100644 --- a/services/cost/VERSION +++ b/services/cost/VERSION @@ -1 +1 @@ -v0.3.2 +v0.4.0 From a66ef5738e0dca161b8027b5fffa9ea1588981b2 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Mon, 18 May 2026 17:36:11 +0200 Subject: [PATCH 06/66] refac(dns): generate inline enums --- services/dns/v1api/api_default.go | 104 ++++++------ .../v1api/model_create_record_set_payload.go | 15 +- .../model_create_record_set_payload_type.go | 160 ++++++++++++++++++ .../dns/v1api/model_create_zone_payload.go | 19 +-- .../v1api/model_create_zone_payload_type.go | 114 +++++++++++++ .../v1api/model_export_record_sets_payload.go | 18 +- ...model_export_record_sets_payload_format.go | 116 +++++++++++++ ...del_import_record_sets_format_parameter.go | 116 +++++++++++++ ...mport_record_sets_import_type_parameter.go | 118 +++++++++++++ ...s_order_by_creation_finished__parameter.go | 114 +++++++++++++ ...ts_order_by_creation_started__parameter.go | 114 +++++++++++++ ...st_record_sets_order_by_name__parameter.go | 114 +++++++++++++ ...d_sets_order_by_record_count__parameter.go | 114 +++++++++++++ ...t_record_sets_order_by_state__parameter.go | 114 +++++++++++++ ...st_record_sets_order_by_type__parameter.go | 114 +++++++++++++ ...ets_order_by_update_finished__parameter.go | 114 +++++++++++++ ...sets_order_by_update_started__parameter.go | 114 +++++++++++++ ...el_list_record_sets_state_eq__parameter.go | 128 ++++++++++++++ ...l_list_record_sets_state_neq__parameter.go | 128 ++++++++++++++ ...del_list_record_sets_type_eq__parameter.go | 160 ++++++++++++++++++ ...s_order_by_creation_finished__parameter.go | 114 +++++++++++++ ...es_order_by_creation_started__parameter.go | 114 +++++++++++++ ...t_zones_order_by_description__parameter.go | 114 +++++++++++++ ...list_zones_order_by_dns_name__parameter.go | 114 +++++++++++++ ...del_list_zones_order_by_name__parameter.go | 114 +++++++++++++ ..._zones_order_by_record_count__parameter.go | 114 +++++++++++++ ...del_list_zones_order_by_type__parameter.go | 114 +++++++++++++ ...nes_order_by_update_finished__parameter.go | 114 +++++++++++++ ...ones_order_by_update_started__parameter.go | 114 +++++++++++++ .../model_list_zones_state_eq__parameter.go | 128 ++++++++++++++ .../model_list_zones_state_neq__parameter.go | 128 ++++++++++++++ .../model_list_zones_type_eq__parameter.go | 114 +++++++++++++ .../model_partial_update_record_payload.go | 12 +- ...el_partial_update_record_payload_action.go | 114 +++++++++++++ services/dns/v1api/model_record_set.go | 28 ++- services/dns/v1api/model_record_set_state.go | 128 ++++++++++++++ services/dns/v1api/model_record_set_type.go | 160 ++++++++++++++++++ services/dns/v1api/model_zone.go | 39 ++--- services/dns/v1api/model_zone_state.go | 128 ++++++++++++++ services/dns/v1api/model_zone_type.go | 114 +++++++++++++ services/dns/v1api/model_zone_visibility.go | 112 ++++++++++++ 41 files changed, 4218 insertions(+), 121 deletions(-) create mode 100644 services/dns/v1api/model_create_record_set_payload_type.go create mode 100644 services/dns/v1api/model_create_zone_payload_type.go create mode 100644 services/dns/v1api/model_export_record_sets_payload_format.go create mode 100644 services/dns/v1api/model_import_record_sets_format_parameter.go create mode 100644 services/dns/v1api/model_import_record_sets_import_type_parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_order_by_creation_finished__parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_order_by_creation_started__parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_order_by_name__parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_order_by_record_count__parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_order_by_state__parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_order_by_type__parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_order_by_update_finished__parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_order_by_update_started__parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_state_eq__parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_state_neq__parameter.go create mode 100644 services/dns/v1api/model_list_record_sets_type_eq__parameter.go create mode 100644 services/dns/v1api/model_list_zones_order_by_creation_finished__parameter.go create mode 100644 services/dns/v1api/model_list_zones_order_by_creation_started__parameter.go create mode 100644 services/dns/v1api/model_list_zones_order_by_description__parameter.go create mode 100644 services/dns/v1api/model_list_zones_order_by_dns_name__parameter.go create mode 100644 services/dns/v1api/model_list_zones_order_by_name__parameter.go create mode 100644 services/dns/v1api/model_list_zones_order_by_record_count__parameter.go create mode 100644 services/dns/v1api/model_list_zones_order_by_type__parameter.go create mode 100644 services/dns/v1api/model_list_zones_order_by_update_finished__parameter.go create mode 100644 services/dns/v1api/model_list_zones_order_by_update_started__parameter.go create mode 100644 services/dns/v1api/model_list_zones_state_eq__parameter.go create mode 100644 services/dns/v1api/model_list_zones_state_neq__parameter.go create mode 100644 services/dns/v1api/model_list_zones_type_eq__parameter.go create mode 100644 services/dns/v1api/model_partial_update_record_payload_action.go create mode 100644 services/dns/v1api/model_record_set_state.go create mode 100644 services/dns/v1api/model_record_set_type.go create mode 100644 services/dns/v1api/model_zone_state.go create mode 100644 services/dns/v1api/model_zone_type.go create mode 100644 services/dns/v1api/model_zone_visibility.go diff --git a/services/dns/v1api/api_default.go b/services/dns/v1api/api_default.go index 03e27f5e6..255ccfdda 100644 --- a/services/dns/v1api/api_default.go +++ b/services/dns/v1api/api_default.go @@ -2466,8 +2466,8 @@ type ApiImportRecordSetsRequest struct { projectId string zoneId string importRecordSetsPayload *ImportRecordSetsPayload - format *string - importType *string + format *ImportRecordSetsFormatParameter + importType *ImportRecordSetsImportTypeParameter } // accepts all response bodies for the export endpoint @@ -2477,13 +2477,13 @@ func (r ApiImportRecordSetsRequest) ImportRecordSetsPayload(importRecordSetsPayl } // format of the data to import -func (r ApiImportRecordSetsRequest) Format(format string) ApiImportRecordSetsRequest { +func (r ApiImportRecordSetsRequest) Format(format ImportRecordSetsFormatParameter) ApiImportRecordSetsRequest { r.format = &format return r } // type of the zone import -func (r ApiImportRecordSetsRequest) ImportType(importType string) ApiImportRecordSetsRequest { +func (r ApiImportRecordSetsRequest) ImportType(importType ImportRecordSetsImportTypeParameter) ApiImportRecordSetsRequest { r.importType = &importType return r } @@ -2541,14 +2541,14 @@ func (a *DefaultAPIService) ImportRecordSetsExecute(r ApiImportRecordSetsRequest if r.format != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") } else { - var defaultValue string = "csv" + var defaultValue ImportRecordSetsFormatParameter = "csv" parameterAddToHeaderOrQuery(localVarQueryParams, "format", defaultValue, "form", "") r.format = &defaultValue } if r.importType != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "importType", r.importType, "form", "") } else { - var defaultValue string = "restore" + var defaultValue ImportRecordSetsImportTypeParameter = "restore" parameterAddToHeaderOrQuery(localVarQueryParams, "importType", defaultValue, "form", "") r.importType = &defaultValue } @@ -2844,9 +2844,9 @@ type ApiListRecordSetsRequest struct { pageSize *int32 nameEq *string nameLike *string - typeEq *string - stateEq *string - stateNeq *string + typeEq *ListRecordSetsTypeEqParameter + stateEq *ListRecordSetsStateEqParameter + stateNeq *ListRecordSetsStateNeqParameter activeEq *bool creationStartedGt *string creationStartedLt *string @@ -2864,14 +2864,14 @@ type ApiListRecordSetsRequest struct { updateFinishedLt *string updateFinishedGte *string updateFinishedLte *string - orderByName *string - orderByCreationStarted *string - orderByCreationFinished *string - orderByUpdateStarted *string - orderByUpdateFinished *string - orderByType *string - orderByState *string - orderByRecordCount *string + orderByName *ListRecordSetsOrderByNameParameter + orderByCreationStarted *ListRecordSetsOrderByCreationStartedParameter + orderByCreationFinished *ListRecordSetsOrderByCreationFinishedParameter + orderByUpdateStarted *ListRecordSetsOrderByUpdateStartedParameter + orderByUpdateFinished *ListRecordSetsOrderByUpdateFinishedParameter + orderByType *ListRecordSetsOrderByTypeParameter + orderByState *ListRecordSetsOrderByStateParameter + orderByRecordCount *ListRecordSetsOrderByRecordCountParameter } // page @@ -2899,19 +2899,19 @@ func (r ApiListRecordSetsRequest) NameLike(nameLike string) ApiListRecordSetsReq } // filter type -func (r ApiListRecordSetsRequest) TypeEq(typeEq string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) TypeEq(typeEq ListRecordSetsTypeEqParameter) ApiListRecordSetsRequest { r.typeEq = &typeEq return r } // filter state -func (r ApiListRecordSetsRequest) StateEq(stateEq string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) StateEq(stateEq ListRecordSetsStateEqParameter) ApiListRecordSetsRequest { r.stateEq = &stateEq return r } // filter state -func (r ApiListRecordSetsRequest) StateNeq(stateNeq string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) StateNeq(stateNeq ListRecordSetsStateNeqParameter) ApiListRecordSetsRequest { r.stateNeq = &stateNeq return r } @@ -3019,49 +3019,49 @@ func (r ApiListRecordSetsRequest) UpdateFinishedLte(updateFinishedLte string) Ap } // order by name -func (r ApiListRecordSetsRequest) OrderByName(orderByName string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) OrderByName(orderByName ListRecordSetsOrderByNameParameter) ApiListRecordSetsRequest { r.orderByName = &orderByName return r } // order by creationStarted -func (r ApiListRecordSetsRequest) OrderByCreationStarted(orderByCreationStarted string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) OrderByCreationStarted(orderByCreationStarted ListRecordSetsOrderByCreationStartedParameter) ApiListRecordSetsRequest { r.orderByCreationStarted = &orderByCreationStarted return r } // order by creationFinished -func (r ApiListRecordSetsRequest) OrderByCreationFinished(orderByCreationFinished string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) OrderByCreationFinished(orderByCreationFinished ListRecordSetsOrderByCreationFinishedParameter) ApiListRecordSetsRequest { r.orderByCreationFinished = &orderByCreationFinished return r } // order by updateStarted -func (r ApiListRecordSetsRequest) OrderByUpdateStarted(orderByUpdateStarted string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) OrderByUpdateStarted(orderByUpdateStarted ListRecordSetsOrderByUpdateStartedParameter) ApiListRecordSetsRequest { r.orderByUpdateStarted = &orderByUpdateStarted return r } // order by updateFinished -func (r ApiListRecordSetsRequest) OrderByUpdateFinished(orderByUpdateFinished string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) OrderByUpdateFinished(orderByUpdateFinished ListRecordSetsOrderByUpdateFinishedParameter) ApiListRecordSetsRequest { r.orderByUpdateFinished = &orderByUpdateFinished return r } // order by type -func (r ApiListRecordSetsRequest) OrderByType(orderByType string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) OrderByType(orderByType ListRecordSetsOrderByTypeParameter) ApiListRecordSetsRequest { r.orderByType = &orderByType return r } // order by state -func (r ApiListRecordSetsRequest) OrderByState(orderByState string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) OrderByState(orderByState ListRecordSetsOrderByStateParameter) ApiListRecordSetsRequest { r.orderByState = &orderByState return r } // order by record count -func (r ApiListRecordSetsRequest) OrderByRecordCount(orderByRecordCount string) ApiListRecordSetsRequest { +func (r ApiListRecordSetsRequest) OrderByRecordCount(orderByRecordCount ListRecordSetsOrderByRecordCountParameter) ApiListRecordSetsRequest { r.orderByRecordCount = &orderByRecordCount return r } @@ -3333,15 +3333,15 @@ type ApiListZonesRequest struct { pageSize *int32 dnsNameEq *string dnsNameLike *string - typeEq *string + typeEq *ListZonesTypeEqParameter nameEq *string nameNeq *string nameLike *string descriptionEq *string descriptionNeq *string descriptionLike *string - stateEq *string - stateNeq *string + stateEq *ListZonesStateEqParameter + stateNeq *ListZonesStateNeqParameter primaryNameServerEq *string primaryNameServerLike *string isReverseZoneEq *bool @@ -3364,15 +3364,15 @@ type ApiListZonesRequest struct { updateFinishedLte *string labelKeyEq *[]string labelValueEq *[]string - orderByDnsName *string - orderByName *string - orderByRecordCount *string - orderByType *string - orderByDescription *string - orderByCreationStarted *string - orderByCreationFinished *string - orderByUpdateStarted *string - orderByUpdateFinished *string + orderByDnsName *ListZonesOrderByDnsNameParameter + orderByName *ListZonesOrderByNameParameter + orderByRecordCount *ListZonesOrderByRecordCountParameter + orderByType *ListZonesOrderByTypeParameter + orderByDescription *ListZonesOrderByDescriptionParameter + orderByCreationStarted *ListZonesOrderByCreationStartedParameter + orderByCreationFinished *ListZonesOrderByCreationFinishedParameter + orderByUpdateStarted *ListZonesOrderByUpdateStartedParameter + orderByUpdateFinished *ListZonesOrderByUpdateFinishedParameter } // page @@ -3400,7 +3400,7 @@ func (r ApiListZonesRequest) DnsNameLike(dnsNameLike string) ApiListZonesRequest } // filter type -func (r ApiListZonesRequest) TypeEq(typeEq string) ApiListZonesRequest { +func (r ApiListZonesRequest) TypeEq(typeEq ListZonesTypeEqParameter) ApiListZonesRequest { r.typeEq = &typeEq return r } @@ -3442,13 +3442,13 @@ func (r ApiListZonesRequest) DescriptionLike(descriptionLike string) ApiListZone } // filter state -func (r ApiListZonesRequest) StateEq(stateEq string) ApiListZonesRequest { +func (r ApiListZonesRequest) StateEq(stateEq ListZonesStateEqParameter) ApiListZonesRequest { r.stateEq = &stateEq return r } // filter state -func (r ApiListZonesRequest) StateNeq(stateNeq string) ApiListZonesRequest { +func (r ApiListZonesRequest) StateNeq(stateNeq ListZonesStateNeqParameter) ApiListZonesRequest { r.stateNeq = &stateNeq return r } @@ -3586,55 +3586,55 @@ func (r ApiListZonesRequest) LabelValueEq(labelValueEq []string) ApiListZonesReq } // order by dns name -func (r ApiListZonesRequest) OrderByDnsName(orderByDnsName string) ApiListZonesRequest { +func (r ApiListZonesRequest) OrderByDnsName(orderByDnsName ListZonesOrderByDnsNameParameter) ApiListZonesRequest { r.orderByDnsName = &orderByDnsName return r } // order by name -func (r ApiListZonesRequest) OrderByName(orderByName string) ApiListZonesRequest { +func (r ApiListZonesRequest) OrderByName(orderByName ListZonesOrderByNameParameter) ApiListZonesRequest { r.orderByName = &orderByName return r } // order by record count -func (r ApiListZonesRequest) OrderByRecordCount(orderByRecordCount string) ApiListZonesRequest { +func (r ApiListZonesRequest) OrderByRecordCount(orderByRecordCount ListZonesOrderByRecordCountParameter) ApiListZonesRequest { r.orderByRecordCount = &orderByRecordCount return r } // order by type -func (r ApiListZonesRequest) OrderByType(orderByType string) ApiListZonesRequest { +func (r ApiListZonesRequest) OrderByType(orderByType ListZonesOrderByTypeParameter) ApiListZonesRequest { r.orderByType = &orderByType return r } // order by description -func (r ApiListZonesRequest) OrderByDescription(orderByDescription string) ApiListZonesRequest { +func (r ApiListZonesRequest) OrderByDescription(orderByDescription ListZonesOrderByDescriptionParameter) ApiListZonesRequest { r.orderByDescription = &orderByDescription return r } // order by creationStarted -func (r ApiListZonesRequest) OrderByCreationStarted(orderByCreationStarted string) ApiListZonesRequest { +func (r ApiListZonesRequest) OrderByCreationStarted(orderByCreationStarted ListZonesOrderByCreationStartedParameter) ApiListZonesRequest { r.orderByCreationStarted = &orderByCreationStarted return r } // order by creationFinished -func (r ApiListZonesRequest) OrderByCreationFinished(orderByCreationFinished string) ApiListZonesRequest { +func (r ApiListZonesRequest) OrderByCreationFinished(orderByCreationFinished ListZonesOrderByCreationFinishedParameter) ApiListZonesRequest { r.orderByCreationFinished = &orderByCreationFinished return r } // order by updateStarted -func (r ApiListZonesRequest) OrderByUpdateStarted(orderByUpdateStarted string) ApiListZonesRequest { +func (r ApiListZonesRequest) OrderByUpdateStarted(orderByUpdateStarted ListZonesOrderByUpdateStartedParameter) ApiListZonesRequest { r.orderByUpdateStarted = &orderByUpdateStarted return r } // order by updateFinished -func (r ApiListZonesRequest) OrderByUpdateFinished(orderByUpdateFinished string) ApiListZonesRequest { +func (r ApiListZonesRequest) OrderByUpdateFinished(orderByUpdateFinished ListZonesOrderByUpdateFinishedParameter) ApiListZonesRequest { r.orderByUpdateFinished = &orderByUpdateFinished return r } diff --git a/services/dns/v1api/model_create_record_set_payload.go b/services/dns/v1api/model_create_record_set_payload.go index 3c06f2498..e9fdeecce 100644 --- a/services/dns/v1api/model_create_record_set_payload.go +++ b/services/dns/v1api/model_create_record_set_payload.go @@ -28,9 +28,8 @@ type CreateRecordSetPayload struct { // records Records []RecordPayload `json:"records"` // time to live. If nothing provided we will set the zone ttl. - Ttl *int32 `json:"ttl,omitempty"` - // record set type - Type string `json:"type"` + Ttl *int32 `json:"ttl,omitempty"` + Type CreateRecordSetPayloadType `json:"type"` AdditionalProperties map[string]interface{} } @@ -40,7 +39,7 @@ type _CreateRecordSetPayload CreateRecordSetPayload // 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 NewCreateRecordSetPayload(name string, records []RecordPayload, types string) *CreateRecordSetPayload { +func NewCreateRecordSetPayload(name string, records []RecordPayload, types CreateRecordSetPayloadType) *CreateRecordSetPayload { this := CreateRecordSetPayload{} this.Name = name this.Records = records @@ -169,9 +168,9 @@ func (o *CreateRecordSetPayload) SetTtl(v int32) { } // GetType returns the Type field value -func (o *CreateRecordSetPayload) GetType() string { +func (o *CreateRecordSetPayload) GetType() CreateRecordSetPayloadType { if o == nil { - var ret string + var ret CreateRecordSetPayloadType return ret } @@ -180,7 +179,7 @@ func (o *CreateRecordSetPayload) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *CreateRecordSetPayload) GetTypeOk() (*string, bool) { +func (o *CreateRecordSetPayload) GetTypeOk() (*CreateRecordSetPayloadType, bool) { if o == nil { return nil, false } @@ -188,7 +187,7 @@ func (o *CreateRecordSetPayload) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *CreateRecordSetPayload) SetType(v string) { +func (o *CreateRecordSetPayload) SetType(v CreateRecordSetPayloadType) { o.Type = v } diff --git a/services/dns/v1api/model_create_record_set_payload_type.go b/services/dns/v1api/model_create_record_set_payload_type.go new file mode 100644 index 000000000..c7df0290a --- /dev/null +++ b/services/dns/v1api/model_create_record_set_payload_type.go @@ -0,0 +1,160 @@ +/* +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" +) + +// CreateRecordSetPayloadType record set type +type CreateRecordSetPayloadType string + +// List of CreateRecordSetPayload_type +const ( + CREATERECORDSETPAYLOADTYPE_A CreateRecordSetPayloadType = "A" + CREATERECORDSETPAYLOADTYPE_AAAA CreateRecordSetPayloadType = "AAAA" + CREATERECORDSETPAYLOADTYPE_SOA CreateRecordSetPayloadType = "SOA" + CREATERECORDSETPAYLOADTYPE_CNAME CreateRecordSetPayloadType = "CNAME" + CREATERECORDSETPAYLOADTYPE_NS CreateRecordSetPayloadType = "NS" + CREATERECORDSETPAYLOADTYPE_MX CreateRecordSetPayloadType = "MX" + CREATERECORDSETPAYLOADTYPE_TXT CreateRecordSetPayloadType = "TXT" + CREATERECORDSETPAYLOADTYPE_SRV CreateRecordSetPayloadType = "SRV" + CREATERECORDSETPAYLOADTYPE_PTR CreateRecordSetPayloadType = "PTR" + CREATERECORDSETPAYLOADTYPE_ALIAS CreateRecordSetPayloadType = "ALIAS" + CREATERECORDSETPAYLOADTYPE_DNAME CreateRecordSetPayloadType = "DNAME" + CREATERECORDSETPAYLOADTYPE_CAA CreateRecordSetPayloadType = "CAA" + CREATERECORDSETPAYLOADTYPE_DNSKEY CreateRecordSetPayloadType = "DNSKEY" + CREATERECORDSETPAYLOADTYPE_DS CreateRecordSetPayloadType = "DS" + CREATERECORDSETPAYLOADTYPE_LOC CreateRecordSetPayloadType = "LOC" + CREATERECORDSETPAYLOADTYPE_NAPTR CreateRecordSetPayloadType = "NAPTR" + CREATERECORDSETPAYLOADTYPE_SSHFP CreateRecordSetPayloadType = "SSHFP" + CREATERECORDSETPAYLOADTYPE_TLSA CreateRecordSetPayloadType = "TLSA" + CREATERECORDSETPAYLOADTYPE_URI CreateRecordSetPayloadType = "URI" + CREATERECORDSETPAYLOADTYPE_CERT CreateRecordSetPayloadType = "CERT" + CREATERECORDSETPAYLOADTYPE_SVCB CreateRecordSetPayloadType = "SVCB" + CREATERECORDSETPAYLOADTYPE_TYPE CreateRecordSetPayloadType = "TYPE" + CREATERECORDSETPAYLOADTYPE_CSYNC CreateRecordSetPayloadType = "CSYNC" + CREATERECORDSETPAYLOADTYPE_HINFO CreateRecordSetPayloadType = "HINFO" + CREATERECORDSETPAYLOADTYPE_HTTPS CreateRecordSetPayloadType = "HTTPS" + CREATERECORDSETPAYLOADTYPE_UNKNOWN_DEFAULT_OPEN_API CreateRecordSetPayloadType = "unknown_default_open_api" +) + +// All allowed values of CreateRecordSetPayloadType enum +var AllowedCreateRecordSetPayloadTypeEnumValues = []CreateRecordSetPayloadType{ + "A", + "AAAA", + "SOA", + "CNAME", + "NS", + "MX", + "TXT", + "SRV", + "PTR", + "ALIAS", + "DNAME", + "CAA", + "DNSKEY", + "DS", + "LOC", + "NAPTR", + "SSHFP", + "TLSA", + "URI", + "CERT", + "SVCB", + "TYPE", + "CSYNC", + "HINFO", + "HTTPS", + "unknown_default_open_api", +} + +func (v *CreateRecordSetPayloadType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateRecordSetPayloadType(value) + for _, existing := range AllowedCreateRecordSetPayloadTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATERECORDSETPAYLOADTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateRecordSetPayloadTypeFromValue returns a pointer to a valid CreateRecordSetPayloadType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateRecordSetPayloadTypeFromValue(v string) (*CreateRecordSetPayloadType, error) { + ev := CreateRecordSetPayloadType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateRecordSetPayloadType: valid values are %v", v, AllowedCreateRecordSetPayloadTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateRecordSetPayloadType) IsValid() bool { + for _, existing := range AllowedCreateRecordSetPayloadTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateRecordSetPayload_type value +func (v CreateRecordSetPayloadType) Ptr() *CreateRecordSetPayloadType { + return &v +} + +type NullableCreateRecordSetPayloadType struct { + value *CreateRecordSetPayloadType + isSet bool +} + +func (v NullableCreateRecordSetPayloadType) Get() *CreateRecordSetPayloadType { + return v.value +} + +func (v *NullableCreateRecordSetPayloadType) Set(val *CreateRecordSetPayloadType) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRecordSetPayloadType) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRecordSetPayloadType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRecordSetPayloadType(val *CreateRecordSetPayloadType) *NullableCreateRecordSetPayloadType { + return &NullableCreateRecordSetPayloadType{value: val, isSet: true} +} + +func (v NullableCreateRecordSetPayloadType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRecordSetPayloadType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_create_zone_payload.go b/services/dns/v1api/model_create_zone_payload.go index 34252d07f..a7058e001 100644 --- a/services/dns/v1api/model_create_zone_payload.go +++ b/services/dns/v1api/model_create_zone_payload.go @@ -46,9 +46,8 @@ type CreateZonePayload struct { // refresh time RefreshTime *int32 `json:"refreshTime,omitempty"` // retry time - RetryTime *int32 `json:"retryTime,omitempty"` - // zone type - Type *string `json:"type,omitempty"` + RetryTime *int32 `json:"retryTime,omitempty"` + Type *CreateZonePayloadType `json:"type,omitempty"` AdditionalProperties map[string]interface{} } @@ -76,7 +75,7 @@ func NewCreateZonePayload(dnsName string, name string) *CreateZonePayload { this.RefreshTime = &refreshTime var retryTime int32 = 600 this.RetryTime = &retryTime - var types string = "primary" + var types CreateZonePayloadType = CREATEZONEPAYLOADTYPE_PRIMARY this.Type = &types return &this } @@ -100,7 +99,7 @@ func NewCreateZonePayloadWithDefaults() *CreateZonePayload { this.RefreshTime = &refreshTime var retryTime int32 = 600 this.RetryTime = &retryTime - var types string = "primary" + var types CreateZonePayloadType = CREATEZONEPAYLOADTYPE_PRIMARY this.Type = &types return &this } @@ -506,9 +505,9 @@ func (o *CreateZonePayload) SetRetryTime(v int32) { } // GetType returns the Type field value if set, zero value otherwise. -func (o *CreateZonePayload) GetType() string { +func (o *CreateZonePayload) GetType() CreateZonePayloadType { if o == nil || IsNil(o.Type) { - var ret string + var ret CreateZonePayloadType return ret } return *o.Type @@ -516,7 +515,7 @@ func (o *CreateZonePayload) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateZonePayload) GetTypeOk() (*string, bool) { +func (o *CreateZonePayload) GetTypeOk() (*CreateZonePayloadType, bool) { if o == nil || IsNil(o.Type) { return nil, false } @@ -532,8 +531,8 @@ func (o *CreateZonePayload) HasType() bool { return false } -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *CreateZonePayload) SetType(v string) { +// SetType gets a reference to the given CreateZonePayloadType and assigns it to the Type field. +func (o *CreateZonePayload) SetType(v CreateZonePayloadType) { o.Type = &v } diff --git a/services/dns/v1api/model_create_zone_payload_type.go b/services/dns/v1api/model_create_zone_payload_type.go new file mode 100644 index 000000000..27208a1dc --- /dev/null +++ b/services/dns/v1api/model_create_zone_payload_type.go @@ -0,0 +1,114 @@ +/* +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" +) + +// CreateZonePayloadType zone type +type CreateZonePayloadType string + +// List of CreateZonePayload_type +const ( + CREATEZONEPAYLOADTYPE_PRIMARY CreateZonePayloadType = "primary" + CREATEZONEPAYLOADTYPE_SECONDARY CreateZonePayloadType = "secondary" + CREATEZONEPAYLOADTYPE_UNKNOWN_DEFAULT_OPEN_API CreateZonePayloadType = "unknown_default_open_api" +) + +// All allowed values of CreateZonePayloadType enum +var AllowedCreateZonePayloadTypeEnumValues = []CreateZonePayloadType{ + "primary", + "secondary", + "unknown_default_open_api", +} + +func (v *CreateZonePayloadType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateZonePayloadType(value) + for _, existing := range AllowedCreateZonePayloadTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEZONEPAYLOADTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateZonePayloadTypeFromValue returns a pointer to a valid CreateZonePayloadType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateZonePayloadTypeFromValue(v string) (*CreateZonePayloadType, error) { + ev := CreateZonePayloadType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateZonePayloadType: valid values are %v", v, AllowedCreateZonePayloadTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateZonePayloadType) IsValid() bool { + for _, existing := range AllowedCreateZonePayloadTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateZonePayload_type value +func (v CreateZonePayloadType) Ptr() *CreateZonePayloadType { + return &v +} + +type NullableCreateZonePayloadType struct { + value *CreateZonePayloadType + isSet bool +} + +func (v NullableCreateZonePayloadType) Get() *CreateZonePayloadType { + return v.value +} + +func (v *NullableCreateZonePayloadType) Set(val *CreateZonePayloadType) { + v.value = val + v.isSet = true +} + +func (v NullableCreateZonePayloadType) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateZonePayloadType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateZonePayloadType(val *CreateZonePayloadType) *NullableCreateZonePayloadType { + return &NullableCreateZonePayloadType{value: val, isSet: true} +} + +func (v NullableCreateZonePayloadType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateZonePayloadType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_export_record_sets_payload.go b/services/dns/v1api/model_export_record_sets_payload.go index e846e7efb..65b550ddf 100644 --- a/services/dns/v1api/model_export_record_sets_payload.go +++ b/services/dns/v1api/model_export_record_sets_payload.go @@ -20,8 +20,8 @@ var _ MappedNullable = &ExportRecordSetsPayload{} // ExportRecordSetsPayload struct for ExportRecordSetsPayload type ExportRecordSetsPayload struct { - ExportAsFQDN *bool `json:"exportAsFQDN,omitempty"` - Format *string `json:"format,omitempty"` + ExportAsFQDN *bool `json:"exportAsFQDN,omitempty"` + Format *ExportRecordSetsPayloadFormat `json:"format,omitempty"` AdditionalProperties map[string]interface{} } @@ -35,7 +35,7 @@ func NewExportRecordSetsPayload() *ExportRecordSetsPayload { this := ExportRecordSetsPayload{} var exportAsFQDN bool = true this.ExportAsFQDN = &exportAsFQDN - var format string = "csv" + var format ExportRecordSetsPayloadFormat = EXPORTRECORDSETSPAYLOADFORMAT_CSV this.Format = &format return &this } @@ -47,7 +47,7 @@ func NewExportRecordSetsPayloadWithDefaults() *ExportRecordSetsPayload { this := ExportRecordSetsPayload{} var exportAsFQDN bool = true this.ExportAsFQDN = &exportAsFQDN - var format string = "csv" + var format ExportRecordSetsPayloadFormat = EXPORTRECORDSETSPAYLOADFORMAT_CSV this.Format = &format return &this } @@ -85,9 +85,9 @@ func (o *ExportRecordSetsPayload) SetExportAsFQDN(v bool) { } // GetFormat returns the Format field value if set, zero value otherwise. -func (o *ExportRecordSetsPayload) GetFormat() string { +func (o *ExportRecordSetsPayload) GetFormat() ExportRecordSetsPayloadFormat { if o == nil || IsNil(o.Format) { - var ret string + var ret ExportRecordSetsPayloadFormat return ret } return *o.Format @@ -95,7 +95,7 @@ func (o *ExportRecordSetsPayload) GetFormat() string { // GetFormatOk returns a tuple with the Format field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ExportRecordSetsPayload) GetFormatOk() (*string, bool) { +func (o *ExportRecordSetsPayload) GetFormatOk() (*ExportRecordSetsPayloadFormat, bool) { if o == nil || IsNil(o.Format) { return nil, false } @@ -111,8 +111,8 @@ func (o *ExportRecordSetsPayload) HasFormat() bool { return false } -// SetFormat gets a reference to the given string and assigns it to the Format field. -func (o *ExportRecordSetsPayload) SetFormat(v string) { +// SetFormat gets a reference to the given ExportRecordSetsPayloadFormat and assigns it to the Format field. +func (o *ExportRecordSetsPayload) SetFormat(v ExportRecordSetsPayloadFormat) { o.Format = &v } diff --git a/services/dns/v1api/model_export_record_sets_payload_format.go b/services/dns/v1api/model_export_record_sets_payload_format.go new file mode 100644 index 000000000..cc558e675 --- /dev/null +++ b/services/dns/v1api/model_export_record_sets_payload_format.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" +) + +// ExportRecordSetsPayloadFormat the model 'ExportRecordSetsPayloadFormat' +type ExportRecordSetsPayloadFormat string + +// List of ExportRecordSetsPayload_format +const ( + EXPORTRECORDSETSPAYLOADFORMAT_CSV ExportRecordSetsPayloadFormat = "csv" + EXPORTRECORDSETSPAYLOADFORMAT_JSON ExportRecordSetsPayloadFormat = "json" + EXPORTRECORDSETSPAYLOADFORMAT_BIND ExportRecordSetsPayloadFormat = "bind" + EXPORTRECORDSETSPAYLOADFORMAT_UNKNOWN_DEFAULT_OPEN_API ExportRecordSetsPayloadFormat = "unknown_default_open_api" +) + +// All allowed values of ExportRecordSetsPayloadFormat enum +var AllowedExportRecordSetsPayloadFormatEnumValues = []ExportRecordSetsPayloadFormat{ + "csv", + "json", + "bind", + "unknown_default_open_api", +} + +func (v *ExportRecordSetsPayloadFormat) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ExportRecordSetsPayloadFormat(value) + for _, existing := range AllowedExportRecordSetsPayloadFormatEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = EXPORTRECORDSETSPAYLOADFORMAT_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewExportRecordSetsPayloadFormatFromValue returns a pointer to a valid ExportRecordSetsPayloadFormat +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewExportRecordSetsPayloadFormatFromValue(v string) (*ExportRecordSetsPayloadFormat, error) { + ev := ExportRecordSetsPayloadFormat(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ExportRecordSetsPayloadFormat: valid values are %v", v, AllowedExportRecordSetsPayloadFormatEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ExportRecordSetsPayloadFormat) IsValid() bool { + for _, existing := range AllowedExportRecordSetsPayloadFormatEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ExportRecordSetsPayload_format value +func (v ExportRecordSetsPayloadFormat) Ptr() *ExportRecordSetsPayloadFormat { + return &v +} + +type NullableExportRecordSetsPayloadFormat struct { + value *ExportRecordSetsPayloadFormat + isSet bool +} + +func (v NullableExportRecordSetsPayloadFormat) Get() *ExportRecordSetsPayloadFormat { + return v.value +} + +func (v *NullableExportRecordSetsPayloadFormat) Set(val *ExportRecordSetsPayloadFormat) { + v.value = val + v.isSet = true +} + +func (v NullableExportRecordSetsPayloadFormat) IsSet() bool { + return v.isSet +} + +func (v *NullableExportRecordSetsPayloadFormat) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExportRecordSetsPayloadFormat(val *ExportRecordSetsPayloadFormat) *NullableExportRecordSetsPayloadFormat { + return &NullableExportRecordSetsPayloadFormat{value: val, isSet: true} +} + +func (v NullableExportRecordSetsPayloadFormat) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExportRecordSetsPayloadFormat) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_import_record_sets_format_parameter.go b/services/dns/v1api/model_import_record_sets_format_parameter.go new file mode 100644 index 000000000..bf257cd77 --- /dev/null +++ b/services/dns/v1api/model_import_record_sets_format_parameter.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" +) + +// ImportRecordSetsFormatParameter the model 'ImportRecordSetsFormatParameter' +type ImportRecordSetsFormatParameter string + +// List of ImportRecordSets_format_parameter +const ( + IMPORTRECORDSETSFORMATPARAMETER_JSON ImportRecordSetsFormatParameter = "json" + IMPORTRECORDSETSFORMATPARAMETER_CSV ImportRecordSetsFormatParameter = "csv" + IMPORTRECORDSETSFORMATPARAMETER_BIND ImportRecordSetsFormatParameter = "bind" + IMPORTRECORDSETSFORMATPARAMETER_UNKNOWN_DEFAULT_OPEN_API ImportRecordSetsFormatParameter = "unknown_default_open_api" +) + +// All allowed values of ImportRecordSetsFormatParameter enum +var AllowedImportRecordSetsFormatParameterEnumValues = []ImportRecordSetsFormatParameter{ + "json", + "csv", + "bind", + "unknown_default_open_api", +} + +func (v *ImportRecordSetsFormatParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ImportRecordSetsFormatParameter(value) + for _, existing := range AllowedImportRecordSetsFormatParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = IMPORTRECORDSETSFORMATPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewImportRecordSetsFormatParameterFromValue returns a pointer to a valid ImportRecordSetsFormatParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewImportRecordSetsFormatParameterFromValue(v string) (*ImportRecordSetsFormatParameter, error) { + ev := ImportRecordSetsFormatParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ImportRecordSetsFormatParameter: valid values are %v", v, AllowedImportRecordSetsFormatParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ImportRecordSetsFormatParameter) IsValid() bool { + for _, existing := range AllowedImportRecordSetsFormatParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ImportRecordSets_format_parameter value +func (v ImportRecordSetsFormatParameter) Ptr() *ImportRecordSetsFormatParameter { + return &v +} + +type NullableImportRecordSetsFormatParameter struct { + value *ImportRecordSetsFormatParameter + isSet bool +} + +func (v NullableImportRecordSetsFormatParameter) Get() *ImportRecordSetsFormatParameter { + return v.value +} + +func (v *NullableImportRecordSetsFormatParameter) Set(val *ImportRecordSetsFormatParameter) { + v.value = val + v.isSet = true +} + +func (v NullableImportRecordSetsFormatParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableImportRecordSetsFormatParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportRecordSetsFormatParameter(val *ImportRecordSetsFormatParameter) *NullableImportRecordSetsFormatParameter { + return &NullableImportRecordSetsFormatParameter{value: val, isSet: true} +} + +func (v NullableImportRecordSetsFormatParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportRecordSetsFormatParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_import_record_sets_import_type_parameter.go b/services/dns/v1api/model_import_record_sets_import_type_parameter.go new file mode 100644 index 000000000..a6dfb5cc1 --- /dev/null +++ b/services/dns/v1api/model_import_record_sets_import_type_parameter.go @@ -0,0 +1,118 @@ +/* +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" +) + +// ImportRecordSetsImportTypeParameter the model 'ImportRecordSetsImportTypeParameter' +type ImportRecordSetsImportTypeParameter string + +// List of ImportRecordSets_importType_parameter +const ( + IMPORTRECORDSETSIMPORTTYPEPARAMETER_RESTORE ImportRecordSetsImportTypeParameter = "restore" + IMPORTRECORDSETSIMPORTTYPEPARAMETER_DELETE ImportRecordSetsImportTypeParameter = "delete" + IMPORTRECORDSETSIMPORTTYPEPARAMETER_UPDATE ImportRecordSetsImportTypeParameter = "update" + IMPORTRECORDSETSIMPORTTYPEPARAMETER_UPSERT ImportRecordSetsImportTypeParameter = "upsert" + IMPORTRECORDSETSIMPORTTYPEPARAMETER_UNKNOWN_DEFAULT_OPEN_API ImportRecordSetsImportTypeParameter = "unknown_default_open_api" +) + +// All allowed values of ImportRecordSetsImportTypeParameter enum +var AllowedImportRecordSetsImportTypeParameterEnumValues = []ImportRecordSetsImportTypeParameter{ + "restore", + "delete", + "update", + "upsert", + "unknown_default_open_api", +} + +func (v *ImportRecordSetsImportTypeParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ImportRecordSetsImportTypeParameter(value) + for _, existing := range AllowedImportRecordSetsImportTypeParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = IMPORTRECORDSETSIMPORTTYPEPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewImportRecordSetsImportTypeParameterFromValue returns a pointer to a valid ImportRecordSetsImportTypeParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewImportRecordSetsImportTypeParameterFromValue(v string) (*ImportRecordSetsImportTypeParameter, error) { + ev := ImportRecordSetsImportTypeParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ImportRecordSetsImportTypeParameter: valid values are %v", v, AllowedImportRecordSetsImportTypeParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ImportRecordSetsImportTypeParameter) IsValid() bool { + for _, existing := range AllowedImportRecordSetsImportTypeParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ImportRecordSets_importType_parameter value +func (v ImportRecordSetsImportTypeParameter) Ptr() *ImportRecordSetsImportTypeParameter { + return &v +} + +type NullableImportRecordSetsImportTypeParameter struct { + value *ImportRecordSetsImportTypeParameter + isSet bool +} + +func (v NullableImportRecordSetsImportTypeParameter) Get() *ImportRecordSetsImportTypeParameter { + return v.value +} + +func (v *NullableImportRecordSetsImportTypeParameter) Set(val *ImportRecordSetsImportTypeParameter) { + v.value = val + v.isSet = true +} + +func (v NullableImportRecordSetsImportTypeParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableImportRecordSetsImportTypeParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImportRecordSetsImportTypeParameter(val *ImportRecordSetsImportTypeParameter) *NullableImportRecordSetsImportTypeParameter { + return &NullableImportRecordSetsImportTypeParameter{value: val, isSet: true} +} + +func (v NullableImportRecordSetsImportTypeParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImportRecordSetsImportTypeParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_order_by_creation_finished__parameter.go b/services/dns/v1api/model_list_record_sets_order_by_creation_finished__parameter.go new file mode 100644 index 000000000..ef6bf9f0f --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_order_by_creation_finished__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListRecordSetsOrderByCreationFinishedParameter the model 'ListRecordSetsOrderByCreationFinishedParameter' +type ListRecordSetsOrderByCreationFinishedParameter string + +// List of ListRecordSets_orderBy_creationFinished__parameter +const ( + LISTRECORDSETSORDERBYCREATIONFINISHEDPARAMETER_ASC ListRecordSetsOrderByCreationFinishedParameter = "ASC" + LISTRECORDSETSORDERBYCREATIONFINISHEDPARAMETER_DESC ListRecordSetsOrderByCreationFinishedParameter = "DESC" + LISTRECORDSETSORDERBYCREATIONFINISHEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsOrderByCreationFinishedParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsOrderByCreationFinishedParameter enum +var AllowedListRecordSetsOrderByCreationFinishedParameterEnumValues = []ListRecordSetsOrderByCreationFinishedParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListRecordSetsOrderByCreationFinishedParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsOrderByCreationFinishedParameter(value) + for _, existing := range AllowedListRecordSetsOrderByCreationFinishedParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSORDERBYCREATIONFINISHEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsOrderByCreationFinishedParameterFromValue returns a pointer to a valid ListRecordSetsOrderByCreationFinishedParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsOrderByCreationFinishedParameterFromValue(v string) (*ListRecordSetsOrderByCreationFinishedParameter, error) { + ev := ListRecordSetsOrderByCreationFinishedParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsOrderByCreationFinishedParameter: valid values are %v", v, AllowedListRecordSetsOrderByCreationFinishedParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsOrderByCreationFinishedParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsOrderByCreationFinishedParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_orderBy_creationFinished__parameter value +func (v ListRecordSetsOrderByCreationFinishedParameter) Ptr() *ListRecordSetsOrderByCreationFinishedParameter { + return &v +} + +type NullableListRecordSetsOrderByCreationFinishedParameter struct { + value *ListRecordSetsOrderByCreationFinishedParameter + isSet bool +} + +func (v NullableListRecordSetsOrderByCreationFinishedParameter) Get() *ListRecordSetsOrderByCreationFinishedParameter { + return v.value +} + +func (v *NullableListRecordSetsOrderByCreationFinishedParameter) Set(val *ListRecordSetsOrderByCreationFinishedParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsOrderByCreationFinishedParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsOrderByCreationFinishedParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsOrderByCreationFinishedParameter(val *ListRecordSetsOrderByCreationFinishedParameter) *NullableListRecordSetsOrderByCreationFinishedParameter { + return &NullableListRecordSetsOrderByCreationFinishedParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsOrderByCreationFinishedParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsOrderByCreationFinishedParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_order_by_creation_started__parameter.go b/services/dns/v1api/model_list_record_sets_order_by_creation_started__parameter.go new file mode 100644 index 000000000..e3a4f15c1 --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_order_by_creation_started__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListRecordSetsOrderByCreationStartedParameter the model 'ListRecordSetsOrderByCreationStartedParameter' +type ListRecordSetsOrderByCreationStartedParameter string + +// List of ListRecordSets_orderBy_creationStarted__parameter +const ( + LISTRECORDSETSORDERBYCREATIONSTARTEDPARAMETER_ASC ListRecordSetsOrderByCreationStartedParameter = "ASC" + LISTRECORDSETSORDERBYCREATIONSTARTEDPARAMETER_DESC ListRecordSetsOrderByCreationStartedParameter = "DESC" + LISTRECORDSETSORDERBYCREATIONSTARTEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsOrderByCreationStartedParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsOrderByCreationStartedParameter enum +var AllowedListRecordSetsOrderByCreationStartedParameterEnumValues = []ListRecordSetsOrderByCreationStartedParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListRecordSetsOrderByCreationStartedParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsOrderByCreationStartedParameter(value) + for _, existing := range AllowedListRecordSetsOrderByCreationStartedParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSORDERBYCREATIONSTARTEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsOrderByCreationStartedParameterFromValue returns a pointer to a valid ListRecordSetsOrderByCreationStartedParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsOrderByCreationStartedParameterFromValue(v string) (*ListRecordSetsOrderByCreationStartedParameter, error) { + ev := ListRecordSetsOrderByCreationStartedParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsOrderByCreationStartedParameter: valid values are %v", v, AllowedListRecordSetsOrderByCreationStartedParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsOrderByCreationStartedParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsOrderByCreationStartedParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_orderBy_creationStarted__parameter value +func (v ListRecordSetsOrderByCreationStartedParameter) Ptr() *ListRecordSetsOrderByCreationStartedParameter { + return &v +} + +type NullableListRecordSetsOrderByCreationStartedParameter struct { + value *ListRecordSetsOrderByCreationStartedParameter + isSet bool +} + +func (v NullableListRecordSetsOrderByCreationStartedParameter) Get() *ListRecordSetsOrderByCreationStartedParameter { + return v.value +} + +func (v *NullableListRecordSetsOrderByCreationStartedParameter) Set(val *ListRecordSetsOrderByCreationStartedParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsOrderByCreationStartedParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsOrderByCreationStartedParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsOrderByCreationStartedParameter(val *ListRecordSetsOrderByCreationStartedParameter) *NullableListRecordSetsOrderByCreationStartedParameter { + return &NullableListRecordSetsOrderByCreationStartedParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsOrderByCreationStartedParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsOrderByCreationStartedParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_order_by_name__parameter.go b/services/dns/v1api/model_list_record_sets_order_by_name__parameter.go new file mode 100644 index 000000000..a3d4c014a --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_order_by_name__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListRecordSetsOrderByNameParameter the model 'ListRecordSetsOrderByNameParameter' +type ListRecordSetsOrderByNameParameter string + +// List of ListRecordSets_orderBy_name__parameter +const ( + LISTRECORDSETSORDERBYNAMEPARAMETER_ASC ListRecordSetsOrderByNameParameter = "ASC" + LISTRECORDSETSORDERBYNAMEPARAMETER_DESC ListRecordSetsOrderByNameParameter = "DESC" + LISTRECORDSETSORDERBYNAMEPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsOrderByNameParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsOrderByNameParameter enum +var AllowedListRecordSetsOrderByNameParameterEnumValues = []ListRecordSetsOrderByNameParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListRecordSetsOrderByNameParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsOrderByNameParameter(value) + for _, existing := range AllowedListRecordSetsOrderByNameParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSORDERBYNAMEPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsOrderByNameParameterFromValue returns a pointer to a valid ListRecordSetsOrderByNameParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsOrderByNameParameterFromValue(v string) (*ListRecordSetsOrderByNameParameter, error) { + ev := ListRecordSetsOrderByNameParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsOrderByNameParameter: valid values are %v", v, AllowedListRecordSetsOrderByNameParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsOrderByNameParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsOrderByNameParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_orderBy_name__parameter value +func (v ListRecordSetsOrderByNameParameter) Ptr() *ListRecordSetsOrderByNameParameter { + return &v +} + +type NullableListRecordSetsOrderByNameParameter struct { + value *ListRecordSetsOrderByNameParameter + isSet bool +} + +func (v NullableListRecordSetsOrderByNameParameter) Get() *ListRecordSetsOrderByNameParameter { + return v.value +} + +func (v *NullableListRecordSetsOrderByNameParameter) Set(val *ListRecordSetsOrderByNameParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsOrderByNameParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsOrderByNameParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsOrderByNameParameter(val *ListRecordSetsOrderByNameParameter) *NullableListRecordSetsOrderByNameParameter { + return &NullableListRecordSetsOrderByNameParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsOrderByNameParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsOrderByNameParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_order_by_record_count__parameter.go b/services/dns/v1api/model_list_record_sets_order_by_record_count__parameter.go new file mode 100644 index 000000000..7b51250a4 --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_order_by_record_count__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListRecordSetsOrderByRecordCountParameter the model 'ListRecordSetsOrderByRecordCountParameter' +type ListRecordSetsOrderByRecordCountParameter string + +// List of ListRecordSets_orderBy_recordCount__parameter +const ( + LISTRECORDSETSORDERBYRECORDCOUNTPARAMETER_ASC ListRecordSetsOrderByRecordCountParameter = "ASC" + LISTRECORDSETSORDERBYRECORDCOUNTPARAMETER_DESC ListRecordSetsOrderByRecordCountParameter = "DESC" + LISTRECORDSETSORDERBYRECORDCOUNTPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsOrderByRecordCountParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsOrderByRecordCountParameter enum +var AllowedListRecordSetsOrderByRecordCountParameterEnumValues = []ListRecordSetsOrderByRecordCountParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListRecordSetsOrderByRecordCountParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsOrderByRecordCountParameter(value) + for _, existing := range AllowedListRecordSetsOrderByRecordCountParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSORDERBYRECORDCOUNTPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsOrderByRecordCountParameterFromValue returns a pointer to a valid ListRecordSetsOrderByRecordCountParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsOrderByRecordCountParameterFromValue(v string) (*ListRecordSetsOrderByRecordCountParameter, error) { + ev := ListRecordSetsOrderByRecordCountParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsOrderByRecordCountParameter: valid values are %v", v, AllowedListRecordSetsOrderByRecordCountParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsOrderByRecordCountParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsOrderByRecordCountParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_orderBy_recordCount__parameter value +func (v ListRecordSetsOrderByRecordCountParameter) Ptr() *ListRecordSetsOrderByRecordCountParameter { + return &v +} + +type NullableListRecordSetsOrderByRecordCountParameter struct { + value *ListRecordSetsOrderByRecordCountParameter + isSet bool +} + +func (v NullableListRecordSetsOrderByRecordCountParameter) Get() *ListRecordSetsOrderByRecordCountParameter { + return v.value +} + +func (v *NullableListRecordSetsOrderByRecordCountParameter) Set(val *ListRecordSetsOrderByRecordCountParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsOrderByRecordCountParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsOrderByRecordCountParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsOrderByRecordCountParameter(val *ListRecordSetsOrderByRecordCountParameter) *NullableListRecordSetsOrderByRecordCountParameter { + return &NullableListRecordSetsOrderByRecordCountParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsOrderByRecordCountParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsOrderByRecordCountParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_order_by_state__parameter.go b/services/dns/v1api/model_list_record_sets_order_by_state__parameter.go new file mode 100644 index 000000000..ef05106dd --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_order_by_state__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListRecordSetsOrderByStateParameter the model 'ListRecordSetsOrderByStateParameter' +type ListRecordSetsOrderByStateParameter string + +// List of ListRecordSets_orderBy_state__parameter +const ( + LISTRECORDSETSORDERBYSTATEPARAMETER_ASC ListRecordSetsOrderByStateParameter = "ASC" + LISTRECORDSETSORDERBYSTATEPARAMETER_DESC ListRecordSetsOrderByStateParameter = "DESC" + LISTRECORDSETSORDERBYSTATEPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsOrderByStateParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsOrderByStateParameter enum +var AllowedListRecordSetsOrderByStateParameterEnumValues = []ListRecordSetsOrderByStateParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListRecordSetsOrderByStateParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsOrderByStateParameter(value) + for _, existing := range AllowedListRecordSetsOrderByStateParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSORDERBYSTATEPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsOrderByStateParameterFromValue returns a pointer to a valid ListRecordSetsOrderByStateParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsOrderByStateParameterFromValue(v string) (*ListRecordSetsOrderByStateParameter, error) { + ev := ListRecordSetsOrderByStateParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsOrderByStateParameter: valid values are %v", v, AllowedListRecordSetsOrderByStateParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsOrderByStateParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsOrderByStateParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_orderBy_state__parameter value +func (v ListRecordSetsOrderByStateParameter) Ptr() *ListRecordSetsOrderByStateParameter { + return &v +} + +type NullableListRecordSetsOrderByStateParameter struct { + value *ListRecordSetsOrderByStateParameter + isSet bool +} + +func (v NullableListRecordSetsOrderByStateParameter) Get() *ListRecordSetsOrderByStateParameter { + return v.value +} + +func (v *NullableListRecordSetsOrderByStateParameter) Set(val *ListRecordSetsOrderByStateParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsOrderByStateParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsOrderByStateParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsOrderByStateParameter(val *ListRecordSetsOrderByStateParameter) *NullableListRecordSetsOrderByStateParameter { + return &NullableListRecordSetsOrderByStateParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsOrderByStateParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsOrderByStateParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_order_by_type__parameter.go b/services/dns/v1api/model_list_record_sets_order_by_type__parameter.go new file mode 100644 index 000000000..74802cc35 --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_order_by_type__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListRecordSetsOrderByTypeParameter the model 'ListRecordSetsOrderByTypeParameter' +type ListRecordSetsOrderByTypeParameter string + +// List of ListRecordSets_orderBy_type__parameter +const ( + LISTRECORDSETSORDERBYTYPEPARAMETER_ASC ListRecordSetsOrderByTypeParameter = "ASC" + LISTRECORDSETSORDERBYTYPEPARAMETER_DESC ListRecordSetsOrderByTypeParameter = "DESC" + LISTRECORDSETSORDERBYTYPEPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsOrderByTypeParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsOrderByTypeParameter enum +var AllowedListRecordSetsOrderByTypeParameterEnumValues = []ListRecordSetsOrderByTypeParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListRecordSetsOrderByTypeParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsOrderByTypeParameter(value) + for _, existing := range AllowedListRecordSetsOrderByTypeParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSORDERBYTYPEPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsOrderByTypeParameterFromValue returns a pointer to a valid ListRecordSetsOrderByTypeParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsOrderByTypeParameterFromValue(v string) (*ListRecordSetsOrderByTypeParameter, error) { + ev := ListRecordSetsOrderByTypeParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsOrderByTypeParameter: valid values are %v", v, AllowedListRecordSetsOrderByTypeParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsOrderByTypeParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsOrderByTypeParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_orderBy_type__parameter value +func (v ListRecordSetsOrderByTypeParameter) Ptr() *ListRecordSetsOrderByTypeParameter { + return &v +} + +type NullableListRecordSetsOrderByTypeParameter struct { + value *ListRecordSetsOrderByTypeParameter + isSet bool +} + +func (v NullableListRecordSetsOrderByTypeParameter) Get() *ListRecordSetsOrderByTypeParameter { + return v.value +} + +func (v *NullableListRecordSetsOrderByTypeParameter) Set(val *ListRecordSetsOrderByTypeParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsOrderByTypeParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsOrderByTypeParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsOrderByTypeParameter(val *ListRecordSetsOrderByTypeParameter) *NullableListRecordSetsOrderByTypeParameter { + return &NullableListRecordSetsOrderByTypeParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsOrderByTypeParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsOrderByTypeParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_order_by_update_finished__parameter.go b/services/dns/v1api/model_list_record_sets_order_by_update_finished__parameter.go new file mode 100644 index 000000000..8f6a6b1a3 --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_order_by_update_finished__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListRecordSetsOrderByUpdateFinishedParameter the model 'ListRecordSetsOrderByUpdateFinishedParameter' +type ListRecordSetsOrderByUpdateFinishedParameter string + +// List of ListRecordSets_orderBy_updateFinished__parameter +const ( + LISTRECORDSETSORDERBYUPDATEFINISHEDPARAMETER_ASC ListRecordSetsOrderByUpdateFinishedParameter = "ASC" + LISTRECORDSETSORDERBYUPDATEFINISHEDPARAMETER_DESC ListRecordSetsOrderByUpdateFinishedParameter = "DESC" + LISTRECORDSETSORDERBYUPDATEFINISHEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsOrderByUpdateFinishedParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsOrderByUpdateFinishedParameter enum +var AllowedListRecordSetsOrderByUpdateFinishedParameterEnumValues = []ListRecordSetsOrderByUpdateFinishedParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListRecordSetsOrderByUpdateFinishedParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsOrderByUpdateFinishedParameter(value) + for _, existing := range AllowedListRecordSetsOrderByUpdateFinishedParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSORDERBYUPDATEFINISHEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsOrderByUpdateFinishedParameterFromValue returns a pointer to a valid ListRecordSetsOrderByUpdateFinishedParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsOrderByUpdateFinishedParameterFromValue(v string) (*ListRecordSetsOrderByUpdateFinishedParameter, error) { + ev := ListRecordSetsOrderByUpdateFinishedParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsOrderByUpdateFinishedParameter: valid values are %v", v, AllowedListRecordSetsOrderByUpdateFinishedParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsOrderByUpdateFinishedParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsOrderByUpdateFinishedParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_orderBy_updateFinished__parameter value +func (v ListRecordSetsOrderByUpdateFinishedParameter) Ptr() *ListRecordSetsOrderByUpdateFinishedParameter { + return &v +} + +type NullableListRecordSetsOrderByUpdateFinishedParameter struct { + value *ListRecordSetsOrderByUpdateFinishedParameter + isSet bool +} + +func (v NullableListRecordSetsOrderByUpdateFinishedParameter) Get() *ListRecordSetsOrderByUpdateFinishedParameter { + return v.value +} + +func (v *NullableListRecordSetsOrderByUpdateFinishedParameter) Set(val *ListRecordSetsOrderByUpdateFinishedParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsOrderByUpdateFinishedParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsOrderByUpdateFinishedParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsOrderByUpdateFinishedParameter(val *ListRecordSetsOrderByUpdateFinishedParameter) *NullableListRecordSetsOrderByUpdateFinishedParameter { + return &NullableListRecordSetsOrderByUpdateFinishedParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsOrderByUpdateFinishedParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsOrderByUpdateFinishedParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_order_by_update_started__parameter.go b/services/dns/v1api/model_list_record_sets_order_by_update_started__parameter.go new file mode 100644 index 000000000..78f456102 --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_order_by_update_started__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListRecordSetsOrderByUpdateStartedParameter the model 'ListRecordSetsOrderByUpdateStartedParameter' +type ListRecordSetsOrderByUpdateStartedParameter string + +// List of ListRecordSets_orderBy_updateStarted__parameter +const ( + LISTRECORDSETSORDERBYUPDATESTARTEDPARAMETER_ASC ListRecordSetsOrderByUpdateStartedParameter = "ASC" + LISTRECORDSETSORDERBYUPDATESTARTEDPARAMETER_DESC ListRecordSetsOrderByUpdateStartedParameter = "DESC" + LISTRECORDSETSORDERBYUPDATESTARTEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsOrderByUpdateStartedParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsOrderByUpdateStartedParameter enum +var AllowedListRecordSetsOrderByUpdateStartedParameterEnumValues = []ListRecordSetsOrderByUpdateStartedParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListRecordSetsOrderByUpdateStartedParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsOrderByUpdateStartedParameter(value) + for _, existing := range AllowedListRecordSetsOrderByUpdateStartedParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSORDERBYUPDATESTARTEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsOrderByUpdateStartedParameterFromValue returns a pointer to a valid ListRecordSetsOrderByUpdateStartedParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsOrderByUpdateStartedParameterFromValue(v string) (*ListRecordSetsOrderByUpdateStartedParameter, error) { + ev := ListRecordSetsOrderByUpdateStartedParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsOrderByUpdateStartedParameter: valid values are %v", v, AllowedListRecordSetsOrderByUpdateStartedParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsOrderByUpdateStartedParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsOrderByUpdateStartedParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_orderBy_updateStarted__parameter value +func (v ListRecordSetsOrderByUpdateStartedParameter) Ptr() *ListRecordSetsOrderByUpdateStartedParameter { + return &v +} + +type NullableListRecordSetsOrderByUpdateStartedParameter struct { + value *ListRecordSetsOrderByUpdateStartedParameter + isSet bool +} + +func (v NullableListRecordSetsOrderByUpdateStartedParameter) Get() *ListRecordSetsOrderByUpdateStartedParameter { + return v.value +} + +func (v *NullableListRecordSetsOrderByUpdateStartedParameter) Set(val *ListRecordSetsOrderByUpdateStartedParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsOrderByUpdateStartedParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsOrderByUpdateStartedParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsOrderByUpdateStartedParameter(val *ListRecordSetsOrderByUpdateStartedParameter) *NullableListRecordSetsOrderByUpdateStartedParameter { + return &NullableListRecordSetsOrderByUpdateStartedParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsOrderByUpdateStartedParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsOrderByUpdateStartedParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_state_eq__parameter.go b/services/dns/v1api/model_list_record_sets_state_eq__parameter.go new file mode 100644 index 000000000..2448bcb7e --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_state_eq__parameter.go @@ -0,0 +1,128 @@ +/* +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" +) + +// ListRecordSetsStateEqParameter the model 'ListRecordSetsStateEqParameter' +type ListRecordSetsStateEqParameter string + +// List of ListRecordSets_state_eq__parameter +const ( + LISTRECORDSETSSTATEEQPARAMETER_CREATING ListRecordSetsStateEqParameter = "CREATING" + LISTRECORDSETSSTATEEQPARAMETER_CREATE_SUCCEEDED ListRecordSetsStateEqParameter = "CREATE_SUCCEEDED" + LISTRECORDSETSSTATEEQPARAMETER_CREATE_FAILED ListRecordSetsStateEqParameter = "CREATE_FAILED" + LISTRECORDSETSSTATEEQPARAMETER_DELETING ListRecordSetsStateEqParameter = "DELETING" + LISTRECORDSETSSTATEEQPARAMETER_DELETE_SUCCEEDED ListRecordSetsStateEqParameter = "DELETE_SUCCEEDED" + LISTRECORDSETSSTATEEQPARAMETER_DELETE_FAILED ListRecordSetsStateEqParameter = "DELETE_FAILED" + LISTRECORDSETSSTATEEQPARAMETER_UPDATING ListRecordSetsStateEqParameter = "UPDATING" + LISTRECORDSETSSTATEEQPARAMETER_UPDATE_SUCCEEDED ListRecordSetsStateEqParameter = "UPDATE_SUCCEEDED" + LISTRECORDSETSSTATEEQPARAMETER_UPDATE_FAILED ListRecordSetsStateEqParameter = "UPDATE_FAILED" + LISTRECORDSETSSTATEEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsStateEqParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsStateEqParameter enum +var AllowedListRecordSetsStateEqParameterEnumValues = []ListRecordSetsStateEqParameter{ + "CREATING", + "CREATE_SUCCEEDED", + "CREATE_FAILED", + "DELETING", + "DELETE_SUCCEEDED", + "DELETE_FAILED", + "UPDATING", + "UPDATE_SUCCEEDED", + "UPDATE_FAILED", + "unknown_default_open_api", +} + +func (v *ListRecordSetsStateEqParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsStateEqParameter(value) + for _, existing := range AllowedListRecordSetsStateEqParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSSTATEEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsStateEqParameterFromValue returns a pointer to a valid ListRecordSetsStateEqParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsStateEqParameterFromValue(v string) (*ListRecordSetsStateEqParameter, error) { + ev := ListRecordSetsStateEqParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsStateEqParameter: valid values are %v", v, AllowedListRecordSetsStateEqParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsStateEqParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsStateEqParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_state_eq__parameter value +func (v ListRecordSetsStateEqParameter) Ptr() *ListRecordSetsStateEqParameter { + return &v +} + +type NullableListRecordSetsStateEqParameter struct { + value *ListRecordSetsStateEqParameter + isSet bool +} + +func (v NullableListRecordSetsStateEqParameter) Get() *ListRecordSetsStateEqParameter { + return v.value +} + +func (v *NullableListRecordSetsStateEqParameter) Set(val *ListRecordSetsStateEqParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsStateEqParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsStateEqParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsStateEqParameter(val *ListRecordSetsStateEqParameter) *NullableListRecordSetsStateEqParameter { + return &NullableListRecordSetsStateEqParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsStateEqParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsStateEqParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_state_neq__parameter.go b/services/dns/v1api/model_list_record_sets_state_neq__parameter.go new file mode 100644 index 000000000..8ed1987b1 --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_state_neq__parameter.go @@ -0,0 +1,128 @@ +/* +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" +) + +// ListRecordSetsStateNeqParameter the model 'ListRecordSetsStateNeqParameter' +type ListRecordSetsStateNeqParameter string + +// List of ListRecordSets_state_neq__parameter +const ( + LISTRECORDSETSSTATENEQPARAMETER_CREATING ListRecordSetsStateNeqParameter = "CREATING" + LISTRECORDSETSSTATENEQPARAMETER_CREATE_SUCCEEDED ListRecordSetsStateNeqParameter = "CREATE_SUCCEEDED" + LISTRECORDSETSSTATENEQPARAMETER_CREATE_FAILED ListRecordSetsStateNeqParameter = "CREATE_FAILED" + LISTRECORDSETSSTATENEQPARAMETER_DELETING ListRecordSetsStateNeqParameter = "DELETING" + LISTRECORDSETSSTATENEQPARAMETER_DELETE_SUCCEEDED ListRecordSetsStateNeqParameter = "DELETE_SUCCEEDED" + LISTRECORDSETSSTATENEQPARAMETER_DELETE_FAILED ListRecordSetsStateNeqParameter = "DELETE_FAILED" + LISTRECORDSETSSTATENEQPARAMETER_UPDATING ListRecordSetsStateNeqParameter = "UPDATING" + LISTRECORDSETSSTATENEQPARAMETER_UPDATE_SUCCEEDED ListRecordSetsStateNeqParameter = "UPDATE_SUCCEEDED" + LISTRECORDSETSSTATENEQPARAMETER_UPDATE_FAILED ListRecordSetsStateNeqParameter = "UPDATE_FAILED" + LISTRECORDSETSSTATENEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsStateNeqParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsStateNeqParameter enum +var AllowedListRecordSetsStateNeqParameterEnumValues = []ListRecordSetsStateNeqParameter{ + "CREATING", + "CREATE_SUCCEEDED", + "CREATE_FAILED", + "DELETING", + "DELETE_SUCCEEDED", + "DELETE_FAILED", + "UPDATING", + "UPDATE_SUCCEEDED", + "UPDATE_FAILED", + "unknown_default_open_api", +} + +func (v *ListRecordSetsStateNeqParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsStateNeqParameter(value) + for _, existing := range AllowedListRecordSetsStateNeqParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSSTATENEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsStateNeqParameterFromValue returns a pointer to a valid ListRecordSetsStateNeqParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsStateNeqParameterFromValue(v string) (*ListRecordSetsStateNeqParameter, error) { + ev := ListRecordSetsStateNeqParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsStateNeqParameter: valid values are %v", v, AllowedListRecordSetsStateNeqParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsStateNeqParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsStateNeqParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_state_neq__parameter value +func (v ListRecordSetsStateNeqParameter) Ptr() *ListRecordSetsStateNeqParameter { + return &v +} + +type NullableListRecordSetsStateNeqParameter struct { + value *ListRecordSetsStateNeqParameter + isSet bool +} + +func (v NullableListRecordSetsStateNeqParameter) Get() *ListRecordSetsStateNeqParameter { + return v.value +} + +func (v *NullableListRecordSetsStateNeqParameter) Set(val *ListRecordSetsStateNeqParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsStateNeqParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsStateNeqParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsStateNeqParameter(val *ListRecordSetsStateNeqParameter) *NullableListRecordSetsStateNeqParameter { + return &NullableListRecordSetsStateNeqParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsStateNeqParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsStateNeqParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_record_sets_type_eq__parameter.go b/services/dns/v1api/model_list_record_sets_type_eq__parameter.go new file mode 100644 index 000000000..a5bd8c583 --- /dev/null +++ b/services/dns/v1api/model_list_record_sets_type_eq__parameter.go @@ -0,0 +1,160 @@ +/* +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" +) + +// ListRecordSetsTypeEqParameter the model 'ListRecordSetsTypeEqParameter' +type ListRecordSetsTypeEqParameter string + +// List of ListRecordSets_type_eq__parameter +const ( + LISTRECORDSETSTYPEEQPARAMETER_A ListRecordSetsTypeEqParameter = "A" + LISTRECORDSETSTYPEEQPARAMETER_AAAA ListRecordSetsTypeEqParameter = "AAAA" + LISTRECORDSETSTYPEEQPARAMETER_SOA ListRecordSetsTypeEqParameter = "SOA" + LISTRECORDSETSTYPEEQPARAMETER_CNAME ListRecordSetsTypeEqParameter = "CNAME" + LISTRECORDSETSTYPEEQPARAMETER_NS ListRecordSetsTypeEqParameter = "NS" + LISTRECORDSETSTYPEEQPARAMETER_MX ListRecordSetsTypeEqParameter = "MX" + LISTRECORDSETSTYPEEQPARAMETER_TXT ListRecordSetsTypeEqParameter = "TXT" + LISTRECORDSETSTYPEEQPARAMETER_SRV ListRecordSetsTypeEqParameter = "SRV" + LISTRECORDSETSTYPEEQPARAMETER_PTR ListRecordSetsTypeEqParameter = "PTR" + LISTRECORDSETSTYPEEQPARAMETER_ALIAS ListRecordSetsTypeEqParameter = "ALIAS" + LISTRECORDSETSTYPEEQPARAMETER_DNAME ListRecordSetsTypeEqParameter = "DNAME" + LISTRECORDSETSTYPEEQPARAMETER_CAA ListRecordSetsTypeEqParameter = "CAA" + LISTRECORDSETSTYPEEQPARAMETER_DNSKEY ListRecordSetsTypeEqParameter = "DNSKEY" + LISTRECORDSETSTYPEEQPARAMETER_DS ListRecordSetsTypeEqParameter = "DS" + LISTRECORDSETSTYPEEQPARAMETER_LOC ListRecordSetsTypeEqParameter = "LOC" + LISTRECORDSETSTYPEEQPARAMETER_NAPTR ListRecordSetsTypeEqParameter = "NAPTR" + LISTRECORDSETSTYPEEQPARAMETER_SSHFP ListRecordSetsTypeEqParameter = "SSHFP" + LISTRECORDSETSTYPEEQPARAMETER_TLSA ListRecordSetsTypeEqParameter = "TLSA" + LISTRECORDSETSTYPEEQPARAMETER_URI ListRecordSetsTypeEqParameter = "URI" + LISTRECORDSETSTYPEEQPARAMETER_CERT ListRecordSetsTypeEqParameter = "CERT" + LISTRECORDSETSTYPEEQPARAMETER_SVCB ListRecordSetsTypeEqParameter = "SVCB" + LISTRECORDSETSTYPEEQPARAMETER_TYPE ListRecordSetsTypeEqParameter = "TYPE" + LISTRECORDSETSTYPEEQPARAMETER_CSYNC ListRecordSetsTypeEqParameter = "CSYNC" + LISTRECORDSETSTYPEEQPARAMETER_HINFO ListRecordSetsTypeEqParameter = "HINFO" + LISTRECORDSETSTYPEEQPARAMETER_HTTPS ListRecordSetsTypeEqParameter = "HTTPS" + LISTRECORDSETSTYPEEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRecordSetsTypeEqParameter = "unknown_default_open_api" +) + +// All allowed values of ListRecordSetsTypeEqParameter enum +var AllowedListRecordSetsTypeEqParameterEnumValues = []ListRecordSetsTypeEqParameter{ + "A", + "AAAA", + "SOA", + "CNAME", + "NS", + "MX", + "TXT", + "SRV", + "PTR", + "ALIAS", + "DNAME", + "CAA", + "DNSKEY", + "DS", + "LOC", + "NAPTR", + "SSHFP", + "TLSA", + "URI", + "CERT", + "SVCB", + "TYPE", + "CSYNC", + "HINFO", + "HTTPS", + "unknown_default_open_api", +} + +func (v *ListRecordSetsTypeEqParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRecordSetsTypeEqParameter(value) + for _, existing := range AllowedListRecordSetsTypeEqParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRECORDSETSTYPEEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRecordSetsTypeEqParameterFromValue returns a pointer to a valid ListRecordSetsTypeEqParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRecordSetsTypeEqParameterFromValue(v string) (*ListRecordSetsTypeEqParameter, error) { + ev := ListRecordSetsTypeEqParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRecordSetsTypeEqParameter: valid values are %v", v, AllowedListRecordSetsTypeEqParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRecordSetsTypeEqParameter) IsValid() bool { + for _, existing := range AllowedListRecordSetsTypeEqParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRecordSets_type_eq__parameter value +func (v ListRecordSetsTypeEqParameter) Ptr() *ListRecordSetsTypeEqParameter { + return &v +} + +type NullableListRecordSetsTypeEqParameter struct { + value *ListRecordSetsTypeEqParameter + isSet bool +} + +func (v NullableListRecordSetsTypeEqParameter) Get() *ListRecordSetsTypeEqParameter { + return v.value +} + +func (v *NullableListRecordSetsTypeEqParameter) Set(val *ListRecordSetsTypeEqParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRecordSetsTypeEqParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRecordSetsTypeEqParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRecordSetsTypeEqParameter(val *ListRecordSetsTypeEqParameter) *NullableListRecordSetsTypeEqParameter { + return &NullableListRecordSetsTypeEqParameter{value: val, isSet: true} +} + +func (v NullableListRecordSetsTypeEqParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRecordSetsTypeEqParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_order_by_creation_finished__parameter.go b/services/dns/v1api/model_list_zones_order_by_creation_finished__parameter.go new file mode 100644 index 000000000..e14e9c907 --- /dev/null +++ b/services/dns/v1api/model_list_zones_order_by_creation_finished__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListZonesOrderByCreationFinishedParameter the model 'ListZonesOrderByCreationFinishedParameter' +type ListZonesOrderByCreationFinishedParameter string + +// List of ListZones_orderBy_creationFinished__parameter +const ( + LISTZONESORDERBYCREATIONFINISHEDPARAMETER_ASC ListZonesOrderByCreationFinishedParameter = "ASC" + LISTZONESORDERBYCREATIONFINISHEDPARAMETER_DESC ListZonesOrderByCreationFinishedParameter = "DESC" + LISTZONESORDERBYCREATIONFINISHEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesOrderByCreationFinishedParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesOrderByCreationFinishedParameter enum +var AllowedListZonesOrderByCreationFinishedParameterEnumValues = []ListZonesOrderByCreationFinishedParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListZonesOrderByCreationFinishedParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesOrderByCreationFinishedParameter(value) + for _, existing := range AllowedListZonesOrderByCreationFinishedParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESORDERBYCREATIONFINISHEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesOrderByCreationFinishedParameterFromValue returns a pointer to a valid ListZonesOrderByCreationFinishedParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesOrderByCreationFinishedParameterFromValue(v string) (*ListZonesOrderByCreationFinishedParameter, error) { + ev := ListZonesOrderByCreationFinishedParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesOrderByCreationFinishedParameter: valid values are %v", v, AllowedListZonesOrderByCreationFinishedParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesOrderByCreationFinishedParameter) IsValid() bool { + for _, existing := range AllowedListZonesOrderByCreationFinishedParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_orderBy_creationFinished__parameter value +func (v ListZonesOrderByCreationFinishedParameter) Ptr() *ListZonesOrderByCreationFinishedParameter { + return &v +} + +type NullableListZonesOrderByCreationFinishedParameter struct { + value *ListZonesOrderByCreationFinishedParameter + isSet bool +} + +func (v NullableListZonesOrderByCreationFinishedParameter) Get() *ListZonesOrderByCreationFinishedParameter { + return v.value +} + +func (v *NullableListZonesOrderByCreationFinishedParameter) Set(val *ListZonesOrderByCreationFinishedParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesOrderByCreationFinishedParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesOrderByCreationFinishedParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesOrderByCreationFinishedParameter(val *ListZonesOrderByCreationFinishedParameter) *NullableListZonesOrderByCreationFinishedParameter { + return &NullableListZonesOrderByCreationFinishedParameter{value: val, isSet: true} +} + +func (v NullableListZonesOrderByCreationFinishedParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesOrderByCreationFinishedParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_order_by_creation_started__parameter.go b/services/dns/v1api/model_list_zones_order_by_creation_started__parameter.go new file mode 100644 index 000000000..22ec94590 --- /dev/null +++ b/services/dns/v1api/model_list_zones_order_by_creation_started__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListZonesOrderByCreationStartedParameter the model 'ListZonesOrderByCreationStartedParameter' +type ListZonesOrderByCreationStartedParameter string + +// List of ListZones_orderBy_creationStarted__parameter +const ( + LISTZONESORDERBYCREATIONSTARTEDPARAMETER_ASC ListZonesOrderByCreationStartedParameter = "ASC" + LISTZONESORDERBYCREATIONSTARTEDPARAMETER_DESC ListZonesOrderByCreationStartedParameter = "DESC" + LISTZONESORDERBYCREATIONSTARTEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesOrderByCreationStartedParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesOrderByCreationStartedParameter enum +var AllowedListZonesOrderByCreationStartedParameterEnumValues = []ListZonesOrderByCreationStartedParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListZonesOrderByCreationStartedParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesOrderByCreationStartedParameter(value) + for _, existing := range AllowedListZonesOrderByCreationStartedParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESORDERBYCREATIONSTARTEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesOrderByCreationStartedParameterFromValue returns a pointer to a valid ListZonesOrderByCreationStartedParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesOrderByCreationStartedParameterFromValue(v string) (*ListZonesOrderByCreationStartedParameter, error) { + ev := ListZonesOrderByCreationStartedParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesOrderByCreationStartedParameter: valid values are %v", v, AllowedListZonesOrderByCreationStartedParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesOrderByCreationStartedParameter) IsValid() bool { + for _, existing := range AllowedListZonesOrderByCreationStartedParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_orderBy_creationStarted__parameter value +func (v ListZonesOrderByCreationStartedParameter) Ptr() *ListZonesOrderByCreationStartedParameter { + return &v +} + +type NullableListZonesOrderByCreationStartedParameter struct { + value *ListZonesOrderByCreationStartedParameter + isSet bool +} + +func (v NullableListZonesOrderByCreationStartedParameter) Get() *ListZonesOrderByCreationStartedParameter { + return v.value +} + +func (v *NullableListZonesOrderByCreationStartedParameter) Set(val *ListZonesOrderByCreationStartedParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesOrderByCreationStartedParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesOrderByCreationStartedParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesOrderByCreationStartedParameter(val *ListZonesOrderByCreationStartedParameter) *NullableListZonesOrderByCreationStartedParameter { + return &NullableListZonesOrderByCreationStartedParameter{value: val, isSet: true} +} + +func (v NullableListZonesOrderByCreationStartedParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesOrderByCreationStartedParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_order_by_description__parameter.go b/services/dns/v1api/model_list_zones_order_by_description__parameter.go new file mode 100644 index 000000000..7ad9df8a3 --- /dev/null +++ b/services/dns/v1api/model_list_zones_order_by_description__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListZonesOrderByDescriptionParameter the model 'ListZonesOrderByDescriptionParameter' +type ListZonesOrderByDescriptionParameter string + +// List of ListZones_orderBy_description__parameter +const ( + LISTZONESORDERBYDESCRIPTIONPARAMETER_ASC ListZonesOrderByDescriptionParameter = "ASC" + LISTZONESORDERBYDESCRIPTIONPARAMETER_DESC ListZonesOrderByDescriptionParameter = "DESC" + LISTZONESORDERBYDESCRIPTIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesOrderByDescriptionParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesOrderByDescriptionParameter enum +var AllowedListZonesOrderByDescriptionParameterEnumValues = []ListZonesOrderByDescriptionParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListZonesOrderByDescriptionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesOrderByDescriptionParameter(value) + for _, existing := range AllowedListZonesOrderByDescriptionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESORDERBYDESCRIPTIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesOrderByDescriptionParameterFromValue returns a pointer to a valid ListZonesOrderByDescriptionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesOrderByDescriptionParameterFromValue(v string) (*ListZonesOrderByDescriptionParameter, error) { + ev := ListZonesOrderByDescriptionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesOrderByDescriptionParameter: valid values are %v", v, AllowedListZonesOrderByDescriptionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesOrderByDescriptionParameter) IsValid() bool { + for _, existing := range AllowedListZonesOrderByDescriptionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_orderBy_description__parameter value +func (v ListZonesOrderByDescriptionParameter) Ptr() *ListZonesOrderByDescriptionParameter { + return &v +} + +type NullableListZonesOrderByDescriptionParameter struct { + value *ListZonesOrderByDescriptionParameter + isSet bool +} + +func (v NullableListZonesOrderByDescriptionParameter) Get() *ListZonesOrderByDescriptionParameter { + return v.value +} + +func (v *NullableListZonesOrderByDescriptionParameter) Set(val *ListZonesOrderByDescriptionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesOrderByDescriptionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesOrderByDescriptionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesOrderByDescriptionParameter(val *ListZonesOrderByDescriptionParameter) *NullableListZonesOrderByDescriptionParameter { + return &NullableListZonesOrderByDescriptionParameter{value: val, isSet: true} +} + +func (v NullableListZonesOrderByDescriptionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesOrderByDescriptionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_order_by_dns_name__parameter.go b/services/dns/v1api/model_list_zones_order_by_dns_name__parameter.go new file mode 100644 index 000000000..3506fbbe0 --- /dev/null +++ b/services/dns/v1api/model_list_zones_order_by_dns_name__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListZonesOrderByDnsNameParameter the model 'ListZonesOrderByDnsNameParameter' +type ListZonesOrderByDnsNameParameter string + +// List of ListZones_orderBy_dnsName__parameter +const ( + LISTZONESORDERBYDNSNAMEPARAMETER_ASC ListZonesOrderByDnsNameParameter = "ASC" + LISTZONESORDERBYDNSNAMEPARAMETER_DESC ListZonesOrderByDnsNameParameter = "DESC" + LISTZONESORDERBYDNSNAMEPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesOrderByDnsNameParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesOrderByDnsNameParameter enum +var AllowedListZonesOrderByDnsNameParameterEnumValues = []ListZonesOrderByDnsNameParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListZonesOrderByDnsNameParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesOrderByDnsNameParameter(value) + for _, existing := range AllowedListZonesOrderByDnsNameParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESORDERBYDNSNAMEPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesOrderByDnsNameParameterFromValue returns a pointer to a valid ListZonesOrderByDnsNameParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesOrderByDnsNameParameterFromValue(v string) (*ListZonesOrderByDnsNameParameter, error) { + ev := ListZonesOrderByDnsNameParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesOrderByDnsNameParameter: valid values are %v", v, AllowedListZonesOrderByDnsNameParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesOrderByDnsNameParameter) IsValid() bool { + for _, existing := range AllowedListZonesOrderByDnsNameParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_orderBy_dnsName__parameter value +func (v ListZonesOrderByDnsNameParameter) Ptr() *ListZonesOrderByDnsNameParameter { + return &v +} + +type NullableListZonesOrderByDnsNameParameter struct { + value *ListZonesOrderByDnsNameParameter + isSet bool +} + +func (v NullableListZonesOrderByDnsNameParameter) Get() *ListZonesOrderByDnsNameParameter { + return v.value +} + +func (v *NullableListZonesOrderByDnsNameParameter) Set(val *ListZonesOrderByDnsNameParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesOrderByDnsNameParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesOrderByDnsNameParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesOrderByDnsNameParameter(val *ListZonesOrderByDnsNameParameter) *NullableListZonesOrderByDnsNameParameter { + return &NullableListZonesOrderByDnsNameParameter{value: val, isSet: true} +} + +func (v NullableListZonesOrderByDnsNameParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesOrderByDnsNameParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_order_by_name__parameter.go b/services/dns/v1api/model_list_zones_order_by_name__parameter.go new file mode 100644 index 000000000..ab16acba0 --- /dev/null +++ b/services/dns/v1api/model_list_zones_order_by_name__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListZonesOrderByNameParameter the model 'ListZonesOrderByNameParameter' +type ListZonesOrderByNameParameter string + +// List of ListZones_orderBy_name__parameter +const ( + LISTZONESORDERBYNAMEPARAMETER_ASC ListZonesOrderByNameParameter = "ASC" + LISTZONESORDERBYNAMEPARAMETER_DESC ListZonesOrderByNameParameter = "DESC" + LISTZONESORDERBYNAMEPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesOrderByNameParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesOrderByNameParameter enum +var AllowedListZonesOrderByNameParameterEnumValues = []ListZonesOrderByNameParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListZonesOrderByNameParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesOrderByNameParameter(value) + for _, existing := range AllowedListZonesOrderByNameParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESORDERBYNAMEPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesOrderByNameParameterFromValue returns a pointer to a valid ListZonesOrderByNameParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesOrderByNameParameterFromValue(v string) (*ListZonesOrderByNameParameter, error) { + ev := ListZonesOrderByNameParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesOrderByNameParameter: valid values are %v", v, AllowedListZonesOrderByNameParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesOrderByNameParameter) IsValid() bool { + for _, existing := range AllowedListZonesOrderByNameParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_orderBy_name__parameter value +func (v ListZonesOrderByNameParameter) Ptr() *ListZonesOrderByNameParameter { + return &v +} + +type NullableListZonesOrderByNameParameter struct { + value *ListZonesOrderByNameParameter + isSet bool +} + +func (v NullableListZonesOrderByNameParameter) Get() *ListZonesOrderByNameParameter { + return v.value +} + +func (v *NullableListZonesOrderByNameParameter) Set(val *ListZonesOrderByNameParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesOrderByNameParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesOrderByNameParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesOrderByNameParameter(val *ListZonesOrderByNameParameter) *NullableListZonesOrderByNameParameter { + return &NullableListZonesOrderByNameParameter{value: val, isSet: true} +} + +func (v NullableListZonesOrderByNameParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesOrderByNameParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_order_by_record_count__parameter.go b/services/dns/v1api/model_list_zones_order_by_record_count__parameter.go new file mode 100644 index 000000000..7596a75ab --- /dev/null +++ b/services/dns/v1api/model_list_zones_order_by_record_count__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListZonesOrderByRecordCountParameter the model 'ListZonesOrderByRecordCountParameter' +type ListZonesOrderByRecordCountParameter string + +// List of ListZones_orderBy_recordCount__parameter +const ( + LISTZONESORDERBYRECORDCOUNTPARAMETER_ASC ListZonesOrderByRecordCountParameter = "ASC" + LISTZONESORDERBYRECORDCOUNTPARAMETER_DESC ListZonesOrderByRecordCountParameter = "DESC" + LISTZONESORDERBYRECORDCOUNTPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesOrderByRecordCountParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesOrderByRecordCountParameter enum +var AllowedListZonesOrderByRecordCountParameterEnumValues = []ListZonesOrderByRecordCountParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListZonesOrderByRecordCountParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesOrderByRecordCountParameter(value) + for _, existing := range AllowedListZonesOrderByRecordCountParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESORDERBYRECORDCOUNTPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesOrderByRecordCountParameterFromValue returns a pointer to a valid ListZonesOrderByRecordCountParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesOrderByRecordCountParameterFromValue(v string) (*ListZonesOrderByRecordCountParameter, error) { + ev := ListZonesOrderByRecordCountParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesOrderByRecordCountParameter: valid values are %v", v, AllowedListZonesOrderByRecordCountParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesOrderByRecordCountParameter) IsValid() bool { + for _, existing := range AllowedListZonesOrderByRecordCountParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_orderBy_recordCount__parameter value +func (v ListZonesOrderByRecordCountParameter) Ptr() *ListZonesOrderByRecordCountParameter { + return &v +} + +type NullableListZonesOrderByRecordCountParameter struct { + value *ListZonesOrderByRecordCountParameter + isSet bool +} + +func (v NullableListZonesOrderByRecordCountParameter) Get() *ListZonesOrderByRecordCountParameter { + return v.value +} + +func (v *NullableListZonesOrderByRecordCountParameter) Set(val *ListZonesOrderByRecordCountParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesOrderByRecordCountParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesOrderByRecordCountParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesOrderByRecordCountParameter(val *ListZonesOrderByRecordCountParameter) *NullableListZonesOrderByRecordCountParameter { + return &NullableListZonesOrderByRecordCountParameter{value: val, isSet: true} +} + +func (v NullableListZonesOrderByRecordCountParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesOrderByRecordCountParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_order_by_type__parameter.go b/services/dns/v1api/model_list_zones_order_by_type__parameter.go new file mode 100644 index 000000000..6ad19ab04 --- /dev/null +++ b/services/dns/v1api/model_list_zones_order_by_type__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListZonesOrderByTypeParameter the model 'ListZonesOrderByTypeParameter' +type ListZonesOrderByTypeParameter string + +// List of ListZones_orderBy_type__parameter +const ( + LISTZONESORDERBYTYPEPARAMETER_ASC ListZonesOrderByTypeParameter = "ASC" + LISTZONESORDERBYTYPEPARAMETER_DESC ListZonesOrderByTypeParameter = "DESC" + LISTZONESORDERBYTYPEPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesOrderByTypeParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesOrderByTypeParameter enum +var AllowedListZonesOrderByTypeParameterEnumValues = []ListZonesOrderByTypeParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListZonesOrderByTypeParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesOrderByTypeParameter(value) + for _, existing := range AllowedListZonesOrderByTypeParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESORDERBYTYPEPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesOrderByTypeParameterFromValue returns a pointer to a valid ListZonesOrderByTypeParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesOrderByTypeParameterFromValue(v string) (*ListZonesOrderByTypeParameter, error) { + ev := ListZonesOrderByTypeParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesOrderByTypeParameter: valid values are %v", v, AllowedListZonesOrderByTypeParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesOrderByTypeParameter) IsValid() bool { + for _, existing := range AllowedListZonesOrderByTypeParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_orderBy_type__parameter value +func (v ListZonesOrderByTypeParameter) Ptr() *ListZonesOrderByTypeParameter { + return &v +} + +type NullableListZonesOrderByTypeParameter struct { + value *ListZonesOrderByTypeParameter + isSet bool +} + +func (v NullableListZonesOrderByTypeParameter) Get() *ListZonesOrderByTypeParameter { + return v.value +} + +func (v *NullableListZonesOrderByTypeParameter) Set(val *ListZonesOrderByTypeParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesOrderByTypeParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesOrderByTypeParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesOrderByTypeParameter(val *ListZonesOrderByTypeParameter) *NullableListZonesOrderByTypeParameter { + return &NullableListZonesOrderByTypeParameter{value: val, isSet: true} +} + +func (v NullableListZonesOrderByTypeParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesOrderByTypeParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_order_by_update_finished__parameter.go b/services/dns/v1api/model_list_zones_order_by_update_finished__parameter.go new file mode 100644 index 000000000..2f4ac8dbf --- /dev/null +++ b/services/dns/v1api/model_list_zones_order_by_update_finished__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListZonesOrderByUpdateFinishedParameter the model 'ListZonesOrderByUpdateFinishedParameter' +type ListZonesOrderByUpdateFinishedParameter string + +// List of ListZones_orderBy_updateFinished__parameter +const ( + LISTZONESORDERBYUPDATEFINISHEDPARAMETER_ASC ListZonesOrderByUpdateFinishedParameter = "ASC" + LISTZONESORDERBYUPDATEFINISHEDPARAMETER_DESC ListZonesOrderByUpdateFinishedParameter = "DESC" + LISTZONESORDERBYUPDATEFINISHEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesOrderByUpdateFinishedParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesOrderByUpdateFinishedParameter enum +var AllowedListZonesOrderByUpdateFinishedParameterEnumValues = []ListZonesOrderByUpdateFinishedParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListZonesOrderByUpdateFinishedParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesOrderByUpdateFinishedParameter(value) + for _, existing := range AllowedListZonesOrderByUpdateFinishedParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESORDERBYUPDATEFINISHEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesOrderByUpdateFinishedParameterFromValue returns a pointer to a valid ListZonesOrderByUpdateFinishedParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesOrderByUpdateFinishedParameterFromValue(v string) (*ListZonesOrderByUpdateFinishedParameter, error) { + ev := ListZonesOrderByUpdateFinishedParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesOrderByUpdateFinishedParameter: valid values are %v", v, AllowedListZonesOrderByUpdateFinishedParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesOrderByUpdateFinishedParameter) IsValid() bool { + for _, existing := range AllowedListZonesOrderByUpdateFinishedParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_orderBy_updateFinished__parameter value +func (v ListZonesOrderByUpdateFinishedParameter) Ptr() *ListZonesOrderByUpdateFinishedParameter { + return &v +} + +type NullableListZonesOrderByUpdateFinishedParameter struct { + value *ListZonesOrderByUpdateFinishedParameter + isSet bool +} + +func (v NullableListZonesOrderByUpdateFinishedParameter) Get() *ListZonesOrderByUpdateFinishedParameter { + return v.value +} + +func (v *NullableListZonesOrderByUpdateFinishedParameter) Set(val *ListZonesOrderByUpdateFinishedParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesOrderByUpdateFinishedParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesOrderByUpdateFinishedParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesOrderByUpdateFinishedParameter(val *ListZonesOrderByUpdateFinishedParameter) *NullableListZonesOrderByUpdateFinishedParameter { + return &NullableListZonesOrderByUpdateFinishedParameter{value: val, isSet: true} +} + +func (v NullableListZonesOrderByUpdateFinishedParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesOrderByUpdateFinishedParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_order_by_update_started__parameter.go b/services/dns/v1api/model_list_zones_order_by_update_started__parameter.go new file mode 100644 index 000000000..d29e34376 --- /dev/null +++ b/services/dns/v1api/model_list_zones_order_by_update_started__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListZonesOrderByUpdateStartedParameter the model 'ListZonesOrderByUpdateStartedParameter' +type ListZonesOrderByUpdateStartedParameter string + +// List of ListZones_orderBy_updateStarted__parameter +const ( + LISTZONESORDERBYUPDATESTARTEDPARAMETER_ASC ListZonesOrderByUpdateStartedParameter = "ASC" + LISTZONESORDERBYUPDATESTARTEDPARAMETER_DESC ListZonesOrderByUpdateStartedParameter = "DESC" + LISTZONESORDERBYUPDATESTARTEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesOrderByUpdateStartedParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesOrderByUpdateStartedParameter enum +var AllowedListZonesOrderByUpdateStartedParameterEnumValues = []ListZonesOrderByUpdateStartedParameter{ + "ASC", + "DESC", + "unknown_default_open_api", +} + +func (v *ListZonesOrderByUpdateStartedParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesOrderByUpdateStartedParameter(value) + for _, existing := range AllowedListZonesOrderByUpdateStartedParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESORDERBYUPDATESTARTEDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesOrderByUpdateStartedParameterFromValue returns a pointer to a valid ListZonesOrderByUpdateStartedParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesOrderByUpdateStartedParameterFromValue(v string) (*ListZonesOrderByUpdateStartedParameter, error) { + ev := ListZonesOrderByUpdateStartedParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesOrderByUpdateStartedParameter: valid values are %v", v, AllowedListZonesOrderByUpdateStartedParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesOrderByUpdateStartedParameter) IsValid() bool { + for _, existing := range AllowedListZonesOrderByUpdateStartedParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_orderBy_updateStarted__parameter value +func (v ListZonesOrderByUpdateStartedParameter) Ptr() *ListZonesOrderByUpdateStartedParameter { + return &v +} + +type NullableListZonesOrderByUpdateStartedParameter struct { + value *ListZonesOrderByUpdateStartedParameter + isSet bool +} + +func (v NullableListZonesOrderByUpdateStartedParameter) Get() *ListZonesOrderByUpdateStartedParameter { + return v.value +} + +func (v *NullableListZonesOrderByUpdateStartedParameter) Set(val *ListZonesOrderByUpdateStartedParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesOrderByUpdateStartedParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesOrderByUpdateStartedParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesOrderByUpdateStartedParameter(val *ListZonesOrderByUpdateStartedParameter) *NullableListZonesOrderByUpdateStartedParameter { + return &NullableListZonesOrderByUpdateStartedParameter{value: val, isSet: true} +} + +func (v NullableListZonesOrderByUpdateStartedParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesOrderByUpdateStartedParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_state_eq__parameter.go b/services/dns/v1api/model_list_zones_state_eq__parameter.go new file mode 100644 index 000000000..076e09895 --- /dev/null +++ b/services/dns/v1api/model_list_zones_state_eq__parameter.go @@ -0,0 +1,128 @@ +/* +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" +) + +// ListZonesStateEqParameter the model 'ListZonesStateEqParameter' +type ListZonesStateEqParameter string + +// List of ListZones_state_eq__parameter +const ( + LISTZONESSTATEEQPARAMETER_CREATING ListZonesStateEqParameter = "CREATING" + LISTZONESSTATEEQPARAMETER_CREATE_SUCCEEDED ListZonesStateEqParameter = "CREATE_SUCCEEDED" + LISTZONESSTATEEQPARAMETER_CREATE_FAILED ListZonesStateEqParameter = "CREATE_FAILED" + LISTZONESSTATEEQPARAMETER_DELETING ListZonesStateEqParameter = "DELETING" + LISTZONESSTATEEQPARAMETER_DELETE_SUCCEEDED ListZonesStateEqParameter = "DELETE_SUCCEEDED" + LISTZONESSTATEEQPARAMETER_DELETE_FAILED ListZonesStateEqParameter = "DELETE_FAILED" + LISTZONESSTATEEQPARAMETER_UPDATING ListZonesStateEqParameter = "UPDATING" + LISTZONESSTATEEQPARAMETER_UPDATE_SUCCEEDED ListZonesStateEqParameter = "UPDATE_SUCCEEDED" + LISTZONESSTATEEQPARAMETER_UPDATE_FAILED ListZonesStateEqParameter = "UPDATE_FAILED" + LISTZONESSTATEEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesStateEqParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesStateEqParameter enum +var AllowedListZonesStateEqParameterEnumValues = []ListZonesStateEqParameter{ + "CREATING", + "CREATE_SUCCEEDED", + "CREATE_FAILED", + "DELETING", + "DELETE_SUCCEEDED", + "DELETE_FAILED", + "UPDATING", + "UPDATE_SUCCEEDED", + "UPDATE_FAILED", + "unknown_default_open_api", +} + +func (v *ListZonesStateEqParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesStateEqParameter(value) + for _, existing := range AllowedListZonesStateEqParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESSTATEEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesStateEqParameterFromValue returns a pointer to a valid ListZonesStateEqParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesStateEqParameterFromValue(v string) (*ListZonesStateEqParameter, error) { + ev := ListZonesStateEqParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesStateEqParameter: valid values are %v", v, AllowedListZonesStateEqParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesStateEqParameter) IsValid() bool { + for _, existing := range AllowedListZonesStateEqParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_state_eq__parameter value +func (v ListZonesStateEqParameter) Ptr() *ListZonesStateEqParameter { + return &v +} + +type NullableListZonesStateEqParameter struct { + value *ListZonesStateEqParameter + isSet bool +} + +func (v NullableListZonesStateEqParameter) Get() *ListZonesStateEqParameter { + return v.value +} + +func (v *NullableListZonesStateEqParameter) Set(val *ListZonesStateEqParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesStateEqParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesStateEqParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesStateEqParameter(val *ListZonesStateEqParameter) *NullableListZonesStateEqParameter { + return &NullableListZonesStateEqParameter{value: val, isSet: true} +} + +func (v NullableListZonesStateEqParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesStateEqParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_state_neq__parameter.go b/services/dns/v1api/model_list_zones_state_neq__parameter.go new file mode 100644 index 000000000..79ddc36a3 --- /dev/null +++ b/services/dns/v1api/model_list_zones_state_neq__parameter.go @@ -0,0 +1,128 @@ +/* +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" +) + +// ListZonesStateNeqParameter the model 'ListZonesStateNeqParameter' +type ListZonesStateNeqParameter string + +// List of ListZones_state_neq__parameter +const ( + LISTZONESSTATENEQPARAMETER_CREATING ListZonesStateNeqParameter = "CREATING" + LISTZONESSTATENEQPARAMETER_CREATE_SUCCEEDED ListZonesStateNeqParameter = "CREATE_SUCCEEDED" + LISTZONESSTATENEQPARAMETER_CREATE_FAILED ListZonesStateNeqParameter = "CREATE_FAILED" + LISTZONESSTATENEQPARAMETER_DELETING ListZonesStateNeqParameter = "DELETING" + LISTZONESSTATENEQPARAMETER_DELETE_SUCCEEDED ListZonesStateNeqParameter = "DELETE_SUCCEEDED" + LISTZONESSTATENEQPARAMETER_DELETE_FAILED ListZonesStateNeqParameter = "DELETE_FAILED" + LISTZONESSTATENEQPARAMETER_UPDATING ListZonesStateNeqParameter = "UPDATING" + LISTZONESSTATENEQPARAMETER_UPDATE_SUCCEEDED ListZonesStateNeqParameter = "UPDATE_SUCCEEDED" + LISTZONESSTATENEQPARAMETER_UPDATE_FAILED ListZonesStateNeqParameter = "UPDATE_FAILED" + LISTZONESSTATENEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesStateNeqParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesStateNeqParameter enum +var AllowedListZonesStateNeqParameterEnumValues = []ListZonesStateNeqParameter{ + "CREATING", + "CREATE_SUCCEEDED", + "CREATE_FAILED", + "DELETING", + "DELETE_SUCCEEDED", + "DELETE_FAILED", + "UPDATING", + "UPDATE_SUCCEEDED", + "UPDATE_FAILED", + "unknown_default_open_api", +} + +func (v *ListZonesStateNeqParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesStateNeqParameter(value) + for _, existing := range AllowedListZonesStateNeqParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESSTATENEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesStateNeqParameterFromValue returns a pointer to a valid ListZonesStateNeqParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesStateNeqParameterFromValue(v string) (*ListZonesStateNeqParameter, error) { + ev := ListZonesStateNeqParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesStateNeqParameter: valid values are %v", v, AllowedListZonesStateNeqParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesStateNeqParameter) IsValid() bool { + for _, existing := range AllowedListZonesStateNeqParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_state_neq__parameter value +func (v ListZonesStateNeqParameter) Ptr() *ListZonesStateNeqParameter { + return &v +} + +type NullableListZonesStateNeqParameter struct { + value *ListZonesStateNeqParameter + isSet bool +} + +func (v NullableListZonesStateNeqParameter) Get() *ListZonesStateNeqParameter { + return v.value +} + +func (v *NullableListZonesStateNeqParameter) Set(val *ListZonesStateNeqParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesStateNeqParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesStateNeqParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesStateNeqParameter(val *ListZonesStateNeqParameter) *NullableListZonesStateNeqParameter { + return &NullableListZonesStateNeqParameter{value: val, isSet: true} +} + +func (v NullableListZonesStateNeqParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesStateNeqParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_list_zones_type_eq__parameter.go b/services/dns/v1api/model_list_zones_type_eq__parameter.go new file mode 100644 index 000000000..400b0a874 --- /dev/null +++ b/services/dns/v1api/model_list_zones_type_eq__parameter.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ListZonesTypeEqParameter the model 'ListZonesTypeEqParameter' +type ListZonesTypeEqParameter string + +// List of ListZones_type_eq__parameter +const ( + LISTZONESTYPEEQPARAMETER_PRIMARY ListZonesTypeEqParameter = "primary" + LISTZONESTYPEEQPARAMETER_SECONDARY ListZonesTypeEqParameter = "secondary" + LISTZONESTYPEEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListZonesTypeEqParameter = "unknown_default_open_api" +) + +// All allowed values of ListZonesTypeEqParameter enum +var AllowedListZonesTypeEqParameterEnumValues = []ListZonesTypeEqParameter{ + "primary", + "secondary", + "unknown_default_open_api", +} + +func (v *ListZonesTypeEqParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListZonesTypeEqParameter(value) + for _, existing := range AllowedListZonesTypeEqParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTZONESTYPEEQPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListZonesTypeEqParameterFromValue returns a pointer to a valid ListZonesTypeEqParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListZonesTypeEqParameterFromValue(v string) (*ListZonesTypeEqParameter, error) { + ev := ListZonesTypeEqParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListZonesTypeEqParameter: valid values are %v", v, AllowedListZonesTypeEqParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListZonesTypeEqParameter) IsValid() bool { + for _, existing := range AllowedListZonesTypeEqParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListZones_type_eq__parameter value +func (v ListZonesTypeEqParameter) Ptr() *ListZonesTypeEqParameter { + return &v +} + +type NullableListZonesTypeEqParameter struct { + value *ListZonesTypeEqParameter + isSet bool +} + +func (v NullableListZonesTypeEqParameter) Get() *ListZonesTypeEqParameter { + return v.value +} + +func (v *NullableListZonesTypeEqParameter) Set(val *ListZonesTypeEqParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListZonesTypeEqParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListZonesTypeEqParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListZonesTypeEqParameter(val *ListZonesTypeEqParameter) *NullableListZonesTypeEqParameter { + return &NullableListZonesTypeEqParameter{value: val, isSet: true} +} + +func (v NullableListZonesTypeEqParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListZonesTypeEqParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_partial_update_record_payload.go b/services/dns/v1api/model_partial_update_record_payload.go index 61388d724..bd3fc677e 100644 --- a/services/dns/v1api/model_partial_update_record_payload.go +++ b/services/dns/v1api/model_partial_update_record_payload.go @@ -21,7 +21,7 @@ var _ MappedNullable = &PartialUpdateRecordPayload{} // PartialUpdateRecordPayload RecordPatch for record patch in record set. type PartialUpdateRecordPayload struct { - Action string `json:"action"` + Action PartialUpdateRecordPayloadAction `json:"action"` // records Records []RecordPayload `json:"records"` AdditionalProperties map[string]interface{} @@ -33,7 +33,7 @@ type _PartialUpdateRecordPayload PartialUpdateRecordPayload // 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 NewPartialUpdateRecordPayload(action string, records []RecordPayload) *PartialUpdateRecordPayload { +func NewPartialUpdateRecordPayload(action PartialUpdateRecordPayloadAction, records []RecordPayload) *PartialUpdateRecordPayload { this := PartialUpdateRecordPayload{} this.Action = action this.Records = records @@ -49,9 +49,9 @@ func NewPartialUpdateRecordPayloadWithDefaults() *PartialUpdateRecordPayload { } // GetAction returns the Action field value -func (o *PartialUpdateRecordPayload) GetAction() string { +func (o *PartialUpdateRecordPayload) GetAction() PartialUpdateRecordPayloadAction { if o == nil { - var ret string + var ret PartialUpdateRecordPayloadAction return ret } @@ -60,7 +60,7 @@ func (o *PartialUpdateRecordPayload) GetAction() string { // GetActionOk returns a tuple with the Action field value // and a boolean to check if the value has been set. -func (o *PartialUpdateRecordPayload) GetActionOk() (*string, bool) { +func (o *PartialUpdateRecordPayload) GetActionOk() (*PartialUpdateRecordPayloadAction, bool) { if o == nil { return nil, false } @@ -68,7 +68,7 @@ func (o *PartialUpdateRecordPayload) GetActionOk() (*string, bool) { } // SetAction sets field value -func (o *PartialUpdateRecordPayload) SetAction(v string) { +func (o *PartialUpdateRecordPayload) SetAction(v PartialUpdateRecordPayloadAction) { o.Action = v } diff --git a/services/dns/v1api/model_partial_update_record_payload_action.go b/services/dns/v1api/model_partial_update_record_payload_action.go new file mode 100644 index 000000000..3fa599bfb --- /dev/null +++ b/services/dns/v1api/model_partial_update_record_payload_action.go @@ -0,0 +1,114 @@ +/* +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" +) + +// PartialUpdateRecordPayloadAction the model 'PartialUpdateRecordPayloadAction' +type PartialUpdateRecordPayloadAction string + +// List of PartialUpdateRecordPayload_action +const ( + PARTIALUPDATERECORDPAYLOADACTION_ADD PartialUpdateRecordPayloadAction = "add" + PARTIALUPDATERECORDPAYLOADACTION_DELETE PartialUpdateRecordPayloadAction = "delete" + PARTIALUPDATERECORDPAYLOADACTION_UNKNOWN_DEFAULT_OPEN_API PartialUpdateRecordPayloadAction = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateRecordPayloadAction enum +var AllowedPartialUpdateRecordPayloadActionEnumValues = []PartialUpdateRecordPayloadAction{ + "add", + "delete", + "unknown_default_open_api", +} + +func (v *PartialUpdateRecordPayloadAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateRecordPayloadAction(value) + for _, existing := range AllowedPartialUpdateRecordPayloadActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATERECORDPAYLOADACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateRecordPayloadActionFromValue returns a pointer to a valid PartialUpdateRecordPayloadAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateRecordPayloadActionFromValue(v string) (*PartialUpdateRecordPayloadAction, error) { + ev := PartialUpdateRecordPayloadAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateRecordPayloadAction: valid values are %v", v, AllowedPartialUpdateRecordPayloadActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateRecordPayloadAction) IsValid() bool { + for _, existing := range AllowedPartialUpdateRecordPayloadActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateRecordPayload_action value +func (v PartialUpdateRecordPayloadAction) Ptr() *PartialUpdateRecordPayloadAction { + return &v +} + +type NullablePartialUpdateRecordPayloadAction struct { + value *PartialUpdateRecordPayloadAction + isSet bool +} + +func (v NullablePartialUpdateRecordPayloadAction) Get() *PartialUpdateRecordPayloadAction { + return v.value +} + +func (v *NullablePartialUpdateRecordPayloadAction) Set(val *PartialUpdateRecordPayloadAction) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateRecordPayloadAction) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateRecordPayloadAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateRecordPayloadAction(val *PartialUpdateRecordPayloadAction) *NullablePartialUpdateRecordPayloadAction { + return &NullablePartialUpdateRecordPayloadAction{value: val, isSet: true} +} + +func (v NullablePartialUpdateRecordPayloadAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateRecordPayloadAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_record_set.go b/services/dns/v1api/model_record_set.go index ace249f32..ccdc75d25 100644 --- a/services/dns/v1api/model_record_set.go +++ b/services/dns/v1api/model_record_set.go @@ -36,13 +36,11 @@ type RecordSet struct { // name of the record which should be a valid domain according to rfc1035 Section 2.3.4. For APEX records (same as zone name), the zone name itself has to be put in here. Name string `json:"name"` // records - Records []Record `json:"records"` - // record set state - State string `json:"state"` + Records []Record `json:"records"` + State RecordSetState `json:"state"` // time to live - Ttl int32 `json:"ttl"` - // record set type - Type string `json:"type"` + Ttl int32 `json:"ttl"` + Type RecordSetType `json:"type"` // when record set update/deletion finished UpdateFinished string `json:"updateFinished"` // when record set update/deletion started @@ -56,7 +54,7 @@ type _RecordSet RecordSet // 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 NewRecordSet(creationFinished string, creationStarted string, id string, name string, records []Record, state string, ttl int32, types string, updateFinished string, updateStarted string) *RecordSet { +func NewRecordSet(creationFinished string, creationStarted string, id string, name string, records []Record, state RecordSetState, ttl int32, types RecordSetType, updateFinished string, updateStarted string) *RecordSet { this := RecordSet{} this.CreationFinished = creationFinished this.CreationStarted = creationStarted @@ -296,9 +294,9 @@ func (o *RecordSet) SetRecords(v []Record) { } // GetState returns the State field value -func (o *RecordSet) GetState() string { +func (o *RecordSet) GetState() RecordSetState { if o == nil { - var ret string + var ret RecordSetState return ret } @@ -307,7 +305,7 @@ func (o *RecordSet) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *RecordSet) GetStateOk() (*string, bool) { +func (o *RecordSet) GetStateOk() (*RecordSetState, bool) { if o == nil { return nil, false } @@ -315,7 +313,7 @@ func (o *RecordSet) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *RecordSet) SetState(v string) { +func (o *RecordSet) SetState(v RecordSetState) { o.State = v } @@ -344,9 +342,9 @@ func (o *RecordSet) SetTtl(v int32) { } // GetType returns the Type field value -func (o *RecordSet) GetType() string { +func (o *RecordSet) GetType() RecordSetType { if o == nil { - var ret string + var ret RecordSetType return ret } @@ -355,7 +353,7 @@ func (o *RecordSet) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *RecordSet) GetTypeOk() (*string, bool) { +func (o *RecordSet) GetTypeOk() (*RecordSetType, bool) { if o == nil { return nil, false } @@ -363,7 +361,7 @@ func (o *RecordSet) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *RecordSet) SetType(v string) { +func (o *RecordSet) SetType(v RecordSetType) { o.Type = v } diff --git a/services/dns/v1api/model_record_set_state.go b/services/dns/v1api/model_record_set_state.go new file mode 100644 index 000000000..0357c0f3a --- /dev/null +++ b/services/dns/v1api/model_record_set_state.go @@ -0,0 +1,128 @@ +/* +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" +) + +// RecordSetState record set state +type RecordSetState string + +// List of RecordSet_state +const ( + RECORDSETSTATE_CREATING RecordSetState = "CREATING" + RECORDSETSTATE_CREATE_SUCCEEDED RecordSetState = "CREATE_SUCCEEDED" + RECORDSETSTATE_CREATE_FAILED RecordSetState = "CREATE_FAILED" + RECORDSETSTATE_DELETING RecordSetState = "DELETING" + RECORDSETSTATE_DELETE_SUCCEEDED RecordSetState = "DELETE_SUCCEEDED" + RECORDSETSTATE_DELETE_FAILED RecordSetState = "DELETE_FAILED" + RECORDSETSTATE_UPDATING RecordSetState = "UPDATING" + RECORDSETSTATE_UPDATE_SUCCEEDED RecordSetState = "UPDATE_SUCCEEDED" + RECORDSETSTATE_UPDATE_FAILED RecordSetState = "UPDATE_FAILED" + RECORDSETSTATE_UNKNOWN_DEFAULT_OPEN_API RecordSetState = "unknown_default_open_api" +) + +// All allowed values of RecordSetState enum +var AllowedRecordSetStateEnumValues = []RecordSetState{ + "CREATING", + "CREATE_SUCCEEDED", + "CREATE_FAILED", + "DELETING", + "DELETE_SUCCEEDED", + "DELETE_FAILED", + "UPDATING", + "UPDATE_SUCCEEDED", + "UPDATE_FAILED", + "unknown_default_open_api", +} + +func (v *RecordSetState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RecordSetState(value) + for _, existing := range AllowedRecordSetStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = RECORDSETSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewRecordSetStateFromValue returns a pointer to a valid RecordSetState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRecordSetStateFromValue(v string) (*RecordSetState, error) { + ev := RecordSetState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RecordSetState: valid values are %v", v, AllowedRecordSetStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RecordSetState) IsValid() bool { + for _, existing := range AllowedRecordSetStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RecordSet_state value +func (v RecordSetState) Ptr() *RecordSetState { + return &v +} + +type NullableRecordSetState struct { + value *RecordSetState + isSet bool +} + +func (v NullableRecordSetState) Get() *RecordSetState { + return v.value +} + +func (v *NullableRecordSetState) Set(val *RecordSetState) { + v.value = val + v.isSet = true +} + +func (v NullableRecordSetState) IsSet() bool { + return v.isSet +} + +func (v *NullableRecordSetState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecordSetState(val *RecordSetState) *NullableRecordSetState { + return &NullableRecordSetState{value: val, isSet: true} +} + +func (v NullableRecordSetState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecordSetState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_record_set_type.go b/services/dns/v1api/model_record_set_type.go new file mode 100644 index 000000000..416aa940e --- /dev/null +++ b/services/dns/v1api/model_record_set_type.go @@ -0,0 +1,160 @@ +/* +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" +) + +// RecordSetType record set type +type RecordSetType string + +// List of RecordSet_type +const ( + RECORDSETTYPE_A RecordSetType = "A" + RECORDSETTYPE_AAAA RecordSetType = "AAAA" + RECORDSETTYPE_SOA RecordSetType = "SOA" + RECORDSETTYPE_CNAME RecordSetType = "CNAME" + RECORDSETTYPE_NS RecordSetType = "NS" + RECORDSETTYPE_MX RecordSetType = "MX" + RECORDSETTYPE_TXT RecordSetType = "TXT" + RECORDSETTYPE_SRV RecordSetType = "SRV" + RECORDSETTYPE_PTR RecordSetType = "PTR" + RECORDSETTYPE_ALIAS RecordSetType = "ALIAS" + RECORDSETTYPE_DNAME RecordSetType = "DNAME" + RECORDSETTYPE_CAA RecordSetType = "CAA" + RECORDSETTYPE_DNSKEY RecordSetType = "DNSKEY" + RECORDSETTYPE_DS RecordSetType = "DS" + RECORDSETTYPE_LOC RecordSetType = "LOC" + RECORDSETTYPE_NAPTR RecordSetType = "NAPTR" + RECORDSETTYPE_SSHFP RecordSetType = "SSHFP" + RECORDSETTYPE_TLSA RecordSetType = "TLSA" + RECORDSETTYPE_URI RecordSetType = "URI" + RECORDSETTYPE_CERT RecordSetType = "CERT" + RECORDSETTYPE_SVCB RecordSetType = "SVCB" + RECORDSETTYPE_TYPE RecordSetType = "TYPE" + RECORDSETTYPE_CSYNC RecordSetType = "CSYNC" + RECORDSETTYPE_HINFO RecordSetType = "HINFO" + RECORDSETTYPE_HTTPS RecordSetType = "HTTPS" + RECORDSETTYPE_UNKNOWN_DEFAULT_OPEN_API RecordSetType = "unknown_default_open_api" +) + +// All allowed values of RecordSetType enum +var AllowedRecordSetTypeEnumValues = []RecordSetType{ + "A", + "AAAA", + "SOA", + "CNAME", + "NS", + "MX", + "TXT", + "SRV", + "PTR", + "ALIAS", + "DNAME", + "CAA", + "DNSKEY", + "DS", + "LOC", + "NAPTR", + "SSHFP", + "TLSA", + "URI", + "CERT", + "SVCB", + "TYPE", + "CSYNC", + "HINFO", + "HTTPS", + "unknown_default_open_api", +} + +func (v *RecordSetType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RecordSetType(value) + for _, existing := range AllowedRecordSetTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = RECORDSETTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewRecordSetTypeFromValue returns a pointer to a valid RecordSetType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRecordSetTypeFromValue(v string) (*RecordSetType, error) { + ev := RecordSetType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RecordSetType: valid values are %v", v, AllowedRecordSetTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RecordSetType) IsValid() bool { + for _, existing := range AllowedRecordSetTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RecordSet_type value +func (v RecordSetType) Ptr() *RecordSetType { + return &v +} + +type NullableRecordSetType struct { + value *RecordSetType + isSet bool +} + +func (v NullableRecordSetType) Get() *RecordSetType { + return v.value +} + +func (v *NullableRecordSetType) Set(val *RecordSetType) { + v.value = val + v.isSet = true +} + +func (v NullableRecordSetType) IsSet() bool { + return v.isSet +} + +func (v *NullableRecordSetType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecordSetType(val *RecordSetType) *NullableRecordSetType { + return &NullableRecordSetType{value: val, isSet: true} +} + +func (v NullableRecordSetType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecordSetType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_zone.go b/services/dns/v1api/model_zone.go index 90af7e65c..12e0b0f30 100644 --- a/services/dns/v1api/model_zone.go +++ b/services/dns/v1api/model_zone.go @@ -61,17 +61,14 @@ type Zone struct { // retry time RetryTime int32 `json:"retryTime"` // serial number - SerialNumber int32 `json:"serialNumber"` - // zone state - State string `json:"state"` - // zone type - Type string `json:"type"` + SerialNumber int32 `json:"serialNumber"` + State ZoneState `json:"state"` + Type ZoneType `json:"type"` // when zone update/deletion finished UpdateFinished string `json:"updateFinished"` // when zone update/deletion started - UpdateStarted string `json:"updateStarted"` - // visibility of the zone - Visibility string `json:"visibility"` + UpdateStarted string `json:"updateStarted"` + Visibility ZoneVisibility `json:"visibility"` AdditionalProperties map[string]interface{} } @@ -81,7 +78,7 @@ type _Zone Zone // 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 NewZone(acl string, creationFinished string, creationStarted string, defaultTTL int32, dnsName string, expireTime int32, id string, name string, negativeCache int32, primaryNameServer string, refreshTime int32, retryTime int32, serialNumber int32, state string, types string, updateFinished string, updateStarted string, visibility string) *Zone { +func NewZone(acl string, creationFinished string, creationStarted string, defaultTTL int32, dnsName string, expireTime int32, id string, name string, negativeCache int32, primaryNameServer string, refreshTime int32, retryTime int32, serialNumber int32, state ZoneState, types ZoneType, updateFinished string, updateStarted string, visibility ZoneVisibility) *Zone { this := Zone{} this.Acl = acl this.CreationFinished = creationFinished @@ -713,9 +710,9 @@ func (o *Zone) SetSerialNumber(v int32) { } // GetState returns the State field value -func (o *Zone) GetState() string { +func (o *Zone) GetState() ZoneState { if o == nil { - var ret string + var ret ZoneState return ret } @@ -724,7 +721,7 @@ func (o *Zone) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *Zone) GetStateOk() (*string, bool) { +func (o *Zone) GetStateOk() (*ZoneState, bool) { if o == nil { return nil, false } @@ -732,14 +729,14 @@ func (o *Zone) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *Zone) SetState(v string) { +func (o *Zone) SetState(v ZoneState) { o.State = v } // GetType returns the Type field value -func (o *Zone) GetType() string { +func (o *Zone) GetType() ZoneType { if o == nil { - var ret string + var ret ZoneType return ret } @@ -748,7 +745,7 @@ func (o *Zone) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *Zone) GetTypeOk() (*string, bool) { +func (o *Zone) GetTypeOk() (*ZoneType, bool) { if o == nil { return nil, false } @@ -756,7 +753,7 @@ func (o *Zone) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *Zone) SetType(v string) { +func (o *Zone) SetType(v ZoneType) { o.Type = v } @@ -809,9 +806,9 @@ func (o *Zone) SetUpdateStarted(v string) { } // GetVisibility returns the Visibility field value -func (o *Zone) GetVisibility() string { +func (o *Zone) GetVisibility() ZoneVisibility { if o == nil { - var ret string + var ret ZoneVisibility return ret } @@ -820,7 +817,7 @@ func (o *Zone) GetVisibility() string { // GetVisibilityOk returns a tuple with the Visibility field value // and a boolean to check if the value has been set. -func (o *Zone) GetVisibilityOk() (*string, bool) { +func (o *Zone) GetVisibilityOk() (*ZoneVisibility, bool) { if o == nil { return nil, false } @@ -828,7 +825,7 @@ func (o *Zone) GetVisibilityOk() (*string, bool) { } // SetVisibility sets field value -func (o *Zone) SetVisibility(v string) { +func (o *Zone) SetVisibility(v ZoneVisibility) { o.Visibility = v } diff --git a/services/dns/v1api/model_zone_state.go b/services/dns/v1api/model_zone_state.go new file mode 100644 index 000000000..45fefa3b7 --- /dev/null +++ b/services/dns/v1api/model_zone_state.go @@ -0,0 +1,128 @@ +/* +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" +) + +// ZoneState zone state +type ZoneState string + +// List of Zone_state +const ( + ZONESTATE_CREATING ZoneState = "CREATING" + ZONESTATE_CREATE_SUCCEEDED ZoneState = "CREATE_SUCCEEDED" + ZONESTATE_CREATE_FAILED ZoneState = "CREATE_FAILED" + ZONESTATE_DELETING ZoneState = "DELETING" + ZONESTATE_DELETE_SUCCEEDED ZoneState = "DELETE_SUCCEEDED" + ZONESTATE_DELETE_FAILED ZoneState = "DELETE_FAILED" + ZONESTATE_UPDATING ZoneState = "UPDATING" + ZONESTATE_UPDATE_SUCCEEDED ZoneState = "UPDATE_SUCCEEDED" + ZONESTATE_UPDATE_FAILED ZoneState = "UPDATE_FAILED" + ZONESTATE_UNKNOWN_DEFAULT_OPEN_API ZoneState = "unknown_default_open_api" +) + +// All allowed values of ZoneState enum +var AllowedZoneStateEnumValues = []ZoneState{ + "CREATING", + "CREATE_SUCCEEDED", + "CREATE_FAILED", + "DELETING", + "DELETE_SUCCEEDED", + "DELETE_FAILED", + "UPDATING", + "UPDATE_SUCCEEDED", + "UPDATE_FAILED", + "unknown_default_open_api", +} + +func (v *ZoneState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ZoneState(value) + for _, existing := range AllowedZoneStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ZONESTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewZoneStateFromValue returns a pointer to a valid ZoneState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewZoneStateFromValue(v string) (*ZoneState, error) { + ev := ZoneState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ZoneState: valid values are %v", v, AllowedZoneStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ZoneState) IsValid() bool { + for _, existing := range AllowedZoneStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Zone_state value +func (v ZoneState) Ptr() *ZoneState { + return &v +} + +type NullableZoneState struct { + value *ZoneState + isSet bool +} + +func (v NullableZoneState) Get() *ZoneState { + return v.value +} + +func (v *NullableZoneState) Set(val *ZoneState) { + v.value = val + v.isSet = true +} + +func (v NullableZoneState) IsSet() bool { + return v.isSet +} + +func (v *NullableZoneState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableZoneState(val *ZoneState) *NullableZoneState { + return &NullableZoneState{value: val, isSet: true} +} + +func (v NullableZoneState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableZoneState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_zone_type.go b/services/dns/v1api/model_zone_type.go new file mode 100644 index 000000000..add904f39 --- /dev/null +++ b/services/dns/v1api/model_zone_type.go @@ -0,0 +1,114 @@ +/* +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" +) + +// ZoneType zone type +type ZoneType string + +// List of Zone_type +const ( + ZONETYPE_PRIMARY ZoneType = "primary" + ZONETYPE_SECONDARY ZoneType = "secondary" + ZONETYPE_UNKNOWN_DEFAULT_OPEN_API ZoneType = "unknown_default_open_api" +) + +// All allowed values of ZoneType enum +var AllowedZoneTypeEnumValues = []ZoneType{ + "primary", + "secondary", + "unknown_default_open_api", +} + +func (v *ZoneType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ZoneType(value) + for _, existing := range AllowedZoneTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ZONETYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewZoneTypeFromValue returns a pointer to a valid ZoneType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewZoneTypeFromValue(v string) (*ZoneType, error) { + ev := ZoneType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ZoneType: valid values are %v", v, AllowedZoneTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ZoneType) IsValid() bool { + for _, existing := range AllowedZoneTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Zone_type value +func (v ZoneType) Ptr() *ZoneType { + return &v +} + +type NullableZoneType struct { + value *ZoneType + isSet bool +} + +func (v NullableZoneType) Get() *ZoneType { + return v.value +} + +func (v *NullableZoneType) Set(val *ZoneType) { + v.value = val + v.isSet = true +} + +func (v NullableZoneType) IsSet() bool { + return v.isSet +} + +func (v *NullableZoneType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableZoneType(val *ZoneType) *NullableZoneType { + return &NullableZoneType{value: val, isSet: true} +} + +func (v NullableZoneType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableZoneType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_zone_visibility.go b/services/dns/v1api/model_zone_visibility.go new file mode 100644 index 000000000..18f6108db --- /dev/null +++ b/services/dns/v1api/model_zone_visibility.go @@ -0,0 +1,112 @@ +/* +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" +) + +// ZoneVisibility visibility of the zone +type ZoneVisibility string + +// List of Zone_visibility +const ( + ZONEVISIBILITY_PUBLIC ZoneVisibility = "public" + ZONEVISIBILITY_UNKNOWN_DEFAULT_OPEN_API ZoneVisibility = "unknown_default_open_api" +) + +// All allowed values of ZoneVisibility enum +var AllowedZoneVisibilityEnumValues = []ZoneVisibility{ + "public", + "unknown_default_open_api", +} + +func (v *ZoneVisibility) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ZoneVisibility(value) + for _, existing := range AllowedZoneVisibilityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ZONEVISIBILITY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewZoneVisibilityFromValue returns a pointer to a valid ZoneVisibility +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewZoneVisibilityFromValue(v string) (*ZoneVisibility, error) { + ev := ZoneVisibility(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ZoneVisibility: valid values are %v", v, AllowedZoneVisibilityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ZoneVisibility) IsValid() bool { + for _, existing := range AllowedZoneVisibilityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Zone_visibility value +func (v ZoneVisibility) Ptr() *ZoneVisibility { + return &v +} + +type NullableZoneVisibility struct { + value *ZoneVisibility + isSet bool +} + +func (v NullableZoneVisibility) Get() *ZoneVisibility { + return v.value +} + +func (v *NullableZoneVisibility) Set(val *ZoneVisibility) { + v.value = val + v.isSet = true +} + +func (v NullableZoneVisibility) IsSet() bool { + return v.isSet +} + +func (v *NullableZoneVisibility) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableZoneVisibility(val *ZoneVisibility) *NullableZoneVisibility { + return &NullableZoneVisibility{value: val, isSet: true} +} + +func (v NullableZoneVisibility) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableZoneVisibility) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 59e3ac66c462538fe4d0b6a8d8186e8cb3a36746 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Mon, 18 May 2026 17:58:58 +0200 Subject: [PATCH 07/66] chore(dns): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/dns/CHANGELOG.md | 3 ++ services/dns/VERSION | 2 +- services/dns/v1api/wait/wait.go | 48 ++++++++++++++-------------- services/dns/v1api/wait/wait_test.go | 46 +++++++++++++------------- 5 files changed, 53 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7496ee90..2ef92a6a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -106,6 +106,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v0.20.2](services/dns/CHANGELOG.md#v0202) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` + - [v0.21.0](services/dns/CHANGELOG.md#v0210) + - **Feature:** Introduce enums for various attributes - `dremio` - [v0.1.0](services/dremio/CHANGELOG.md#v010) - Manage your STACKIT Dremio resources: `DremioInstance`, `DremioUser` diff --git a/services/dns/CHANGELOG.md b/services/dns/CHANGELOG.md index dceb86090..5e76c021b 100644 --- a/services/dns/CHANGELOG.md +++ b/services/dns/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.21.0 +- **Feature:** Introduce enums for various attributes + ## v0.20.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` diff --git a/services/dns/VERSION b/services/dns/VERSION index 014ec6192..759e855fb 100644 --- a/services/dns/VERSION +++ b/services/dns/VERSION @@ -1 +1 @@ -v0.20.2 \ No newline at end of file +v0.21.0 diff --git a/services/dns/v1api/wait/wait.go b/services/dns/v1api/wait/wait.go index 05ea819c8..4bb18b831 100644 --- a/services/dns/v1api/wait/wait.go +++ b/services/dns/v1api/wait/wait.go @@ -34,16 +34,16 @@ const ( // CreateZoneWaitHandler will wait for zone creation func CreateZoneWaitHandler(ctx context.Context, a dns.DefaultAPI, projectId, instanceId string) *wait.AsyncActionHandler[dns.ZoneResponse] { - waitConfig := wait.WaiterHelper[dns.ZoneResponse, string]{ + waitConfig := wait.WaiterHelper[dns.ZoneResponse, dns.ZoneState]{ FetchInstance: a.GetZone(ctx, projectId, instanceId).Execute, - GetState: func(d *dns.ZoneResponse) (string, error) { + GetState: func(d *dns.ZoneResponse) (dns.ZoneState, error) { if d == nil { return "", errors.New("empty response") } return d.Zone.State, nil }, - ActiveState: []string{ZONESTATE_CREATE_SUCCEEDED}, - ErrorState: []string{ZONESTATE_CREATE_FAILED}, + ActiveState: []dns.ZoneState{dns.ZONESTATE_CREATE_SUCCEEDED}, + ErrorState: []dns.ZoneState{dns.ZONESTATE_CREATE_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -53,16 +53,16 @@ func CreateZoneWaitHandler(ctx context.Context, a dns.DefaultAPI, projectId, ins // PartialUpdateZoneWaitHandler will wait for zone update func PartialUpdateZoneWaitHandler(ctx context.Context, a dns.DefaultAPI, projectId, instanceId string) *wait.AsyncActionHandler[dns.ZoneResponse] { - waitConfig := wait.WaiterHelper[dns.ZoneResponse, string]{ + waitConfig := wait.WaiterHelper[dns.ZoneResponse, dns.ZoneState]{ FetchInstance: a.GetZone(ctx, projectId, instanceId).Execute, - GetState: func(d *dns.ZoneResponse) (string, error) { + GetState: func(d *dns.ZoneResponse) (dns.ZoneState, error) { if d == nil { return "", errors.New("empty response") } return d.Zone.State, nil }, - ActiveState: []string{ZONESTATE_UPDATE_SUCCEEDED}, - ErrorState: []string{ZONESTATE_UPDATE_FAILED}, + ActiveState: []dns.ZoneState{dns.ZONESTATE_UPDATE_SUCCEEDED}, + ErrorState: []dns.ZoneState{dns.ZONESTATE_UPDATE_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -73,16 +73,16 @@ func PartialUpdateZoneWaitHandler(ctx context.Context, a dns.DefaultAPI, project // DeleteZoneWaitHandler will wait for zone deletion // returned interface is nil or *ZoneResponseZone func DeleteZoneWaitHandler(ctx context.Context, a dns.DefaultAPI, projectId, instanceId string) *wait.AsyncActionHandler[dns.ZoneResponse] { - waitConfig := wait.WaiterHelper[dns.ZoneResponse, string]{ + waitConfig := wait.WaiterHelper[dns.ZoneResponse, dns.ZoneState]{ FetchInstance: a.GetZone(ctx, projectId, instanceId).Execute, - GetState: func(d *dns.ZoneResponse) (string, error) { + GetState: func(d *dns.ZoneResponse) (dns.ZoneState, error) { if d == nil { return "", errors.New("empty response") } return d.Zone.State, nil }, - ActiveState: []string{ZONESTATE_DELETE_SUCCEEDED}, - ErrorState: []string{ZONESTATE_DELETE_FAILED}, + ActiveState: []dns.ZoneState{dns.ZONESTATE_DELETE_SUCCEEDED}, + ErrorState: []dns.ZoneState{dns.ZONESTATE_DELETE_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -92,16 +92,16 @@ func DeleteZoneWaitHandler(ctx context.Context, a dns.DefaultAPI, projectId, ins // CreateRecordSetWaitHandler will wait for recordset creation func CreateRecordSetWaitHandler(ctx context.Context, a dns.DefaultAPI, projectId, instanceId, rrSetId string) *wait.AsyncActionHandler[dns.RecordSetResponse] { - waitConfig := wait.WaiterHelper[dns.RecordSetResponse, string]{ + waitConfig := wait.WaiterHelper[dns.RecordSetResponse, dns.RecordSetState]{ FetchInstance: a.GetRecordSet(ctx, projectId, instanceId, rrSetId).Execute, - GetState: func(d *dns.RecordSetResponse) (string, error) { + GetState: func(d *dns.RecordSetResponse) (dns.RecordSetState, error) { if d == nil { return "", errors.New("empty response") } return d.Rrset.State, nil }, - ActiveState: []string{RECORDSETSTATE_CREATE_SUCCEEDED}, - ErrorState: []string{RECORDSETSTATE_CREATE_FAILED}, + ActiveState: []dns.RecordSetState{dns.RECORDSETSTATE_CREATE_SUCCEEDED}, + ErrorState: []dns.RecordSetState{dns.RECORDSETSTATE_CREATE_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -111,16 +111,16 @@ func CreateRecordSetWaitHandler(ctx context.Context, a dns.DefaultAPI, projectId // PartialUpdateRecordSetWaitHandler will wait for recordset update func PartialUpdateRecordSetWaitHandler(ctx context.Context, a dns.DefaultAPI, projectId, instanceId, rrSetId string) *wait.AsyncActionHandler[dns.RecordSetResponse] { - waitConfig := wait.WaiterHelper[dns.RecordSetResponse, string]{ + waitConfig := wait.WaiterHelper[dns.RecordSetResponse, dns.RecordSetState]{ FetchInstance: a.GetRecordSet(ctx, projectId, instanceId, rrSetId).Execute, - GetState: func(d *dns.RecordSetResponse) (string, error) { + GetState: func(d *dns.RecordSetResponse) (dns.RecordSetState, error) { if d == nil { return "", errors.New("empty response") } return d.Rrset.State, nil }, - ActiveState: []string{RECORDSETSTATE_UPDATE_SUCCEEDED}, - ErrorState: []string{RECORDSETSTATE_UPDATE_FAILED}, + ActiveState: []dns.RecordSetState{dns.RECORDSETSTATE_UPDATE_SUCCEEDED}, + ErrorState: []dns.RecordSetState{dns.RECORDSETSTATE_UPDATE_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -131,16 +131,16 @@ func PartialUpdateRecordSetWaitHandler(ctx context.Context, a dns.DefaultAPI, pr // DeleteRecordSetWaitHandler will wait for deletion // returned interface is nil or *RecordSetResponse func DeleteRecordSetWaitHandler(ctx context.Context, a dns.DefaultAPI, projectId, instanceId, rrSetId string) *wait.AsyncActionHandler[dns.RecordSetResponse] { - waitConfig := wait.WaiterHelper[dns.RecordSetResponse, string]{ + waitConfig := wait.WaiterHelper[dns.RecordSetResponse, dns.RecordSetState]{ FetchInstance: a.GetRecordSet(ctx, projectId, instanceId, rrSetId).Execute, - GetState: func(d *dns.RecordSetResponse) (string, error) { + GetState: func(d *dns.RecordSetResponse) (dns.RecordSetState, error) { if d == nil { return "", errors.New("empty response") } return d.Rrset.State, nil }, - ActiveState: []string{RECORDSETSTATE_DELETE_SUCCEEDED}, - ErrorState: []string{RECORDSETSTATE_DELETE_FAILED}, + ActiveState: []dns.RecordSetState{dns.RECORDSETSTATE_DELETE_SUCCEEDED}, + ErrorState: []dns.RecordSetState{dns.RECORDSETSTATE_DELETE_FAILED}, DeleteHttpErrorStatusCodes: []int{http.StatusNotFound}, } diff --git a/services/dns/v1api/wait/wait_test.go b/services/dns/v1api/wait/wait_test.go index 397f16b7e..f15754244 100644 --- a/services/dns/v1api/wait/wait_test.go +++ b/services/dns/v1api/wait/wait_test.go @@ -29,7 +29,7 @@ func newAPIMock(settings mockSettings) dns.DefaultAPI { return &dns.ZoneResponse{ Zone: dns.Zone{ - State: settings.resourceState, + State: dns.ZoneState(settings.resourceState), Id: "zid", }, }, nil @@ -43,7 +43,7 @@ func newAPIMock(settings mockSettings) dns.DefaultAPI { return &dns.RecordSetResponse{ Rrset: dns.RecordSet{ - State: settings.resourceState, + State: dns.RecordSetState(settings.resourceState), Id: "rid", }, }, nil @@ -55,21 +55,21 @@ func TestCreateZoneWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState dns.ZoneState wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: ZONESTATE_CREATE_SUCCEEDED, + resourceState: dns.ZONESTATE_CREATE_SUCCEEDED, wantErr: false, wantResp: true, }, { desc: "create_failed", getFails: false, - resourceState: ZONESTATE_CREATE_FAILED, + resourceState: dns.ZONESTATE_CREATE_FAILED, wantErr: true, wantResp: true, }, @@ -93,7 +93,7 @@ func TestCreateZoneWaitHandler(t *testing.T) { synctest.Test(t, func(t *testing.T) { apiClient := newAPIMock(mockSettings{ getFails: tt.getFails, - resourceState: tt.resourceState, + resourceState: string(tt.resourceState), }) var wantRes *dns.ZoneResponse @@ -125,21 +125,21 @@ func TestUpdateZoneWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState dns.ZoneState wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: ZONESTATE_UPDATE_SUCCEEDED, + resourceState: dns.ZONESTATE_UPDATE_SUCCEEDED, wantErr: false, wantResp: true, }, { desc: "update_failed", getFails: false, - resourceState: ZONESTATE_UPDATE_FAILED, + resourceState: dns.ZONESTATE_UPDATE_FAILED, wantErr: true, wantResp: true, }, @@ -163,7 +163,7 @@ func TestUpdateZoneWaitHandler(t *testing.T) { synctest.Test(t, func(t *testing.T) { apiClient := newAPIMock(mockSettings{ getFails: tt.getFails, - resourceState: tt.resourceState, + resourceState: string(tt.resourceState), }) var wantRes *dns.ZoneResponse @@ -195,21 +195,21 @@ func TestDeleteZoneWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState dns.ZoneState wantErr bool wantResp bool }{ { desc: "delete_succeeded", getFails: false, - resourceState: ZONESTATE_DELETE_SUCCEEDED, + resourceState: dns.ZONESTATE_DELETE_SUCCEEDED, wantErr: false, wantResp: true, }, { desc: "delete_failed", getFails: false, - resourceState: ZONESTATE_DELETE_FAILED, + resourceState: dns.ZONESTATE_DELETE_FAILED, wantErr: true, wantResp: true, }, @@ -233,7 +233,7 @@ func TestDeleteZoneWaitHandler(t *testing.T) { synctest.Test(t, func(t *testing.T) { apiClient := newAPIMock(mockSettings{ getFails: tt.getFails, - resourceState: tt.resourceState, + resourceState: string(tt.resourceState), }) var wantRes *dns.ZoneResponse @@ -267,21 +267,21 @@ func TestCreateRecordSetWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState dns.RecordSetState wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: RECORDSETSTATE_CREATE_SUCCEEDED, + resourceState: dns.RECORDSETSTATE_CREATE_SUCCEEDED, wantErr: false, wantResp: true, }, { desc: "create_failed", getFails: false, - resourceState: RECORDSETSTATE_CREATE_FAILED, + resourceState: dns.RECORDSETSTATE_CREATE_FAILED, wantErr: true, wantResp: true, }, @@ -337,21 +337,21 @@ func TestUpdateRecordSetWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState dns.RecordSetState wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: RECORDSETSTATE_UPDATE_SUCCEEDED, + resourceState: dns.RECORDSETSTATE_UPDATE_SUCCEEDED, wantErr: false, wantResp: true, }, { desc: "update_failed", getFails: false, - resourceState: RECORDSETSTATE_UPDATE_FAILED, + resourceState: dns.RECORDSETSTATE_UPDATE_FAILED, wantErr: true, wantResp: true, }, @@ -407,21 +407,21 @@ func TestDeleteRecordSetWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState dns.RecordSetState wantErr bool wantResp bool }{ { desc: "delete_succeeded", getFails: false, - resourceState: RECORDSETSTATE_DELETE_SUCCEEDED, + resourceState: dns.RECORDSETSTATE_DELETE_SUCCEEDED, wantErr: false, wantResp: true, }, { desc: "delete_failed", getFails: false, - resourceState: RECORDSETSTATE_DELETE_FAILED, + resourceState: dns.RECORDSETSTATE_DELETE_FAILED, wantErr: true, wantResp: true, }, From 9446fd1d662d0942b4962a9cc239d70f4bfead3f Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 09:41:04 +0200 Subject: [PATCH 08/66] refac(dremio): introduce inline enums --- services/dremio/v1alphaapi/api_default.go | 54 ++++---- .../dremio/v1alphaapi/api_default_mock.go | 18 +-- .../dremio/v1alphaapi/model_authentication.go | 16 +-- .../v1alphaapi/model_authentication_type.go | 115 +++++++++++++++++ .../v1alphaapi/model_dremio_response.go | 15 ++- .../v1alphaapi/model_dremio_response_state.go | 117 ++++++++++++++++++ .../v1alphaapi/model_dremio_user_response.go | 15 ++- .../model_dremio_user_response_state.go | 117 ++++++++++++++++++ ...st_dremio_instances_region_id_parameter.go | 113 +++++++++++++++++ 9 files changed, 520 insertions(+), 60 deletions(-) create mode 100644 services/dremio/v1alphaapi/model_authentication_type.go create mode 100644 services/dremio/v1alphaapi/model_dremio_response_state.go create mode 100644 services/dremio/v1alphaapi/model_dremio_user_response_state.go create mode 100644 services/dremio/v1alphaapi/model_list_dremio_instances_region_id_parameter.go diff --git a/services/dremio/v1alphaapi/api_default.go b/services/dremio/v1alphaapi/api_default.go index 3e9c0e4e9..354f0a618 100644 --- a/services/dremio/v1alphaapi/api_default.go +++ b/services/dremio/v1alphaapi/api_default.go @@ -33,7 +33,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiCreateDremioInstanceRequest */ - CreateDremioInstance(ctx context.Context, projectId string, regionId string) ApiCreateDremioInstanceRequest + CreateDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter) ApiCreateDremioInstanceRequest // CreateDremioInstanceExecute executes the request // @return DremioResponse @@ -50,7 +50,7 @@ type DefaultAPI interface { @param dremioId The Dremio instance UUID. @return ApiCreateDremioUserRequest */ - CreateDremioUser(ctx context.Context, projectId string, regionId string, dremioId string) ApiCreateDremioUserRequest + CreateDremioUser(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiCreateDremioUserRequest // CreateDremioUserExecute executes the request // @return DremioUserResponse @@ -67,7 +67,7 @@ type DefaultAPI interface { @param dremioId The Dremio instance UUID. @return ApiDeleteDremioInstanceRequest */ - DeleteDremioInstance(ctx context.Context, projectId string, regionId string, dremioId string) ApiDeleteDremioInstanceRequest + DeleteDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiDeleteDremioInstanceRequest // DeleteDremioInstanceExecute executes the request DeleteDremioInstanceExecute(r ApiDeleteDremioInstanceRequest) error @@ -84,7 +84,7 @@ type DefaultAPI interface { @param dremioUserId The Dremio user UUID. @return ApiDeleteDremioUserRequest */ - DeleteDremioUser(ctx context.Context, projectId string, regionId string, dremioId string, dremioUserId string) ApiDeleteDremioUserRequest + DeleteDremioUser(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string, dremioUserId string) ApiDeleteDremioUserRequest // DeleteDremioUserExecute executes the request DeleteDremioUserExecute(r ApiDeleteDremioUserRequest) error @@ -100,7 +100,7 @@ type DefaultAPI interface { @param dremioId The Dremio instance UUID. @return ApiGetDremioInstanceRequest */ - GetDremioInstance(ctx context.Context, projectId string, regionId string, dremioId string) ApiGetDremioInstanceRequest + GetDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiGetDremioInstanceRequest // GetDremioInstanceExecute executes the request // @return DremioResponse @@ -118,7 +118,7 @@ type DefaultAPI interface { @param dremioUserId The Dremio user UUID. @return ApiGetDremioUserRequest */ - GetDremioUser(ctx context.Context, projectId string, regionId string, dremioId string, dremioUserId string) ApiGetDremioUserRequest + GetDremioUser(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string, dremioUserId string) ApiGetDremioUserRequest // GetDremioUserExecute executes the request // @return DremioUserResponse @@ -134,7 +134,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiListDremioInstancesRequest */ - ListDremioInstances(ctx context.Context, projectId string, regionId string) ApiListDremioInstancesRequest + ListDremioInstances(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter) ApiListDremioInstancesRequest // ListDremioInstancesExecute executes the request // @return ListDremiosResponse @@ -151,7 +151,7 @@ type DefaultAPI interface { @param dremioId The Dremio instance UUID. @return ApiListDremioUsersRequest */ - ListDremioUsers(ctx context.Context, projectId string, regionId string, dremioId string) ApiListDremioUsersRequest + ListDremioUsers(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiListDremioUsersRequest // ListDremioUsersExecute executes the request // @return ListDremioUsersResponse @@ -168,7 +168,7 @@ type DefaultAPI interface { @param dremioId The Dremio instance UUID. @return ApiUpdateDremioInstanceRequest */ - UpdateDremioInstance(ctx context.Context, projectId string, regionId string, dremioId string) ApiUpdateDremioInstanceRequest + UpdateDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiUpdateDremioInstanceRequest // UpdateDremioInstanceExecute executes the request // @return DremioResponse @@ -182,7 +182,7 @@ type ApiCreateDremioInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListDremioInstancesRegionIdParameter createDremioInstancePayload *CreateDremioInstancePayload } @@ -205,7 +205,7 @@ Creates a new Dremio instance within the project. @param regionId The STACKIT region name the resource is located in. @return ApiCreateDremioInstanceRequest */ -func (a *DefaultAPIService) CreateDremioInstance(ctx context.Context, projectId string, regionId string) ApiCreateDremioInstanceRequest { +func (a *DefaultAPIService) CreateDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter) ApiCreateDremioInstanceRequest { return ApiCreateDremioInstanceRequest{ ApiService: a, ctx: ctx, @@ -312,7 +312,7 @@ type ApiCreateDremioUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListDremioInstancesRegionIdParameter dremioId string createDremioUserPayload *CreateDremioUserPayload } @@ -337,7 +337,7 @@ Creates a new Dremio admin user for the given Dremio instance. @param dremioId The Dremio instance UUID. @return ApiCreateDremioUserRequest */ -func (a *DefaultAPIService) CreateDremioUser(ctx context.Context, projectId string, regionId string, dremioId string) ApiCreateDremioUserRequest { +func (a *DefaultAPIService) CreateDremioUser(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiCreateDremioUserRequest { return ApiCreateDremioUserRequest{ ApiService: a, ctx: ctx, @@ -446,7 +446,7 @@ type ApiDeleteDremioInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListDremioInstancesRegionIdParameter dremioId string } @@ -465,7 +465,7 @@ Deletes the given Dremio instance. @param dremioId The Dremio instance UUID. @return ApiDeleteDremioInstanceRequest */ -func (a *DefaultAPIService) DeleteDremioInstance(ctx context.Context, projectId string, regionId string, dremioId string) ApiDeleteDremioInstanceRequest { +func (a *DefaultAPIService) DeleteDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiDeleteDremioInstanceRequest { return ApiDeleteDremioInstanceRequest{ ApiService: a, ctx: ctx, @@ -556,7 +556,7 @@ type ApiDeleteDremioUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListDremioInstancesRegionIdParameter dremioId string dremioUserId string } @@ -577,7 +577,7 @@ Deletes the given dremio admin user. @param dremioUserId The Dremio user UUID. @return ApiDeleteDremioUserRequest */ -func (a *DefaultAPIService) DeleteDremioUser(ctx context.Context, projectId string, regionId string, dremioId string, dremioUserId string) ApiDeleteDremioUserRequest { +func (a *DefaultAPIService) DeleteDremioUser(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string, dremioUserId string) ApiDeleteDremioUserRequest { return ApiDeleteDremioUserRequest{ ApiService: a, ctx: ctx, @@ -670,7 +670,7 @@ type ApiGetDremioInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListDremioInstancesRegionIdParameter dremioId string } @@ -689,7 +689,7 @@ Returns the details for the given Dremio instance. @param dremioId The Dremio instance UUID. @return ApiGetDremioInstanceRequest */ -func (a *DefaultAPIService) GetDremioInstance(ctx context.Context, projectId string, regionId string, dremioId string) ApiGetDremioInstanceRequest { +func (a *DefaultAPIService) GetDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiGetDremioInstanceRequest { return ApiGetDremioInstanceRequest{ ApiService: a, ctx: ctx, @@ -793,7 +793,7 @@ type ApiGetDremioUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListDremioInstancesRegionIdParameter dremioId string dremioUserId string } @@ -814,7 +814,7 @@ Returns the details for the given dremio admin user @param dremioUserId The Dremio user UUID. @return ApiGetDremioUserRequest */ -func (a *DefaultAPIService) GetDremioUser(ctx context.Context, projectId string, regionId string, dremioId string, dremioUserId string) ApiGetDremioUserRequest { +func (a *DefaultAPIService) GetDremioUser(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string, dremioUserId string) ApiGetDremioUserRequest { return ApiGetDremioUserRequest{ ApiService: a, ctx: ctx, @@ -920,7 +920,7 @@ type ApiListDremioInstancesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListDremioInstancesRegionIdParameter pageToken *string pageSize *int32 } @@ -951,7 +951,7 @@ Returns a list of all Dremio instances within the project. @param regionId The STACKIT region name the resource is located in. @return ApiListDremioInstancesRequest */ -func (a *DefaultAPIService) ListDremioInstances(ctx context.Context, projectId string, regionId string) ApiListDremioInstancesRequest { +func (a *DefaultAPIService) ListDremioInstances(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter) ApiListDremioInstancesRequest { return ApiListDremioInstancesRequest{ ApiService: a, ctx: ctx, @@ -1063,7 +1063,7 @@ type ApiListDremioUsersRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListDremioInstancesRegionIdParameter dremioId string pageToken *string pageSize *int32 @@ -1096,7 +1096,7 @@ Returns a list of all Dremio admin users for the given dremio instance. @param dremioId The Dremio instance UUID. @return ApiListDremioUsersRequest */ -func (a *DefaultAPIService) ListDremioUsers(ctx context.Context, projectId string, regionId string, dremioId string) ApiListDremioUsersRequest { +func (a *DefaultAPIService) ListDremioUsers(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiListDremioUsersRequest { return ApiListDremioUsersRequest{ ApiService: a, ctx: ctx, @@ -1210,7 +1210,7 @@ type ApiUpdateDremioInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListDremioInstancesRegionIdParameter dremioId string updateDremioInstancePayload *UpdateDremioInstancePayload } @@ -1235,7 +1235,7 @@ Updates the given Dremio instance. Please note that changing certain fields will @param dremioId The Dremio instance UUID. @return ApiUpdateDremioInstanceRequest */ -func (a *DefaultAPIService) UpdateDremioInstance(ctx context.Context, projectId string, regionId string, dremioId string) ApiUpdateDremioInstanceRequest { +func (a *DefaultAPIService) UpdateDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiUpdateDremioInstanceRequest { return ApiUpdateDremioInstanceRequest{ ApiService: a, ctx: ctx, diff --git a/services/dremio/v1alphaapi/api_default_mock.go b/services/dremio/v1alphaapi/api_default_mock.go index c48e7f47c..1aeddbd08 100644 --- a/services/dremio/v1alphaapi/api_default_mock.go +++ b/services/dremio/v1alphaapi/api_default_mock.go @@ -40,7 +40,7 @@ type DefaultAPIServiceMock struct { UpdateDremioInstanceExecuteMock *func(r ApiUpdateDremioInstanceRequest) (*DremioResponse, error) } -func (a DefaultAPIServiceMock) CreateDremioInstance(ctx context.Context, projectId string, regionId string) ApiCreateDremioInstanceRequest { +func (a DefaultAPIServiceMock) CreateDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter) ApiCreateDremioInstanceRequest { return ApiCreateDremioInstanceRequest{ ApiService: a, ctx: ctx, @@ -59,7 +59,7 @@ func (a DefaultAPIServiceMock) CreateDremioInstanceExecute(r ApiCreateDremioInst return (*a.CreateDremioInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateDremioUser(ctx context.Context, projectId string, regionId string, dremioId string) ApiCreateDremioUserRequest { +func (a DefaultAPIServiceMock) CreateDremioUser(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiCreateDremioUserRequest { return ApiCreateDremioUserRequest{ ApiService: a, ctx: ctx, @@ -79,7 +79,7 @@ func (a DefaultAPIServiceMock) CreateDremioUserExecute(r ApiCreateDremioUserRequ return (*a.CreateDremioUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteDremioInstance(ctx context.Context, projectId string, regionId string, dremioId string) ApiDeleteDremioInstanceRequest { +func (a DefaultAPIServiceMock) DeleteDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiDeleteDremioInstanceRequest { return ApiDeleteDremioInstanceRequest{ ApiService: a, ctx: ctx, @@ -98,7 +98,7 @@ func (a DefaultAPIServiceMock) DeleteDremioInstanceExecute(r ApiDeleteDremioInst return (*a.DeleteDremioInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteDremioUser(ctx context.Context, projectId string, regionId string, dremioId string, dremioUserId string) ApiDeleteDremioUserRequest { +func (a DefaultAPIServiceMock) DeleteDremioUser(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string, dremioUserId string) ApiDeleteDremioUserRequest { return ApiDeleteDremioUserRequest{ ApiService: a, ctx: ctx, @@ -118,7 +118,7 @@ func (a DefaultAPIServiceMock) DeleteDremioUserExecute(r ApiDeleteDremioUserRequ return (*a.DeleteDremioUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetDremioInstance(ctx context.Context, projectId string, regionId string, dremioId string) ApiGetDremioInstanceRequest { +func (a DefaultAPIServiceMock) GetDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiGetDremioInstanceRequest { return ApiGetDremioInstanceRequest{ ApiService: a, ctx: ctx, @@ -138,7 +138,7 @@ func (a DefaultAPIServiceMock) GetDremioInstanceExecute(r ApiGetDremioInstanceRe return (*a.GetDremioInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetDremioUser(ctx context.Context, projectId string, regionId string, dremioId string, dremioUserId string) ApiGetDremioUserRequest { +func (a DefaultAPIServiceMock) GetDremioUser(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string, dremioUserId string) ApiGetDremioUserRequest { return ApiGetDremioUserRequest{ ApiService: a, ctx: ctx, @@ -159,7 +159,7 @@ func (a DefaultAPIServiceMock) GetDremioUserExecute(r ApiGetDremioUserRequest) ( return (*a.GetDremioUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDremioInstances(ctx context.Context, projectId string, regionId string) ApiListDremioInstancesRequest { +func (a DefaultAPIServiceMock) ListDremioInstances(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter) ApiListDremioInstancesRequest { return ApiListDremioInstancesRequest{ ApiService: a, ctx: ctx, @@ -178,7 +178,7 @@ func (a DefaultAPIServiceMock) ListDremioInstancesExecute(r ApiListDremioInstanc return (*a.ListDremioInstancesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDremioUsers(ctx context.Context, projectId string, regionId string, dremioId string) ApiListDremioUsersRequest { +func (a DefaultAPIServiceMock) ListDremioUsers(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiListDremioUsersRequest { return ApiListDremioUsersRequest{ ApiService: a, ctx: ctx, @@ -198,7 +198,7 @@ func (a DefaultAPIServiceMock) ListDremioUsersExecute(r ApiListDremioUsersReques return (*a.ListDremioUsersExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateDremioInstance(ctx context.Context, projectId string, regionId string, dremioId string) ApiUpdateDremioInstanceRequest { +func (a DefaultAPIServiceMock) UpdateDremioInstance(ctx context.Context, projectId string, regionId ListDremioInstancesRegionIdParameter, dremioId string) ApiUpdateDremioInstanceRequest { return ApiUpdateDremioInstanceRequest{ ApiService: a, ctx: ctx, diff --git a/services/dremio/v1alphaapi/model_authentication.go b/services/dremio/v1alphaapi/model_authentication.go index d21a0e1f6..f210f083f 100644 --- a/services/dremio/v1alphaapi/model_authentication.go +++ b/services/dremio/v1alphaapi/model_authentication.go @@ -20,9 +20,9 @@ var _ MappedNullable = &Authentication{} // Authentication Dremio instance authentication settings. A change here triggers a Dremio restart and will incur downtime. type Authentication struct { - Azuread *Azuread `json:"azuread,omitempty"` - Oauth *Oauth `json:"oauth,omitempty"` - Type string `json:"type"` + Azuread *Azuread `json:"azuread,omitempty"` + Oauth *Oauth `json:"oauth,omitempty"` + Type AuthenticationType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +32,7 @@ type _Authentication Authentication // 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 NewAuthentication(types string) *Authentication { +func NewAuthentication(types AuthenticationType) *Authentication { this := Authentication{} this.Type = types return &this @@ -111,9 +111,9 @@ func (o *Authentication) SetOauth(v Oauth) { } // GetType returns the Type field value -func (o *Authentication) GetType() string { +func (o *Authentication) GetType() AuthenticationType { if o == nil { - var ret string + var ret AuthenticationType return ret } @@ -122,7 +122,7 @@ func (o *Authentication) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *Authentication) GetTypeOk() (*string, bool) { +func (o *Authentication) GetTypeOk() (*AuthenticationType, bool) { if o == nil { return nil, false } @@ -130,7 +130,7 @@ func (o *Authentication) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *Authentication) SetType(v string) { +func (o *Authentication) SetType(v AuthenticationType) { o.Type = v } diff --git a/services/dremio/v1alphaapi/model_authentication_type.go b/services/dremio/v1alphaapi/model_authentication_type.go new file mode 100644 index 000000000..4783d2631 --- /dev/null +++ b/services/dremio/v1alphaapi/model_authentication_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Dremio API + +This API provides endpoints for managing Dremios. + +API version: 1alpha.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// AuthenticationType the model 'AuthenticationType' +type AuthenticationType string + +// List of authentication_type +const ( + AUTHENTICATIONTYPE_LOCAL_ONLY AuthenticationType = "local-only" + AUTHENTICATIONTYPE_AZUREAD AuthenticationType = "azuread" + AUTHENTICATIONTYPE_OAUTH AuthenticationType = "oauth" + AUTHENTICATIONTYPE_UNKNOWN_DEFAULT_OPEN_API AuthenticationType = "unknown_default_open_api" +) + +// All allowed values of AuthenticationType enum +var AllowedAuthenticationTypeEnumValues = []AuthenticationType{ + "local-only", + "azuread", + "oauth", + "unknown_default_open_api", +} + +func (v *AuthenticationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuthenticationType(value) + for _, existing := range AllowedAuthenticationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = AUTHENTICATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAuthenticationTypeFromValue returns a pointer to a valid AuthenticationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuthenticationTypeFromValue(v string) (*AuthenticationType, error) { + ev := AuthenticationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuthenticationType: valid values are %v", v, AllowedAuthenticationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuthenticationType) IsValid() bool { + for _, existing := range AllowedAuthenticationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to authentication_type value +func (v AuthenticationType) Ptr() *AuthenticationType { + return &v +} + +type NullableAuthenticationType struct { + value *AuthenticationType + isSet bool +} + +func (v NullableAuthenticationType) Get() *AuthenticationType { + return v.value +} + +func (v *NullableAuthenticationType) Set(val *AuthenticationType) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticationType) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticationType(val *AuthenticationType) *NullableAuthenticationType { + return &NullableAuthenticationType{value: val, isSet: true} +} + +func (v NullableAuthenticationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dremio/v1alphaapi/model_dremio_response.go b/services/dremio/v1alphaapi/model_dremio_response.go index 6ddcbddb8..c97e05aa4 100644 --- a/services/dremio/v1alphaapi/model_dremio_response.go +++ b/services/dremio/v1alphaapi/model_dremio_response.go @@ -32,9 +32,8 @@ type DremioResponse struct { // A message describing an actionable error the user can resolve. This field is empty if no such error exists. ErrorMessage *string `json:"errorMessage,omitempty"` // A auto generated unique id which identifies the resource. - Id string `json:"id"` - // The current state of the resource. - State string `json:"state"` + Id string `json:"id"` + State DremioResponseState `json:"state"` AdditionalProperties map[string]interface{} } @@ -44,7 +43,7 @@ type _DremioResponse DremioResponse // 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 NewDremioResponse(authentication Authentication, createTime time.Time, displayName string, endpoints Endpoints, id string, state string) *DremioResponse { +func NewDremioResponse(authentication Authentication, createTime time.Time, displayName string, endpoints Endpoints, id string, state DremioResponseState) *DremioResponse { this := DremioResponse{} this.Authentication = authentication this.CreateTime = createTime @@ -248,9 +247,9 @@ func (o *DremioResponse) SetId(v string) { } // GetState returns the State field value -func (o *DremioResponse) GetState() string { +func (o *DremioResponse) GetState() DremioResponseState { if o == nil { - var ret string + var ret DremioResponseState return ret } @@ -259,7 +258,7 @@ func (o *DremioResponse) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *DremioResponse) GetStateOk() (*string, bool) { +func (o *DremioResponse) GetStateOk() (*DremioResponseState, bool) { if o == nil { return nil, false } @@ -267,7 +266,7 @@ func (o *DremioResponse) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *DremioResponse) SetState(v string) { +func (o *DremioResponse) SetState(v DremioResponseState) { o.State = v } diff --git a/services/dremio/v1alphaapi/model_dremio_response_state.go b/services/dremio/v1alphaapi/model_dremio_response_state.go new file mode 100644 index 000000000..13b4d2486 --- /dev/null +++ b/services/dremio/v1alphaapi/model_dremio_response_state.go @@ -0,0 +1,117 @@ +/* +STACKIT Dremio API + +This API provides endpoints for managing Dremios. + +API version: 1alpha.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// DremioResponseState The current state of the resource. +type DremioResponseState string + +// List of dremioResponse_state +const ( + DREMIORESPONSESTATE_RECONCILING DremioResponseState = "reconciling" + DREMIORESPONSESTATE_ACTIVE DremioResponseState = "active" + DREMIORESPONSESTATE_DELETING DremioResponseState = "deleting" + DREMIORESPONSESTATE_ERROR DremioResponseState = "error" + DREMIORESPONSESTATE_UNKNOWN_DEFAULT_OPEN_API DremioResponseState = "unknown_default_open_api" +) + +// All allowed values of DremioResponseState enum +var AllowedDremioResponseStateEnumValues = []DremioResponseState{ + "reconciling", + "active", + "deleting", + "error", + "unknown_default_open_api", +} + +func (v *DremioResponseState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DremioResponseState(value) + for _, existing := range AllowedDremioResponseStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DREMIORESPONSESTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDremioResponseStateFromValue returns a pointer to a valid DremioResponseState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDremioResponseStateFromValue(v string) (*DremioResponseState, error) { + ev := DremioResponseState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DremioResponseState: valid values are %v", v, AllowedDremioResponseStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DremioResponseState) IsValid() bool { + for _, existing := range AllowedDremioResponseStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to dremioResponse_state value +func (v DremioResponseState) Ptr() *DremioResponseState { + return &v +} + +type NullableDremioResponseState struct { + value *DremioResponseState + isSet bool +} + +func (v NullableDremioResponseState) Get() *DremioResponseState { + return v.value +} + +func (v *NullableDremioResponseState) Set(val *DremioResponseState) { + v.value = val + v.isSet = true +} + +func (v NullableDremioResponseState) IsSet() bool { + return v.isSet +} + +func (v *NullableDremioResponseState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDremioResponseState(val *DremioResponseState) *NullableDremioResponseState { + return &NullableDremioResponseState{value: val, isSet: true} +} + +func (v NullableDremioResponseState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDremioResponseState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dremio/v1alphaapi/model_dremio_user_response.go b/services/dremio/v1alphaapi/model_dremio_user_response.go index 5b61e1a11..0bce9b139 100644 --- a/services/dremio/v1alphaapi/model_dremio_user_response.go +++ b/services/dremio/v1alphaapi/model_dremio_user_response.go @@ -36,9 +36,8 @@ type DremioUserResponse struct { // This is the admin user's last name. LastName string `json:"lastName"` // This is the username used to login the admin user. - Name string `json:"name"` - // The current state of the resource. - State string `json:"state"` + Name string `json:"name"` + State DremioUserResponseState `json:"state"` AdditionalProperties map[string]interface{} } @@ -48,7 +47,7 @@ type _DremioUserResponse DremioUserResponse // 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 NewDremioUserResponse(email string, firstName string, id string, lastName string, name string, state string) *DremioUserResponse { +func NewDremioUserResponse(email string, firstName string, id string, lastName string, name string, state DremioUserResponseState) *DremioUserResponse { this := DremioUserResponse{} this.Email = email this.FirstName = firstName @@ -284,9 +283,9 @@ func (o *DremioUserResponse) SetName(v string) { } // GetState returns the State field value -func (o *DremioUserResponse) GetState() string { +func (o *DremioUserResponse) GetState() DremioUserResponseState { if o == nil { - var ret string + var ret DremioUserResponseState return ret } @@ -295,7 +294,7 @@ func (o *DremioUserResponse) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *DremioUserResponse) GetStateOk() (*string, bool) { +func (o *DremioUserResponse) GetStateOk() (*DremioUserResponseState, bool) { if o == nil { return nil, false } @@ -303,7 +302,7 @@ func (o *DremioUserResponse) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *DremioUserResponse) SetState(v string) { +func (o *DremioUserResponse) SetState(v DremioUserResponseState) { o.State = v } diff --git a/services/dremio/v1alphaapi/model_dremio_user_response_state.go b/services/dremio/v1alphaapi/model_dremio_user_response_state.go new file mode 100644 index 000000000..feacc8f83 --- /dev/null +++ b/services/dremio/v1alphaapi/model_dremio_user_response_state.go @@ -0,0 +1,117 @@ +/* +STACKIT Dremio API + +This API provides endpoints for managing Dremios. + +API version: 1alpha.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// DremioUserResponseState The current state of the resource. +type DremioUserResponseState string + +// List of dremioUserResponse_state +const ( + DREMIOUSERRESPONSESTATE_RECONCILING DremioUserResponseState = "reconciling" + DREMIOUSERRESPONSESTATE_ACTIVE DremioUserResponseState = "active" + DREMIOUSERRESPONSESTATE_DELETING DremioUserResponseState = "deleting" + DREMIOUSERRESPONSESTATE_ERROR DremioUserResponseState = "error" + DREMIOUSERRESPONSESTATE_UNKNOWN_DEFAULT_OPEN_API DremioUserResponseState = "unknown_default_open_api" +) + +// All allowed values of DremioUserResponseState enum +var AllowedDremioUserResponseStateEnumValues = []DremioUserResponseState{ + "reconciling", + "active", + "deleting", + "error", + "unknown_default_open_api", +} + +func (v *DremioUserResponseState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DremioUserResponseState(value) + for _, existing := range AllowedDremioUserResponseStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DREMIOUSERRESPONSESTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDremioUserResponseStateFromValue returns a pointer to a valid DremioUserResponseState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDremioUserResponseStateFromValue(v string) (*DremioUserResponseState, error) { + ev := DremioUserResponseState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DremioUserResponseState: valid values are %v", v, AllowedDremioUserResponseStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DremioUserResponseState) IsValid() bool { + for _, existing := range AllowedDremioUserResponseStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to dremioUserResponse_state value +func (v DremioUserResponseState) Ptr() *DremioUserResponseState { + return &v +} + +type NullableDremioUserResponseState struct { + value *DremioUserResponseState + isSet bool +} + +func (v NullableDremioUserResponseState) Get() *DremioUserResponseState { + return v.value +} + +func (v *NullableDremioUserResponseState) Set(val *DremioUserResponseState) { + v.value = val + v.isSet = true +} + +func (v NullableDremioUserResponseState) IsSet() bool { + return v.isSet +} + +func (v *NullableDremioUserResponseState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDremioUserResponseState(val *DremioUserResponseState) *NullableDremioUserResponseState { + return &NullableDremioUserResponseState{value: val, isSet: true} +} + +func (v NullableDremioUserResponseState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDremioUserResponseState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dremio/v1alphaapi/model_list_dremio_instances_region_id_parameter.go b/services/dremio/v1alphaapi/model_list_dremio_instances_region_id_parameter.go new file mode 100644 index 000000000..5a0b194e4 --- /dev/null +++ b/services/dremio/v1alphaapi/model_list_dremio_instances_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Dremio API + +This API provides endpoints for managing Dremios. + +API version: 1alpha.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// ListDremioInstancesRegionIdParameter the model 'ListDremioInstancesRegionIdParameter' +type ListDremioInstancesRegionIdParameter string + +// List of list_dremio_instances_regionId_parameter +const ( + LISTDREMIOINSTANCESREGIONIDPARAMETER_EU01 ListDremioInstancesRegionIdParameter = "eu01" + LISTDREMIOINSTANCESREGIONIDPARAMETER_EU02 ListDremioInstancesRegionIdParameter = "eu02" + LISTDREMIOINSTANCESREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDremioInstancesRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of ListDremioInstancesRegionIdParameter enum +var AllowedListDremioInstancesRegionIdParameterEnumValues = []ListDremioInstancesRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListDremioInstancesRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListDremioInstancesRegionIdParameter(value) + for _, existing := range AllowedListDremioInstancesRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTDREMIOINSTANCESREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListDremioInstancesRegionIdParameterFromValue returns a pointer to a valid ListDremioInstancesRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListDremioInstancesRegionIdParameterFromValue(v string) (*ListDremioInstancesRegionIdParameter, error) { + ev := ListDremioInstancesRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListDremioInstancesRegionIdParameter: valid values are %v", v, AllowedListDremioInstancesRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListDremioInstancesRegionIdParameter) IsValid() bool { + for _, existing := range AllowedListDremioInstancesRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to list_dremio_instances_regionId_parameter value +func (v ListDremioInstancesRegionIdParameter) Ptr() *ListDremioInstancesRegionIdParameter { + return &v +} + +type NullableListDremioInstancesRegionIdParameter struct { + value *ListDremioInstancesRegionIdParameter + isSet bool +} + +func (v NullableListDremioInstancesRegionIdParameter) Get() *ListDremioInstancesRegionIdParameter { + return v.value +} + +func (v *NullableListDremioInstancesRegionIdParameter) Set(val *ListDremioInstancesRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListDremioInstancesRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListDremioInstancesRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDremioInstancesRegionIdParameter(val *ListDremioInstancesRegionIdParameter) *NullableListDremioInstancesRegionIdParameter { + return &NullableListDremioInstancesRegionIdParameter{value: val, isSet: true} +} + +func (v NullableListDremioInstancesRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDremioInstancesRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From f8662a9b7708f0a53111fc89de72607a0755d8bc Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 09:52:26 +0200 Subject: [PATCH 09/66] chore(dremio): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 + services/dremio/CHANGELOG.md | 3 + services/dremio/VERSION | 2 +- services/dremio/v1alphaapi/wait/wait/wait.go | 68 +++++++++---------- .../dremio/v1alphaapi/wait/wait/wait_test.go | 48 ++++++------- 5 files changed, 64 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ef92a6a0..78052b033 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,6 +113,8 @@ - Manage your STACKIT Dremio resources: `DremioInstance`, `DremioUser` - Waiters for async operations: `CreateDremioInstanceWaitHandler`, `UpdateDremioInstanceWaitHandler`, `DeleteDremioInstanceWaitHandler`, `CreateDremioUserWaitHandler`, `UpdateDremioUserWaitHandler`, `DeleteDremioUserWaitHandler` - [Usage example](https://github.com/stackitcloud/stackit-sdk-go/tree/main/examples/dremio) + - [v0.2.0](services/dremio/CHANGELOG.md#v020) + - **Feature:** Introduce enums for various attributes - `edge`: - [v0.8.2](services/edge/CHANGELOG.md#v082) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/dremio/CHANGELOG.md b/services/dremio/CHANGELOG.md index 7aaf0459f..76191ee37 100644 --- a/services/dremio/CHANGELOG.md +++ b/services/dremio/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.2.0 +- **Feature:** Introduce enums for various attributes + ## v0.1.0 - Manage your STACKIT Dremio resources: `DremioInstance`, `DremioUser` diff --git a/services/dremio/VERSION b/services/dremio/VERSION index 9ff151c5b..81fd7ba08 100644 --- a/services/dremio/VERSION +++ b/services/dremio/VERSION @@ -1 +1 @@ -v0.1.0 \ No newline at end of file +v0.2.0 \ No newline at end of file diff --git a/services/dremio/v1alphaapi/wait/wait/wait.go b/services/dremio/v1alphaapi/wait/wait/wait.go index 5b437f683..c363b0483 100644 --- a/services/dremio/v1alphaapi/wait/wait/wait.go +++ b/services/dremio/v1alphaapi/wait/wait/wait.go @@ -19,17 +19,17 @@ const ( ) // CreateDremioWaitHandler will wait for the creation of a Dremio instance -func CreateDremioWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId, regionId, dremioId string) *wait.AsyncActionHandler[dremio.DremioResponse] { - waitConfig := wait.WaiterHelper[dremio.DremioResponse, string]{ +func CreateDremioWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId string, regionId dremio.ListDremioInstancesRegionIdParameter, dremioId string) *wait.AsyncActionHandler[dremio.DremioResponse] { + waitConfig := wait.WaiterHelper[dremio.DremioResponse, dremio.DremioResponseState]{ FetchInstance: a.GetDremioInstance(ctx, projectId, regionId, dremioId).Execute, - GetState: func(dremio *dremio.DremioResponse) (string, error) { - if dremio == nil { + GetState: func(dremioResp *dremio.DremioResponse) (dremio.DremioResponseState, error) { + if dremioResp == nil { return "", errors.New("empty response") } - return dremio.State, nil + return dremioResp.State, nil }, - ActiveState: []string{DREMIOSTATE_ACTIVE}, - ErrorState: []string{DREMIOSTATE_ERROR}, + ActiveState: []dremio.DremioResponseState{dremio.DREMIORESPONSESTATE_ACTIVE}, + ErrorState: []dremio.DremioResponseState{dremio.DREMIORESPONSESTATE_ERROR}, } handler := wait.New(waitConfig.Wait()) @@ -38,17 +38,17 @@ func CreateDremioWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId } // UpdateDremioWaitHandler will wait an update of a Dremio instance -func UpdateDremioWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId, regionId, dremioId string) *wait.AsyncActionHandler[dremio.DremioResponse] { - waitConfig := wait.WaiterHelper[dremio.DremioResponse, string]{ +func UpdateDremioWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId string, regionId dremio.ListDremioInstancesRegionIdParameter, dremioId string) *wait.AsyncActionHandler[dremio.DremioResponse] { + waitConfig := wait.WaiterHelper[dremio.DremioResponse, dremio.DremioResponseState]{ FetchInstance: a.GetDremioInstance(ctx, projectId, regionId, dremioId).Execute, - GetState: func(dremio *dremio.DremioResponse) (string, error) { - if dremio == nil { + GetState: func(dremioResp *dremio.DremioResponse) (dremio.DremioResponseState, error) { + if dremioResp == nil { return "", errors.New("empty response") } - return dremio.State, nil + return dremioResp.State, nil }, - ActiveState: []string{DREMIOSTATE_ACTIVE}, - ErrorState: []string{DREMIOSTATE_ERROR}, + ActiveState: []dremio.DremioResponseState{dremio.DREMIORESPONSESTATE_ACTIVE}, + ErrorState: []dremio.DremioResponseState{dremio.DREMIORESPONSESTATE_ERROR}, } handler := wait.New(waitConfig.Wait()) @@ -57,16 +57,16 @@ func UpdateDremioWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId } // DeleteDremioWaitHandler will wait for the deletion of a Dremio instance -func DeleteDremioWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId, regionId, dremioId string) *wait.AsyncActionHandler[dremio.DremioResponse] { - waitConfig := wait.WaiterHelper[dremio.DremioResponse, string]{ +func DeleteDremioWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId string, regionId dremio.ListDremioInstancesRegionIdParameter, dremioId string) *wait.AsyncActionHandler[dremio.DremioResponse] { + waitConfig := wait.WaiterHelper[dremio.DremioResponse, dremio.DremioResponseState]{ FetchInstance: a.GetDremioInstance(ctx, projectId, regionId, dremioId).Execute, - GetState: func(dremio *dremio.DremioResponse) (string, error) { - if dremio == nil { + GetState: func(dremioResp *dremio.DremioResponse) (dremio.DremioResponseState, error) { + if dremioResp == nil { return "", errors.New("empty response") } - return dremio.State, nil + return dremioResp.State, nil }, - ErrorState: []string{DREMIOSTATE_ERROR}, + ErrorState: []dremio.DremioResponseState{dremio.DREMIORESPONSESTATE_ERROR}, DeleteHttpErrorStatusCodes: []int{http.StatusNotFound}, } @@ -76,17 +76,17 @@ func DeleteDremioWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId } // CreateDremioUserWaitHandler will wait for the creation of a Dremio user -func CreateDremioUserWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId, regionId, dremioId, dremioUserId string) *wait.AsyncActionHandler[dremio.DremioUserResponse] { - waitConfig := wait.WaiterHelper[dremio.DremioUserResponse, string]{ +func CreateDremioUserWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId string, regionId dremio.ListDremioInstancesRegionIdParameter, dremioId, dremioUserId string) *wait.AsyncActionHandler[dremio.DremioUserResponse] { + waitConfig := wait.WaiterHelper[dremio.DremioUserResponse, dremio.DremioUserResponseState]{ FetchInstance: a.GetDremioUser(ctx, projectId, regionId, dremioId, dremioUserId).Execute, - GetState: func(user *dremio.DremioUserResponse) (string, error) { + GetState: func(user *dremio.DremioUserResponse) (dremio.DremioUserResponseState, error) { if user == nil { return "", errors.New("empty response") } return user.State, nil }, - ActiveState: []string{DREMIOUSERSTATE_ACTIVE}, - ErrorState: []string{DREMIOUSERSTATE_ERROR}, + ActiveState: []dremio.DremioUserResponseState{dremio.DREMIOUSERRESPONSESTATE_ACTIVE}, + ErrorState: []dremio.DremioUserResponseState{dremio.DREMIOUSERRESPONSESTATE_ERROR}, } handler := wait.New(waitConfig.Wait()) @@ -95,17 +95,17 @@ func CreateDremioUserWaitHandler(ctx context.Context, a dremio.DefaultAPI, proje } // UpdateDremioUserWaitHandler will wait for an update to a Dremio user -func UpdateDremioUserWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId, regionId, dremioId, dremioUserId string) *wait.AsyncActionHandler[dremio.DremioUserResponse] { - waitConfig := wait.WaiterHelper[dremio.DremioUserResponse, string]{ +func UpdateDremioUserWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId string, regionId dremio.ListDremioInstancesRegionIdParameter, dremioId, dremioUserId string) *wait.AsyncActionHandler[dremio.DremioUserResponse] { + waitConfig := wait.WaiterHelper[dremio.DremioUserResponse, dremio.DremioUserResponseState]{ FetchInstance: a.GetDremioUser(ctx, projectId, regionId, dremioId, dremioUserId).Execute, - GetState: func(user *dremio.DremioUserResponse) (string, error) { + GetState: func(user *dremio.DremioUserResponse) (dremio.DremioUserResponseState, error) { if user == nil { return "", errors.New("empty response") } return user.State, nil }, - ActiveState: []string{DREMIOUSERSTATE_ACTIVE}, - ErrorState: []string{DREMIOUSERSTATE_ERROR}, + ActiveState: []dremio.DremioUserResponseState{dremio.DREMIOUSERRESPONSESTATE_ACTIVE}, + ErrorState: []dremio.DremioUserResponseState{dremio.DREMIOUSERRESPONSESTATE_ERROR}, } handler := wait.New(waitConfig.Wait()) @@ -114,16 +114,16 @@ func UpdateDremioUserWaitHandler(ctx context.Context, a dremio.DefaultAPI, proje } // DeleteDremioUserWaitHandler will wait for a deletion of a Dremio user -func DeleteDremioUserWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId, regionId, dremioId, dremioUserId string) *wait.AsyncActionHandler[dremio.DremioUserResponse] { - waitConfig := wait.WaiterHelper[dremio.DremioUserResponse, string]{ +func DeleteDremioUserWaitHandler(ctx context.Context, a dremio.DefaultAPI, projectId string, regionId dremio.ListDremioInstancesRegionIdParameter, dremioId, dremioUserId string) *wait.AsyncActionHandler[dremio.DremioUserResponse] { + waitConfig := wait.WaiterHelper[dremio.DremioUserResponse, dremio.DremioUserResponseState]{ FetchInstance: a.GetDremioUser(ctx, projectId, regionId, dremioId, dremioUserId).Execute, - GetState: func(user *dremio.DremioUserResponse) (string, error) { + GetState: func(user *dremio.DremioUserResponse) (dremio.DremioUserResponseState, error) { if user == nil { return "", errors.New("empty response") } return user.State, nil }, - ErrorState: []string{DREMIOUSERSTATE_ERROR}, + ErrorState: []dremio.DremioUserResponseState{dremio.DREMIOUSERRESPONSESTATE_ERROR}, DeleteHttpErrorStatusCodes: []int{http.StatusNotFound}, } diff --git a/services/dremio/v1alphaapi/wait/wait/wait_test.go b/services/dremio/v1alphaapi/wait/wait/wait_test.go index b1eb4fc8e..af2494a42 100644 --- a/services/dremio/v1alphaapi/wait/wait/wait_test.go +++ b/services/dremio/v1alphaapi/wait/wait/wait_test.go @@ -35,7 +35,7 @@ func newAPIMock(settings mockSettings) dremio.DefaultAPI { } return &dremio.DremioResponse{ - State: settings.resourceState, + State: dremio.DremioResponseState(settings.resourceState), }, nil }, ), @@ -53,7 +53,7 @@ func newAPIMock(settings mockSettings) dremio.DefaultAPI { } return &dremio.DremioUserResponse{ - State: settings.resourceState, + State: dremio.DremioUserResponseState(settings.resourceState), }, nil }, ), @@ -71,14 +71,14 @@ func TestCreateDremioWaitHandler(t *testing.T) { { description: "create_succeeded", getFails: false, - resourceState: DREMIOSTATE_ACTIVE, + resourceState: string(dremio.DREMIORESPONSESTATE_ACTIVE), wantError: false, wantResponse: true, }, { description: "create_failed", getFails: false, - resourceState: DREMIOSTATE_ERROR, + resourceState: string(dremio.DREMIORESPONSESTATE_ERROR), wantError: true, wantResponse: true, }, @@ -109,11 +109,11 @@ func TestCreateDremioWaitHandler(t *testing.T) { var expectedResponse *dremio.DremioResponse if currentTest.wantResponse { expectedResponse = &dremio.DremioResponse{ - State: currentTest.resourceState, + State: dremio.DremioResponseState(currentTest.resourceState), } } - handler := CreateDremioWaitHandler(context.Background(), apiClient, "pid", "zid", "dremioId") + handler := CreateDremioWaitHandler(context.Background(), apiClient, "pid", dremio.ListDremioInstancesRegionIdParameter("zid"), "dremioId") gotResponse, err := handler.WaitWithContext(context.Background()) @@ -139,14 +139,14 @@ func TestUpdateDremioWaitHandler(t *testing.T) { { description: "update_succeeded", getFails: false, - resourceState: DREMIOSTATE_ACTIVE, + resourceState: string(dremio.DREMIORESPONSESTATE_ACTIVE), wantError: false, wantResponse: true, }, { description: "update_failed", getFails: false, - resourceState: DREMIOSTATE_ERROR, + resourceState: string(dremio.DREMIORESPONSESTATE_ERROR), wantError: true, wantResponse: true, }, @@ -177,11 +177,11 @@ func TestUpdateDremioWaitHandler(t *testing.T) { var expectedResponse *dremio.DremioResponse if currentTest.wantResponse { expectedResponse = &dremio.DremioResponse{ - State: currentTest.resourceState, + State: dremio.DremioResponseState(currentTest.resourceState), } } - handler := UpdateDremioWaitHandler(context.Background(), apiClient, "pid", "zid", "dremioId") + handler := UpdateDremioWaitHandler(context.Background(), apiClient, "pid", dremio.ListDremioInstancesRegionIdParameter("zid"), "dremioId") gotResponse, err := handler.WaitWithContext(context.Background()) @@ -217,7 +217,7 @@ func TestDeleteDremioWaitHandler(t *testing.T) { description: "delete_failed", isDeleted: false, getFails: false, - resourceState: DREMIOSTATE_ERROR, + resourceState: string(dremio.DREMIORESPONSESTATE_ERROR), wantError: true, wantResponse: true, }, @@ -250,11 +250,11 @@ func TestDeleteDremioWaitHandler(t *testing.T) { var expectedResponse *dremio.DremioResponse if currentTest.wantResponse { expectedResponse = &dremio.DremioResponse{ - State: currentTest.resourceState, + State: dremio.DremioResponseState(currentTest.resourceState), } } - handler := DeleteDremioWaitHandler(context.Background(), apiClient, "pid", "zid", "dremioId") + handler := DeleteDremioWaitHandler(context.Background(), apiClient, "pid", dremio.ListDremioInstancesRegionIdParameter("zid"), "dremioId") gotResponse, err := handler.WaitWithContext(context.Background()) @@ -284,14 +284,14 @@ func TestCreateDremioUserWaitHandler(t *testing.T) { { description: "create_succeeded", getFails: false, - resourceState: DREMIOUSERSTATE_ACTIVE, + resourceState: string(dremio.DREMIOUSERRESPONSESTATE_ACTIVE), wantError: false, wantResponse: true, }, { description: "create_failed", getFails: false, - resourceState: DREMIOUSERSTATE_ERROR, + resourceState: string(dremio.DREMIOUSERRESPONSESTATE_ERROR), wantError: true, wantResponse: true, }, @@ -322,11 +322,11 @@ func TestCreateDremioUserWaitHandler(t *testing.T) { var expectedResponse *dremio.DremioUserResponse if currentTest.wantResponse { expectedResponse = &dremio.DremioUserResponse{ - State: currentTest.resourceState, + State: dremio.DremioUserResponseState(currentTest.resourceState), } } - handler := CreateDremioUserWaitHandler(context.Background(), apiClient, "pid", "zid", "dremioId", "userId") + handler := CreateDremioUserWaitHandler(context.Background(), apiClient, "pid", dremio.ListDremioInstancesRegionIdParameter("zid"), "dremioId", "userId") gotResponse, err := handler.WaitWithContext(context.Background()) @@ -352,14 +352,14 @@ func TestUpdateDremioUserWaitHandler(t *testing.T) { { description: "update_succeeded", getFails: false, - resourceState: DREMIOUSERSTATE_ACTIVE, + resourceState: string(dremio.DREMIOUSERRESPONSESTATE_ACTIVE), wantError: false, wantResponse: true, }, { description: "update_failed", getFails: false, - resourceState: DREMIOUSERSTATE_ERROR, + resourceState: string(dremio.DREMIOUSERRESPONSESTATE_ERROR), wantError: true, wantResponse: true, }, @@ -390,11 +390,11 @@ func TestUpdateDremioUserWaitHandler(t *testing.T) { var expectedResponse *dremio.DremioUserResponse if currentTest.wantResponse { expectedResponse = &dremio.DremioUserResponse{ - State: currentTest.resourceState, + State: dremio.DremioUserResponseState(currentTest.resourceState), } } - handler := UpdateDremioUserWaitHandler(context.Background(), apiClient, "pid", "zid", "dremioId", "userId") + handler := UpdateDremioUserWaitHandler(context.Background(), apiClient, "pid", dremio.ListDremioInstancesRegionIdParameter("zid"), "dremioId", "userId") gotResponse, err := handler.WaitWithContext(context.Background()) @@ -430,7 +430,7 @@ func TestDeleteDremioUserWaitHandler(t *testing.T) { description: "delete_failed", isDeleted: false, getFails: false, - resourceState: DREMIOUSERSTATE_ERROR, + resourceState: string(dremio.DREMIOUSERRESPONSESTATE_ERROR), wantError: true, wantResponse: true, }, @@ -463,11 +463,11 @@ func TestDeleteDremioUserWaitHandler(t *testing.T) { var expectedResponse *dremio.DremioUserResponse if currentTest.wantResponse { expectedResponse = &dremio.DremioUserResponse{ - State: currentTest.resourceState, + State: dremio.DremioUserResponseState(currentTest.resourceState), } } - handler := DeleteDremioUserWaitHandler(context.Background(), apiClient, "pid", "zid", "dremioId", "userId") + handler := DeleteDremioUserWaitHandler(context.Background(), apiClient, "pid", dremio.ListDremioInstancesRegionIdParameter("zid"), "dremioId", "userId") gotResponse, err := handler.WaitWithContext(context.Background()) From 826d6693c3d81cf90de9877f94921ed069089c00 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 09:56:04 +0200 Subject: [PATCH 10/66] refac(edge): introduce inline enums --- services/edge/v1beta1api/api_default.go | 72 +++++------ services/edge/v1beta1api/api_default_mock.go | 24 ++-- ...et_instance_by_name_region_id_parameter.go | 113 +++++++++++++++++ .../model_get_instance_region_id_parameter.go | 113 +++++++++++++++++ ...nfig_by_instance_id_region_id_parameter.go | 113 +++++++++++++++++ ...ig_by_instance_name_region_id_parameter.go | 113 +++++++++++++++++ ...oken_by_instance_id_region_id_parameter.go | 113 +++++++++++++++++ ...en_by_instance_name_region_id_parameter.go | 113 +++++++++++++++++ services/edge/v1beta1api/model_instance.go | 15 ++- .../edge/v1beta1api/model_instance_status.go | 117 ++++++++++++++++++ ...odel_list_instances_region_id_parameter.go | 113 +++++++++++++++++ 11 files changed, 963 insertions(+), 56 deletions(-) create mode 100644 services/edge/v1beta1api/model_get_instance_by_name_region_id_parameter.go create mode 100644 services/edge/v1beta1api/model_get_instance_region_id_parameter.go create mode 100644 services/edge/v1beta1api/model_get_kubeconfig_by_instance_id_region_id_parameter.go create mode 100644 services/edge/v1beta1api/model_get_kubeconfig_by_instance_name_region_id_parameter.go create mode 100644 services/edge/v1beta1api/model_get_token_by_instance_id_region_id_parameter.go create mode 100644 services/edge/v1beta1api/model_get_token_by_instance_name_region_id_parameter.go create mode 100644 services/edge/v1beta1api/model_instance_status.go create mode 100644 services/edge/v1beta1api/model_list_instances_region_id_parameter.go diff --git a/services/edge/v1beta1api/api_default.go b/services/edge/v1beta1api/api_default.go index 064da829c..a694c4b9d 100644 --- a/services/edge/v1beta1api/api_default.go +++ b/services/edge/v1beta1api/api_default.go @@ -33,7 +33,7 @@ type DefaultAPI interface { @param regionId The STACKIT region the instance is part of. @return ApiCreateInstanceRequest */ - CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, regionId ListInstancesRegionIdParameter) ApiCreateInstanceRequest // CreateInstanceExecute executes the request // @return Instance @@ -50,7 +50,7 @@ type DefaultAPI interface { @param instanceId The full ID of the instance, -. @return ApiDeleteInstanceRequest */ - DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, regionId GetInstanceRegionIdParameter, instanceId string) ApiDeleteInstanceRequest // DeleteInstanceExecute executes the request DeleteInstanceExecute(r ApiDeleteInstanceRequest) error @@ -66,7 +66,7 @@ type DefaultAPI interface { @param displayName The instance display name. @return ApiDeleteInstanceByNameRequest */ - DeleteInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiDeleteInstanceByNameRequest + DeleteInstanceByName(ctx context.Context, projectId string, regionId GetInstanceByNameRegionIdParameter, displayName string) ApiDeleteInstanceByNameRequest // DeleteInstanceByNameExecute executes the request DeleteInstanceByNameExecute(r ApiDeleteInstanceByNameRequest) error @@ -82,7 +82,7 @@ type DefaultAPI interface { @param instanceId The full ID of the instance, -. @return ApiGetInstanceRequest */ - GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, regionId GetInstanceRegionIdParameter, instanceId string) ApiGetInstanceRequest // GetInstanceExecute executes the request // @return Instance @@ -99,7 +99,7 @@ type DefaultAPI interface { @param displayName The instance display name. @return ApiGetInstanceByNameRequest */ - GetInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetInstanceByNameRequest + GetInstanceByName(ctx context.Context, projectId string, regionId GetInstanceByNameRegionIdParameter, displayName string) ApiGetInstanceByNameRequest // GetInstanceByNameExecute executes the request // @return Instance @@ -116,7 +116,7 @@ type DefaultAPI interface { @param instanceId The full ID of the instance, -. @return ApiGetKubeconfigByInstanceIdRequest */ - GetKubeconfigByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetKubeconfigByInstanceIdRequest + GetKubeconfigByInstanceId(ctx context.Context, projectId string, regionId GetKubeconfigByInstanceIdRegionIdParameter, instanceId string) ApiGetKubeconfigByInstanceIdRequest // GetKubeconfigByInstanceIdExecute executes the request // @return Kubeconfig @@ -133,7 +133,7 @@ type DefaultAPI interface { @param displayName The instance display name. @return ApiGetKubeconfigByInstanceNameRequest */ - GetKubeconfigByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetKubeconfigByInstanceNameRequest + GetKubeconfigByInstanceName(ctx context.Context, projectId string, regionId GetKubeconfigByInstanceNameRegionIdParameter, displayName string) ApiGetKubeconfigByInstanceNameRequest // GetKubeconfigByInstanceNameExecute executes the request // @return Kubeconfig @@ -150,7 +150,7 @@ type DefaultAPI interface { @param instanceId The instance UUID. @return ApiGetTokenByInstanceIdRequest */ - GetTokenByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetTokenByInstanceIdRequest + GetTokenByInstanceId(ctx context.Context, projectId string, regionId GetTokenByInstanceIdRegionIdParameter, instanceId string) ApiGetTokenByInstanceIdRequest // GetTokenByInstanceIdExecute executes the request // @return Token @@ -167,7 +167,7 @@ type DefaultAPI interface { @param displayName The instance display name. @return ApiGetTokenByInstanceNameRequest */ - GetTokenByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetTokenByInstanceNameRequest + GetTokenByInstanceName(ctx context.Context, projectId string, regionId GetTokenByInstanceNameRegionIdParameter, displayName string) ApiGetTokenByInstanceNameRequest // GetTokenByInstanceNameExecute executes the request // @return Token @@ -195,7 +195,7 @@ type DefaultAPI interface { @param regionId The STACKIT region the instance is part of. @return ApiListInstancesRequest */ - ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, regionId ListInstancesRegionIdParameter) ApiListInstancesRequest // ListInstancesExecute executes the request // @return InstanceList @@ -227,7 +227,7 @@ type DefaultAPI interface { @param instanceId The full ID of the instance, -. @return ApiUpdateInstanceRequest */ - UpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateInstanceRequest + UpdateInstance(ctx context.Context, projectId string, regionId GetInstanceRegionIdParameter, instanceId string) ApiUpdateInstanceRequest // UpdateInstanceExecute executes the request UpdateInstanceExecute(r ApiUpdateInstanceRequest) error @@ -243,7 +243,7 @@ type DefaultAPI interface { @param displayName The instance display name. @return ApiUpdateInstanceByNameRequest */ - UpdateInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiUpdateInstanceByNameRequest + UpdateInstanceByName(ctx context.Context, projectId string, regionId GetInstanceByNameRegionIdParameter, displayName string) ApiUpdateInstanceByNameRequest // UpdateInstanceByNameExecute executes the request UpdateInstanceByNameExecute(r ApiUpdateInstanceByNameRequest) error @@ -256,7 +256,7 @@ type ApiCreateInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListInstancesRegionIdParameter createInstancePayload *CreateInstancePayload } @@ -279,7 +279,7 @@ Creates a new instance within the project. @param regionId The STACKIT region the instance is part of. @return ApiCreateInstanceRequest */ -func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, regionId ListInstancesRegionIdParameter) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ ApiService: a, ctx: ctx, @@ -397,7 +397,7 @@ type ApiDeleteInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetInstanceRegionIdParameter instanceId string } @@ -416,7 +416,7 @@ Deletes the given instance. @param instanceId The full ID of the instance, -. @return ApiDeleteInstanceRequest */ -func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, regionId GetInstanceRegionIdParameter, instanceId string) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -532,7 +532,7 @@ type ApiDeleteInstanceByNameRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetInstanceByNameRegionIdParameter displayName string } @@ -551,7 +551,7 @@ Deletes the given instance by name. @param displayName The instance display name. @return ApiDeleteInstanceByNameRequest */ -func (a *DefaultAPIService) DeleteInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiDeleteInstanceByNameRequest { +func (a *DefaultAPIService) DeleteInstanceByName(ctx context.Context, projectId string, regionId GetInstanceByNameRegionIdParameter, displayName string) ApiDeleteInstanceByNameRequest { return ApiDeleteInstanceByNameRequest{ ApiService: a, ctx: ctx, @@ -667,7 +667,7 @@ type ApiGetInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetInstanceRegionIdParameter instanceId string } @@ -686,7 +686,7 @@ Returns the details for the given instance. @param instanceId The full ID of the instance, -. @return ApiGetInstanceRequest */ -func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, regionId GetInstanceRegionIdParameter, instanceId string) ApiGetInstanceRequest { return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, @@ -815,7 +815,7 @@ type ApiGetInstanceByNameRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetInstanceByNameRegionIdParameter displayName string } @@ -834,7 +834,7 @@ Returns the details for the given instance by name. @param displayName The instance display name. @return ApiGetInstanceByNameRequest */ -func (a *DefaultAPIService) GetInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetInstanceByNameRequest { +func (a *DefaultAPIService) GetInstanceByName(ctx context.Context, projectId string, regionId GetInstanceByNameRegionIdParameter, displayName string) ApiGetInstanceByNameRequest { return ApiGetInstanceByNameRequest{ ApiService: a, ctx: ctx, @@ -963,7 +963,7 @@ type ApiGetKubeconfigByInstanceIdRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetKubeconfigByInstanceIdRegionIdParameter instanceId string expirationSeconds *int64 } @@ -989,7 +989,7 @@ Returns the kubeconfig for the given instance. @param instanceId The full ID of the instance, -. @return ApiGetKubeconfigByInstanceIdRequest */ -func (a *DefaultAPIService) GetKubeconfigByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetKubeconfigByInstanceIdRequest { +func (a *DefaultAPIService) GetKubeconfigByInstanceId(ctx context.Context, projectId string, regionId GetKubeconfigByInstanceIdRegionIdParameter, instanceId string) ApiGetKubeconfigByInstanceIdRequest { return ApiGetKubeconfigByInstanceIdRequest{ ApiService: a, ctx: ctx, @@ -1125,7 +1125,7 @@ type ApiGetKubeconfigByInstanceNameRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetKubeconfigByInstanceNameRegionIdParameter displayName string expirationSeconds *int64 } @@ -1151,7 +1151,7 @@ Returns the kubeconfig for the given instance. @param displayName The instance display name. @return ApiGetKubeconfigByInstanceNameRequest */ -func (a *DefaultAPIService) GetKubeconfigByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetKubeconfigByInstanceNameRequest { +func (a *DefaultAPIService) GetKubeconfigByInstanceName(ctx context.Context, projectId string, regionId GetKubeconfigByInstanceNameRegionIdParameter, displayName string) ApiGetKubeconfigByInstanceNameRequest { return ApiGetKubeconfigByInstanceNameRequest{ ApiService: a, ctx: ctx, @@ -1287,7 +1287,7 @@ type ApiGetTokenByInstanceIdRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetTokenByInstanceIdRegionIdParameter instanceId string expirationSeconds *int64 } @@ -1313,7 +1313,7 @@ Returns an ServiceAccount token. @param instanceId The instance UUID. @return ApiGetTokenByInstanceIdRequest */ -func (a *DefaultAPIService) GetTokenByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetTokenByInstanceIdRequest { +func (a *DefaultAPIService) GetTokenByInstanceId(ctx context.Context, projectId string, regionId GetTokenByInstanceIdRegionIdParameter, instanceId string) ApiGetTokenByInstanceIdRequest { return ApiGetTokenByInstanceIdRequest{ ApiService: a, ctx: ctx, @@ -1449,7 +1449,7 @@ type ApiGetTokenByInstanceNameRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetTokenByInstanceNameRegionIdParameter displayName string expirationSeconds *int64 } @@ -1475,7 +1475,7 @@ Returns an ServiceAccount token. @param displayName The instance display name. @return ApiGetTokenByInstanceNameRequest */ -func (a *DefaultAPIService) GetTokenByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetTokenByInstanceNameRequest { +func (a *DefaultAPIService) GetTokenByInstanceName(ctx context.Context, projectId string, regionId GetTokenByInstanceNameRegionIdParameter, displayName string) ApiGetTokenByInstanceNameRequest { return ApiGetTokenByInstanceNameRequest{ ApiService: a, ctx: ctx, @@ -1742,7 +1742,7 @@ type ApiListInstancesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListInstancesRegionIdParameter } func (r ApiListInstancesRequest) Execute() (*InstanceList, error) { @@ -1759,7 +1759,7 @@ Returns a list of all instances within the project. @param regionId The STACKIT region the instance is part of. @return ApiListInstancesRequest */ -func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, regionId ListInstancesRegionIdParameter) ApiListInstancesRequest { return ApiListInstancesRequest{ ApiService: a, ctx: ctx, @@ -2020,7 +2020,7 @@ type ApiUpdateInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetInstanceRegionIdParameter instanceId string updateInstancePayload *UpdateInstancePayload } @@ -2045,7 +2045,7 @@ Updates the given instance. @param instanceId The full ID of the instance, -. @return ApiUpdateInstanceRequest */ -func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateInstanceRequest { +func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, regionId GetInstanceRegionIdParameter, instanceId string) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -2166,7 +2166,7 @@ type ApiUpdateInstanceByNameRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetInstanceByNameRegionIdParameter displayName string updateInstanceByNamePayload *UpdateInstanceByNamePayload } @@ -2191,7 +2191,7 @@ Updates the given instance. @param displayName The instance display name. @return ApiUpdateInstanceByNameRequest */ -func (a *DefaultAPIService) UpdateInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiUpdateInstanceByNameRequest { +func (a *DefaultAPIService) UpdateInstanceByName(ctx context.Context, projectId string, regionId GetInstanceByNameRegionIdParameter, displayName string) ApiUpdateInstanceByNameRequest { return ApiUpdateInstanceByNameRequest{ ApiService: a, ctx: ctx, diff --git a/services/edge/v1beta1api/api_default_mock.go b/services/edge/v1beta1api/api_default_mock.go index f5e252b6f..f9302e9e3 100644 --- a/services/edge/v1beta1api/api_default_mock.go +++ b/services/edge/v1beta1api/api_default_mock.go @@ -50,7 +50,7 @@ type DefaultAPIServiceMock struct { UpdateInstanceByNameExecuteMock *func(r ApiUpdateInstanceByNameRequest) error } -func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, regionId ListInstancesRegionIdParameter) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ ApiService: a, ctx: ctx, @@ -69,7 +69,7 @@ func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) return (*a.CreateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, regionId GetInstanceRegionIdParameter, instanceId string) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -88,7 +88,7 @@ func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) return (*a.DeleteInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiDeleteInstanceByNameRequest { +func (a DefaultAPIServiceMock) DeleteInstanceByName(ctx context.Context, projectId string, regionId GetInstanceByNameRegionIdParameter, displayName string) ApiDeleteInstanceByNameRequest { return ApiDeleteInstanceByNameRequest{ ApiService: a, ctx: ctx, @@ -107,7 +107,7 @@ func (a DefaultAPIServiceMock) DeleteInstanceByNameExecute(r ApiDeleteInstanceBy return (*a.DeleteInstanceByNameExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, regionId GetInstanceRegionIdParameter, instanceId string) ApiGetInstanceRequest { return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, @@ -127,7 +127,7 @@ func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Ins return (*a.GetInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetInstanceByNameRequest { +func (a DefaultAPIServiceMock) GetInstanceByName(ctx context.Context, projectId string, regionId GetInstanceByNameRegionIdParameter, displayName string) ApiGetInstanceByNameRequest { return ApiGetInstanceByNameRequest{ ApiService: a, ctx: ctx, @@ -147,7 +147,7 @@ func (a DefaultAPIServiceMock) GetInstanceByNameExecute(r ApiGetInstanceByNameRe return (*a.GetInstanceByNameExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetKubeconfigByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetKubeconfigByInstanceIdRequest { +func (a DefaultAPIServiceMock) GetKubeconfigByInstanceId(ctx context.Context, projectId string, regionId GetKubeconfigByInstanceIdRegionIdParameter, instanceId string) ApiGetKubeconfigByInstanceIdRequest { return ApiGetKubeconfigByInstanceIdRequest{ ApiService: a, ctx: ctx, @@ -167,7 +167,7 @@ func (a DefaultAPIServiceMock) GetKubeconfigByInstanceIdExecute(r ApiGetKubeconf return (*a.GetKubeconfigByInstanceIdExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetKubeconfigByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetKubeconfigByInstanceNameRequest { +func (a DefaultAPIServiceMock) GetKubeconfigByInstanceName(ctx context.Context, projectId string, regionId GetKubeconfigByInstanceNameRegionIdParameter, displayName string) ApiGetKubeconfigByInstanceNameRequest { return ApiGetKubeconfigByInstanceNameRequest{ ApiService: a, ctx: ctx, @@ -187,7 +187,7 @@ func (a DefaultAPIServiceMock) GetKubeconfigByInstanceNameExecute(r ApiGetKubeco return (*a.GetKubeconfigByInstanceNameExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetTokenByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetTokenByInstanceIdRequest { +func (a DefaultAPIServiceMock) GetTokenByInstanceId(ctx context.Context, projectId string, regionId GetTokenByInstanceIdRegionIdParameter, instanceId string) ApiGetTokenByInstanceIdRequest { return ApiGetTokenByInstanceIdRequest{ ApiService: a, ctx: ctx, @@ -207,7 +207,7 @@ func (a DefaultAPIServiceMock) GetTokenByInstanceIdExecute(r ApiGetTokenByInstan return (*a.GetTokenByInstanceIdExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetTokenByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetTokenByInstanceNameRequest { +func (a DefaultAPIServiceMock) GetTokenByInstanceName(ctx context.Context, projectId string, regionId GetTokenByInstanceNameRegionIdParameter, displayName string) ApiGetTokenByInstanceNameRequest { return ApiGetTokenByInstanceNameRequest{ ApiService: a, ctx: ctx, @@ -244,7 +244,7 @@ func (a DefaultAPIServiceMock) ListCompatibleKubernetesReleasesExecute(r ApiList return (*a.ListCompatibleKubernetesReleasesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, regionId ListInstancesRegionIdParameter) ApiListInstancesRequest { return ApiListInstancesRequest{ ApiService: a, ctx: ctx, @@ -281,7 +281,7 @@ func (a DefaultAPIServiceMock) ListPlansProjectExecute(r ApiListPlansProjectRequ return (*a.ListPlansProjectExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateInstanceRequest { +func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, regionId GetInstanceRegionIdParameter, instanceId string) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -300,7 +300,7 @@ func (a DefaultAPIServiceMock) UpdateInstanceExecute(r ApiUpdateInstanceRequest) return (*a.UpdateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiUpdateInstanceByNameRequest { +func (a DefaultAPIServiceMock) UpdateInstanceByName(ctx context.Context, projectId string, regionId GetInstanceByNameRegionIdParameter, displayName string) ApiUpdateInstanceByNameRequest { return ApiUpdateInstanceByNameRequest{ ApiService: a, ctx: ctx, diff --git a/services/edge/v1beta1api/model_get_instance_by_name_region_id_parameter.go b/services/edge/v1beta1api/model_get_instance_by_name_region_id_parameter.go new file mode 100644 index 000000000..a48ba6d83 --- /dev/null +++ b/services/edge/v1beta1api/model_get_instance_by_name_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Edge Cloud API + +This API provides endpoints for managing STACKIT Edge Cloud instances. + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// GetInstanceByNameRegionIdParameter the model 'GetInstanceByNameRegionIdParameter' +type GetInstanceByNameRegionIdParameter string + +// List of get_instance_by_name_regionId_parameter +const ( + GETINSTANCEBYNAMEREGIONIDPARAMETER_EU01 GetInstanceByNameRegionIdParameter = "eu01" + GETINSTANCEBYNAMEREGIONIDPARAMETER_EU02 GetInstanceByNameRegionIdParameter = "eu02" + GETINSTANCEBYNAMEREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetInstanceByNameRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of GetInstanceByNameRegionIdParameter enum +var AllowedGetInstanceByNameRegionIdParameterEnumValues = []GetInstanceByNameRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetInstanceByNameRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetInstanceByNameRegionIdParameter(value) + for _, existing := range AllowedGetInstanceByNameRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETINSTANCEBYNAMEREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetInstanceByNameRegionIdParameterFromValue returns a pointer to a valid GetInstanceByNameRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetInstanceByNameRegionIdParameterFromValue(v string) (*GetInstanceByNameRegionIdParameter, error) { + ev := GetInstanceByNameRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetInstanceByNameRegionIdParameter: valid values are %v", v, AllowedGetInstanceByNameRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetInstanceByNameRegionIdParameter) IsValid() bool { + for _, existing := range AllowedGetInstanceByNameRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to get_instance_by_name_regionId_parameter value +func (v GetInstanceByNameRegionIdParameter) Ptr() *GetInstanceByNameRegionIdParameter { + return &v +} + +type NullableGetInstanceByNameRegionIdParameter struct { + value *GetInstanceByNameRegionIdParameter + isSet bool +} + +func (v NullableGetInstanceByNameRegionIdParameter) Get() *GetInstanceByNameRegionIdParameter { + return v.value +} + +func (v *NullableGetInstanceByNameRegionIdParameter) Set(val *GetInstanceByNameRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetInstanceByNameRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetInstanceByNameRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetInstanceByNameRegionIdParameter(val *GetInstanceByNameRegionIdParameter) *NullableGetInstanceByNameRegionIdParameter { + return &NullableGetInstanceByNameRegionIdParameter{value: val, isSet: true} +} + +func (v NullableGetInstanceByNameRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetInstanceByNameRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/edge/v1beta1api/model_get_instance_region_id_parameter.go b/services/edge/v1beta1api/model_get_instance_region_id_parameter.go new file mode 100644 index 000000000..adaefac65 --- /dev/null +++ b/services/edge/v1beta1api/model_get_instance_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Edge Cloud API + +This API provides endpoints for managing STACKIT Edge Cloud instances. + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// GetInstanceRegionIdParameter the model 'GetInstanceRegionIdParameter' +type GetInstanceRegionIdParameter string + +// List of get_instance_regionId_parameter +const ( + GETINSTANCEREGIONIDPARAMETER_EU01 GetInstanceRegionIdParameter = "eu01" + GETINSTANCEREGIONIDPARAMETER_EU02 GetInstanceRegionIdParameter = "eu02" + GETINSTANCEREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetInstanceRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of GetInstanceRegionIdParameter enum +var AllowedGetInstanceRegionIdParameterEnumValues = []GetInstanceRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetInstanceRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetInstanceRegionIdParameter(value) + for _, existing := range AllowedGetInstanceRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETINSTANCEREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetInstanceRegionIdParameterFromValue returns a pointer to a valid GetInstanceRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetInstanceRegionIdParameterFromValue(v string) (*GetInstanceRegionIdParameter, error) { + ev := GetInstanceRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetInstanceRegionIdParameter: valid values are %v", v, AllowedGetInstanceRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetInstanceRegionIdParameter) IsValid() bool { + for _, existing := range AllowedGetInstanceRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to get_instance_regionId_parameter value +func (v GetInstanceRegionIdParameter) Ptr() *GetInstanceRegionIdParameter { + return &v +} + +type NullableGetInstanceRegionIdParameter struct { + value *GetInstanceRegionIdParameter + isSet bool +} + +func (v NullableGetInstanceRegionIdParameter) Get() *GetInstanceRegionIdParameter { + return v.value +} + +func (v *NullableGetInstanceRegionIdParameter) Set(val *GetInstanceRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetInstanceRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetInstanceRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetInstanceRegionIdParameter(val *GetInstanceRegionIdParameter) *NullableGetInstanceRegionIdParameter { + return &NullableGetInstanceRegionIdParameter{value: val, isSet: true} +} + +func (v NullableGetInstanceRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetInstanceRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/edge/v1beta1api/model_get_kubeconfig_by_instance_id_region_id_parameter.go b/services/edge/v1beta1api/model_get_kubeconfig_by_instance_id_region_id_parameter.go new file mode 100644 index 000000000..0fc5e899d --- /dev/null +++ b/services/edge/v1beta1api/model_get_kubeconfig_by_instance_id_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Edge Cloud API + +This API provides endpoints for managing STACKIT Edge Cloud instances. + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// GetKubeconfigByInstanceIdRegionIdParameter the model 'GetKubeconfigByInstanceIdRegionIdParameter' +type GetKubeconfigByInstanceIdRegionIdParameter string + +// List of get_kubeconfig_by_instance_id_regionId_parameter +const ( + GETKUBECONFIGBYINSTANCEIDREGIONIDPARAMETER_EU01 GetKubeconfigByInstanceIdRegionIdParameter = "eu01" + GETKUBECONFIGBYINSTANCEIDREGIONIDPARAMETER_EU02 GetKubeconfigByInstanceIdRegionIdParameter = "eu02" + GETKUBECONFIGBYINSTANCEIDREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetKubeconfigByInstanceIdRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of GetKubeconfigByInstanceIdRegionIdParameter enum +var AllowedGetKubeconfigByInstanceIdRegionIdParameterEnumValues = []GetKubeconfigByInstanceIdRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetKubeconfigByInstanceIdRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetKubeconfigByInstanceIdRegionIdParameter(value) + for _, existing := range AllowedGetKubeconfigByInstanceIdRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETKUBECONFIGBYINSTANCEIDREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetKubeconfigByInstanceIdRegionIdParameterFromValue returns a pointer to a valid GetKubeconfigByInstanceIdRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetKubeconfigByInstanceIdRegionIdParameterFromValue(v string) (*GetKubeconfigByInstanceIdRegionIdParameter, error) { + ev := GetKubeconfigByInstanceIdRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetKubeconfigByInstanceIdRegionIdParameter: valid values are %v", v, AllowedGetKubeconfigByInstanceIdRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetKubeconfigByInstanceIdRegionIdParameter) IsValid() bool { + for _, existing := range AllowedGetKubeconfigByInstanceIdRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to get_kubeconfig_by_instance_id_regionId_parameter value +func (v GetKubeconfigByInstanceIdRegionIdParameter) Ptr() *GetKubeconfigByInstanceIdRegionIdParameter { + return &v +} + +type NullableGetKubeconfigByInstanceIdRegionIdParameter struct { + value *GetKubeconfigByInstanceIdRegionIdParameter + isSet bool +} + +func (v NullableGetKubeconfigByInstanceIdRegionIdParameter) Get() *GetKubeconfigByInstanceIdRegionIdParameter { + return v.value +} + +func (v *NullableGetKubeconfigByInstanceIdRegionIdParameter) Set(val *GetKubeconfigByInstanceIdRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetKubeconfigByInstanceIdRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKubeconfigByInstanceIdRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKubeconfigByInstanceIdRegionIdParameter(val *GetKubeconfigByInstanceIdRegionIdParameter) *NullableGetKubeconfigByInstanceIdRegionIdParameter { + return &NullableGetKubeconfigByInstanceIdRegionIdParameter{value: val, isSet: true} +} + +func (v NullableGetKubeconfigByInstanceIdRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKubeconfigByInstanceIdRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/edge/v1beta1api/model_get_kubeconfig_by_instance_name_region_id_parameter.go b/services/edge/v1beta1api/model_get_kubeconfig_by_instance_name_region_id_parameter.go new file mode 100644 index 000000000..686e7c202 --- /dev/null +++ b/services/edge/v1beta1api/model_get_kubeconfig_by_instance_name_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Edge Cloud API + +This API provides endpoints for managing STACKIT Edge Cloud instances. + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// GetKubeconfigByInstanceNameRegionIdParameter the model 'GetKubeconfigByInstanceNameRegionIdParameter' +type GetKubeconfigByInstanceNameRegionIdParameter string + +// List of get_kubeconfig_by_instance_name_regionId_parameter +const ( + GETKUBECONFIGBYINSTANCENAMEREGIONIDPARAMETER_EU01 GetKubeconfigByInstanceNameRegionIdParameter = "eu01" + GETKUBECONFIGBYINSTANCENAMEREGIONIDPARAMETER_EU02 GetKubeconfigByInstanceNameRegionIdParameter = "eu02" + GETKUBECONFIGBYINSTANCENAMEREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetKubeconfigByInstanceNameRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of GetKubeconfigByInstanceNameRegionIdParameter enum +var AllowedGetKubeconfigByInstanceNameRegionIdParameterEnumValues = []GetKubeconfigByInstanceNameRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetKubeconfigByInstanceNameRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetKubeconfigByInstanceNameRegionIdParameter(value) + for _, existing := range AllowedGetKubeconfigByInstanceNameRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETKUBECONFIGBYINSTANCENAMEREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetKubeconfigByInstanceNameRegionIdParameterFromValue returns a pointer to a valid GetKubeconfigByInstanceNameRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetKubeconfigByInstanceNameRegionIdParameterFromValue(v string) (*GetKubeconfigByInstanceNameRegionIdParameter, error) { + ev := GetKubeconfigByInstanceNameRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetKubeconfigByInstanceNameRegionIdParameter: valid values are %v", v, AllowedGetKubeconfigByInstanceNameRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetKubeconfigByInstanceNameRegionIdParameter) IsValid() bool { + for _, existing := range AllowedGetKubeconfigByInstanceNameRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to get_kubeconfig_by_instance_name_regionId_parameter value +func (v GetKubeconfigByInstanceNameRegionIdParameter) Ptr() *GetKubeconfigByInstanceNameRegionIdParameter { + return &v +} + +type NullableGetKubeconfigByInstanceNameRegionIdParameter struct { + value *GetKubeconfigByInstanceNameRegionIdParameter + isSet bool +} + +func (v NullableGetKubeconfigByInstanceNameRegionIdParameter) Get() *GetKubeconfigByInstanceNameRegionIdParameter { + return v.value +} + +func (v *NullableGetKubeconfigByInstanceNameRegionIdParameter) Set(val *GetKubeconfigByInstanceNameRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetKubeconfigByInstanceNameRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKubeconfigByInstanceNameRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKubeconfigByInstanceNameRegionIdParameter(val *GetKubeconfigByInstanceNameRegionIdParameter) *NullableGetKubeconfigByInstanceNameRegionIdParameter { + return &NullableGetKubeconfigByInstanceNameRegionIdParameter{value: val, isSet: true} +} + +func (v NullableGetKubeconfigByInstanceNameRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKubeconfigByInstanceNameRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/edge/v1beta1api/model_get_token_by_instance_id_region_id_parameter.go b/services/edge/v1beta1api/model_get_token_by_instance_id_region_id_parameter.go new file mode 100644 index 000000000..4a83f84ca --- /dev/null +++ b/services/edge/v1beta1api/model_get_token_by_instance_id_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Edge Cloud API + +This API provides endpoints for managing STACKIT Edge Cloud instances. + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// GetTokenByInstanceIdRegionIdParameter the model 'GetTokenByInstanceIdRegionIdParameter' +type GetTokenByInstanceIdRegionIdParameter string + +// List of get_token_by_instance_id_regionId_parameter +const ( + GETTOKENBYINSTANCEIDREGIONIDPARAMETER_EU01 GetTokenByInstanceIdRegionIdParameter = "eu01" + GETTOKENBYINSTANCEIDREGIONIDPARAMETER_EU02 GetTokenByInstanceIdRegionIdParameter = "eu02" + GETTOKENBYINSTANCEIDREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetTokenByInstanceIdRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of GetTokenByInstanceIdRegionIdParameter enum +var AllowedGetTokenByInstanceIdRegionIdParameterEnumValues = []GetTokenByInstanceIdRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetTokenByInstanceIdRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetTokenByInstanceIdRegionIdParameter(value) + for _, existing := range AllowedGetTokenByInstanceIdRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETTOKENBYINSTANCEIDREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetTokenByInstanceIdRegionIdParameterFromValue returns a pointer to a valid GetTokenByInstanceIdRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetTokenByInstanceIdRegionIdParameterFromValue(v string) (*GetTokenByInstanceIdRegionIdParameter, error) { + ev := GetTokenByInstanceIdRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetTokenByInstanceIdRegionIdParameter: valid values are %v", v, AllowedGetTokenByInstanceIdRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetTokenByInstanceIdRegionIdParameter) IsValid() bool { + for _, existing := range AllowedGetTokenByInstanceIdRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to get_token_by_instance_id_regionId_parameter value +func (v GetTokenByInstanceIdRegionIdParameter) Ptr() *GetTokenByInstanceIdRegionIdParameter { + return &v +} + +type NullableGetTokenByInstanceIdRegionIdParameter struct { + value *GetTokenByInstanceIdRegionIdParameter + isSet bool +} + +func (v NullableGetTokenByInstanceIdRegionIdParameter) Get() *GetTokenByInstanceIdRegionIdParameter { + return v.value +} + +func (v *NullableGetTokenByInstanceIdRegionIdParameter) Set(val *GetTokenByInstanceIdRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetTokenByInstanceIdRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTokenByInstanceIdRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTokenByInstanceIdRegionIdParameter(val *GetTokenByInstanceIdRegionIdParameter) *NullableGetTokenByInstanceIdRegionIdParameter { + return &NullableGetTokenByInstanceIdRegionIdParameter{value: val, isSet: true} +} + +func (v NullableGetTokenByInstanceIdRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTokenByInstanceIdRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/edge/v1beta1api/model_get_token_by_instance_name_region_id_parameter.go b/services/edge/v1beta1api/model_get_token_by_instance_name_region_id_parameter.go new file mode 100644 index 000000000..e0b7b646d --- /dev/null +++ b/services/edge/v1beta1api/model_get_token_by_instance_name_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Edge Cloud API + +This API provides endpoints for managing STACKIT Edge Cloud instances. + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// GetTokenByInstanceNameRegionIdParameter the model 'GetTokenByInstanceNameRegionIdParameter' +type GetTokenByInstanceNameRegionIdParameter string + +// List of get_token_by_instance_name_regionId_parameter +const ( + GETTOKENBYINSTANCENAMEREGIONIDPARAMETER_EU01 GetTokenByInstanceNameRegionIdParameter = "eu01" + GETTOKENBYINSTANCENAMEREGIONIDPARAMETER_EU02 GetTokenByInstanceNameRegionIdParameter = "eu02" + GETTOKENBYINSTANCENAMEREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetTokenByInstanceNameRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of GetTokenByInstanceNameRegionIdParameter enum +var AllowedGetTokenByInstanceNameRegionIdParameterEnumValues = []GetTokenByInstanceNameRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetTokenByInstanceNameRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetTokenByInstanceNameRegionIdParameter(value) + for _, existing := range AllowedGetTokenByInstanceNameRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETTOKENBYINSTANCENAMEREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetTokenByInstanceNameRegionIdParameterFromValue returns a pointer to a valid GetTokenByInstanceNameRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetTokenByInstanceNameRegionIdParameterFromValue(v string) (*GetTokenByInstanceNameRegionIdParameter, error) { + ev := GetTokenByInstanceNameRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetTokenByInstanceNameRegionIdParameter: valid values are %v", v, AllowedGetTokenByInstanceNameRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetTokenByInstanceNameRegionIdParameter) IsValid() bool { + for _, existing := range AllowedGetTokenByInstanceNameRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to get_token_by_instance_name_regionId_parameter value +func (v GetTokenByInstanceNameRegionIdParameter) Ptr() *GetTokenByInstanceNameRegionIdParameter { + return &v +} + +type NullableGetTokenByInstanceNameRegionIdParameter struct { + value *GetTokenByInstanceNameRegionIdParameter + isSet bool +} + +func (v NullableGetTokenByInstanceNameRegionIdParameter) Get() *GetTokenByInstanceNameRegionIdParameter { + return v.value +} + +func (v *NullableGetTokenByInstanceNameRegionIdParameter) Set(val *GetTokenByInstanceNameRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetTokenByInstanceNameRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTokenByInstanceNameRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTokenByInstanceNameRegionIdParameter(val *GetTokenByInstanceNameRegionIdParameter) *NullableGetTokenByInstanceNameRegionIdParameter { + return &NullableGetTokenByInstanceNameRegionIdParameter{value: val, isSet: true} +} + +func (v NullableGetTokenByInstanceNameRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTokenByInstanceNameRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/edge/v1beta1api/model_instance.go b/services/edge/v1beta1api/model_instance.go index fe4a66ede..be11be782 100644 --- a/services/edge/v1beta1api/model_instance.go +++ b/services/edge/v1beta1api/model_instance.go @@ -32,9 +32,8 @@ type Instance struct { // A auto generated unique id which identifies the instance. Id string `json:"id"` // Service Plan configures the size of the Instance. - PlanId string `json:"planId"` - // The current status of the instance. - Status string `json:"status"` + PlanId string `json:"planId"` + Status InstanceStatus `json:"status"` AdditionalProperties map[string]interface{} } @@ -44,7 +43,7 @@ type _Instance Instance // 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 NewInstance(created time.Time, displayName string, frontendUrl string, id string, planId string, status string) *Instance { +func NewInstance(created time.Time, displayName string, frontendUrl string, id string, planId string, status InstanceStatus) *Instance { this := Instance{} this.Created = created this.DisplayName = displayName @@ -216,9 +215,9 @@ func (o *Instance) SetPlanId(v string) { } // GetStatus returns the Status field value -func (o *Instance) GetStatus() string { +func (o *Instance) GetStatus() InstanceStatus { if o == nil { - var ret string + var ret InstanceStatus return ret } @@ -227,7 +226,7 @@ func (o *Instance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *Instance) GetStatusOk() (*string, bool) { +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { if o == nil { return nil, false } @@ -235,7 +234,7 @@ func (o *Instance) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *Instance) SetStatus(v string) { +func (o *Instance) SetStatus(v InstanceStatus) { o.Status = v } diff --git a/services/edge/v1beta1api/model_instance_status.go b/services/edge/v1beta1api/model_instance_status.go new file mode 100644 index 000000000..da2d27b44 --- /dev/null +++ b/services/edge/v1beta1api/model_instance_status.go @@ -0,0 +1,117 @@ +/* +STACKIT Edge Cloud API + +This API provides endpoints for managing STACKIT Edge Cloud instances. + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus The current status of the instance. +type InstanceStatus string + +// List of instance_status +const ( + INSTANCESTATUS_ERROR InstanceStatus = "error" + INSTANCESTATUS_RECONCILING InstanceStatus = "reconciling" + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "error", + "reconciling", + "active", + "deleting", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/edge/v1beta1api/model_list_instances_region_id_parameter.go b/services/edge/v1beta1api/model_list_instances_region_id_parameter.go new file mode 100644 index 000000000..c6b56c1bd --- /dev/null +++ b/services/edge/v1beta1api/model_list_instances_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Edge Cloud API + +This API provides endpoints for managing STACKIT Edge Cloud instances. + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// ListInstancesRegionIdParameter the model 'ListInstancesRegionIdParameter' +type ListInstancesRegionIdParameter string + +// List of ListInstances_regionId_parameter +const ( + LISTINSTANCESREGIONIDPARAMETER_EU01 ListInstancesRegionIdParameter = "eu01" + LISTINSTANCESREGIONIDPARAMETER_EU02 ListInstancesRegionIdParameter = "eu02" + LISTINSTANCESREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListInstancesRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of ListInstancesRegionIdParameter enum +var AllowedListInstancesRegionIdParameterEnumValues = []ListInstancesRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListInstancesRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListInstancesRegionIdParameter(value) + for _, existing := range AllowedListInstancesRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTINSTANCESREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListInstancesRegionIdParameterFromValue returns a pointer to a valid ListInstancesRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListInstancesRegionIdParameterFromValue(v string) (*ListInstancesRegionIdParameter, error) { + ev := ListInstancesRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListInstancesRegionIdParameter: valid values are %v", v, AllowedListInstancesRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListInstancesRegionIdParameter) IsValid() bool { + for _, existing := range AllowedListInstancesRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListInstances_regionId_parameter value +func (v ListInstancesRegionIdParameter) Ptr() *ListInstancesRegionIdParameter { + return &v +} + +type NullableListInstancesRegionIdParameter struct { + value *ListInstancesRegionIdParameter + isSet bool +} + +func (v NullableListInstancesRegionIdParameter) Get() *ListInstancesRegionIdParameter { + return v.value +} + +func (v *NullableListInstancesRegionIdParameter) Set(val *ListInstancesRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesRegionIdParameter(val *ListInstancesRegionIdParameter) *NullableListInstancesRegionIdParameter { + return &NullableListInstancesRegionIdParameter{value: val, isSet: true} +} + +func (v NullableListInstancesRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From f3c39878584fa8ae1de876a771aee846e601efff Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 13:14:49 +0200 Subject: [PATCH 11/66] chore(edge): fix waiters/tests/examples, write changelog, bump version --- CHANGELOG.md | 2 ++ examples/edge/edge.go | 4 +-- services/edge/CHANGELOG.md | 3 ++ services/edge/VERSION | 2 +- services/edge/v1beta1api/wait/wait.go | 34 +++++++++++----------- services/edge/v1beta1api/wait/wait_test.go | 24 +++++++-------- 6 files changed, 37 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78052b033..8542467af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -129,6 +129,8 @@ - [v0.11.0](services/edge/CHANGELOG.md#v0110) - **Improvement:** Use new `WaiterHandler` struct in the Edge WaitHandler - **Deprecation:** Deprecated `ErrInstanceCreationFailed` and `ErrInstanceIsBeingDeleted` in `wait` package + - [v0.12.0](services/edge/CHANGELOG.md#v0120) + - **Feature:** Introduce enums for various attributes - `git`: - [v0.11.2](services/git/CHANGELOG.md#v0112) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/examples/edge/edge.go b/examples/edge/edge.go index 6261adbbf..aef7ced76 100644 --- a/examples/edge/edge.go +++ b/examples/edge/edge.go @@ -32,7 +32,7 @@ func main() { ctx = context.Background() ) payload.DisplayName = "example" - instance, err = client.DefaultAPI.CreateInstance(ctx, projectId, region).CreateInstancePayload(*payload).Execute() + instance, err = client.DefaultAPI.CreateInstance(ctx, projectId, edge.ListInstancesRegionIdParameter(region)).CreateInstancePayload(*payload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[Edge API] Failed to create Instance: %v\n", err) os.Exit(1) @@ -95,7 +95,7 @@ func main() { } // Delete Edge Instance - err = client.DefaultAPI.DeleteInstance(ctx, projectId, region, instance.GetId()).Execute() + err = client.DefaultAPI.DeleteInstance(ctx, projectId, edge.GetInstanceRegionIdParameter(region), instance.GetId()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "[Edge API] Failed to delete instance: %v\n", err) os.Exit(1) diff --git a/services/edge/CHANGELOG.md b/services/edge/CHANGELOG.md index 801ed5f91..846cec66f 100644 --- a/services/edge/CHANGELOG.md +++ b/services/edge/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.12.0 +- **Feature:** Introduce enums for various attributes + ## v0.11.0 - **Improvement:** Use new `WaiterHandler` struct in the Edge WaitHandler - **Deprecation:** Deprecated `ErrInstanceCreationFailed` and `ErrInstanceIsBeingDeleted` in `wait` package diff --git a/services/edge/VERSION b/services/edge/VERSION index fd2726c91..87a1cf595 100644 --- a/services/edge/VERSION +++ b/services/edge/VERSION @@ -1 +1 @@ -v0.11.0 +v0.12.0 diff --git a/services/edge/v1beta1api/wait/wait.go b/services/edge/v1beta1api/wait/wait.go index b8b7686b1..36881f179 100644 --- a/services/edge/v1beta1api/wait/wait.go +++ b/services/edge/v1beta1api/wait/wait.go @@ -33,18 +33,18 @@ var ( // createOrUpdateInstanceWaitHandler contains the shared logic for waiting on instance creation or updates. func createOrUpdateInstanceWaitHandler(ctx context.Context, getInstance func(ctx context.Context) (*edge.Instance, error)) *wait.AsyncActionHandler[edge.Instance] { - waitConfig := wait.WaiterHelper[edge.Instance, string]{ + waitConfig := wait.WaiterHelper[edge.Instance, edge.InstanceStatus]{ FetchInstance: func() (*edge.Instance, error) { return getInstance(ctx) }, - GetState: func(e *edge.Instance) (string, error) { + GetState: func(e *edge.Instance) (edge.InstanceStatus, error) { if e == nil { return "", ErrInstanceNotFound } return e.Status, nil }, - ActiveState: []string{INSTANCESTATUS_ACTIVE}, - ErrorState: []string{INSTANCESTATUS_ERROR, INSTANCESTATUS_DELETING}, + ActiveState: []edge.InstanceStatus{edge.INSTANCESTATUS_ACTIVE}, + ErrorState: []edge.InstanceStatus{edge.INSTANCESTATUS_ERROR, edge.INSTANCESTATUS_DELETING}, } handler := wait.New(waitConfig.Wait()) handler.SetTimeout(timeoutMinutes * time.Minute) @@ -54,24 +54,24 @@ func createOrUpdateInstanceWaitHandler(ctx context.Context, getInstance func(ctx // CreateOrUpdateInstanceWaitHandler waits for instance creation or update by ID to complete. func CreateOrUpdateInstanceWaitHandler(ctx context.Context, a edge.DefaultAPI, projectId, regionId, instanceId string) *wait.AsyncActionHandler[edge.Instance] { return createOrUpdateInstanceWaitHandler(ctx, func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstance(ctx, projectId, regionId, instanceId).Execute() + return a.GetInstance(ctx, projectId, edge.GetInstanceRegionIdParameter(regionId), instanceId).Execute() }) } // CreateOrUpdateInstanceByNameWaitHandler waits for instance creation or update by name to complete. func CreateOrUpdateInstanceByNameWaitHandler(ctx context.Context, a edge.DefaultAPI, projectId, regionId, displayName string) *wait.AsyncActionHandler[edge.Instance] { return createOrUpdateInstanceWaitHandler(ctx, func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstanceByName(ctx, projectId, regionId, displayName).Execute() + return a.GetInstanceByName(ctx, projectId, edge.GetInstanceByNameRegionIdParameter(regionId), displayName).Execute() }) } // deleteInstanceWaitHandler contains the shared logic for waiting on instance deletion. func deleteInstanceWaitHandler(ctx context.Context, getInstance func(ctx context.Context) (*edge.Instance, error)) *wait.AsyncActionHandler[edge.Instance] { - waitConfig := wait.WaiterHelper[edge.Instance, string]{ + waitConfig := wait.WaiterHelper[edge.Instance, edge.InstanceStatus]{ FetchInstance: func() (*edge.Instance, error) { return getInstance(ctx) }, - GetState: func(e *edge.Instance) (string, error) { + GetState: func(e *edge.Instance) (edge.InstanceStatus, error) { if e == nil { return "", ErrInstanceNotFound } @@ -86,14 +86,14 @@ func deleteInstanceWaitHandler(ctx context.Context, getInstance func(ctx context // DeleteInstanceWaitHandler waits for instance deletion by ID. func DeleteInstanceWaitHandler(ctx context.Context, a edge.DefaultAPI, projectId, regionId, instanceId string) *wait.AsyncActionHandler[edge.Instance] { return deleteInstanceWaitHandler(ctx, func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstance(ctx, projectId, regionId, instanceId).Execute() + return a.GetInstance(ctx, projectId, edge.GetInstanceRegionIdParameter(regionId), instanceId).Execute() }) } // DeleteInstanceByNameWaitHandler waits for instance deletion by name. func DeleteInstanceByNameWaitHandler(ctx context.Context, a edge.DefaultAPI, projectId, regionId, displayName string) *wait.AsyncActionHandler[edge.Instance] { return deleteInstanceWaitHandler(ctx, func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstanceByName(ctx, projectId, regionId, displayName).Execute() + return a.GetInstanceByName(ctx, projectId, edge.GetInstanceByNameRegionIdParameter(regionId), displayName).Execute() }) } @@ -134,7 +134,7 @@ func KubeconfigWaitHandler(ctx context.Context, a edge.DefaultAPI, projectId, re return checkInstanceExistsWithUsableStatus(ctx, a, projectId, regionId, instanceId) }, func(ctx context.Context) (*edge.Kubeconfig, error) { - req := a.GetKubeconfigByInstanceId(ctx, projectId, regionId, instanceId) + req := a.GetKubeconfigByInstanceId(ctx, projectId, edge.GetKubeconfigByInstanceIdRegionIdParameter(regionId), instanceId) if expirationSeconds != nil { req = req.ExpirationSeconds(*expirationSeconds) } @@ -150,7 +150,7 @@ func KubeconfigByInstanceNameWaitHandler(ctx context.Context, a edge.DefaultAPI, return checkInstanceNameExistsWithUsableStatus(ctx, a, projectId, regionId, displayName) }, func(ctx context.Context) (*edge.Kubeconfig, error) { - req := a.GetKubeconfigByInstanceName(ctx, projectId, regionId, displayName) + req := a.GetKubeconfigByInstanceName(ctx, projectId, edge.GetKubeconfigByInstanceNameRegionIdParameter(regionId), displayName) if expirationSeconds != nil { req = req.ExpirationSeconds(*expirationSeconds) } @@ -196,7 +196,7 @@ func TokenWaitHandler(ctx context.Context, a edge.DefaultAPI, projectId, regionI return checkInstanceExistsWithUsableStatus(ctx, a, projectId, regionId, instanceId) }, func(ctx context.Context) (*edge.Token, error) { - req := a.GetTokenByInstanceId(ctx, projectId, regionId, instanceId) + req := a.GetTokenByInstanceId(ctx, projectId, edge.GetTokenByInstanceIdRegionIdParameter(regionId), instanceId) if expirationSeconds != nil { req = req.ExpirationSeconds(*expirationSeconds) } @@ -212,7 +212,7 @@ func TokenByInstanceNameWaitHandler(ctx context.Context, a edge.DefaultAPI, proj return checkInstanceNameExistsWithUsableStatus(ctx, a, projectId, regionId, displayName) }, func(ctx context.Context) (*edge.Token, error) { - req := a.GetTokenByInstanceName(ctx, projectId, regionId, displayName) + req := a.GetTokenByInstanceName(ctx, projectId, edge.GetTokenByInstanceNameRegionIdParameter(regionId), displayName) if expirationSeconds != nil { req = req.ExpirationSeconds(*expirationSeconds) } @@ -230,7 +230,7 @@ func checkInstanceUsableStatus(ctx context.Context, getInstance func(ctx context if instance == nil { return ErrInstanceNotFound } - if instance.Status == INSTANCESTATUS_ACTIVE || instance.Status == INSTANCESTATUS_RECONCILING { + if instance.Status == edge.INSTANCESTATUS_ACTIVE || instance.Status == edge.INSTANCESTATUS_RECONCILING { return nil } return fmt.Errorf("cannot use instance with %s '%s' with status '%s'", identifierType, identifierValue, instance.Status) @@ -241,7 +241,7 @@ func checkInstanceExistsWithUsableStatus(ctx context.Context, a edge.DefaultAPI, return checkInstanceUsableStatus( ctx, func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstance(ctx, projectId, regionId, instanceId).Execute() + return a.GetInstance(ctx, projectId, edge.GetInstanceRegionIdParameter(regionId), instanceId).Execute() }, "ID", instanceId, @@ -253,7 +253,7 @@ func checkInstanceNameExistsWithUsableStatus(ctx context.Context, a edge.Default return checkInstanceUsableStatus( ctx, func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstanceByName(ctx, projectId, regionId, displayName).Execute() + return a.GetInstanceByName(ctx, projectId, edge.GetInstanceByNameRegionIdParameter(regionId), displayName).Execute() }, "name", displayName, diff --git a/services/edge/v1beta1api/wait/wait_test.go b/services/edge/v1beta1api/wait/wait_test.go index 18c2efb8d..1c97057ce 100644 --- a/services/edge/v1beta1api/wait/wait_test.go +++ b/services/edge/v1beta1api/wait/wait_test.go @@ -22,7 +22,7 @@ const ( ) type mockSettings struct { - instanceStatus string + instanceStatus edge.InstanceStatus instanceError error deleteErrors []error @@ -70,7 +70,7 @@ func newAPIMock(settings *mockSettings) edge.DefaultAPI { if settings.instanceError != nil { return nil, settings.instanceError } - return &edge.Instance{Status: settings.instanceStatus}, nil + return &edge.Instance{Status: edge.InstanceStatus(settings.instanceStatus)}, nil } return &edge.DefaultAPIServiceMock{ @@ -110,25 +110,25 @@ func newAPIMock(settings *mockSettings) edge.DefaultAPI { var createOrUpdateInstanceTests = []struct { desc string shouldFail bool // This will be used to set instanceError - instanceStatus string + instanceStatus edge.InstanceStatus wantErr error }{ { desc: "successful creation", shouldFail: false, - instanceStatus: INSTANCESTATUS_ACTIVE, + instanceStatus: edge.INSTANCESTATUS_ACTIVE, wantErr: nil, }, { desc: "timeout during reconciliation", shouldFail: false, - instanceStatus: INSTANCESTATUS_RECONCILING, + instanceStatus: edge.INSTANCESTATUS_RECONCILING, wantErr: errors.New("WaitWithContext() has timed out"), }, { desc: "failed creation", shouldFail: false, - instanceStatus: INSTANCESTATUS_ERROR, + instanceStatus: edge.INSTANCESTATUS_ERROR, wantErr: errors.New("state is error"), }, { @@ -168,7 +168,7 @@ var deleteInstanceTests = []struct { // This test table is for handlers that retry on 404, which is currently required due to incorrect active instance status var kubeconfigOrTokenTests = []struct { desc string - instanceStatus string + instanceStatus edge.InstanceStatus instanceError error errorsToReturn []error mockShouldTimeout bool @@ -176,19 +176,19 @@ var kubeconfigOrTokenTests = []struct { }{ { desc: "success", - instanceStatus: INSTANCESTATUS_ACTIVE, + instanceStatus: edge.INSTANCESTATUS_ACTIVE, errorsToReturn: []error{nil}, wantErr: nil, }, { desc: "success_on_reconciling", - instanceStatus: INSTANCESTATUS_RECONCILING, + instanceStatus: edge.INSTANCESTATUS_RECONCILING, errorsToReturn: []error{nil}, wantErr: nil, }, { desc: "retry_on_404", - instanceStatus: INSTANCESTATUS_ACTIVE, + instanceStatus: edge.INSTANCESTATUS_ACTIVE, errorsToReturn: []error{ &oapierror.GenericOpenAPIError{StatusCode: http.StatusNotFound}, &oapierror.GenericOpenAPIError{StatusCode: http.StatusNotFound}, @@ -199,7 +199,7 @@ var kubeconfigOrTokenTests = []struct { }, { desc: "timeout", - instanceStatus: INSTANCESTATUS_ACTIVE, + instanceStatus: edge.INSTANCESTATUS_ACTIVE, errorsToReturn: []error{&oapierror.GenericOpenAPIError{StatusCode: http.StatusNotFound}}, mockShouldTimeout: true, wantErr: errors.New("WaitWithContext() has timed out"), @@ -211,7 +211,7 @@ var kubeconfigOrTokenTests = []struct { }, { desc: "unusable_instance_status", - instanceStatus: INSTANCESTATUS_ERROR, + instanceStatus: edge.INSTANCESTATUS_ERROR, wantErr: errors.New("cannot use instance"), }, } From 791682e2cfbdb5ce8f2f13a2dc8f230a7ed92403 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 14:35:49 +0200 Subject: [PATCH 12/66] refac(intake): introduce inline enums --- services/intake/v1betaapi/api_default.go | 90 +++++++------- services/intake/v1betaapi/api_default_mock.go | 30 ++--- .../intake/v1betaapi/model_intake_response.go | 15 ++- .../v1betaapi/model_intake_response_state.go | 117 ++++++++++++++++++ .../v1betaapi/model_intake_runner_response.go | 15 ++- .../model_intake_runner_response_state.go | 115 +++++++++++++++++ .../v1betaapi/model_intake_user_response.go | 17 ++- .../model_intake_user_response_state.go | 115 +++++++++++++++++ ...list_intake_runners_region_id_parameter.go | 113 +++++++++++++++++ 9 files changed, 542 insertions(+), 85 deletions(-) create mode 100644 services/intake/v1betaapi/model_intake_response_state.go create mode 100644 services/intake/v1betaapi/model_intake_runner_response_state.go create mode 100644 services/intake/v1betaapi/model_intake_user_response_state.go create mode 100644 services/intake/v1betaapi/model_list_intake_runners_region_id_parameter.go diff --git a/services/intake/v1betaapi/api_default.go b/services/intake/v1betaapi/api_default.go index 392315b68..8c6fbe028 100644 --- a/services/intake/v1betaapi/api_default.go +++ b/services/intake/v1betaapi/api_default.go @@ -33,7 +33,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiCreateIntakeRequest */ - CreateIntake(ctx context.Context, projectId string, regionId string) ApiCreateIntakeRequest + CreateIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiCreateIntakeRequest // CreateIntakeExecute executes the request // @return IntakeResponse @@ -49,7 +49,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiCreateIntakeRunnerRequest */ - CreateIntakeRunner(ctx context.Context, projectId string, regionId string) ApiCreateIntakeRunnerRequest + CreateIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiCreateIntakeRunnerRequest // CreateIntakeRunnerExecute executes the request // @return IntakeRunnerResponse @@ -66,7 +66,7 @@ type DefaultAPI interface { @param intakeId The intake UUID. @return ApiCreateIntakeUserRequest */ - CreateIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string) ApiCreateIntakeUserRequest + CreateIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiCreateIntakeUserRequest // CreateIntakeUserExecute executes the request // @return IntakeUserResponse @@ -83,7 +83,7 @@ type DefaultAPI interface { @param intakeId The intake UUID. @return ApiDeleteIntakeRequest */ - DeleteIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiDeleteIntakeRequest + DeleteIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiDeleteIntakeRequest // DeleteIntakeExecute executes the request DeleteIntakeExecute(r ApiDeleteIntakeRequest) error @@ -99,7 +99,7 @@ type DefaultAPI interface { @param intakeRunnerId The intake runner UUID. @return ApiDeleteIntakeRunnerRequest */ - DeleteIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiDeleteIntakeRunnerRequest + DeleteIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeRunnerId string) ApiDeleteIntakeRunnerRequest // DeleteIntakeRunnerExecute executes the request DeleteIntakeRunnerExecute(r ApiDeleteIntakeRunnerRequest) error @@ -116,7 +116,7 @@ type DefaultAPI interface { @param intakeUserId The intake user UUID. @return ApiDeleteIntakeUserRequest */ - DeleteIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiDeleteIntakeUserRequest + DeleteIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string, intakeUserId string) ApiDeleteIntakeUserRequest // DeleteIntakeUserExecute executes the request DeleteIntakeUserExecute(r ApiDeleteIntakeUserRequest) error @@ -132,7 +132,7 @@ type DefaultAPI interface { @param intakeId The intake UUID. @return ApiGetIntakeRequest */ - GetIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiGetIntakeRequest + GetIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiGetIntakeRequest // GetIntakeExecute executes the request // @return IntakeResponse @@ -149,7 +149,7 @@ type DefaultAPI interface { @param intakeRunnerId The intake runner UUID. @return ApiGetIntakeRunnerRequest */ - GetIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiGetIntakeRunnerRequest + GetIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeRunnerId string) ApiGetIntakeRunnerRequest // GetIntakeRunnerExecute executes the request // @return IntakeRunnerResponse @@ -167,7 +167,7 @@ type DefaultAPI interface { @param intakeUserId The intake user UUID. @return ApiGetIntakeUserRequest */ - GetIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiGetIntakeUserRequest + GetIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string, intakeUserId string) ApiGetIntakeUserRequest // GetIntakeUserExecute executes the request // @return IntakeUserResponse @@ -183,7 +183,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiListIntakeRunnersRequest */ - ListIntakeRunners(ctx context.Context, projectId string, regionId string) ApiListIntakeRunnersRequest + ListIntakeRunners(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiListIntakeRunnersRequest // ListIntakeRunnersExecute executes the request // @return ListIntakeRunnersResponse @@ -200,7 +200,7 @@ type DefaultAPI interface { @param intakeId The intake UUID. @return ApiListIntakeUsersRequest */ - ListIntakeUsers(ctx context.Context, projectId string, regionId string, intakeId string) ApiListIntakeUsersRequest + ListIntakeUsers(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiListIntakeUsersRequest // ListIntakeUsersExecute executes the request // @return ListIntakeUsersResponse @@ -216,7 +216,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiListIntakesRequest */ - ListIntakes(ctx context.Context, projectId string, regionId string) ApiListIntakesRequest + ListIntakes(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiListIntakesRequest // ListIntakesExecute executes the request // @return ListIntakesResponse @@ -233,7 +233,7 @@ type DefaultAPI interface { @param intakeId The intake UUID. @return ApiUpdateIntakeRequest */ - UpdateIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiUpdateIntakeRequest + UpdateIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiUpdateIntakeRequest // UpdateIntakeExecute executes the request // @return IntakeResponse @@ -250,7 +250,7 @@ type DefaultAPI interface { @param intakeRunnerId The intake runner UUID. @return ApiUpdateIntakeRunnerRequest */ - UpdateIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiUpdateIntakeRunnerRequest + UpdateIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeRunnerId string) ApiUpdateIntakeRunnerRequest // UpdateIntakeRunnerExecute executes the request // @return IntakeRunnerResponse @@ -268,7 +268,7 @@ type DefaultAPI interface { @param intakeUserId The intake user UUID. @return ApiUpdateIntakeUserRequest */ - UpdateIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiUpdateIntakeUserRequest + UpdateIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string, intakeUserId string) ApiUpdateIntakeUserRequest // UpdateIntakeUserExecute executes the request // @return IntakeUserResponse @@ -282,7 +282,7 @@ type ApiCreateIntakeRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter createIntakePayload *CreateIntakePayload } @@ -305,7 +305,7 @@ Creates a new intake within the project. @param regionId The STACKIT region name the resource is located in. @return ApiCreateIntakeRequest */ -func (a *DefaultAPIService) CreateIntake(ctx context.Context, projectId string, regionId string) ApiCreateIntakeRequest { +func (a *DefaultAPIService) CreateIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiCreateIntakeRequest { return ApiCreateIntakeRequest{ ApiService: a, ctx: ctx, @@ -412,7 +412,7 @@ type ApiCreateIntakeRunnerRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter createIntakeRunnerPayload *CreateIntakeRunnerPayload } @@ -435,7 +435,7 @@ Creates a new intake runner within the project. @param regionId The STACKIT region name the resource is located in. @return ApiCreateIntakeRunnerRequest */ -func (a *DefaultAPIService) CreateIntakeRunner(ctx context.Context, projectId string, regionId string) ApiCreateIntakeRunnerRequest { +func (a *DefaultAPIService) CreateIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiCreateIntakeRunnerRequest { return ApiCreateIntakeRunnerRequest{ ApiService: a, ctx: ctx, @@ -542,7 +542,7 @@ type ApiCreateIntakeUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeId string createIntakeUserPayload *CreateIntakeUserPayload } @@ -567,7 +567,7 @@ Creates a new user for this intake. @param intakeId The intake UUID. @return ApiCreateIntakeUserRequest */ -func (a *DefaultAPIService) CreateIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string) ApiCreateIntakeUserRequest { +func (a *DefaultAPIService) CreateIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiCreateIntakeUserRequest { return ApiCreateIntakeUserRequest{ ApiService: a, ctx: ctx, @@ -676,7 +676,7 @@ type ApiDeleteIntakeRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeId string force *bool } @@ -702,7 +702,7 @@ Deletes the given intake. @param intakeId The intake UUID. @return ApiDeleteIntakeRequest */ -func (a *DefaultAPIService) DeleteIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiDeleteIntakeRequest { +func (a *DefaultAPIService) DeleteIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiDeleteIntakeRequest { return ApiDeleteIntakeRequest{ ApiService: a, ctx: ctx, @@ -800,7 +800,7 @@ type ApiDeleteIntakeRunnerRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeRunnerId string force *bool } @@ -826,7 +826,7 @@ Deletes the given intake runner. @param intakeRunnerId The intake runner UUID. @return ApiDeleteIntakeRunnerRequest */ -func (a *DefaultAPIService) DeleteIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiDeleteIntakeRunnerRequest { +func (a *DefaultAPIService) DeleteIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeRunnerId string) ApiDeleteIntakeRunnerRequest { return ApiDeleteIntakeRunnerRequest{ ApiService: a, ctx: ctx, @@ -924,7 +924,7 @@ type ApiDeleteIntakeUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeId string intakeUserId string } @@ -945,7 +945,7 @@ Deletes the given intake user. @param intakeUserId The intake user UUID. @return ApiDeleteIntakeUserRequest */ -func (a *DefaultAPIService) DeleteIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiDeleteIntakeUserRequest { +func (a *DefaultAPIService) DeleteIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string, intakeUserId string) ApiDeleteIntakeUserRequest { return ApiDeleteIntakeUserRequest{ ApiService: a, ctx: ctx, @@ -1038,7 +1038,7 @@ type ApiGetIntakeRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeId string } @@ -1057,7 +1057,7 @@ Returns the details for the given intake. @param intakeId The intake UUID. @return ApiGetIntakeRequest */ -func (a *DefaultAPIService) GetIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiGetIntakeRequest { +func (a *DefaultAPIService) GetIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiGetIntakeRequest { return ApiGetIntakeRequest{ ApiService: a, ctx: ctx, @@ -1161,7 +1161,7 @@ type ApiGetIntakeRunnerRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeRunnerId string } @@ -1180,7 +1180,7 @@ Returns the details for the given intake runner. @param intakeRunnerId The intake runner UUID. @return ApiGetIntakeRunnerRequest */ -func (a *DefaultAPIService) GetIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiGetIntakeRunnerRequest { +func (a *DefaultAPIService) GetIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeRunnerId string) ApiGetIntakeRunnerRequest { return ApiGetIntakeRunnerRequest{ ApiService: a, ctx: ctx, @@ -1284,7 +1284,7 @@ type ApiGetIntakeUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeId string intakeUserId string } @@ -1305,7 +1305,7 @@ Returns the details for the given user. @param intakeUserId The intake user UUID. @return ApiGetIntakeUserRequest */ -func (a *DefaultAPIService) GetIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiGetIntakeUserRequest { +func (a *DefaultAPIService) GetIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string, intakeUserId string) ApiGetIntakeUserRequest { return ApiGetIntakeUserRequest{ ApiService: a, ctx: ctx, @@ -1411,7 +1411,7 @@ type ApiListIntakeRunnersRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter pageToken *string pageSize *int32 } @@ -1442,7 +1442,7 @@ Returns a list of all intake runners within the project. @param regionId The STACKIT region name the resource is located in. @return ApiListIntakeRunnersRequest */ -func (a *DefaultAPIService) ListIntakeRunners(ctx context.Context, projectId string, regionId string) ApiListIntakeRunnersRequest { +func (a *DefaultAPIService) ListIntakeRunners(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiListIntakeRunnersRequest { return ApiListIntakeRunnersRequest{ ApiService: a, ctx: ctx, @@ -1554,7 +1554,7 @@ type ApiListIntakeUsersRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeId string pageToken *string pageSize *int32 @@ -1587,7 +1587,7 @@ Returns a list of all intake users within the project and intake. @param intakeId The intake UUID. @return ApiListIntakeUsersRequest */ -func (a *DefaultAPIService) ListIntakeUsers(ctx context.Context, projectId string, regionId string, intakeId string) ApiListIntakeUsersRequest { +func (a *DefaultAPIService) ListIntakeUsers(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiListIntakeUsersRequest { return ApiListIntakeUsersRequest{ ApiService: a, ctx: ctx, @@ -1701,7 +1701,7 @@ type ApiListIntakesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter pageToken *string pageSize *int32 } @@ -1732,7 +1732,7 @@ Returns a list of all intakes within the project. @param regionId The STACKIT region name the resource is located in. @return ApiListIntakesRequest */ -func (a *DefaultAPIService) ListIntakes(ctx context.Context, projectId string, regionId string) ApiListIntakesRequest { +func (a *DefaultAPIService) ListIntakes(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiListIntakesRequest { return ApiListIntakesRequest{ ApiService: a, ctx: ctx, @@ -1844,7 +1844,7 @@ type ApiUpdateIntakeRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeId string updateIntakePayload *UpdateIntakePayload } @@ -1869,7 +1869,7 @@ Updates the given intake. @param intakeId The intake UUID. @return ApiUpdateIntakeRequest */ -func (a *DefaultAPIService) UpdateIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiUpdateIntakeRequest { +func (a *DefaultAPIService) UpdateIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiUpdateIntakeRequest { return ApiUpdateIntakeRequest{ ApiService: a, ctx: ctx, @@ -1978,7 +1978,7 @@ type ApiUpdateIntakeRunnerRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeRunnerId string updateIntakeRunnerPayload *UpdateIntakeRunnerPayload } @@ -2003,7 +2003,7 @@ Updates a intake runner within the project. @param intakeRunnerId The intake runner UUID. @return ApiUpdateIntakeRunnerRequest */ -func (a *DefaultAPIService) UpdateIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiUpdateIntakeRunnerRequest { +func (a *DefaultAPIService) UpdateIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeRunnerId string) ApiUpdateIntakeRunnerRequest { return ApiUpdateIntakeRunnerRequest{ ApiService: a, ctx: ctx, @@ -2112,7 +2112,7 @@ type ApiUpdateIntakeUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListIntakeRunnersRegionIdParameter intakeId string intakeUserId string updateIntakeUserPayload *UpdateIntakeUserPayload @@ -2139,7 +2139,7 @@ Updates the given intake user. @param intakeUserId The intake user UUID. @return ApiUpdateIntakeUserRequest */ -func (a *DefaultAPIService) UpdateIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiUpdateIntakeUserRequest { +func (a *DefaultAPIService) UpdateIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string, intakeUserId string) ApiUpdateIntakeUserRequest { return ApiUpdateIntakeUserRequest{ ApiService: a, ctx: ctx, diff --git a/services/intake/v1betaapi/api_default_mock.go b/services/intake/v1betaapi/api_default_mock.go index c201ad2dc..bead5b836 100644 --- a/services/intake/v1betaapi/api_default_mock.go +++ b/services/intake/v1betaapi/api_default_mock.go @@ -52,7 +52,7 @@ type DefaultAPIServiceMock struct { UpdateIntakeUserExecuteMock *func(r ApiUpdateIntakeUserRequest) (*IntakeUserResponse, error) } -func (a DefaultAPIServiceMock) CreateIntake(ctx context.Context, projectId string, regionId string) ApiCreateIntakeRequest { +func (a DefaultAPIServiceMock) CreateIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiCreateIntakeRequest { return ApiCreateIntakeRequest{ ApiService: a, ctx: ctx, @@ -71,7 +71,7 @@ func (a DefaultAPIServiceMock) CreateIntakeExecute(r ApiCreateIntakeRequest) (*I return (*a.CreateIntakeExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateIntakeRunner(ctx context.Context, projectId string, regionId string) ApiCreateIntakeRunnerRequest { +func (a DefaultAPIServiceMock) CreateIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiCreateIntakeRunnerRequest { return ApiCreateIntakeRunnerRequest{ ApiService: a, ctx: ctx, @@ -90,7 +90,7 @@ func (a DefaultAPIServiceMock) CreateIntakeRunnerExecute(r ApiCreateIntakeRunner return (*a.CreateIntakeRunnerExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string) ApiCreateIntakeUserRequest { +func (a DefaultAPIServiceMock) CreateIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiCreateIntakeUserRequest { return ApiCreateIntakeUserRequest{ ApiService: a, ctx: ctx, @@ -110,7 +110,7 @@ func (a DefaultAPIServiceMock) CreateIntakeUserExecute(r ApiCreateIntakeUserRequ return (*a.CreateIntakeUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiDeleteIntakeRequest { +func (a DefaultAPIServiceMock) DeleteIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiDeleteIntakeRequest { return ApiDeleteIntakeRequest{ ApiService: a, ctx: ctx, @@ -129,7 +129,7 @@ func (a DefaultAPIServiceMock) DeleteIntakeExecute(r ApiDeleteIntakeRequest) err return (*a.DeleteIntakeExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiDeleteIntakeRunnerRequest { +func (a DefaultAPIServiceMock) DeleteIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeRunnerId string) ApiDeleteIntakeRunnerRequest { return ApiDeleteIntakeRunnerRequest{ ApiService: a, ctx: ctx, @@ -148,7 +148,7 @@ func (a DefaultAPIServiceMock) DeleteIntakeRunnerExecute(r ApiDeleteIntakeRunner return (*a.DeleteIntakeRunnerExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiDeleteIntakeUserRequest { +func (a DefaultAPIServiceMock) DeleteIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string, intakeUserId string) ApiDeleteIntakeUserRequest { return ApiDeleteIntakeUserRequest{ ApiService: a, ctx: ctx, @@ -168,7 +168,7 @@ func (a DefaultAPIServiceMock) DeleteIntakeUserExecute(r ApiDeleteIntakeUserRequ return (*a.DeleteIntakeUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiGetIntakeRequest { +func (a DefaultAPIServiceMock) GetIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiGetIntakeRequest { return ApiGetIntakeRequest{ ApiService: a, ctx: ctx, @@ -188,7 +188,7 @@ func (a DefaultAPIServiceMock) GetIntakeExecute(r ApiGetIntakeRequest) (*IntakeR return (*a.GetIntakeExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiGetIntakeRunnerRequest { +func (a DefaultAPIServiceMock) GetIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeRunnerId string) ApiGetIntakeRunnerRequest { return ApiGetIntakeRunnerRequest{ ApiService: a, ctx: ctx, @@ -208,7 +208,7 @@ func (a DefaultAPIServiceMock) GetIntakeRunnerExecute(r ApiGetIntakeRunnerReques return (*a.GetIntakeRunnerExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiGetIntakeUserRequest { +func (a DefaultAPIServiceMock) GetIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string, intakeUserId string) ApiGetIntakeUserRequest { return ApiGetIntakeUserRequest{ ApiService: a, ctx: ctx, @@ -229,7 +229,7 @@ func (a DefaultAPIServiceMock) GetIntakeUserExecute(r ApiGetIntakeUserRequest) ( return (*a.GetIntakeUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListIntakeRunners(ctx context.Context, projectId string, regionId string) ApiListIntakeRunnersRequest { +func (a DefaultAPIServiceMock) ListIntakeRunners(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiListIntakeRunnersRequest { return ApiListIntakeRunnersRequest{ ApiService: a, ctx: ctx, @@ -248,7 +248,7 @@ func (a DefaultAPIServiceMock) ListIntakeRunnersExecute(r ApiListIntakeRunnersRe return (*a.ListIntakeRunnersExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListIntakeUsers(ctx context.Context, projectId string, regionId string, intakeId string) ApiListIntakeUsersRequest { +func (a DefaultAPIServiceMock) ListIntakeUsers(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiListIntakeUsersRequest { return ApiListIntakeUsersRequest{ ApiService: a, ctx: ctx, @@ -268,7 +268,7 @@ func (a DefaultAPIServiceMock) ListIntakeUsersExecute(r ApiListIntakeUsersReques return (*a.ListIntakeUsersExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListIntakes(ctx context.Context, projectId string, regionId string) ApiListIntakesRequest { +func (a DefaultAPIServiceMock) ListIntakes(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter) ApiListIntakesRequest { return ApiListIntakesRequest{ ApiService: a, ctx: ctx, @@ -287,7 +287,7 @@ func (a DefaultAPIServiceMock) ListIntakesExecute(r ApiListIntakesRequest) (*Lis return (*a.ListIntakesExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateIntake(ctx context.Context, projectId string, regionId string, intakeId string) ApiUpdateIntakeRequest { +func (a DefaultAPIServiceMock) UpdateIntake(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string) ApiUpdateIntakeRequest { return ApiUpdateIntakeRequest{ ApiService: a, ctx: ctx, @@ -307,7 +307,7 @@ func (a DefaultAPIServiceMock) UpdateIntakeExecute(r ApiUpdateIntakeRequest) (*I return (*a.UpdateIntakeExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateIntakeRunner(ctx context.Context, projectId string, regionId string, intakeRunnerId string) ApiUpdateIntakeRunnerRequest { +func (a DefaultAPIServiceMock) UpdateIntakeRunner(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeRunnerId string) ApiUpdateIntakeRunnerRequest { return ApiUpdateIntakeRunnerRequest{ ApiService: a, ctx: ctx, @@ -327,7 +327,7 @@ func (a DefaultAPIServiceMock) UpdateIntakeRunnerExecute(r ApiUpdateIntakeRunner return (*a.UpdateIntakeRunnerExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateIntakeUser(ctx context.Context, projectId string, regionId string, intakeId string, intakeUserId string) ApiUpdateIntakeUserRequest { +func (a DefaultAPIServiceMock) UpdateIntakeUser(ctx context.Context, projectId string, regionId ListIntakeRunnersRegionIdParameter, intakeId string, intakeUserId string) ApiUpdateIntakeUserRequest { return ApiUpdateIntakeUserRequest{ ApiService: a, ctx: ctx, diff --git a/services/intake/v1betaapi/model_intake_response.go b/services/intake/v1betaapi/model_intake_response.go index 07caf1f1e..bb741aef8 100644 --- a/services/intake/v1betaapi/model_intake_response.go +++ b/services/intake/v1betaapi/model_intake_response.go @@ -37,9 +37,8 @@ type IntakeResponse struct { // The unique id of the intake runner this intake is running on. IntakeRunnerId string `json:"intakeRunnerId"` // Labels are a set of key-value pairs assigned to resources. - Labels map[string]string `json:"labels,omitempty"` - // The current state of the resource. - State string `json:"state"` + Labels map[string]string `json:"labels,omitempty"` + State IntakeResponseState `json:"state"` // The topic to publish data to. Topic string `json:"topic"` // Number of messages that failed delivery and were sent to the Dead Letter Queue. @@ -55,7 +54,7 @@ type _IntakeResponse IntakeResponse // 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 NewIntakeResponse(catalog IntakeCatalog, createTime time.Time, deadLetterTopic string, displayName string, id string, intakeRunnerId string, state string, topic string, uri string) *IntakeResponse { +func NewIntakeResponse(catalog IntakeCatalog, createTime time.Time, deadLetterTopic string, displayName string, id string, intakeRunnerId string, state IntakeResponseState, topic string, uri string) *IntakeResponse { this := IntakeResponse{} this.Catalog = catalog this.CreateTime = createTime @@ -319,9 +318,9 @@ func (o *IntakeResponse) SetLabels(v map[string]string) { } // GetState returns the State field value -func (o *IntakeResponse) GetState() string { +func (o *IntakeResponse) GetState() IntakeResponseState { if o == nil { - var ret string + var ret IntakeResponseState return ret } @@ -330,7 +329,7 @@ func (o *IntakeResponse) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *IntakeResponse) GetStateOk() (*string, bool) { +func (o *IntakeResponse) GetStateOk() (*IntakeResponseState, bool) { if o == nil { return nil, false } @@ -338,7 +337,7 @@ func (o *IntakeResponse) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *IntakeResponse) SetState(v string) { +func (o *IntakeResponse) SetState(v IntakeResponseState) { o.State = v } diff --git a/services/intake/v1betaapi/model_intake_response_state.go b/services/intake/v1betaapi/model_intake_response_state.go new file mode 100644 index 000000000..8caa5d7ea --- /dev/null +++ b/services/intake/v1betaapi/model_intake_response_state.go @@ -0,0 +1,117 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.3.7 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// IntakeResponseState The current state of the resource. +type IntakeResponseState string + +// List of intakeResponse_state +const ( + INTAKERESPONSESTATE_RECONCILING IntakeResponseState = "reconciling" + INTAKERESPONSESTATE_ACTIVE IntakeResponseState = "active" + INTAKERESPONSESTATE_DELETING IntakeResponseState = "deleting" + INTAKERESPONSESTATE_FAILED IntakeResponseState = "failed" + INTAKERESPONSESTATE_UNKNOWN_DEFAULT_OPEN_API IntakeResponseState = "unknown_default_open_api" +) + +// All allowed values of IntakeResponseState enum +var AllowedIntakeResponseStateEnumValues = []IntakeResponseState{ + "reconciling", + "active", + "deleting", + "failed", + "unknown_default_open_api", +} + +func (v *IntakeResponseState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IntakeResponseState(value) + for _, existing := range AllowedIntakeResponseStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INTAKERESPONSESTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewIntakeResponseStateFromValue returns a pointer to a valid IntakeResponseState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIntakeResponseStateFromValue(v string) (*IntakeResponseState, error) { + ev := IntakeResponseState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IntakeResponseState: valid values are %v", v, AllowedIntakeResponseStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IntakeResponseState) IsValid() bool { + for _, existing := range AllowedIntakeResponseStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to intakeResponse_state value +func (v IntakeResponseState) Ptr() *IntakeResponseState { + return &v +} + +type NullableIntakeResponseState struct { + value *IntakeResponseState + isSet bool +} + +func (v NullableIntakeResponseState) Get() *IntakeResponseState { + return v.value +} + +func (v *NullableIntakeResponseState) Set(val *IntakeResponseState) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeResponseState) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeResponseState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeResponseState(val *IntakeResponseState) *NullableIntakeResponseState { + return &NullableIntakeResponseState{value: val, isSet: true} +} + +func (v NullableIntakeResponseState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeResponseState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/v1betaapi/model_intake_runner_response.go b/services/intake/v1betaapi/model_intake_runner_response.go index 9053cabf0..90ed56bf8 100644 --- a/services/intake/v1betaapi/model_intake_runner_response.go +++ b/services/intake/v1betaapi/model_intake_runner_response.go @@ -34,9 +34,8 @@ type IntakeRunnerResponse struct { // The maximum size of a message in kibibytes (1 KiB = 1024 bytes). MaxMessageSizeKiB int32 `json:"maxMessageSizeKiB"` // The maximum number of messages per hour. - MaxMessagesPerHour int32 `json:"maxMessagesPerHour"` - // The current state of the resource. - State string `json:"state"` + MaxMessagesPerHour int32 `json:"maxMessagesPerHour"` + State IntakeRunnerResponseState `json:"state"` // The URI for reaching the resource. Uri string `json:"uri"` AdditionalProperties map[string]interface{} @@ -48,7 +47,7 @@ type _IntakeRunnerResponse IntakeRunnerResponse // 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 NewIntakeRunnerResponse(createTime time.Time, displayName string, id string, maxMessageSizeKiB int32, maxMessagesPerHour int32, state string, uri string) *IntakeRunnerResponse { +func NewIntakeRunnerResponse(createTime time.Time, displayName string, id string, maxMessageSizeKiB int32, maxMessagesPerHour int32, state IntakeRunnerResponseState, uri string) *IntakeRunnerResponse { this := IntakeRunnerResponse{} this.CreateTime = createTime this.DisplayName = displayName @@ -254,9 +253,9 @@ func (o *IntakeRunnerResponse) SetMaxMessagesPerHour(v int32) { } // GetState returns the State field value -func (o *IntakeRunnerResponse) GetState() string { +func (o *IntakeRunnerResponse) GetState() IntakeRunnerResponseState { if o == nil { - var ret string + var ret IntakeRunnerResponseState return ret } @@ -265,7 +264,7 @@ func (o *IntakeRunnerResponse) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *IntakeRunnerResponse) GetStateOk() (*string, bool) { +func (o *IntakeRunnerResponse) GetStateOk() (*IntakeRunnerResponseState, bool) { if o == nil { return nil, false } @@ -273,7 +272,7 @@ func (o *IntakeRunnerResponse) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *IntakeRunnerResponse) SetState(v string) { +func (o *IntakeRunnerResponse) SetState(v IntakeRunnerResponseState) { o.State = v } diff --git a/services/intake/v1betaapi/model_intake_runner_response_state.go b/services/intake/v1betaapi/model_intake_runner_response_state.go new file mode 100644 index 000000000..d93f420c5 --- /dev/null +++ b/services/intake/v1betaapi/model_intake_runner_response_state.go @@ -0,0 +1,115 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.3.7 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// IntakeRunnerResponseState The current state of the resource. +type IntakeRunnerResponseState string + +// List of intakeRunnerResponse_state +const ( + INTAKERUNNERRESPONSESTATE_RECONCILING IntakeRunnerResponseState = "reconciling" + INTAKERUNNERRESPONSESTATE_ACTIVE IntakeRunnerResponseState = "active" + INTAKERUNNERRESPONSESTATE_DELETING IntakeRunnerResponseState = "deleting" + INTAKERUNNERRESPONSESTATE_UNKNOWN_DEFAULT_OPEN_API IntakeRunnerResponseState = "unknown_default_open_api" +) + +// All allowed values of IntakeRunnerResponseState enum +var AllowedIntakeRunnerResponseStateEnumValues = []IntakeRunnerResponseState{ + "reconciling", + "active", + "deleting", + "unknown_default_open_api", +} + +func (v *IntakeRunnerResponseState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IntakeRunnerResponseState(value) + for _, existing := range AllowedIntakeRunnerResponseStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INTAKERUNNERRESPONSESTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewIntakeRunnerResponseStateFromValue returns a pointer to a valid IntakeRunnerResponseState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIntakeRunnerResponseStateFromValue(v string) (*IntakeRunnerResponseState, error) { + ev := IntakeRunnerResponseState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IntakeRunnerResponseState: valid values are %v", v, AllowedIntakeRunnerResponseStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IntakeRunnerResponseState) IsValid() bool { + for _, existing := range AllowedIntakeRunnerResponseStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to intakeRunnerResponse_state value +func (v IntakeRunnerResponseState) Ptr() *IntakeRunnerResponseState { + return &v +} + +type NullableIntakeRunnerResponseState struct { + value *IntakeRunnerResponseState + isSet bool +} + +func (v NullableIntakeRunnerResponseState) Get() *IntakeRunnerResponseState { + return v.value +} + +func (v *NullableIntakeRunnerResponseState) Set(val *IntakeRunnerResponseState) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeRunnerResponseState) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeRunnerResponseState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeRunnerResponseState(val *IntakeRunnerResponseState) *NullableIntakeRunnerResponseState { + return &NullableIntakeRunnerResponseState{value: val, isSet: true} +} + +func (v NullableIntakeRunnerResponseState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeRunnerResponseState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/v1betaapi/model_intake_user_response.go b/services/intake/v1betaapi/model_intake_user_response.go index 8ec3aa4c4..a0a68ecb2 100644 --- a/services/intake/v1betaapi/model_intake_user_response.go +++ b/services/intake/v1betaapi/model_intake_user_response.go @@ -31,10 +31,9 @@ type IntakeUserResponse struct { // A auto generated unique id which identifies the resource. Id string `json:"id"` // Labels are a set of key-value pairs assigned to resources. - Labels map[string]string `json:"labels,omitempty"` - // The current state of the resource. - State string `json:"state"` - Type UserType `json:"type"` + Labels map[string]string `json:"labels,omitempty"` + State IntakeUserResponseState `json:"state"` + Type UserType `json:"type"` // The user to connect to the intake. User string `json:"user"` AdditionalProperties map[string]interface{} @@ -46,7 +45,7 @@ type _IntakeUserResponse IntakeUserResponse // 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 NewIntakeUserResponse(createTime time.Time, displayName string, id string, state string, types UserType, user string) *IntakeUserResponse { +func NewIntakeUserResponse(createTime time.Time, displayName string, id string, state IntakeUserResponseState, types UserType, user string) *IntakeUserResponse { this := IntakeUserResponse{} this.CreateTime = createTime this.DisplayName = displayName @@ -237,9 +236,9 @@ func (o *IntakeUserResponse) SetLabels(v map[string]string) { } // GetState returns the State field value -func (o *IntakeUserResponse) GetState() string { +func (o *IntakeUserResponse) GetState() IntakeUserResponseState { if o == nil { - var ret string + var ret IntakeUserResponseState return ret } @@ -248,7 +247,7 @@ func (o *IntakeUserResponse) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *IntakeUserResponse) GetStateOk() (*string, bool) { +func (o *IntakeUserResponse) GetStateOk() (*IntakeUserResponseState, bool) { if o == nil { return nil, false } @@ -256,7 +255,7 @@ func (o *IntakeUserResponse) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *IntakeUserResponse) SetState(v string) { +func (o *IntakeUserResponse) SetState(v IntakeUserResponseState) { o.State = v } diff --git a/services/intake/v1betaapi/model_intake_user_response_state.go b/services/intake/v1betaapi/model_intake_user_response_state.go new file mode 100644 index 000000000..67b790f66 --- /dev/null +++ b/services/intake/v1betaapi/model_intake_user_response_state.go @@ -0,0 +1,115 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.3.7 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// IntakeUserResponseState The current state of the resource. +type IntakeUserResponseState string + +// List of intakeUserResponse_state +const ( + INTAKEUSERRESPONSESTATE_RECONCILING IntakeUserResponseState = "reconciling" + INTAKEUSERRESPONSESTATE_ACTIVE IntakeUserResponseState = "active" + INTAKEUSERRESPONSESTATE_DELETING IntakeUserResponseState = "deleting" + INTAKEUSERRESPONSESTATE_UNKNOWN_DEFAULT_OPEN_API IntakeUserResponseState = "unknown_default_open_api" +) + +// All allowed values of IntakeUserResponseState enum +var AllowedIntakeUserResponseStateEnumValues = []IntakeUserResponseState{ + "reconciling", + "active", + "deleting", + "unknown_default_open_api", +} + +func (v *IntakeUserResponseState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IntakeUserResponseState(value) + for _, existing := range AllowedIntakeUserResponseStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INTAKEUSERRESPONSESTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewIntakeUserResponseStateFromValue returns a pointer to a valid IntakeUserResponseState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIntakeUserResponseStateFromValue(v string) (*IntakeUserResponseState, error) { + ev := IntakeUserResponseState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IntakeUserResponseState: valid values are %v", v, AllowedIntakeUserResponseStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IntakeUserResponseState) IsValid() bool { + for _, existing := range AllowedIntakeUserResponseStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to intakeUserResponse_state value +func (v IntakeUserResponseState) Ptr() *IntakeUserResponseState { + return &v +} + +type NullableIntakeUserResponseState struct { + value *IntakeUserResponseState + isSet bool +} + +func (v NullableIntakeUserResponseState) Get() *IntakeUserResponseState { + return v.value +} + +func (v *NullableIntakeUserResponseState) Set(val *IntakeUserResponseState) { + v.value = val + v.isSet = true +} + +func (v NullableIntakeUserResponseState) IsSet() bool { + return v.isSet +} + +func (v *NullableIntakeUserResponseState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntakeUserResponseState(val *IntakeUserResponseState) *NullableIntakeUserResponseState { + return &NullableIntakeUserResponseState{value: val, isSet: true} +} + +func (v NullableIntakeUserResponseState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntakeUserResponseState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/intake/v1betaapi/model_list_intake_runners_region_id_parameter.go b/services/intake/v1betaapi/model_list_intake_runners_region_id_parameter.go new file mode 100644 index 000000000..819ffefdf --- /dev/null +++ b/services/intake/v1betaapi/model_list_intake_runners_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Intake API + +This API provides endpoints for managing Intakes. + +API version: 1beta.3.7 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ListIntakeRunnersRegionIdParameter the model 'ListIntakeRunnersRegionIdParameter' +type ListIntakeRunnersRegionIdParameter string + +// List of list_intake_runners_regionId_parameter +const ( + LISTINTAKERUNNERSREGIONIDPARAMETER_EU01 ListIntakeRunnersRegionIdParameter = "eu01" + LISTINTAKERUNNERSREGIONIDPARAMETER_EU02 ListIntakeRunnersRegionIdParameter = "eu02" + LISTINTAKERUNNERSREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListIntakeRunnersRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of ListIntakeRunnersRegionIdParameter enum +var AllowedListIntakeRunnersRegionIdParameterEnumValues = []ListIntakeRunnersRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListIntakeRunnersRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListIntakeRunnersRegionIdParameter(value) + for _, existing := range AllowedListIntakeRunnersRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTINTAKERUNNERSREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListIntakeRunnersRegionIdParameterFromValue returns a pointer to a valid ListIntakeRunnersRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListIntakeRunnersRegionIdParameterFromValue(v string) (*ListIntakeRunnersRegionIdParameter, error) { + ev := ListIntakeRunnersRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListIntakeRunnersRegionIdParameter: valid values are %v", v, AllowedListIntakeRunnersRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListIntakeRunnersRegionIdParameter) IsValid() bool { + for _, existing := range AllowedListIntakeRunnersRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to list_intake_runners_regionId_parameter value +func (v ListIntakeRunnersRegionIdParameter) Ptr() *ListIntakeRunnersRegionIdParameter { + return &v +} + +type NullableListIntakeRunnersRegionIdParameter struct { + value *ListIntakeRunnersRegionIdParameter + isSet bool +} + +func (v NullableListIntakeRunnersRegionIdParameter) Get() *ListIntakeRunnersRegionIdParameter { + return v.value +} + +func (v *NullableListIntakeRunnersRegionIdParameter) Set(val *ListIntakeRunnersRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListIntakeRunnersRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListIntakeRunnersRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListIntakeRunnersRegionIdParameter(val *ListIntakeRunnersRegionIdParameter) *NullableListIntakeRunnersRegionIdParameter { + return &NullableListIntakeRunnersRegionIdParameter{value: val, isSet: true} +} + +func (v NullableListIntakeRunnersRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListIntakeRunnersRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 36a27219942a7f0fa5a1fd9e56852f4629d87d0f Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 14:48:39 +0200 Subject: [PATCH 13/66] chore(intake): fix waiters/tests/examples, write changelog, bump version --- examples/intake/intake.go | 6 ++-- services/intake/CHANGELOG.md | 3 ++ services/intake/VERSION | 2 +- services/intake/v1betaapi/wait/wait.go | 20 ++++++------ services/intake/v1betaapi/wait/wait_test.go | 34 ++++++++++----------- 5 files changed, 34 insertions(+), 31 deletions(-) diff --git a/examples/intake/intake.go b/examples/intake/intake.go index deb2f2ff5..5fda471bc 100644 --- a/examples/intake/intake.go +++ b/examples/intake/intake.go @@ -10,8 +10,8 @@ import ( ) func main() { - region := "eu01" // Region where the resources will be created - projectId := "PROJECT_ID" // Your STACKIT project ID + region := intake.LISTINTAKERUNNERSREGIONIDPARAMETER_EU01 // Region where the resources will be created + projectId := "PROJECT_ID" // Your STACKIT project ID dremioCatalogURI := "DREMIO_CATALOG_URI" //nolint:gosec // E.g., "https://my-dremio-catalog.data-platform.stackit.run/iceberg" dremioTokenEndpoint := "DREMIO_TOKEN_ENDPOINT" //nolint:gosec // E.g., "https://my-dremio.data-platform.stackit.run/oauth/token" @@ -43,7 +43,7 @@ func main() { fmt.Printf("Triggered creation of Intake Runner with ID: %s. Waiting for it to become active...\n", intakeRunnerId) // Create an Intake - dremioAuthType := intake.CatalogAuthType("dremio") // can also be set to "none" if the catalog is not authenticated + dremioAuthType := intake.CATALOGAUTHTYPE_DREMIO // can also be set to "none" if the catalog is not authenticated createIntakePayload := intake.CreateIntakePayload{ DisplayName: "my-example-intake", IntakeRunnerId: intakeRunnerId, diff --git a/services/intake/CHANGELOG.md b/services/intake/CHANGELOG.md index 6067e030b..b6120fafd 100644 --- a/services/intake/CHANGELOG.md +++ b/services/intake/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.10.0 +- **Feature:** Introduce enums for various attributes + ## v0.9.0 - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. diff --git a/services/intake/VERSION b/services/intake/VERSION index 7965b36d6..bf057dbfd 100644 --- a/services/intake/VERSION +++ b/services/intake/VERSION @@ -1 +1 @@ -v0.9.0 \ No newline at end of file +v0.10.0 diff --git a/services/intake/v1betaapi/wait/wait.go b/services/intake/v1betaapi/wait/wait.go index 5c1e0b9f3..34303c1a2 100644 --- a/services/intake/v1betaapi/wait/wait.go +++ b/services/intake/v1betaapi/wait/wait.go @@ -27,7 +27,7 @@ const ( INTAKEUSERRESPONSESTATE_DELETING = "deleting" ) -func CreateOrUpdateIntakeRunnerWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId, region, intakeRunnerId string) *wait.AsyncActionHandler[intake.IntakeRunnerResponse] { +func CreateOrUpdateIntakeRunnerWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId string, region intake.ListIntakeRunnersRegionIdParameter, intakeRunnerId string) *wait.AsyncActionHandler[intake.IntakeRunnerResponse] { handler := wait.New(func() (waitFinished bool, response *intake.IntakeRunnerResponse, err error) { runner, err := a.GetIntakeRunner(ctx, projectId, region, intakeRunnerId).Execute() if err != nil { @@ -38,7 +38,7 @@ func CreateOrUpdateIntakeRunnerWaitHandler(ctx context.Context, a intake.Default return false, nil, fmt.Errorf("API returned a nil response for Intake Runner %s", intakeRunnerId) } - if runner.Id == intakeRunnerId && runner.State == INTAKERUNNERRESPONSESTATE_ACTIVE { + if runner.Id == intakeRunnerId && runner.State == intake.INTAKERUNNERRESPONSESTATE_ACTIVE { return true, runner, nil } @@ -50,7 +50,7 @@ func CreateOrUpdateIntakeRunnerWaitHandler(ctx context.Context, a intake.Default return handler } -func DeleteIntakeRunnerWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId, region, intakeRunnerId string) *wait.AsyncActionHandler[intake.IntakeRunnerResponse] { +func DeleteIntakeRunnerWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId string, region intake.ListIntakeRunnersRegionIdParameter, intakeRunnerId string) *wait.AsyncActionHandler[intake.IntakeRunnerResponse] { handler := wait.New(func() (waitFinished bool, response *intake.IntakeRunnerResponse, err error) { _, err = a.GetIntakeRunner(ctx, projectId, region, intakeRunnerId).Execute() if err == nil { @@ -72,7 +72,7 @@ func DeleteIntakeRunnerWaitHandler(ctx context.Context, a intake.DefaultAPI, pro return handler } -func CreateOrUpdateIntakeWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId, region, intakeId string) *wait.AsyncActionHandler[intake.IntakeResponse] { +func CreateOrUpdateIntakeWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId string, region intake.ListIntakeRunnersRegionIdParameter, intakeId string) *wait.AsyncActionHandler[intake.IntakeResponse] { handler := wait.New(func() (waitFinished bool, response *intake.IntakeResponse, err error) { ik, err := a.GetIntake(ctx, projectId, region, intakeId).Execute() if err != nil { @@ -83,11 +83,11 @@ func CreateOrUpdateIntakeWaitHandler(ctx context.Context, a intake.DefaultAPI, p return false, nil, fmt.Errorf("API returned a nil response for Intake %s", intakeId) } - if ik.Id == intakeId && ik.State == INTAKERESPONSESTATE_ACTIVE { + if ik.Id == intakeId && ik.State == intake.INTAKERESPONSESTATE_ACTIVE { return true, ik, nil } - if ik.Id == intakeId && ik.State == INTAKERESPONSESTATE_FAILED { + if ik.Id == intakeId && ik.State == intake.INTAKERESPONSESTATE_FAILED { return true, ik, fmt.Errorf("create/update failed for Intake %s", intakeId) } @@ -97,7 +97,7 @@ func CreateOrUpdateIntakeWaitHandler(ctx context.Context, a intake.DefaultAPI, p return handler } -func DeleteIntakeWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId, region, intakeId string) *wait.AsyncActionHandler[intake.IntakeResponse] { +func DeleteIntakeWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId string, region intake.ListIntakeRunnersRegionIdParameter, intakeId string) *wait.AsyncActionHandler[intake.IntakeResponse] { handler := wait.New(func() (waitFinished bool, response *intake.IntakeResponse, err error) { _, err = a.GetIntake(ctx, projectId, region, intakeId).Execute() if err == nil { @@ -116,7 +116,7 @@ func DeleteIntakeWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId return handler } -func CreateOrUpdateIntakeUserWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId, region, intakeId, intakeUserId string) *wait.AsyncActionHandler[intake.IntakeUserResponse] { +func CreateOrUpdateIntakeUserWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId string, region intake.ListIntakeRunnersRegionIdParameter, intakeId, intakeUserId string) *wait.AsyncActionHandler[intake.IntakeUserResponse] { handler := wait.New(func() (waitFinished bool, response *intake.IntakeUserResponse, err error) { user, err := a.GetIntakeUser(ctx, projectId, region, intakeId, intakeUserId).Execute() if err != nil { @@ -127,7 +127,7 @@ func CreateOrUpdateIntakeUserWaitHandler(ctx context.Context, a intake.DefaultAP return false, nil, fmt.Errorf("API returned a nil response for Intake User %s", intakeUserId) } - if user.Id == intakeUserId && user.State == INTAKEUSERRESPONSESTATE_ACTIVE { + if user.Id == intakeUserId && user.State == intake.INTAKEUSERRESPONSESTATE_ACTIVE { return true, user, nil } @@ -139,7 +139,7 @@ func CreateOrUpdateIntakeUserWaitHandler(ctx context.Context, a intake.DefaultAP return handler } -func DeleteIntakeUserWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId, region, intakeId, intakeUserId string) *wait.AsyncActionHandler[intake.IntakeUserResponse] { +func DeleteIntakeUserWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId string, region intake.ListIntakeRunnersRegionIdParameter, intakeId, intakeUserId string) *wait.AsyncActionHandler[intake.IntakeUserResponse] { handler := wait.New(func() (waitFinished bool, response *intake.IntakeUserResponse, err error) { _, err = a.GetIntakeUser(ctx, projectId, region, intakeId, intakeUserId).Execute() if err == nil { diff --git a/services/intake/v1betaapi/wait/wait_test.go b/services/intake/v1betaapi/wait/wait_test.go index 3c15a551e..dcce48b3f 100644 --- a/services/intake/v1betaapi/wait/wait_test.go +++ b/services/intake/v1betaapi/wait/wait_test.go @@ -66,7 +66,7 @@ func newAPIMock(settings *mockSettings) intake.DefaultAPI { } } -const region = "eu01" +const regionId = intake.LISTINTAKERUNNERSREGIONIDPARAMETER_EU01 var ( projectId = uuid.NewString() @@ -93,7 +93,7 @@ func TestCreateOrUpdateIntakeRunnerWaitHandler(t *testing.T) { returnRunner: true, intakeRunnerResponse: &intake.IntakeRunnerResponse{ Id: intakeRunnerId, - State: INTAKERUNNERRESPONSESTATE_ACTIVE, + State: intake.INTAKERUNNERRESPONSESTATE_ACTIVE, }, }, { @@ -112,7 +112,7 @@ func TestCreateOrUpdateIntakeRunnerWaitHandler(t *testing.T) { returnRunner: true, intakeRunnerResponse: &intake.IntakeRunnerResponse{ Id: intakeRunnerId, - State: INTAKERUNNERRESPONSESTATE_RECONCILING, + State: intake.INTAKERUNNERRESPONSESTATE_RECONCILING, }, }, { @@ -129,7 +129,7 @@ func TestCreateOrUpdateIntakeRunnerWaitHandler(t *testing.T) { wantResp: false, returnRunner: true, intakeRunnerResponse: &intake.IntakeRunnerResponse{ - State: INTAKERUNNERRESPONSESTATE_RECONCILING, + State: intake.INTAKERUNNERRESPONSESTATE_RECONCILING, }, }, { @@ -158,7 +158,7 @@ func TestCreateOrUpdateIntakeRunnerWaitHandler(t *testing.T) { wantResp = tt.intakeRunnerResponse } - handler := CreateOrUpdateIntakeRunnerWaitHandler(context.Background(), apiClient, projectId, region, intakeRunnerId) + handler := CreateOrUpdateIntakeRunnerWaitHandler(context.Background(), apiClient, projectId, regionId, intakeRunnerId) got, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { @@ -213,7 +213,7 @@ func TestDeleteIntakeRunnerWaitHandler(t *testing.T) { }, }) - handler := DeleteIntakeRunnerWaitHandler(context.Background(), apiClient, projectId, region, intakeRunnerId) + handler := DeleteIntakeRunnerWaitHandler(context.Background(), apiClient, projectId, regionId, intakeRunnerId) _, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { @@ -242,7 +242,7 @@ func TestCreateOrUpdateIntakeWaitHandler(t *testing.T) { returnIntake: true, intakeResponse: &intake.IntakeResponse{ Id: intakeId, - State: INTAKERESPONSESTATE_ACTIVE, + State: intake.INTAKERESPONSESTATE_ACTIVE, }, }, { @@ -253,7 +253,7 @@ func TestCreateOrUpdateIntakeWaitHandler(t *testing.T) { returnIntake: true, intakeResponse: &intake.IntakeResponse{ Id: intakeId, - State: INTAKERESPONSESTATE_FAILED, + State: intake.INTAKERESPONSESTATE_FAILED, }, }, { @@ -272,7 +272,7 @@ func TestCreateOrUpdateIntakeWaitHandler(t *testing.T) { returnIntake: true, intakeResponse: &intake.IntakeResponse{ Id: intakeId, - State: INTAKERESPONSESTATE_RECONCILING, + State: intake.INTAKERESPONSESTATE_RECONCILING, }, }, { @@ -289,7 +289,7 @@ func TestCreateOrUpdateIntakeWaitHandler(t *testing.T) { wantResp: false, returnIntake: true, intakeResponse: &intake.IntakeResponse{ - State: INTAKERESPONSESTATE_RECONCILING, + State: intake.INTAKERESPONSESTATE_RECONCILING, }, }, { @@ -318,7 +318,7 @@ func TestCreateOrUpdateIntakeWaitHandler(t *testing.T) { wantResp = tt.intakeResponse } - handler := CreateOrUpdateIntakeWaitHandler(context.Background(), apiClient, projectId, region, intakeId) + handler := CreateOrUpdateIntakeWaitHandler(context.Background(), apiClient, projectId, regionId, intakeId) got, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { @@ -373,7 +373,7 @@ func TestDeleteIntakeWaitHandler(t *testing.T) { }, }) - handler := DeleteIntakeWaitHandler(context.Background(), apiClient, projectId, region, intakeId) + handler := DeleteIntakeWaitHandler(context.Background(), apiClient, projectId, regionId, intakeId) _, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { @@ -402,7 +402,7 @@ func TestCreateOrUpdateIntakeUserWaitHandler(t *testing.T) { returnUser: true, intakeUserResponse: &intake.IntakeUserResponse{ Id: intakeUserId, - State: INTAKEUSERRESPONSESTATE_ACTIVE, + State: intake.INTAKEUSERRESPONSESTATE_ACTIVE, }, }, { @@ -421,7 +421,7 @@ func TestCreateOrUpdateIntakeUserWaitHandler(t *testing.T) { returnUser: true, intakeUserResponse: &intake.IntakeUserResponse{ Id: intakeUserId, - State: INTAKEUSERRESPONSESTATE_RECONCILING, + State: intake.INTAKEUSERRESPONSESTATE_RECONCILING, }, }, { @@ -438,7 +438,7 @@ func TestCreateOrUpdateIntakeUserWaitHandler(t *testing.T) { wantResp: false, returnUser: true, intakeUserResponse: &intake.IntakeUserResponse{ - State: INTAKEUSERRESPONSESTATE_RECONCILING, + State: intake.INTAKEUSERRESPONSESTATE_RECONCILING, }, }, { @@ -467,7 +467,7 @@ func TestCreateOrUpdateIntakeUserWaitHandler(t *testing.T) { wantResp = tt.intakeUserResponse } - handler := CreateOrUpdateIntakeUserWaitHandler(context.Background(), apiClient, projectId, region, intakeId, intakeUserId) + handler := CreateOrUpdateIntakeUserWaitHandler(context.Background(), apiClient, projectId, regionId, intakeId, intakeUserId) got, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { @@ -522,7 +522,7 @@ func TestDeleteIntakeUserWaitHandler(t *testing.T) { }, }) - handler := DeleteIntakeUserWaitHandler(context.Background(), apiClient, projectId, region, intakeId, intakeUserId) + handler := DeleteIntakeUserWaitHandler(context.Background(), apiClient, projectId, regionId, intakeId, intakeUserId) _, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) if (err != nil) != tt.wantErr { From cebee39661e371bd68beaeace3d67c2ac374dc1a Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 14:49:34 +0200 Subject: [PATCH 14/66] chore(kms): introduce inline enums --- services/kms/v1api/api_default.go | 150 +++++++++--------- services/kms/v1api/api_default_mock.go | 50 +++--- services/kms/v1api/model_key.go | 19 ++- services/kms/v1api/model_key_ring.go | 15 +- services/kms/v1api/model_key_ring_state.go | 115 ++++++++++++++ services/kms/v1api/model_key_state.go | 121 ++++++++++++++ ...odel_list_key_rings_region_id_parameter.go | 111 +++++++++++++ services/kms/v1api/model_version.go | 15 +- services/kms/v1api/model_version_state.go | 121 ++++++++++++++ services/kms/v1api/model_wrapping_key.go | 17 +- .../kms/v1api/model_wrapping_key_state.go | 119 ++++++++++++++ 11 files changed, 718 insertions(+), 135 deletions(-) create mode 100644 services/kms/v1api/model_key_ring_state.go create mode 100644 services/kms/v1api/model_key_state.go create mode 100644 services/kms/v1api/model_list_key_rings_region_id_parameter.go create mode 100644 services/kms/v1api/model_version_state.go create mode 100644 services/kms/v1api/model_wrapping_key_state.go diff --git a/services/kms/v1api/api_default.go b/services/kms/v1api/api_default.go index 08e6db373..eaf70f88c 100644 --- a/services/kms/v1api/api_default.go +++ b/services/kms/v1api/api_default.go @@ -34,7 +34,7 @@ type DefaultAPI interface { @param keyRingId The key ring UUID. @return ApiCreateKeyRequest */ - CreateKey(ctx context.Context, projectId string, regionId string, keyRingId string) ApiCreateKeyRequest + CreateKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiCreateKeyRequest // CreateKeyExecute executes the request // @return Key @@ -50,7 +50,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the key ring is located in. @return ApiCreateKeyRingRequest */ - CreateKeyRing(ctx context.Context, projectId string, regionId string) ApiCreateKeyRingRequest + CreateKeyRing(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter) ApiCreateKeyRingRequest // CreateKeyRingExecute executes the request // @return KeyRing @@ -67,7 +67,7 @@ type DefaultAPI interface { @param keyRingId The key ring UUID. @return ApiCreateWrappingKeyRequest */ - CreateWrappingKey(ctx context.Context, projectId string, regionId string, keyRingId string) ApiCreateWrappingKeyRequest + CreateWrappingKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiCreateWrappingKeyRequest // CreateWrappingKeyExecute executes the request // @return WrappingKey @@ -86,7 +86,7 @@ type DefaultAPI interface { @param versionNumber The version number. @return ApiDecryptRequest */ - Decrypt(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiDecryptRequest + Decrypt(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiDecryptRequest // DecryptExecute executes the request // @return DecryptedData @@ -104,7 +104,7 @@ type DefaultAPI interface { @param keyId The key UUID. @return ApiDeleteKeyRequest */ - DeleteKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiDeleteKeyRequest + DeleteKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiDeleteKeyRequest // DeleteKeyExecute executes the request DeleteKeyExecute(r ApiDeleteKeyRequest) error @@ -120,7 +120,7 @@ type DefaultAPI interface { @param keyRingId The key ring UUID. @return ApiDeleteKeyRingRequest */ - DeleteKeyRing(ctx context.Context, projectId string, regionId string, keyRingId string) ApiDeleteKeyRingRequest + DeleteKeyRing(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiDeleteKeyRingRequest // DeleteKeyRingExecute executes the request DeleteKeyRingExecute(r ApiDeleteKeyRingRequest) error @@ -137,7 +137,7 @@ type DefaultAPI interface { @param wrappingKeyId The wrapping key UUID. @return ApiDeleteWrappingKeyRequest */ - DeleteWrappingKey(ctx context.Context, projectId string, regionId string, keyRingId string, wrappingKeyId string) ApiDeleteWrappingKeyRequest + DeleteWrappingKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, wrappingKeyId string) ApiDeleteWrappingKeyRequest // DeleteWrappingKeyExecute executes the request DeleteWrappingKeyExecute(r ApiDeleteWrappingKeyRequest) error @@ -155,7 +155,7 @@ type DefaultAPI interface { @param versionNumber The version number. @return ApiDestroyVersionRequest */ - DestroyVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiDestroyVersionRequest + DestroyVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiDestroyVersionRequest // DestroyVersionExecute executes the request DestroyVersionExecute(r ApiDestroyVersionRequest) error @@ -173,7 +173,7 @@ type DefaultAPI interface { @param versionNumber The version number. @return ApiDisableVersionRequest */ - DisableVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiDisableVersionRequest + DisableVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiDisableVersionRequest // DisableVersionExecute executes the request DisableVersionExecute(r ApiDisableVersionRequest) error @@ -191,7 +191,7 @@ type DefaultAPI interface { @param versionNumber The version number. @return ApiEnableVersionRequest */ - EnableVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiEnableVersionRequest + EnableVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiEnableVersionRequest // EnableVersionExecute executes the request EnableVersionExecute(r ApiEnableVersionRequest) error @@ -209,7 +209,7 @@ type DefaultAPI interface { @param versionNumber The version number. @return ApiEncryptRequest */ - Encrypt(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiEncryptRequest + Encrypt(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiEncryptRequest // EncryptExecute executes the request // @return EncryptedData @@ -227,7 +227,7 @@ type DefaultAPI interface { @param keyId The key UUID. @return ApiGetKeyRequest */ - GetKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiGetKeyRequest + GetKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiGetKeyRequest // GetKeyExecute executes the request // @return Key @@ -244,7 +244,7 @@ type DefaultAPI interface { @param keyRingId The key ring UUID. @return ApiGetKeyRingRequest */ - GetKeyRing(ctx context.Context, projectId string, regionId string, keyRingId string) ApiGetKeyRingRequest + GetKeyRing(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiGetKeyRingRequest // GetKeyRingExecute executes the request // @return KeyRing @@ -263,7 +263,7 @@ type DefaultAPI interface { @param versionNumber The version number. @return ApiGetVersionRequest */ - GetVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiGetVersionRequest + GetVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiGetVersionRequest // GetVersionExecute executes the request // @return Version @@ -281,7 +281,7 @@ type DefaultAPI interface { @param wrappingKeyId The wrapping key UUID. @return ApiGetWrappingKeyRequest */ - GetWrappingKey(ctx context.Context, projectId string, regionId string, keyRingId string, wrappingKeyId string) ApiGetWrappingKeyRequest + GetWrappingKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, wrappingKeyId string) ApiGetWrappingKeyRequest // GetWrappingKeyExecute executes the request // @return WrappingKey @@ -299,7 +299,7 @@ type DefaultAPI interface { @param keyId The key UUID. @return ApiImportKeyRequest */ - ImportKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiImportKeyRequest + ImportKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiImportKeyRequest // ImportKeyExecute executes the request // @return Version @@ -315,7 +315,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the key ring is located in. @return ApiListKeyRingsRequest */ - ListKeyRings(ctx context.Context, projectId string, regionId string) ApiListKeyRingsRequest + ListKeyRings(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter) ApiListKeyRingsRequest // ListKeyRingsExecute executes the request // @return KeyRingList @@ -332,7 +332,7 @@ type DefaultAPI interface { @param keyRingId The key ring UUID. @return ApiListKeysRequest */ - ListKeys(ctx context.Context, projectId string, regionId string, keyRingId string) ApiListKeysRequest + ListKeys(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiListKeysRequest // ListKeysExecute executes the request // @return KeyList @@ -350,7 +350,7 @@ type DefaultAPI interface { @param keyId The key UUID. @return ApiListVersionsRequest */ - ListVersions(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiListVersionsRequest + ListVersions(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiListVersionsRequest // ListVersionsExecute executes the request // @return VersionList @@ -367,7 +367,7 @@ type DefaultAPI interface { @param keyRingId The key ring UUID. @return ApiListWrappingKeysRequest */ - ListWrappingKeys(ctx context.Context, projectId string, regionId string, keyRingId string) ApiListWrappingKeysRequest + ListWrappingKeys(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiListWrappingKeysRequest // ListWrappingKeysExecute executes the request // @return WrappingKeyList @@ -385,7 +385,7 @@ type DefaultAPI interface { @param keyId The key UUID. @return ApiRestoreKeyRequest */ - RestoreKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiRestoreKeyRequest + RestoreKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiRestoreKeyRequest // RestoreKeyExecute executes the request RestoreKeyExecute(r ApiRestoreKeyRequest) error @@ -403,7 +403,7 @@ type DefaultAPI interface { @param versionNumber The version number. @return ApiRestoreVersionRequest */ - RestoreVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiRestoreVersionRequest + RestoreVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiRestoreVersionRequest // RestoreVersionExecute executes the request RestoreVersionExecute(r ApiRestoreVersionRequest) error @@ -420,7 +420,7 @@ type DefaultAPI interface { @param keyId The key UUID. @return ApiRotateKeyRequest */ - RotateKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiRotateKeyRequest + RotateKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiRotateKeyRequest // RotateKeyExecute executes the request // @return Version @@ -439,7 +439,7 @@ type DefaultAPI interface { @param versionNumber The version number. @return ApiSignRequest */ - Sign(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiSignRequest + Sign(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiSignRequest // SignExecute executes the request // @return SignedData @@ -458,7 +458,7 @@ type DefaultAPI interface { @param versionNumber The version number. @return ApiVerifyRequest */ - Verify(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiVerifyRequest + Verify(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiVerifyRequest // VerifyExecute executes the request // @return VerifiedData @@ -472,7 +472,7 @@ type ApiCreateKeyRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string createKeyPayload *CreateKeyPayload } @@ -497,7 +497,7 @@ Creates a new key for the given key ring. @param keyRingId The key ring UUID. @return ApiCreateKeyRequest */ -func (a *DefaultAPIService) CreateKey(ctx context.Context, projectId string, regionId string, keyRingId string) ApiCreateKeyRequest { +func (a *DefaultAPIService) CreateKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiCreateKeyRequest { return ApiCreateKeyRequest{ ApiService: a, ctx: ctx, @@ -649,7 +649,7 @@ type ApiCreateKeyRingRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter createKeyRingPayload *CreateKeyRingPayload } @@ -672,7 +672,7 @@ Creates a new key ring within the project. @param regionId The STACKIT region name the key ring is located in. @return ApiCreateKeyRingRequest */ -func (a *DefaultAPIService) CreateKeyRing(ctx context.Context, projectId string, regionId string) ApiCreateKeyRingRequest { +func (a *DefaultAPIService) CreateKeyRing(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter) ApiCreateKeyRingRequest { return ApiCreateKeyRingRequest{ ApiService: a, ctx: ctx, @@ -811,7 +811,7 @@ type ApiCreateWrappingKeyRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string createWrappingKeyPayload *CreateWrappingKeyPayload } @@ -836,7 +836,7 @@ Creates a new wrapping key for the given key ring. @param keyRingId The key ring UUID. @return ApiCreateWrappingKeyRequest */ -func (a *DefaultAPIService) CreateWrappingKey(ctx context.Context, projectId string, regionId string, keyRingId string) ApiCreateWrappingKeyRequest { +func (a *DefaultAPIService) CreateWrappingKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiCreateWrappingKeyRequest { return ApiCreateWrappingKeyRequest{ ApiService: a, ctx: ctx, @@ -988,7 +988,7 @@ type ApiDecryptRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string versionNumber int64 @@ -1017,7 +1017,7 @@ Decrypts data using the given key version. @param versionNumber The version number. @return ApiDecryptRequest */ -func (a *DefaultAPIService) Decrypt(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiDecryptRequest { +func (a *DefaultAPIService) Decrypt(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiDecryptRequest { return ApiDecryptRequest{ ApiService: a, ctx: ctx, @@ -1195,7 +1195,7 @@ type ApiDeleteKeyRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string } @@ -1216,7 +1216,7 @@ Schedules the deletion of the given key @param keyId The key UUID. @return ApiDeleteKeyRequest */ -func (a *DefaultAPIService) DeleteKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiDeleteKeyRequest { +func (a *DefaultAPIService) DeleteKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiDeleteKeyRequest { return ApiDeleteKeyRequest{ ApiService: a, ctx: ctx, @@ -1363,7 +1363,7 @@ type ApiDeleteKeyRingRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string } @@ -1382,7 +1382,7 @@ Deletes the given key ring if it is empty @param keyRingId The key ring UUID. @return ApiDeleteKeyRingRequest */ -func (a *DefaultAPIService) DeleteKeyRing(ctx context.Context, projectId string, regionId string, keyRingId string) ApiDeleteKeyRingRequest { +func (a *DefaultAPIService) DeleteKeyRing(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiDeleteKeyRingRequest { return ApiDeleteKeyRingRequest{ ApiService: a, ctx: ctx, @@ -1527,7 +1527,7 @@ type ApiDeleteWrappingKeyRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string wrappingKeyId string } @@ -1548,7 +1548,7 @@ Deletes the given wrapping key @param wrappingKeyId The wrapping key UUID. @return ApiDeleteWrappingKeyRequest */ -func (a *DefaultAPIService) DeleteWrappingKey(ctx context.Context, projectId string, regionId string, keyRingId string, wrappingKeyId string) ApiDeleteWrappingKeyRequest { +func (a *DefaultAPIService) DeleteWrappingKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, wrappingKeyId string) ApiDeleteWrappingKeyRequest { return ApiDeleteWrappingKeyRequest{ ApiService: a, ctx: ctx, @@ -1695,7 +1695,7 @@ type ApiDestroyVersionRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string versionNumber int64 @@ -1718,7 +1718,7 @@ Removes the key material of a version permanently. @param versionNumber The version number. @return ApiDestroyVersionRequest */ -func (a *DefaultAPIService) DestroyVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiDestroyVersionRequest { +func (a *DefaultAPIService) DestroyVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiDestroyVersionRequest { return ApiDestroyVersionRequest{ ApiService: a, ctx: ctx, @@ -1867,7 +1867,7 @@ type ApiDisableVersionRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string versionNumber int64 @@ -1890,7 +1890,7 @@ Disables the given version. @param versionNumber The version number. @return ApiDisableVersionRequest */ -func (a *DefaultAPIService) DisableVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiDisableVersionRequest { +func (a *DefaultAPIService) DisableVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiDisableVersionRequest { return ApiDisableVersionRequest{ ApiService: a, ctx: ctx, @@ -2039,7 +2039,7 @@ type ApiEnableVersionRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string versionNumber int64 @@ -2062,7 +2062,7 @@ Enables the given version. @param versionNumber The version number. @return ApiEnableVersionRequest */ -func (a *DefaultAPIService) EnableVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiEnableVersionRequest { +func (a *DefaultAPIService) EnableVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiEnableVersionRequest { return ApiEnableVersionRequest{ ApiService: a, ctx: ctx, @@ -2211,7 +2211,7 @@ type ApiEncryptRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string versionNumber int64 @@ -2240,7 +2240,7 @@ Encrypts data using the given key version. @param versionNumber The version number. @return ApiEncryptRequest */ -func (a *DefaultAPIService) Encrypt(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiEncryptRequest { +func (a *DefaultAPIService) Encrypt(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiEncryptRequest { return ApiEncryptRequest{ ApiService: a, ctx: ctx, @@ -2418,7 +2418,7 @@ type ApiGetKeyRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string } @@ -2439,7 +2439,7 @@ Returns the details for the given key. @param keyId The key UUID. @return ApiGetKeyRequest */ -func (a *DefaultAPIService) GetKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiGetKeyRequest { +func (a *DefaultAPIService) GetKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiGetKeyRequest { return ApiGetKeyRequest{ ApiService: a, ctx: ctx, @@ -2588,7 +2588,7 @@ type ApiGetKeyRingRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string } @@ -2607,7 +2607,7 @@ Returns the details for the given key ring. @param keyRingId The key ring UUID. @return ApiGetKeyRingRequest */ -func (a *DefaultAPIService) GetKeyRing(ctx context.Context, projectId string, regionId string, keyRingId string) ApiGetKeyRingRequest { +func (a *DefaultAPIService) GetKeyRing(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiGetKeyRingRequest { return ApiGetKeyRingRequest{ ApiService: a, ctx: ctx, @@ -2754,7 +2754,7 @@ type ApiGetVersionRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string versionNumber int64 @@ -2777,7 +2777,7 @@ Returns the details for the given version. @param versionNumber The version number. @return ApiGetVersionRequest */ -func (a *DefaultAPIService) GetVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiGetVersionRequest { +func (a *DefaultAPIService) GetVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiGetVersionRequest { return ApiGetVersionRequest{ ApiService: a, ctx: ctx, @@ -2928,7 +2928,7 @@ type ApiGetWrappingKeyRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string wrappingKeyId string } @@ -2949,7 +2949,7 @@ Returns the details for the given wrapping key. @param wrappingKeyId The wrapping key UUID. @return ApiGetWrappingKeyRequest */ -func (a *DefaultAPIService) GetWrappingKey(ctx context.Context, projectId string, regionId string, keyRingId string, wrappingKeyId string) ApiGetWrappingKeyRequest { +func (a *DefaultAPIService) GetWrappingKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, wrappingKeyId string) ApiGetWrappingKeyRequest { return ApiGetWrappingKeyRequest{ ApiService: a, ctx: ctx, @@ -3098,7 +3098,7 @@ type ApiImportKeyRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string importKeyPayload *ImportKeyPayload @@ -3125,7 +3125,7 @@ Imports a new version to the given key. @param keyId The key UUID. @return ApiImportKeyRequest */ -func (a *DefaultAPIService) ImportKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiImportKeyRequest { +func (a *DefaultAPIService) ImportKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiImportKeyRequest { return ApiImportKeyRequest{ ApiService: a, ctx: ctx, @@ -3290,7 +3290,7 @@ type ApiListKeyRingsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter } func (r ApiListKeyRingsRequest) Execute() (*KeyRingList, error) { @@ -3307,7 +3307,7 @@ Returns a list of all key rings within the project. @param regionId The STACKIT region name the key ring is located in. @return ApiListKeyRingsRequest */ -func (a *DefaultAPIService) ListKeyRings(ctx context.Context, projectId string, regionId string) ApiListKeyRingsRequest { +func (a *DefaultAPIService) ListKeyRings(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter) ApiListKeyRingsRequest { return ApiListKeyRingsRequest{ ApiService: a, ctx: ctx, @@ -3441,7 +3441,7 @@ type ApiListKeysRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string } @@ -3460,7 +3460,7 @@ Returns the keys for the given key ring. @param keyRingId The key ring UUID. @return ApiListKeysRequest */ -func (a *DefaultAPIService) ListKeys(ctx context.Context, projectId string, regionId string, keyRingId string) ApiListKeysRequest { +func (a *DefaultAPIService) ListKeys(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiListKeysRequest { return ApiListKeysRequest{ ApiService: a, ctx: ctx, @@ -3607,7 +3607,7 @@ type ApiListVersionsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string } @@ -3628,7 +3628,7 @@ Returns a list of all versions of a given key. @param keyId The key UUID. @return ApiListVersionsRequest */ -func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiListVersionsRequest { +func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiListVersionsRequest { return ApiListVersionsRequest{ ApiService: a, ctx: ctx, @@ -3777,7 +3777,7 @@ type ApiListWrappingKeysRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string } @@ -3796,7 +3796,7 @@ Returns the wrapping keys for the given key ring. @param keyRingId The key ring UUID. @return ApiListWrappingKeysRequest */ -func (a *DefaultAPIService) ListWrappingKeys(ctx context.Context, projectId string, regionId string, keyRingId string) ApiListWrappingKeysRequest { +func (a *DefaultAPIService) ListWrappingKeys(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiListWrappingKeysRequest { return ApiListWrappingKeysRequest{ ApiService: a, ctx: ctx, @@ -3943,7 +3943,7 @@ type ApiRestoreKeyRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string } @@ -3964,7 +3964,7 @@ Restores the given key from being deleted. @param keyId The key UUID. @return ApiRestoreKeyRequest */ -func (a *DefaultAPIService) RestoreKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiRestoreKeyRequest { +func (a *DefaultAPIService) RestoreKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiRestoreKeyRequest { return ApiRestoreKeyRequest{ ApiService: a, ctx: ctx, @@ -4111,7 +4111,7 @@ type ApiRestoreVersionRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string versionNumber int64 @@ -4134,7 +4134,7 @@ Restores the given version from being destroyed @param versionNumber The version number. @return ApiRestoreVersionRequest */ -func (a *DefaultAPIService) RestoreVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiRestoreVersionRequest { +func (a *DefaultAPIService) RestoreVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiRestoreVersionRequest { return ApiRestoreVersionRequest{ ApiService: a, ctx: ctx, @@ -4283,7 +4283,7 @@ type ApiRotateKeyRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string } @@ -4304,7 +4304,7 @@ Rotates the given key. @param keyId The key UUID. @return ApiRotateKeyRequest */ -func (a *DefaultAPIService) RotateKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiRotateKeyRequest { +func (a *DefaultAPIService) RotateKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiRotateKeyRequest { return ApiRotateKeyRequest{ ApiService: a, ctx: ctx, @@ -4475,7 +4475,7 @@ type ApiSignRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string versionNumber int64 @@ -4504,7 +4504,7 @@ Sign data using the given key version as secret. @param versionNumber The version number. @return ApiSignRequest */ -func (a *DefaultAPIService) Sign(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiSignRequest { +func (a *DefaultAPIService) Sign(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiSignRequest { return ApiSignRequest{ ApiService: a, ctx: ctx, @@ -4682,7 +4682,7 @@ type ApiVerifyRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListKeyRingsRegionIdParameter keyRingId string keyId string versionNumber int64 @@ -4711,7 +4711,7 @@ Verify data using the given key version as secret. @param versionNumber The version number. @return ApiVerifyRequest */ -func (a *DefaultAPIService) Verify(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiVerifyRequest { +func (a *DefaultAPIService) Verify(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiVerifyRequest { return ApiVerifyRequest{ ApiService: a, ctx: ctx, diff --git a/services/kms/v1api/api_default_mock.go b/services/kms/v1api/api_default_mock.go index c5222d2c8..a6e8bc5b9 100644 --- a/services/kms/v1api/api_default_mock.go +++ b/services/kms/v1api/api_default_mock.go @@ -72,7 +72,7 @@ type DefaultAPIServiceMock struct { VerifyExecuteMock *func(r ApiVerifyRequest) (*VerifiedData, error) } -func (a DefaultAPIServiceMock) CreateKey(ctx context.Context, projectId string, regionId string, keyRingId string) ApiCreateKeyRequest { +func (a DefaultAPIServiceMock) CreateKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiCreateKeyRequest { return ApiCreateKeyRequest{ ApiService: a, ctx: ctx, @@ -92,7 +92,7 @@ func (a DefaultAPIServiceMock) CreateKeyExecute(r ApiCreateKeyRequest) (*Key, er return (*a.CreateKeyExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateKeyRing(ctx context.Context, projectId string, regionId string) ApiCreateKeyRingRequest { +func (a DefaultAPIServiceMock) CreateKeyRing(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter) ApiCreateKeyRingRequest { return ApiCreateKeyRingRequest{ ApiService: a, ctx: ctx, @@ -111,7 +111,7 @@ func (a DefaultAPIServiceMock) CreateKeyRingExecute(r ApiCreateKeyRingRequest) ( return (*a.CreateKeyRingExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateWrappingKey(ctx context.Context, projectId string, regionId string, keyRingId string) ApiCreateWrappingKeyRequest { +func (a DefaultAPIServiceMock) CreateWrappingKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiCreateWrappingKeyRequest { return ApiCreateWrappingKeyRequest{ ApiService: a, ctx: ctx, @@ -131,7 +131,7 @@ func (a DefaultAPIServiceMock) CreateWrappingKeyExecute(r ApiCreateWrappingKeyRe return (*a.CreateWrappingKeyExecuteMock)(r) } -func (a DefaultAPIServiceMock) Decrypt(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiDecryptRequest { +func (a DefaultAPIServiceMock) Decrypt(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiDecryptRequest { return ApiDecryptRequest{ ApiService: a, ctx: ctx, @@ -153,7 +153,7 @@ func (a DefaultAPIServiceMock) DecryptExecute(r ApiDecryptRequest) (*DecryptedDa return (*a.DecryptExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiDeleteKeyRequest { +func (a DefaultAPIServiceMock) DeleteKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiDeleteKeyRequest { return ApiDeleteKeyRequest{ ApiService: a, ctx: ctx, @@ -173,7 +173,7 @@ func (a DefaultAPIServiceMock) DeleteKeyExecute(r ApiDeleteKeyRequest) error { return (*a.DeleteKeyExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteKeyRing(ctx context.Context, projectId string, regionId string, keyRingId string) ApiDeleteKeyRingRequest { +func (a DefaultAPIServiceMock) DeleteKeyRing(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiDeleteKeyRingRequest { return ApiDeleteKeyRingRequest{ ApiService: a, ctx: ctx, @@ -192,7 +192,7 @@ func (a DefaultAPIServiceMock) DeleteKeyRingExecute(r ApiDeleteKeyRingRequest) e return (*a.DeleteKeyRingExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteWrappingKey(ctx context.Context, projectId string, regionId string, keyRingId string, wrappingKeyId string) ApiDeleteWrappingKeyRequest { +func (a DefaultAPIServiceMock) DeleteWrappingKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, wrappingKeyId string) ApiDeleteWrappingKeyRequest { return ApiDeleteWrappingKeyRequest{ ApiService: a, ctx: ctx, @@ -212,7 +212,7 @@ func (a DefaultAPIServiceMock) DeleteWrappingKeyExecute(r ApiDeleteWrappingKeyRe return (*a.DeleteWrappingKeyExecuteMock)(r) } -func (a DefaultAPIServiceMock) DestroyVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiDestroyVersionRequest { +func (a DefaultAPIServiceMock) DestroyVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiDestroyVersionRequest { return ApiDestroyVersionRequest{ ApiService: a, ctx: ctx, @@ -233,7 +233,7 @@ func (a DefaultAPIServiceMock) DestroyVersionExecute(r ApiDestroyVersionRequest) return (*a.DestroyVersionExecuteMock)(r) } -func (a DefaultAPIServiceMock) DisableVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiDisableVersionRequest { +func (a DefaultAPIServiceMock) DisableVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiDisableVersionRequest { return ApiDisableVersionRequest{ ApiService: a, ctx: ctx, @@ -254,7 +254,7 @@ func (a DefaultAPIServiceMock) DisableVersionExecute(r ApiDisableVersionRequest) return (*a.DisableVersionExecuteMock)(r) } -func (a DefaultAPIServiceMock) EnableVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiEnableVersionRequest { +func (a DefaultAPIServiceMock) EnableVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiEnableVersionRequest { return ApiEnableVersionRequest{ ApiService: a, ctx: ctx, @@ -275,7 +275,7 @@ func (a DefaultAPIServiceMock) EnableVersionExecute(r ApiEnableVersionRequest) e return (*a.EnableVersionExecuteMock)(r) } -func (a DefaultAPIServiceMock) Encrypt(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiEncryptRequest { +func (a DefaultAPIServiceMock) Encrypt(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiEncryptRequest { return ApiEncryptRequest{ ApiService: a, ctx: ctx, @@ -297,7 +297,7 @@ func (a DefaultAPIServiceMock) EncryptExecute(r ApiEncryptRequest) (*EncryptedDa return (*a.EncryptExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiGetKeyRequest { +func (a DefaultAPIServiceMock) GetKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiGetKeyRequest { return ApiGetKeyRequest{ ApiService: a, ctx: ctx, @@ -318,7 +318,7 @@ func (a DefaultAPIServiceMock) GetKeyExecute(r ApiGetKeyRequest) (*Key, error) { return (*a.GetKeyExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetKeyRing(ctx context.Context, projectId string, regionId string, keyRingId string) ApiGetKeyRingRequest { +func (a DefaultAPIServiceMock) GetKeyRing(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiGetKeyRingRequest { return ApiGetKeyRingRequest{ ApiService: a, ctx: ctx, @@ -338,7 +338,7 @@ func (a DefaultAPIServiceMock) GetKeyRingExecute(r ApiGetKeyRingRequest) (*KeyRi return (*a.GetKeyRingExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiGetVersionRequest { +func (a DefaultAPIServiceMock) GetVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiGetVersionRequest { return ApiGetVersionRequest{ ApiService: a, ctx: ctx, @@ -360,7 +360,7 @@ func (a DefaultAPIServiceMock) GetVersionExecute(r ApiGetVersionRequest) (*Versi return (*a.GetVersionExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetWrappingKey(ctx context.Context, projectId string, regionId string, keyRingId string, wrappingKeyId string) ApiGetWrappingKeyRequest { +func (a DefaultAPIServiceMock) GetWrappingKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, wrappingKeyId string) ApiGetWrappingKeyRequest { return ApiGetWrappingKeyRequest{ ApiService: a, ctx: ctx, @@ -381,7 +381,7 @@ func (a DefaultAPIServiceMock) GetWrappingKeyExecute(r ApiGetWrappingKeyRequest) return (*a.GetWrappingKeyExecuteMock)(r) } -func (a DefaultAPIServiceMock) ImportKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiImportKeyRequest { +func (a DefaultAPIServiceMock) ImportKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiImportKeyRequest { return ApiImportKeyRequest{ ApiService: a, ctx: ctx, @@ -402,7 +402,7 @@ func (a DefaultAPIServiceMock) ImportKeyExecute(r ApiImportKeyRequest) (*Version return (*a.ImportKeyExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListKeyRings(ctx context.Context, projectId string, regionId string) ApiListKeyRingsRequest { +func (a DefaultAPIServiceMock) ListKeyRings(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter) ApiListKeyRingsRequest { return ApiListKeyRingsRequest{ ApiService: a, ctx: ctx, @@ -421,7 +421,7 @@ func (a DefaultAPIServiceMock) ListKeyRingsExecute(r ApiListKeyRingsRequest) (*K return (*a.ListKeyRingsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListKeys(ctx context.Context, projectId string, regionId string, keyRingId string) ApiListKeysRequest { +func (a DefaultAPIServiceMock) ListKeys(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiListKeysRequest { return ApiListKeysRequest{ ApiService: a, ctx: ctx, @@ -441,7 +441,7 @@ func (a DefaultAPIServiceMock) ListKeysExecute(r ApiListKeysRequest) (*KeyList, return (*a.ListKeysExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiListVersionsRequest { +func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiListVersionsRequest { return ApiListVersionsRequest{ ApiService: a, ctx: ctx, @@ -462,7 +462,7 @@ func (a DefaultAPIServiceMock) ListVersionsExecute(r ApiListVersionsRequest) (*V return (*a.ListVersionsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListWrappingKeys(ctx context.Context, projectId string, regionId string, keyRingId string) ApiListWrappingKeysRequest { +func (a DefaultAPIServiceMock) ListWrappingKeys(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string) ApiListWrappingKeysRequest { return ApiListWrappingKeysRequest{ ApiService: a, ctx: ctx, @@ -482,7 +482,7 @@ func (a DefaultAPIServiceMock) ListWrappingKeysExecute(r ApiListWrappingKeysRequ return (*a.ListWrappingKeysExecuteMock)(r) } -func (a DefaultAPIServiceMock) RestoreKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiRestoreKeyRequest { +func (a DefaultAPIServiceMock) RestoreKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiRestoreKeyRequest { return ApiRestoreKeyRequest{ ApiService: a, ctx: ctx, @@ -502,7 +502,7 @@ func (a DefaultAPIServiceMock) RestoreKeyExecute(r ApiRestoreKeyRequest) error { return (*a.RestoreKeyExecuteMock)(r) } -func (a DefaultAPIServiceMock) RestoreVersion(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiRestoreVersionRequest { +func (a DefaultAPIServiceMock) RestoreVersion(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiRestoreVersionRequest { return ApiRestoreVersionRequest{ ApiService: a, ctx: ctx, @@ -523,7 +523,7 @@ func (a DefaultAPIServiceMock) RestoreVersionExecute(r ApiRestoreVersionRequest) return (*a.RestoreVersionExecuteMock)(r) } -func (a DefaultAPIServiceMock) RotateKey(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string) ApiRotateKeyRequest { +func (a DefaultAPIServiceMock) RotateKey(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string) ApiRotateKeyRequest { return ApiRotateKeyRequest{ ApiService: a, ctx: ctx, @@ -544,7 +544,7 @@ func (a DefaultAPIServiceMock) RotateKeyExecute(r ApiRotateKeyRequest) (*Version return (*a.RotateKeyExecuteMock)(r) } -func (a DefaultAPIServiceMock) Sign(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiSignRequest { +func (a DefaultAPIServiceMock) Sign(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiSignRequest { return ApiSignRequest{ ApiService: a, ctx: ctx, @@ -566,7 +566,7 @@ func (a DefaultAPIServiceMock) SignExecute(r ApiSignRequest) (*SignedData, error return (*a.SignExecuteMock)(r) } -func (a DefaultAPIServiceMock) Verify(ctx context.Context, projectId string, regionId string, keyRingId string, keyId string, versionNumber int64) ApiVerifyRequest { +func (a DefaultAPIServiceMock) Verify(ctx context.Context, projectId string, regionId ListKeyRingsRegionIdParameter, keyRingId string, keyId string, versionNumber int64) ApiVerifyRequest { return ApiVerifyRequest{ ApiService: a, ctx: ctx, diff --git a/services/kms/v1api/model_key.go b/services/kms/v1api/model_key.go index 39df4f4da..3d3263f3e 100644 --- a/services/kms/v1api/model_key.go +++ b/services/kms/v1api/model_key.go @@ -36,11 +36,10 @@ type Key struct { // States whether versions can be created or only imported. ImportOnly bool `json:"importOnly"` // The unique id of the key ring this key is assigned to. - KeyRingId string `json:"keyRingId"` - Protection Protection `json:"protection"` - Purpose Purpose `json:"purpose"` - // The current state of the key. - State string `json:"state"` + KeyRingId string `json:"keyRingId"` + Protection Protection `json:"protection"` + Purpose Purpose `json:"purpose"` + State KeyState `json:"state"` AdditionalProperties map[string]interface{} } @@ -50,7 +49,7 @@ type _Key Key // 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 NewKey(accessScope AccessScope, algorithm Algorithm, createdAt time.Time, displayName string, id string, importOnly bool, keyRingId string, protection Protection, purpose Purpose, state string) *Key { +func NewKey(accessScope AccessScope, algorithm Algorithm, createdAt time.Time, displayName string, id string, importOnly bool, keyRingId string, protection Protection, purpose Purpose, state KeyState) *Key { this := Key{} this.AccessScope = accessScope this.Algorithm = algorithm @@ -358,9 +357,9 @@ func (o *Key) SetPurpose(v Purpose) { } // GetState returns the State field value -func (o *Key) GetState() string { +func (o *Key) GetState() KeyState { if o == nil { - var ret string + var ret KeyState return ret } @@ -369,7 +368,7 @@ func (o *Key) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *Key) GetStateOk() (*string, bool) { +func (o *Key) GetStateOk() (*KeyState, bool) { if o == nil { return nil, false } @@ -377,7 +376,7 @@ func (o *Key) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *Key) SetState(v string) { +func (o *Key) SetState(v KeyState) { o.State = v } diff --git a/services/kms/v1api/model_key_ring.go b/services/kms/v1api/model_key_ring.go index a6f408955..2c157be23 100644 --- a/services/kms/v1api/model_key_ring.go +++ b/services/kms/v1api/model_key_ring.go @@ -28,9 +28,8 @@ type KeyRing struct { // The display name to distinguish multiple key rings. DisplayName string `json:"displayName"` // A auto generated unique id which identifies the key ring. - Id string `json:"id"` - // The current state of the key ring. - State string `json:"state"` + Id string `json:"id"` + State KeyRingState `json:"state"` AdditionalProperties map[string]interface{} } @@ -40,7 +39,7 @@ type _KeyRing KeyRing // 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 NewKeyRing(createdAt time.Time, displayName string, id string, state string) *KeyRing { +func NewKeyRing(createdAt time.Time, displayName string, id string, state KeyRingState) *KeyRing { this := KeyRing{} this.CreatedAt = createdAt this.DisplayName = displayName @@ -162,9 +161,9 @@ func (o *KeyRing) SetId(v string) { } // GetState returns the State field value -func (o *KeyRing) GetState() string { +func (o *KeyRing) GetState() KeyRingState { if o == nil { - var ret string + var ret KeyRingState return ret } @@ -173,7 +172,7 @@ func (o *KeyRing) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *KeyRing) GetStateOk() (*string, bool) { +func (o *KeyRing) GetStateOk() (*KeyRingState, bool) { if o == nil { return nil, false } @@ -181,7 +180,7 @@ func (o *KeyRing) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *KeyRing) SetState(v string) { +func (o *KeyRing) SetState(v KeyRingState) { o.State = v } diff --git a/services/kms/v1api/model_key_ring_state.go b/services/kms/v1api/model_key_ring_state.go new file mode 100644 index 000000000..d31af0e20 --- /dev/null +++ b/services/kms/v1api/model_key_ring_state.go @@ -0,0 +1,115 @@ +/* +STACKIT Key Management Service API + +This API provides endpoints for managing keys and key rings. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// KeyRingState The current state of the key ring. +type KeyRingState string + +// List of keyRing_state +const ( + KEYRINGSTATE_CREATING KeyRingState = "creating" + KEYRINGSTATE_ACTIVE KeyRingState = "active" + KEYRINGSTATE_DELETED KeyRingState = "deleted" + KEYRINGSTATE_UNKNOWN_DEFAULT_OPEN_API KeyRingState = "unknown_default_open_api" +) + +// All allowed values of KeyRingState enum +var AllowedKeyRingStateEnumValues = []KeyRingState{ + "creating", + "active", + "deleted", + "unknown_default_open_api", +} + +func (v *KeyRingState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := KeyRingState(value) + for _, existing := range AllowedKeyRingStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = KEYRINGSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewKeyRingStateFromValue returns a pointer to a valid KeyRingState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewKeyRingStateFromValue(v string) (*KeyRingState, error) { + ev := KeyRingState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for KeyRingState: valid values are %v", v, AllowedKeyRingStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v KeyRingState) IsValid() bool { + for _, existing := range AllowedKeyRingStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to keyRing_state value +func (v KeyRingState) Ptr() *KeyRingState { + return &v +} + +type NullableKeyRingState struct { + value *KeyRingState + isSet bool +} + +func (v NullableKeyRingState) Get() *KeyRingState { + return v.value +} + +func (v *NullableKeyRingState) Set(val *KeyRingState) { + v.value = val + v.isSet = true +} + +func (v NullableKeyRingState) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyRingState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyRingState(val *KeyRingState) *NullableKeyRingState { + return &NullableKeyRingState{value: val, isSet: true} +} + +func (v NullableKeyRingState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyRingState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/kms/v1api/model_key_state.go b/services/kms/v1api/model_key_state.go new file mode 100644 index 000000000..88a73cf1f --- /dev/null +++ b/services/kms/v1api/model_key_state.go @@ -0,0 +1,121 @@ +/* +STACKIT Key Management Service API + +This API provides endpoints for managing keys and key rings. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// KeyState The current state of the key. +type KeyState string + +// List of key_state +const ( + KEYSTATE_ACTIVE KeyState = "active" + KEYSTATE_DELETED KeyState = "deleted" + KEYSTATE_NOT_AVAILABLE KeyState = "not_available" + KEYSTATE_ERRORS_EXIST KeyState = "errors_exist" + KEYSTATE_CREATING KeyState = "creating" + KEYSTATE_NO_VERSION KeyState = "no_version" + KEYSTATE_UNKNOWN_DEFAULT_OPEN_API KeyState = "unknown_default_open_api" +) + +// All allowed values of KeyState enum +var AllowedKeyStateEnumValues = []KeyState{ + "active", + "deleted", + "not_available", + "errors_exist", + "creating", + "no_version", + "unknown_default_open_api", +} + +func (v *KeyState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := KeyState(value) + for _, existing := range AllowedKeyStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = KEYSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewKeyStateFromValue returns a pointer to a valid KeyState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewKeyStateFromValue(v string) (*KeyState, error) { + ev := KeyState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for KeyState: valid values are %v", v, AllowedKeyStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v KeyState) IsValid() bool { + for _, existing := range AllowedKeyStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to key_state value +func (v KeyState) Ptr() *KeyState { + return &v +} + +type NullableKeyState struct { + value *KeyState + isSet bool +} + +func (v NullableKeyState) Get() *KeyState { + return v.value +} + +func (v *NullableKeyState) Set(val *KeyState) { + v.value = val + v.isSet = true +} + +func (v NullableKeyState) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyState(val *KeyState) *NullableKeyState { + return &NullableKeyState{value: val, isSet: true} +} + +func (v NullableKeyState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/kms/v1api/model_list_key_rings_region_id_parameter.go b/services/kms/v1api/model_list_key_rings_region_id_parameter.go new file mode 100644 index 000000000..06d3d2fba --- /dev/null +++ b/services/kms/v1api/model_list_key_rings_region_id_parameter.go @@ -0,0 +1,111 @@ +/* +STACKIT Key Management Service API + +This API provides endpoints for managing keys and key rings. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ListKeyRingsRegionIdParameter the model 'ListKeyRingsRegionIdParameter' +type ListKeyRingsRegionIdParameter string + +// List of ListKeyRings_regionId_parameter +const ( + LISTKEYRINGSREGIONIDPARAMETER_EU01 ListKeyRingsRegionIdParameter = "eu01" + LISTKEYRINGSREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListKeyRingsRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of ListKeyRingsRegionIdParameter enum +var AllowedListKeyRingsRegionIdParameterEnumValues = []ListKeyRingsRegionIdParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ListKeyRingsRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListKeyRingsRegionIdParameter(value) + for _, existing := range AllowedListKeyRingsRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTKEYRINGSREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListKeyRingsRegionIdParameterFromValue returns a pointer to a valid ListKeyRingsRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListKeyRingsRegionIdParameterFromValue(v string) (*ListKeyRingsRegionIdParameter, error) { + ev := ListKeyRingsRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListKeyRingsRegionIdParameter: valid values are %v", v, AllowedListKeyRingsRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListKeyRingsRegionIdParameter) IsValid() bool { + for _, existing := range AllowedListKeyRingsRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListKeyRings_regionId_parameter value +func (v ListKeyRingsRegionIdParameter) Ptr() *ListKeyRingsRegionIdParameter { + return &v +} + +type NullableListKeyRingsRegionIdParameter struct { + value *ListKeyRingsRegionIdParameter + isSet bool +} + +func (v NullableListKeyRingsRegionIdParameter) Get() *ListKeyRingsRegionIdParameter { + return v.value +} + +func (v *NullableListKeyRingsRegionIdParameter) Set(val *ListKeyRingsRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListKeyRingsRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListKeyRingsRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListKeyRingsRegionIdParameter(val *ListKeyRingsRegionIdParameter) *NullableListKeyRingsRegionIdParameter { + return &NullableListKeyRingsRegionIdParameter{value: val, isSet: true} +} + +func (v NullableListKeyRingsRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListKeyRingsRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/kms/v1api/model_version.go b/services/kms/v1api/model_version.go index 97fe396e5..bd8c2cc62 100644 --- a/services/kms/v1api/model_version.go +++ b/services/kms/v1api/model_version.go @@ -34,9 +34,8 @@ type Version struct { // A sequential number which identifies the key versions. Number int64 `json:"number"` // The public key of the key version. Only present in asymmetric keys. - PublicKey *string `json:"publicKey,omitempty"` - // The current state of the key. - State string `json:"state"` + PublicKey *string `json:"publicKey,omitempty"` + State VersionState `json:"state"` AdditionalProperties map[string]interface{} } @@ -46,7 +45,7 @@ type _Version Version // 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 NewVersion(createdAt time.Time, disabled bool, keyId string, keyRingId string, number int64, state string) *Version { +func NewVersion(createdAt time.Time, disabled bool, keyId string, keyRingId string, number int64, state VersionState) *Version { this := Version{} this.CreatedAt = createdAt this.Disabled = disabled @@ -252,9 +251,9 @@ func (o *Version) SetPublicKey(v string) { } // GetState returns the State field value -func (o *Version) GetState() string { +func (o *Version) GetState() VersionState { if o == nil { - var ret string + var ret VersionState return ret } @@ -263,7 +262,7 @@ func (o *Version) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *Version) GetStateOk() (*string, bool) { +func (o *Version) GetStateOk() (*VersionState, bool) { if o == nil { return nil, false } @@ -271,7 +270,7 @@ func (o *Version) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *Version) SetState(v string) { +func (o *Version) SetState(v VersionState) { o.State = v } diff --git a/services/kms/v1api/model_version_state.go b/services/kms/v1api/model_version_state.go new file mode 100644 index 000000000..649761bde --- /dev/null +++ b/services/kms/v1api/model_version_state.go @@ -0,0 +1,121 @@ +/* +STACKIT Key Management Service API + +This API provides endpoints for managing keys and key rings. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// VersionState The current state of the key. +type VersionState string + +// List of version_state +const ( + VERSIONSTATE_ACTIVE VersionState = "active" + VERSIONSTATE_CREATING VersionState = "creating" + VERSIONSTATE_KEY_MATERIAL_INVALID VersionState = "key_material_invalid" + VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE VersionState = "key_material_unavailable" + VERSIONSTATE_DISABLED VersionState = "disabled" + VERSIONSTATE_DESTROYED VersionState = "destroyed" + VERSIONSTATE_UNKNOWN_DEFAULT_OPEN_API VersionState = "unknown_default_open_api" +) + +// All allowed values of VersionState enum +var AllowedVersionStateEnumValues = []VersionState{ + "active", + "creating", + "key_material_invalid", + "key_material_unavailable", + "disabled", + "destroyed", + "unknown_default_open_api", +} + +func (v *VersionState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VersionState(value) + for _, existing := range AllowedVersionStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = VERSIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewVersionStateFromValue returns a pointer to a valid VersionState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVersionStateFromValue(v string) (*VersionState, error) { + ev := VersionState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VersionState: valid values are %v", v, AllowedVersionStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VersionState) IsValid() bool { + for _, existing := range AllowedVersionStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to version_state value +func (v VersionState) Ptr() *VersionState { + return &v +} + +type NullableVersionState struct { + value *VersionState + isSet bool +} + +func (v NullableVersionState) Get() *VersionState { + return v.value +} + +func (v *NullableVersionState) Set(val *VersionState) { + v.value = val + v.isSet = true +} + +func (v NullableVersionState) IsSet() bool { + return v.isSet +} + +func (v *NullableVersionState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersionState(val *VersionState) *NullableVersionState { + return &NullableVersionState{value: val, isSet: true} +} + +func (v NullableVersionState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersionState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/kms/v1api/model_wrapping_key.go b/services/kms/v1api/model_wrapping_key.go index e3f375300..8c8c6426e 100644 --- a/services/kms/v1api/model_wrapping_key.go +++ b/services/kms/v1api/model_wrapping_key.go @@ -37,10 +37,9 @@ type WrappingKey struct { KeyRingId string `json:"keyRingId"` Protection Protection `json:"protection"` // The public key of the wrapping key. - PublicKey *string `json:"publicKey,omitempty"` - Purpose WrappingPurpose `json:"purpose"` - // The current state of the wrapping key. - State string `json:"state"` + PublicKey *string `json:"publicKey,omitempty"` + Purpose WrappingPurpose `json:"purpose"` + State WrappingKeyState `json:"state"` AdditionalProperties map[string]interface{} } @@ -50,7 +49,7 @@ type _WrappingKey WrappingKey // 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 NewWrappingKey(accessScope AccessScope, algorithm WrappingAlgorithm, createdAt time.Time, displayName string, expiresAt time.Time, id string, keyRingId string, protection Protection, purpose WrappingPurpose, state string) *WrappingKey { +func NewWrappingKey(accessScope AccessScope, algorithm WrappingAlgorithm, createdAt time.Time, displayName string, expiresAt time.Time, id string, keyRingId string, protection Protection, purpose WrappingPurpose, state WrappingKeyState) *WrappingKey { this := WrappingKey{} this.AccessScope = accessScope this.Algorithm = algorithm @@ -356,9 +355,9 @@ func (o *WrappingKey) SetPurpose(v WrappingPurpose) { } // GetState returns the State field value -func (o *WrappingKey) GetState() string { +func (o *WrappingKey) GetState() WrappingKeyState { if o == nil { - var ret string + var ret WrappingKeyState return ret } @@ -367,7 +366,7 @@ func (o *WrappingKey) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *WrappingKey) GetStateOk() (*string, bool) { +func (o *WrappingKey) GetStateOk() (*WrappingKeyState, bool) { if o == nil { return nil, false } @@ -375,7 +374,7 @@ func (o *WrappingKey) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *WrappingKey) SetState(v string) { +func (o *WrappingKey) SetState(v WrappingKeyState) { o.State = v } diff --git a/services/kms/v1api/model_wrapping_key_state.go b/services/kms/v1api/model_wrapping_key_state.go new file mode 100644 index 000000000..e02294951 --- /dev/null +++ b/services/kms/v1api/model_wrapping_key_state.go @@ -0,0 +1,119 @@ +/* +STACKIT Key Management Service API + +This API provides endpoints for managing keys and key rings. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// WrappingKeyState The current state of the wrapping key. +type WrappingKeyState string + +// List of wrappingKey_state +const ( + WRAPPINGKEYSTATE_ACTIVE WrappingKeyState = "active" + WRAPPINGKEYSTATE_CREATING WrappingKeyState = "creating" + WRAPPINGKEYSTATE_EXPIRED WrappingKeyState = "expired" + WRAPPINGKEYSTATE_DELETED WrappingKeyState = "deleted" + WRAPPINGKEYSTATE_KEY_MATERIAL_UNAVAILABLE WrappingKeyState = "key_material_unavailable" + WRAPPINGKEYSTATE_UNKNOWN_DEFAULT_OPEN_API WrappingKeyState = "unknown_default_open_api" +) + +// All allowed values of WrappingKeyState enum +var AllowedWrappingKeyStateEnumValues = []WrappingKeyState{ + "active", + "creating", + "expired", + "deleted", + "key_material_unavailable", + "unknown_default_open_api", +} + +func (v *WrappingKeyState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WrappingKeyState(value) + for _, existing := range AllowedWrappingKeyStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = WRAPPINGKEYSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewWrappingKeyStateFromValue returns a pointer to a valid WrappingKeyState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWrappingKeyStateFromValue(v string) (*WrappingKeyState, error) { + ev := WrappingKeyState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WrappingKeyState: valid values are %v", v, AllowedWrappingKeyStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WrappingKeyState) IsValid() bool { + for _, existing := range AllowedWrappingKeyStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to wrappingKey_state value +func (v WrappingKeyState) Ptr() *WrappingKeyState { + return &v +} + +type NullableWrappingKeyState struct { + value *WrappingKeyState + isSet bool +} + +func (v NullableWrappingKeyState) Get() *WrappingKeyState { + return v.value +} + +func (v *NullableWrappingKeyState) Set(val *WrappingKeyState) { + v.value = val + v.isSet = true +} + +func (v NullableWrappingKeyState) IsSet() bool { + return v.isSet +} + +func (v *NullableWrappingKeyState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWrappingKeyState(val *WrappingKeyState) *NullableWrappingKeyState { + return &NullableWrappingKeyState{value: val, isSet: true} +} + +func (v NullableWrappingKeyState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWrappingKeyState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From fc27367c0b210c21e0fd2e4c8c5a7c2c68d6d785 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 14:53:35 +0200 Subject: [PATCH 15/66] fix(intake): write root changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8542467af..7b4421fa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -170,6 +170,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` - [v0.9.0](services/intake/CHANGELOG.md#v090) - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. + - [v0.10.0](services/intake/CHANGELOG.md#v0100) + - **Feature:** Introduce enums for various attributes - `kms`: - [v1.6.2](services/kms/CHANGELOG.md#v162) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` From d559100696cc5b865cb5e7e584d6b3f92beefcb8 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 15:52:27 +0200 Subject: [PATCH 16/66] chore(kms): fix waiters/tests/examples, write changelog, bump version --- CHANGELOG.md | 2 + examples/kms/kms.go | 2 +- services/kms/CHANGELOG.md | 3 + services/kms/VERSION | 2 +- services/kms/v1api/wait/wait.go | 84 +++++++----- services/kms/v1api/wait/wait_test.go | 194 +++++++++++++-------------- 6 files changed, 153 insertions(+), 134 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b4421fa9..d8244f866 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -185,6 +185,8 @@ - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. - [v1.9.0](services/kms/CHANGELOG.md#v190) - **Improvement:** Use new WaitHandler struct for all wait handlers + - [v1.10.0](services/kms/CHANGELOG.md#v1100) + - Feature: Introduce enums for various attributes - `lbapplication`: - [v0.5.7](services/lbapplication/CHANGELOG.md#v057) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/examples/kms/kms.go b/examples/kms/kms.go index f032e4084..f8349ebc8 100644 --- a/examples/kms/kms.go +++ b/examples/kms/kms.go @@ -12,7 +12,7 @@ import ( func main() { projectId := "PROJECT_ID" // the uuid of your STACKIT project - region := "eu01" + region := kms.LISTKEYRINGSREGIONIDPARAMETER_EU01 // Create a new API client, that uses default authentication and configuration kmsClient, err := kms.NewAPIClient() diff --git a/services/kms/CHANGELOG.md b/services/kms/CHANGELOG.md index 4b887de52..a912482a2 100644 --- a/services/kms/CHANGELOG.md +++ b/services/kms/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.10.0 +- **Feature:** Introduce enums for various attributes + ## v1.9.0 - **Improvement:** Use new WaitHandler struct for all wait handlers diff --git a/services/kms/VERSION b/services/kms/VERSION index e2f650c40..bf7b70e00 100644 --- a/services/kms/VERSION +++ b/services/kms/VERSION @@ -1 +1 @@ -v1.9.0 \ No newline at end of file +v1.10.0 diff --git a/services/kms/v1api/wait/wait.go b/services/kms/v1api/wait/wait.go index 065e27af9..6d0330220 100644 --- a/services/kms/v1api/wait/wait.go +++ b/services/kms/v1api/wait/wait.go @@ -36,42 +36,48 @@ const ( KEYSTATE_NO_VERSION = "no_version" ) -func CreateKeyRingWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId, region, keyRingId string) *wait.AsyncActionHandler[kms.KeyRing] { - waitConfig := wait.WaiterHelper[kms.KeyRing, string]{ +func CreateKeyRingWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId string, region kms.ListKeyRingsRegionIdParameter, keyRingId string) *wait.AsyncActionHandler[kms.KeyRing] { + waitConfig := wait.WaiterHelper[kms.KeyRing, kms.KeyRingState]{ FetchInstance: client.GetKeyRing(ctx, projectId, region, keyRingId).Execute, - GetState: func(d *kms.KeyRing) (string, error) { - if d == nil || d.State == "" { - return "", errors.New("keyring or state is nil") + GetState: func(d *kms.KeyRing) (kms.KeyRingState, error) { + if d == nil { + return "", errors.New("keyring is nil") } return d.State, nil }, - ActiveState: []string{KEYRINGSTATE_ACTIVE, KEYRINGSTATE_DELETED}, + ActiveState: []kms.KeyRingState{kms.KEYRINGSTATE_ACTIVE, kms.KEYRINGSTATE_DELETED}, } handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } -func CreateOrUpdateKeyWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId, region, keyRingId, keyId string) *wait.AsyncActionHandler[kms.Key] { - waitConfig := wait.WaiterHelper[kms.Key, string]{ +func CreateOrUpdateKeyWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId string, region kms.ListKeyRingsRegionIdParameter, keyRingId, keyId string) *wait.AsyncActionHandler[kms.Key] { + waitConfig := wait.WaiterHelper[kms.Key, kms.KeyState]{ FetchInstance: client.GetKey(ctx, projectId, region, keyRingId, keyId).Execute, - GetState: func(d *kms.Key) (string, error) { - if d == nil || d.State == "" { - return "", errors.New("key or state is nil") + GetState: func(d *kms.Key) (kms.KeyState, error) { + if d == nil { + return "", errors.New("key is nil") } return d.State, nil }, - ActiveState: []string{KEYSTATE_ACTIVE, KEYSTATE_DELETED, KEYSTATE_NO_VERSION, KEYSTATE_ERRORS_EXIST, KEYSTATE_NOT_AVAILABLE}, + ActiveState: []kms.KeyState{ + kms.KEYSTATE_ACTIVE, + kms.KEYSTATE_DELETED, + kms.KEYSTATE_NO_VERSION, + kms.KEYSTATE_ERRORS_EXIST, + kms.KEYSTATE_NOT_AVAILABLE, + }, } handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } -func DeleteKeyWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId, region, keyRingId, keyId string) *wait.AsyncActionHandler[kms.Key] { - waitConfig := wait.WaiterHelper[kms.Key, string]{ +func DeleteKeyWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId string, region kms.ListKeyRingsRegionIdParameter, keyRingId, keyId string) *wait.AsyncActionHandler[kms.Key] { + waitConfig := wait.WaiterHelper[kms.Key, kms.KeyState]{ FetchInstance: client.GetKey(ctx, projectId, region, keyRingId, keyId).Execute, - GetState: func(_ *kms.Key) (string, error) { + GetState: func(_ *kms.Key) (kms.KeyState, error) { return "", nil }, DeleteHttpErrorStatusCodes: []int{http.StatusNotFound, http.StatusGone}, @@ -81,50 +87,58 @@ func DeleteKeyWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId, return handler } -func EnableKeyVersionWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId, region, keyRingId, keyId string, version int64) *wait.AsyncActionHandler[kms.Version] { - waitConfig := wait.WaiterHelper[kms.Version, string]{ +func EnableKeyVersionWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId string, region kms.ListKeyRingsRegionIdParameter, keyRingId, keyId string, version int64) *wait.AsyncActionHandler[kms.Version] { + waitConfig := wait.WaiterHelper[kms.Version, kms.VersionState]{ FetchInstance: client.GetVersion(ctx, projectId, region, keyRingId, keyId, version).Execute, - GetState: func(d *kms.Version) (string, error) { - if d == nil || d.State == "" { - return "", errors.New("version or state is nil") + GetState: func(d *kms.Version) (kms.VersionState, error) { + if d == nil { + return "", errors.New("version is nil") } return d.State, nil }, - ActiveState: []string{VERSIONSTATE_ACTIVE}, - ErrorState: []string{VERSIONSTATE_DESTROYED, VERSIONSTATE_KEY_MATERIAL_INVALID, VERSIONSTATE_DISABLED, VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE}, + ActiveState: []kms.VersionState{kms.VERSIONSTATE_ACTIVE}, + ErrorState: []kms.VersionState{ + kms.VERSIONSTATE_DESTROYED, + kms.VERSIONSTATE_KEY_MATERIAL_INVALID, + kms.VERSIONSTATE_DISABLED, + kms.VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE, + }, } handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } -func DisableKeyVersionWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId, region, keyRingId, keyId string, version int64) *wait.AsyncActionHandler[kms.Version] { - waitConfig := wait.WaiterHelper[kms.Version, string]{ +func DisableKeyVersionWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId string, region kms.ListKeyRingsRegionIdParameter, keyRingId, keyId string, version int64) *wait.AsyncActionHandler[kms.Version] { + waitConfig := wait.WaiterHelper[kms.Version, kms.VersionState]{ FetchInstance: client.GetVersion(ctx, projectId, region, keyRingId, keyId, version).Execute, - GetState: func(d *kms.Version) (string, error) { - if d == nil || d.State == "" { - return "", errors.New("version or state is nil") + GetState: func(d *kms.Version) (kms.VersionState, error) { + if d == nil { + return "", errors.New("version is nil") } return d.State, nil }, - ActiveState: []string{VERSIONSTATE_DISABLED}, - ErrorState: []string{VERSIONSTATE_DESTROYED, VERSIONSTATE_KEY_MATERIAL_INVALID}, + ActiveState: []kms.VersionState{kms.VERSIONSTATE_DISABLED}, + ErrorState: []kms.VersionState{ + kms.VERSIONSTATE_DESTROYED, + kms.VERSIONSTATE_KEY_MATERIAL_INVALID, + }, } handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) return handler } -func CreateWrappingKeyWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId, region, keyRingId, wrappingKeyId string) *wait.AsyncActionHandler[kms.WrappingKey] { - waitConfig := wait.WaiterHelper[kms.WrappingKey, string]{ +func CreateWrappingKeyWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId string, region kms.ListKeyRingsRegionIdParameter, keyRingId, wrappingKeyId string) *wait.AsyncActionHandler[kms.WrappingKey] { + waitConfig := wait.WaiterHelper[kms.WrappingKey, kms.WrappingKeyState]{ FetchInstance: client.GetWrappingKey(ctx, projectId, region, keyRingId, wrappingKeyId).Execute, - GetState: func(d *kms.WrappingKey) (string, error) { - if d == nil || d.State == "" { - return "", errors.New("wrappingkey or state is nil") + GetState: func(d *kms.WrappingKey) (kms.WrappingKeyState, error) { + if d == nil { + return "", errors.New("wrappingkey is nil") } return d.State, nil }, - ActiveState: []string{WRAPPINGKEYSTATE_ACTIVE, WRAPPINGKEYSTATE_DELETED}, + ActiveState: []kms.WrappingKeyState{kms.WRAPPINGKEYSTATE_ACTIVE, kms.WRAPPINGKEYSTATE_DELETED}, } handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) diff --git a/services/kms/v1api/wait/wait_test.go b/services/kms/v1api/wait/wait_test.go index 38a7f310f..dc15848b8 100644 --- a/services/kms/v1api/wait/wait_test.go +++ b/services/kms/v1api/wait/wait_test.go @@ -17,7 +17,7 @@ import ( ) const ( - testRegion = "eu01" + testRegion = kms.LISTKEYRINGSREGIONIDPARAMETER_EU01 testPublicKey = "i am an invalid public key" ) @@ -88,7 +88,7 @@ func newAPIMock(settings *mockSettings) kms.DefaultAPI { } } -func fixtureKey(state string) *kms.Key { +func fixtureKey(state kms.KeyState) *kms.Key { return &kms.Key{ Algorithm: kms.ALGORITHM_AES_256_GCM, CreatedAt: testDate, @@ -103,7 +103,7 @@ func fixtureKey(state string) *kms.Key { } } -func fixtureKeyRing(state string) *kms.KeyRing { +func fixtureKeyRing(state kms.KeyRingState) *kms.KeyRing { return &kms.KeyRing{ CreatedAt: testDate, Description: utils.Ptr("test-description"), @@ -113,7 +113,7 @@ func fixtureKeyRing(state string) *kms.KeyRing { } } -func fixtureWrappingKey(state string) *kms.WrappingKey { +func fixtureWrappingKey(state kms.WrappingKeyState) *kms.WrappingKey { return &kms.WrappingKey{ Algorithm: kms.WRAPPINGALGORITHM_RSA_2048_OAEP_SHA256, CreatedAt: testDate, @@ -128,7 +128,7 @@ func fixtureWrappingKey(state string) *kms.WrappingKey { } } -func fixtureVersion(version int, disabled bool, state string) *kms.Version { +func fixtureVersion(version int, disabled bool, state kms.VersionState) *kms.Version { return &kms.Version{ CreatedAt: testDate, DestroyDate: &testDate, @@ -151,37 +151,37 @@ func TestCreateKeyRingWaitHandler(t *testing.T) { { name: "create succeeded immediately", responses: []keyRingResponse{ - {fixtureKeyRing(KEYRINGSTATE_ACTIVE), nil}, + {fixtureKeyRing(kms.KEYRINGSTATE_ACTIVE), nil}, }, - want: fixtureKeyRing(KEYRINGSTATE_ACTIVE), + want: fixtureKeyRing(kms.KEYRINGSTATE_ACTIVE), wantErr: false, }, { name: "create succeeded delayed", responses: []keyRingResponse{ - {fixtureKeyRing(KEYRINGSTATE_CREATING), nil}, - {fixtureKeyRing(KEYRINGSTATE_CREATING), nil}, - {fixtureKeyRing(KEYRINGSTATE_CREATING), nil}, - {fixtureKeyRing(KEYRINGSTATE_ACTIVE), nil}, + {fixtureKeyRing(kms.KEYRINGSTATE_CREATING), nil}, + {fixtureKeyRing(kms.KEYRINGSTATE_CREATING), nil}, + {fixtureKeyRing(kms.KEYRINGSTATE_CREATING), nil}, + {fixtureKeyRing(kms.KEYRINGSTATE_ACTIVE), nil}, }, - want: fixtureKeyRing(KEYRINGSTATE_ACTIVE), + want: fixtureKeyRing(kms.KEYRINGSTATE_ACTIVE), wantErr: false, }, { name: "create failed delayed", responses: []keyRingResponse{ - {fixtureKeyRing(KEYRINGSTATE_CREATING), nil}, - {fixtureKeyRing(KEYRINGSTATE_CREATING), nil}, - {fixtureKeyRing(KEYRINGSTATE_CREATING), nil}, - {fixtureKeyRing(KEYRINGSTATE_DELETED), nil}, + {fixtureKeyRing(kms.KEYRINGSTATE_CREATING), nil}, + {fixtureKeyRing(kms.KEYRINGSTATE_CREATING), nil}, + {fixtureKeyRing(kms.KEYRINGSTATE_CREATING), nil}, + {fixtureKeyRing(kms.KEYRINGSTATE_DELETED), nil}, }, - want: fixtureKeyRing(KEYRINGSTATE_DELETED), + want: fixtureKeyRing(kms.KEYRINGSTATE_DELETED), wantErr: false, }, { name: "timeout", responses: []keyRingResponse{ - {fixtureKeyRing(KEYRINGSTATE_CREATING), nil}, + {fixtureKeyRing(kms.KEYRINGSTATE_CREATING), nil}, }, want: nil, wantErr: true, @@ -189,7 +189,7 @@ func TestCreateKeyRingWaitHandler(t *testing.T) { { name: "broken state", responses: []keyRingResponse{ - {fixtureKeyRing("bogus"), nil}, + {fixtureKeyRing(kms.KeyRingState("bogus")), nil}, }, want: nil, wantErr: true, @@ -227,37 +227,37 @@ func TestCreateOrUpdateKeyWaitHandler(t *testing.T) { { "create succeeded immediately", []keyResponse{ - {fixtureKey(KEYSTATE_ACTIVE), nil}, + {fixtureKey(kms.KEYSTATE_ACTIVE), nil}, }, - fixtureKey(KEYSTATE_ACTIVE), + fixtureKey(kms.KEYSTATE_ACTIVE), false, }, { "create succeeded delayed", []keyResponse{ - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_ACTIVE), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_ACTIVE), nil}, }, - fixtureKey(KEYSTATE_ACTIVE), + fixtureKey(kms.KEYSTATE_ACTIVE), false, }, { "create failed delayed", []keyResponse{ - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_DELETED), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_DELETED), nil}, }, - fixtureKey(KEYSTATE_DELETED), + fixtureKey(kms.KEYSTATE_DELETED), false, }, { "timeout", []keyResponse{ - {fixtureKey(KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, }, nil, true, @@ -265,7 +265,7 @@ func TestCreateOrUpdateKeyWaitHandler(t *testing.T) { { "broken state", []keyResponse{ - {fixtureKey("bogus"), nil}, + {fixtureKey(kms.KeyState("bogus")), nil}, }, nil, true, @@ -311,9 +311,9 @@ func TestDeleteKeyWaitHandler(t *testing.T) { { "Delete with '404' delayed", []keyResponse{ - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, {nil, oapierror.NewError(http.StatusNotFound, "not found")}, }, false, @@ -328,9 +328,9 @@ func TestDeleteKeyWaitHandler(t *testing.T) { { "Delete with 'gone' delayed", []keyResponse{ - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, {nil, oapierror.NewError(http.StatusGone, "not found")}, }, false, @@ -338,21 +338,21 @@ func TestDeleteKeyWaitHandler(t *testing.T) { { "Delete with error delayed", []keyResponse{ - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_DELETED), oapierror.NewError(http.StatusInternalServerError, "kapow")}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_DELETED), oapierror.NewError(http.StatusInternalServerError, "kapow")}, }, true, }, { "Cannot delete", []keyResponse{ - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_CREATING), nil}, - {fixtureKey(KEYSTATE_DELETED), oapierror.NewError(http.StatusOK, "ok")}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_CREATING), nil}, + {fixtureKey(kms.KEYSTATE_DELETED), oapierror.NewError(http.StatusOK, "ok")}, }, true, }, @@ -392,37 +392,37 @@ func TestEnableKeyVersionWaitHandler(t *testing.T) { { "create succeeded immediately", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_ACTIVE), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_ACTIVE), nil}, }, - fixtureVersion(1, false, VERSIONSTATE_ACTIVE), + fixtureVersion(1, false, kms.VERSIONSTATE_ACTIVE), false, }, { "create succeeded delayed", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_CREATING), nil}, - {fixtureVersion(1, false, VERSIONSTATE_CREATING), nil}, - {fixtureVersion(1, false, VERSIONSTATE_CREATING), nil}, - {fixtureVersion(1, false, VERSIONSTATE_ACTIVE), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_CREATING), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_CREATING), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_CREATING), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_ACTIVE), nil}, }, - fixtureVersion(1, false, VERSIONSTATE_ACTIVE), + fixtureVersion(1, false, kms.VERSIONSTATE_ACTIVE), false, }, { "create failed with invalid key material", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_CREATING), nil}, - {fixtureVersion(1, false, VERSIONSTATE_CREATING), nil}, - {fixtureVersion(1, false, VERSIONSTATE_CREATING), nil}, - {fixtureVersion(1, false, VERSIONSTATE_KEY_MATERIAL_INVALID), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_CREATING), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_CREATING), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_CREATING), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_KEY_MATERIAL_INVALID), nil}, }, - fixtureVersion(1, false, VERSIONSTATE_KEY_MATERIAL_INVALID), + fixtureVersion(1, false, kms.VERSIONSTATE_KEY_MATERIAL_INVALID), true, }, { "timeout", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_CREATING), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_CREATING), nil}, }, nil, true, @@ -430,7 +430,7 @@ func TestEnableKeyVersionWaitHandler(t *testing.T) { { "broken state", []versionResponse{ - {fixtureVersion(1, false, "bogus"), nil}, + {fixtureVersion(1, false, kms.VersionState("bogus")), nil}, }, nil, true, @@ -438,25 +438,25 @@ func TestEnableKeyVersionWaitHandler(t *testing.T) { { "version destroyed", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_DESTROYED), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_DESTROYED), nil}, }, - fixtureVersion(1, false, VERSIONSTATE_DESTROYED), + fixtureVersion(1, false, kms.VERSIONSTATE_DESTROYED), true, }, { "version disabled - unexpected state", []versionResponse{ - {fixtureVersion(1, true, VERSIONSTATE_DISABLED), nil}, + {fixtureVersion(1, true, kms.VERSIONSTATE_DISABLED), nil}, }, - fixtureVersion(1, true, VERSIONSTATE_DISABLED), + fixtureVersion(1, true, kms.VERSIONSTATE_DISABLED), true, }, { "version key material unavailable - unexpected state", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE), nil}, }, - fixtureVersion(1, false, VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE), + fixtureVersion(1, false, kms.VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE), true, }, { @@ -518,52 +518,52 @@ func TestDisableKeyVersionWaitHandler(t *testing.T) { { "disable succeeded immediately", []versionResponse{ - {fixtureVersion(1, true, VERSIONSTATE_DISABLED), nil}, + {fixtureVersion(1, true, kms.VERSIONSTATE_DISABLED), nil}, }, - fixtureVersion(1, true, VERSIONSTATE_DISABLED), + fixtureVersion(1, true, kms.VERSIONSTATE_DISABLED), false, }, { "disable succeeded delayed", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_ACTIVE), nil}, - {fixtureVersion(1, false, VERSIONSTATE_ACTIVE), nil}, - {fixtureVersion(1, false, VERSIONSTATE_ACTIVE), nil}, - {fixtureVersion(1, true, VERSIONSTATE_DISABLED), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_ACTIVE), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_ACTIVE), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_ACTIVE), nil}, + {fixtureVersion(1, true, kms.VERSIONSTATE_DISABLED), nil}, }, - fixtureVersion(1, true, VERSIONSTATE_DISABLED), + fixtureVersion(1, true, kms.VERSIONSTATE_DISABLED), false, }, { "disable succeeded from creating state", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_CREATING), nil}, - {fixtureVersion(1, false, VERSIONSTATE_CREATING), nil}, - {fixtureVersion(1, true, VERSIONSTATE_DISABLED), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_CREATING), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_CREATING), nil}, + {fixtureVersion(1, true, kms.VERSIONSTATE_DISABLED), nil}, }, - fixtureVersion(1, true, VERSIONSTATE_DISABLED), + fixtureVersion(1, true, kms.VERSIONSTATE_DISABLED), false, }, { "version already destroyed", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_DESTROYED), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_DESTROYED), nil}, }, - fixtureVersion(1, false, VERSIONSTATE_DESTROYED), + fixtureVersion(1, false, kms.VERSIONSTATE_DESTROYED), true, }, { "version key material invalid", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_KEY_MATERIAL_INVALID), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_KEY_MATERIAL_INVALID), nil}, }, - fixtureVersion(1, false, VERSIONSTATE_KEY_MATERIAL_INVALID), + fixtureVersion(1, false, kms.VERSIONSTATE_KEY_MATERIAL_INVALID), true, }, { "timeout waiting for disabled state", []versionResponse{ - {fixtureVersion(1, false, VERSIONSTATE_ACTIVE), nil}, + {fixtureVersion(1, false, kms.VERSIONSTATE_ACTIVE), nil}, }, nil, true, @@ -626,37 +626,37 @@ func TestCreateWrappingWaitHandler(t *testing.T) { { "create succeeded immediately", []wrappingKeyResponse{ - {fixtureWrappingKey(WRAPPINGKEYSTATE_ACTIVE), nil}, + {fixtureWrappingKey(kms.WRAPPINGKEYSTATE_ACTIVE), nil}, }, - fixtureWrappingKey(WRAPPINGKEYSTATE_ACTIVE), + fixtureWrappingKey(kms.WRAPPINGKEYSTATE_ACTIVE), false, }, { "create succeeded delayed", []wrappingKeyResponse{ - {fixtureWrappingKey(WRAPPINGKEYSTATE_CREATING), nil}, - {fixtureWrappingKey(WRAPPINGKEYSTATE_CREATING), nil}, - {fixtureWrappingKey(WRAPPINGKEYSTATE_CREATING), nil}, - {fixtureWrappingKey(WRAPPINGKEYSTATE_ACTIVE), nil}, + {fixtureWrappingKey(kms.WRAPPINGKEYSTATE_CREATING), nil}, + {fixtureWrappingKey(kms.WRAPPINGKEYSTATE_CREATING), nil}, + {fixtureWrappingKey(kms.WRAPPINGKEYSTATE_CREATING), nil}, + {fixtureWrappingKey(kms.WRAPPINGKEYSTATE_ACTIVE), nil}, }, - fixtureWrappingKey(WRAPPINGKEYSTATE_ACTIVE), + fixtureWrappingKey(kms.WRAPPINGKEYSTATE_ACTIVE), false, }, { "create failed delayed", []wrappingKeyResponse{ - {fixtureWrappingKey(WRAPPINGKEYSTATE_CREATING), nil}, - {fixtureWrappingKey(WRAPPINGKEYSTATE_CREATING), nil}, - {fixtureWrappingKey(WRAPPINGKEYSTATE_CREATING), nil}, - {fixtureWrappingKey(WRAPPINGKEYSTATE_DELETED), nil}, + {fixtureWrappingKey(kms.WRAPPINGKEYSTATE_CREATING), nil}, + {fixtureWrappingKey(kms.WRAPPINGKEYSTATE_CREATING), nil}, + {fixtureWrappingKey(kms.WRAPPINGKEYSTATE_CREATING), nil}, + {fixtureWrappingKey(kms.WRAPPINGKEYSTATE_DELETED), nil}, }, - fixtureWrappingKey(WRAPPINGKEYSTATE_DELETED), + fixtureWrappingKey(kms.WRAPPINGKEYSTATE_DELETED), false, }, { "timeout", []wrappingKeyResponse{ - {fixtureWrappingKey(WRAPPINGKEYSTATE_CREATING), nil}, + {fixtureWrappingKey(kms.WRAPPINGKEYSTATE_CREATING), nil}, }, nil, true, @@ -664,7 +664,7 @@ func TestCreateWrappingWaitHandler(t *testing.T) { { "broken state", []wrappingKeyResponse{ - {fixtureWrappingKey("bogus"), nil}, + {fixtureWrappingKey(kms.WrappingKeyState("bogus")), nil}, }, nil, true, From f52fc23057a0cfb5c2099e0a13760b74b728f9ca Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 15:54:32 +0200 Subject: [PATCH 17/66] refac(loadbalancer): introduce inline enums --- .../model_create_load_balancer_payload.go | 14 +- ...del_create_load_balancer_payload_status.go | 119 ++++++++++++++++ .../model_get_service_status_response.go | 13 +- ...odel_get_service_status_response_status.go | 123 +++++++++++++++++ services/loadbalancer/v1api/model_listener.go | 15 +- .../v1api/model_listener_protocol.go | 119 ++++++++++++++++ .../loadbalancer/v1api/model_load_balancer.go | 14 +- .../v1api/model_load_balancer_error.go | 15 +- .../v1api/model_load_balancer_error_type.go | 129 ++++++++++++++++++ .../v1api/model_load_balancer_status.go | 119 ++++++++++++++++ services/loadbalancer/v1api/model_network.go | 15 +- .../loadbalancer/v1api/model_network_role.go | 117 ++++++++++++++++ .../model_update_load_balancer_payload.go | 14 +- ...del_update_load_balancer_payload_status.go | 119 ++++++++++++++++ .../model_create_load_balancer_payload.go | 14 +- ...del_create_load_balancer_payload_status.go | 119 ++++++++++++++++ services/loadbalancer/v2api/model_listener.go | 15 +- .../v2api/model_listener_protocol.go | 119 ++++++++++++++++ .../loadbalancer/v2api/model_load_balancer.go | 14 +- .../v2api/model_load_balancer_error.go | 15 +- .../v2api/model_load_balancer_error_type.go | 129 ++++++++++++++++++ .../v2api/model_load_balancer_status.go | 119 ++++++++++++++++ services/loadbalancer/v2api/model_network.go | 15 +- .../loadbalancer/v2api/model_network_role.go | 117 ++++++++++++++++ .../model_update_load_balancer_payload.go | 14 +- ...del_update_load_balancer_payload_status.go | 119 ++++++++++++++++ 26 files changed, 1657 insertions(+), 97 deletions(-) create mode 100644 services/loadbalancer/v1api/model_create_load_balancer_payload_status.go create mode 100644 services/loadbalancer/v1api/model_get_service_status_response_status.go create mode 100644 services/loadbalancer/v1api/model_listener_protocol.go create mode 100644 services/loadbalancer/v1api/model_load_balancer_error_type.go create mode 100644 services/loadbalancer/v1api/model_load_balancer_status.go create mode 100644 services/loadbalancer/v1api/model_network_role.go create mode 100644 services/loadbalancer/v1api/model_update_load_balancer_payload_status.go create mode 100644 services/loadbalancer/v2api/model_create_load_balancer_payload_status.go create mode 100644 services/loadbalancer/v2api/model_listener_protocol.go create mode 100644 services/loadbalancer/v2api/model_load_balancer_error_type.go create mode 100644 services/loadbalancer/v2api/model_load_balancer_status.go create mode 100644 services/loadbalancer/v2api/model_network_role.go create mode 100644 services/loadbalancer/v2api/model_update_load_balancer_payload_status.go diff --git a/services/loadbalancer/v1api/model_create_load_balancer_payload.go b/services/loadbalancer/v1api/model_create_load_balancer_payload.go index 025e618f8..0e6fb46e4 100644 --- a/services/loadbalancer/v1api/model_create_load_balancer_payload.go +++ b/services/loadbalancer/v1api/model_create_load_balancer_payload.go @@ -33,8 +33,8 @@ type CreateLoadBalancerPayload struct { // Service Plan configures the size of the Load Balancer. Currently supported plans are p10, p50, p250 and p750. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum. PlanId *string `json:"planId,omitempty"` // Transient private load balancer IP address that can change any time. - PrivateAddress *string `json:"privateAddress,omitempty"` - Status *string `json:"status,omitempty"` + PrivateAddress *string `json:"privateAddress,omitempty"` + Status *CreateLoadBalancerPayloadStatus `json:"status,omitempty"` // List of all target pools which will be used in the load balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. @@ -318,9 +318,9 @@ func (o *CreateLoadBalancerPayload) SetPrivateAddress(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateLoadBalancerPayload) GetStatus() string { +func (o *CreateLoadBalancerPayload) GetStatus() CreateLoadBalancerPayloadStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CreateLoadBalancerPayloadStatus return ret } return *o.Status @@ -328,7 +328,7 @@ func (o *CreateLoadBalancerPayload) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateLoadBalancerPayload) GetStatusOk() (*string, bool) { +func (o *CreateLoadBalancerPayload) GetStatusOk() (*CreateLoadBalancerPayloadStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -344,8 +344,8 @@ func (o *CreateLoadBalancerPayload) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateLoadBalancerPayload) SetStatus(v string) { +// SetStatus gets a reference to the given CreateLoadBalancerPayloadStatus and assigns it to the Status field. +func (o *CreateLoadBalancerPayload) SetStatus(v CreateLoadBalancerPayloadStatus) { o.Status = &v } diff --git a/services/loadbalancer/v1api/model_create_load_balancer_payload_status.go b/services/loadbalancer/v1api/model_create_load_balancer_payload_status.go new file mode 100644 index 000000000..3b5dcc059 --- /dev/null +++ b/services/loadbalancer/v1api/model_create_load_balancer_payload_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Network Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CreateLoadBalancerPayloadStatus the model 'CreateLoadBalancerPayloadStatus' +type CreateLoadBalancerPayloadStatus string + +// List of CreateLoadBalancerPayload_status +const ( + CREATELOADBALANCERPAYLOADSTATUS_STATUS_UNSPECIFIED CreateLoadBalancerPayloadStatus = "STATUS_UNSPECIFIED" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_PENDING CreateLoadBalancerPayloadStatus = "STATUS_PENDING" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_READY CreateLoadBalancerPayloadStatus = "STATUS_READY" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_ERROR CreateLoadBalancerPayloadStatus = "STATUS_ERROR" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_TERMINATING CreateLoadBalancerPayloadStatus = "STATUS_TERMINATING" + CREATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API CreateLoadBalancerPayloadStatus = "unknown_default_open_api" +) + +// All allowed values of CreateLoadBalancerPayloadStatus enum +var AllowedCreateLoadBalancerPayloadStatusEnumValues = []CreateLoadBalancerPayloadStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *CreateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateLoadBalancerPayloadStatus(value) + for _, existing := range AllowedCreateLoadBalancerPayloadStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateLoadBalancerPayloadStatusFromValue returns a pointer to a valid CreateLoadBalancerPayloadStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateLoadBalancerPayloadStatusFromValue(v string) (*CreateLoadBalancerPayloadStatus, error) { + ev := CreateLoadBalancerPayloadStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateLoadBalancerPayloadStatus: valid values are %v", v, AllowedCreateLoadBalancerPayloadStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateLoadBalancerPayloadStatus) IsValid() bool { + for _, existing := range AllowedCreateLoadBalancerPayloadStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateLoadBalancerPayload_status value +func (v CreateLoadBalancerPayloadStatus) Ptr() *CreateLoadBalancerPayloadStatus { + return &v +} + +type NullableCreateLoadBalancerPayloadStatus struct { + value *CreateLoadBalancerPayloadStatus + isSet bool +} + +func (v NullableCreateLoadBalancerPayloadStatus) Get() *CreateLoadBalancerPayloadStatus { + return v.value +} + +func (v *NullableCreateLoadBalancerPayloadStatus) Set(val *CreateLoadBalancerPayloadStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCreateLoadBalancerPayloadStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateLoadBalancerPayloadStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateLoadBalancerPayloadStatus(val *CreateLoadBalancerPayloadStatus) *NullableCreateLoadBalancerPayloadStatus { + return &NullableCreateLoadBalancerPayloadStatus{value: val, isSet: true} +} + +func (v NullableCreateLoadBalancerPayloadStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v1api/model_get_service_status_response.go b/services/loadbalancer/v1api/model_get_service_status_response.go index 2d5139928..35ce8df3c 100644 --- a/services/loadbalancer/v1api/model_get_service_status_response.go +++ b/services/loadbalancer/v1api/model_get_service_status_response.go @@ -19,8 +19,7 @@ var _ MappedNullable = &GetServiceStatusResponse{} // GetServiceStatusResponse Response with customer project status. type GetServiceStatusResponse struct { - // status of the project - Status *string `json:"status,omitempty"` + Status *GetServiceStatusResponseStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,9 +43,9 @@ func NewGetServiceStatusResponseWithDefaults() *GetServiceStatusResponse { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *GetServiceStatusResponse) GetStatus() string { +func (o *GetServiceStatusResponse) GetStatus() GetServiceStatusResponseStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret GetServiceStatusResponseStatus return ret } return *o.Status @@ -54,7 +53,7 @@ func (o *GetServiceStatusResponse) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetServiceStatusResponse) GetStatusOk() (*string, bool) { +func (o *GetServiceStatusResponse) GetStatusOk() (*GetServiceStatusResponseStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -70,8 +69,8 @@ func (o *GetServiceStatusResponse) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *GetServiceStatusResponse) SetStatus(v string) { +// SetStatus gets a reference to the given GetServiceStatusResponseStatus and assigns it to the Status field. +func (o *GetServiceStatusResponse) SetStatus(v GetServiceStatusResponseStatus) { o.Status = &v } diff --git a/services/loadbalancer/v1api/model_get_service_status_response_status.go b/services/loadbalancer/v1api/model_get_service_status_response_status.go new file mode 100644 index 000000000..b70ef23dd --- /dev/null +++ b/services/loadbalancer/v1api/model_get_service_status_response_status.go @@ -0,0 +1,123 @@ +/* +STACKIT Network Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// GetServiceStatusResponseStatus status of the project +type GetServiceStatusResponseStatus string + +// List of GetServiceStatusResponse_status +const ( + GETSERVICESTATUSRESPONSESTATUS_STATUS_UNSPECIFIED GetServiceStatusResponseStatus = "STATUS_UNSPECIFIED" + GETSERVICESTATUSRESPONSESTATUS_STATUS_READY GetServiceStatusResponseStatus = "STATUS_READY" + GETSERVICESTATUSRESPONSESTATUS_STATUS_FAILED GetServiceStatusResponseStatus = "STATUS_FAILED" + GETSERVICESTATUSRESPONSESTATUS_STATUS_UPDATING GetServiceStatusResponseStatus = "STATUS_UPDATING" + GETSERVICESTATUSRESPONSESTATUS_STATUS_DELETING GetServiceStatusResponseStatus = "STATUS_DELETING" + GETSERVICESTATUSRESPONSESTATUS_STATUS_DISABLED GetServiceStatusResponseStatus = "STATUS_DISABLED" + GETSERVICESTATUSRESPONSESTATUS_STATUS_PROJECT_UNKNOWN GetServiceStatusResponseStatus = "STATUS_PROJECT_UNKNOWN" + GETSERVICESTATUSRESPONSESTATUS_UNKNOWN_DEFAULT_OPEN_API GetServiceStatusResponseStatus = "unknown_default_open_api" +) + +// All allowed values of GetServiceStatusResponseStatus enum +var AllowedGetServiceStatusResponseStatusEnumValues = []GetServiceStatusResponseStatus{ + "STATUS_UNSPECIFIED", + "STATUS_READY", + "STATUS_FAILED", + "STATUS_UPDATING", + "STATUS_DELETING", + "STATUS_DISABLED", + "STATUS_PROJECT_UNKNOWN", + "unknown_default_open_api", +} + +func (v *GetServiceStatusResponseStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetServiceStatusResponseStatus(value) + for _, existing := range AllowedGetServiceStatusResponseStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETSERVICESTATUSRESPONSESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetServiceStatusResponseStatusFromValue returns a pointer to a valid GetServiceStatusResponseStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetServiceStatusResponseStatusFromValue(v string) (*GetServiceStatusResponseStatus, error) { + ev := GetServiceStatusResponseStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetServiceStatusResponseStatus: valid values are %v", v, AllowedGetServiceStatusResponseStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetServiceStatusResponseStatus) IsValid() bool { + for _, existing := range AllowedGetServiceStatusResponseStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetServiceStatusResponse_status value +func (v GetServiceStatusResponseStatus) Ptr() *GetServiceStatusResponseStatus { + return &v +} + +type NullableGetServiceStatusResponseStatus struct { + value *GetServiceStatusResponseStatus + isSet bool +} + +func (v NullableGetServiceStatusResponseStatus) Get() *GetServiceStatusResponseStatus { + return v.value +} + +func (v *NullableGetServiceStatusResponseStatus) Set(val *GetServiceStatusResponseStatus) { + v.value = val + v.isSet = true +} + +func (v NullableGetServiceStatusResponseStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServiceStatusResponseStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServiceStatusResponseStatus(val *GetServiceStatusResponseStatus) *NullableGetServiceStatusResponseStatus { + return &NullableGetServiceStatusResponseStatus{value: val, isSet: true} +} + +func (v NullableGetServiceStatusResponseStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServiceStatusResponseStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v1api/model_listener.go b/services/loadbalancer/v1api/model_listener.go index 8860265d4..64b38553b 100644 --- a/services/loadbalancer/v1api/model_listener.go +++ b/services/loadbalancer/v1api/model_listener.go @@ -23,9 +23,8 @@ type Listener struct { // Will be used to reference a listener and will replace display name in the future. Currently uses - as the name if no display name is given. Name *string `json:"name,omitempty"` // Port number where we listen for traffic - Port *int32 `json:"port,omitempty"` - // Protocol is the highest network protocol we understand to load balance. Currently only PROTOCOL_TCP, PROTOCOL_TCP_PROXY and PROTOCOL_TLS_PASSTHROUGH are supported. - Protocol *string `json:"protocol,omitempty"` + Port *int32 `json:"port,omitempty"` + Protocol *ListenerProtocol `json:"protocol,omitempty"` // Server Name Idicators config for domains to be routed to the desired target pool for this listener. // Deprecated ServerNameIndicators []ServerNameIndicator `json:"serverNameIndicators,omitempty"` @@ -152,9 +151,9 @@ func (o *Listener) SetPort(v int32) { } // GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *Listener) GetProtocol() string { +func (o *Listener) GetProtocol() ListenerProtocol { if o == nil || IsNil(o.Protocol) { - var ret string + var ret ListenerProtocol return ret } return *o.Protocol @@ -162,7 +161,7 @@ func (o *Listener) GetProtocol() string { // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Listener) GetProtocolOk() (*string, bool) { +func (o *Listener) GetProtocolOk() (*ListenerProtocol, bool) { if o == nil || IsNil(o.Protocol) { return nil, false } @@ -178,8 +177,8 @@ func (o *Listener) HasProtocol() bool { return false } -// SetProtocol gets a reference to the given string and assigns it to the Protocol field. -func (o *Listener) SetProtocol(v string) { +// SetProtocol gets a reference to the given ListenerProtocol and assigns it to the Protocol field. +func (o *Listener) SetProtocol(v ListenerProtocol) { o.Protocol = &v } diff --git a/services/loadbalancer/v1api/model_listener_protocol.go b/services/loadbalancer/v1api/model_listener_protocol.go new file mode 100644 index 000000000..8942a3499 --- /dev/null +++ b/services/loadbalancer/v1api/model_listener_protocol.go @@ -0,0 +1,119 @@ +/* +STACKIT Network Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ListenerProtocol Protocol is the highest network protocol we understand to load balance. Currently only PROTOCOL_TCP, PROTOCOL_TCP_PROXY and PROTOCOL_TLS_PASSTHROUGH are supported. +type ListenerProtocol string + +// List of Listener_protocol +const ( + LISTENERPROTOCOL_PROTOCOL_UNSPECIFIED ListenerProtocol = "PROTOCOL_UNSPECIFIED" + LISTENERPROTOCOL_PROTOCOL_TCP ListenerProtocol = "PROTOCOL_TCP" + LISTENERPROTOCOL_PROTOCOL_UDP ListenerProtocol = "PROTOCOL_UDP" + LISTENERPROTOCOL_PROTOCOL_TCP_PROXY ListenerProtocol = "PROTOCOL_TCP_PROXY" + LISTENERPROTOCOL_PROTOCOL_TLS_PASSTHROUGH ListenerProtocol = "PROTOCOL_TLS_PASSTHROUGH" + LISTENERPROTOCOL_UNKNOWN_DEFAULT_OPEN_API ListenerProtocol = "unknown_default_open_api" +) + +// All allowed values of ListenerProtocol enum +var AllowedListenerProtocolEnumValues = []ListenerProtocol{ + "PROTOCOL_UNSPECIFIED", + "PROTOCOL_TCP", + "PROTOCOL_UDP", + "PROTOCOL_TCP_PROXY", + "PROTOCOL_TLS_PASSTHROUGH", + "unknown_default_open_api", +} + +func (v *ListenerProtocol) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListenerProtocol(value) + for _, existing := range AllowedListenerProtocolEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTENERPROTOCOL_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListenerProtocolFromValue returns a pointer to a valid ListenerProtocol +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListenerProtocolFromValue(v string) (*ListenerProtocol, error) { + ev := ListenerProtocol(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListenerProtocol: valid values are %v", v, AllowedListenerProtocolEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListenerProtocol) IsValid() bool { + for _, existing := range AllowedListenerProtocolEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Listener_protocol value +func (v ListenerProtocol) Ptr() *ListenerProtocol { + return &v +} + +type NullableListenerProtocol struct { + value *ListenerProtocol + isSet bool +} + +func (v NullableListenerProtocol) Get() *ListenerProtocol { + return v.value +} + +func (v *NullableListenerProtocol) Set(val *ListenerProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableListenerProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableListenerProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListenerProtocol(val *ListenerProtocol) *NullableListenerProtocol { + return &NullableListenerProtocol{value: val, isSet: true} +} + +func (v NullableListenerProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListenerProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v1api/model_load_balancer.go b/services/loadbalancer/v1api/model_load_balancer.go index 8494d1a3c..84aab6402 100644 --- a/services/loadbalancer/v1api/model_load_balancer.go +++ b/services/loadbalancer/v1api/model_load_balancer.go @@ -33,8 +33,8 @@ type LoadBalancer struct { // Service Plan configures the size of the Load Balancer. Currently supported plans are p10, p50, p250 and p750. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum. PlanId *string `json:"planId,omitempty"` // Transient private load balancer IP address that can change any time. - PrivateAddress *string `json:"privateAddress,omitempty"` - Status *string `json:"status,omitempty"` + PrivateAddress *string `json:"privateAddress,omitempty"` + Status *LoadBalancerStatus `json:"status,omitempty"` // List of all target pools which will be used in the load balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. @@ -318,9 +318,9 @@ func (o *LoadBalancer) SetPrivateAddress(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *LoadBalancer) GetStatus() string { +func (o *LoadBalancer) GetStatus() LoadBalancerStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret LoadBalancerStatus return ret } return *o.Status @@ -328,7 +328,7 @@ func (o *LoadBalancer) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LoadBalancer) GetStatusOk() (*string, bool) { +func (o *LoadBalancer) GetStatusOk() (*LoadBalancerStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -344,8 +344,8 @@ func (o *LoadBalancer) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *LoadBalancer) SetStatus(v string) { +// SetStatus gets a reference to the given LoadBalancerStatus and assigns it to the Status field. +func (o *LoadBalancer) SetStatus(v LoadBalancerStatus) { o.Status = &v } diff --git a/services/loadbalancer/v1api/model_load_balancer_error.go b/services/loadbalancer/v1api/model_load_balancer_error.go index f6250971e..563a795a1 100644 --- a/services/loadbalancer/v1api/model_load_balancer_error.go +++ b/services/loadbalancer/v1api/model_load_balancer_error.go @@ -20,9 +20,8 @@ var _ MappedNullable = &LoadBalancerError{} // LoadBalancerError struct for LoadBalancerError type LoadBalancerError struct { // The error description contains additional helpful user information to fix the error state of the load balancer. For example the IP 45.135.247.139 does not exist in the project, then the description will report: Floating IP \"45.135.247.139\" could not be found or if the IP was deleted then you will get a proper error message. - Description *string `json:"description,omitempty"` - // The error type specifies which part of the load balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the load balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error or TYPE_FIP_NOT_FOUND if the IP was deleted. - Type *string `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + Type *LoadBalancerErrorType `json:"type,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +77,9 @@ func (o *LoadBalancerError) SetDescription(v string) { } // GetType returns the Type field value if set, zero value otherwise. -func (o *LoadBalancerError) GetType() string { +func (o *LoadBalancerError) GetType() LoadBalancerErrorType { if o == nil || IsNil(o.Type) { - var ret string + var ret LoadBalancerErrorType return ret } return *o.Type @@ -88,7 +87,7 @@ func (o *LoadBalancerError) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LoadBalancerError) GetTypeOk() (*string, bool) { +func (o *LoadBalancerError) GetTypeOk() (*LoadBalancerErrorType, bool) { if o == nil || IsNil(o.Type) { return nil, false } @@ -104,8 +103,8 @@ func (o *LoadBalancerError) HasType() bool { return false } -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *LoadBalancerError) SetType(v string) { +// SetType gets a reference to the given LoadBalancerErrorType and assigns it to the Type field. +func (o *LoadBalancerError) SetType(v LoadBalancerErrorType) { o.Type = &v } diff --git a/services/loadbalancer/v1api/model_load_balancer_error_type.go b/services/loadbalancer/v1api/model_load_balancer_error_type.go new file mode 100644 index 000000000..f35133b02 --- /dev/null +++ b/services/loadbalancer/v1api/model_load_balancer_error_type.go @@ -0,0 +1,129 @@ +/* +STACKIT Network Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// LoadBalancerErrorType The error type specifies which part of the load balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the load balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error or TYPE_FIP_NOT_FOUND if the IP was deleted. +type LoadBalancerErrorType string + +// List of LoadBalancerError_type +const ( + LOADBALANCERERRORTYPE_TYPE_UNSPECIFIED LoadBalancerErrorType = "TYPE_UNSPECIFIED" + LOADBALANCERERRORTYPE_TYPE_INTERNAL LoadBalancerErrorType = "TYPE_INTERNAL" + LOADBALANCERERRORTYPE_TYPE_QUOTA_SECGROUP_EXCEEDED LoadBalancerErrorType = "TYPE_QUOTA_SECGROUP_EXCEEDED" + LOADBALANCERERRORTYPE_TYPE_QUOTA_SECGROUPRULE_EXCEEDED LoadBalancerErrorType = "TYPE_QUOTA_SECGROUPRULE_EXCEEDED" + LOADBALANCERERRORTYPE_TYPE_PORT_NOT_CONFIGURED LoadBalancerErrorType = "TYPE_PORT_NOT_CONFIGURED" + LOADBALANCERERRORTYPE_TYPE_FIP_NOT_CONFIGURED LoadBalancerErrorType = "TYPE_FIP_NOT_CONFIGURED" + LOADBALANCERERRORTYPE_TYPE_TARGET_NOT_ACTIVE LoadBalancerErrorType = "TYPE_TARGET_NOT_ACTIVE" + LOADBALANCERERRORTYPE_TYPE_METRICS_MISCONFIGURED LoadBalancerErrorType = "TYPE_METRICS_MISCONFIGURED" + LOADBALANCERERRORTYPE_TYPE_LOGS_MISCONFIGURED LoadBalancerErrorType = "TYPE_LOGS_MISCONFIGURED" + LOADBALANCERERRORTYPE_TYPE_FIP_NOT_FOUND LoadBalancerErrorType = "TYPE_FIP_NOT_FOUND" + LOADBALANCERERRORTYPE_UNKNOWN_DEFAULT_OPEN_API LoadBalancerErrorType = "unknown_default_open_api" +) + +// All allowed values of LoadBalancerErrorType enum +var AllowedLoadBalancerErrorTypeEnumValues = []LoadBalancerErrorType{ + "TYPE_UNSPECIFIED", + "TYPE_INTERNAL", + "TYPE_QUOTA_SECGROUP_EXCEEDED", + "TYPE_QUOTA_SECGROUPRULE_EXCEEDED", + "TYPE_PORT_NOT_CONFIGURED", + "TYPE_FIP_NOT_CONFIGURED", + "TYPE_TARGET_NOT_ACTIVE", + "TYPE_METRICS_MISCONFIGURED", + "TYPE_LOGS_MISCONFIGURED", + "TYPE_FIP_NOT_FOUND", + "unknown_default_open_api", +} + +func (v *LoadBalancerErrorType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LoadBalancerErrorType(value) + for _, existing := range AllowedLoadBalancerErrorTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOADBALANCERERRORTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLoadBalancerErrorTypeFromValue returns a pointer to a valid LoadBalancerErrorType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLoadBalancerErrorTypeFromValue(v string) (*LoadBalancerErrorType, error) { + ev := LoadBalancerErrorType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LoadBalancerErrorType: valid values are %v", v, AllowedLoadBalancerErrorTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LoadBalancerErrorType) IsValid() bool { + for _, existing := range AllowedLoadBalancerErrorTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LoadBalancerError_type value +func (v LoadBalancerErrorType) Ptr() *LoadBalancerErrorType { + return &v +} + +type NullableLoadBalancerErrorType struct { + value *LoadBalancerErrorType + isSet bool +} + +func (v NullableLoadBalancerErrorType) Get() *LoadBalancerErrorType { + return v.value +} + +func (v *NullableLoadBalancerErrorType) Set(val *LoadBalancerErrorType) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerErrorType) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerErrorType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerErrorType(val *LoadBalancerErrorType) *NullableLoadBalancerErrorType { + return &NullableLoadBalancerErrorType{value: val, isSet: true} +} + +func (v NullableLoadBalancerErrorType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerErrorType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v1api/model_load_balancer_status.go b/services/loadbalancer/v1api/model_load_balancer_status.go new file mode 100644 index 000000000..5b10265af --- /dev/null +++ b/services/loadbalancer/v1api/model_load_balancer_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Network Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// LoadBalancerStatus the model 'LoadBalancerStatus' +type LoadBalancerStatus string + +// List of LoadBalancer_status +const ( + LOADBALANCERSTATUS_STATUS_UNSPECIFIED LoadBalancerStatus = "STATUS_UNSPECIFIED" + LOADBALANCERSTATUS_STATUS_PENDING LoadBalancerStatus = "STATUS_PENDING" + LOADBALANCERSTATUS_STATUS_READY LoadBalancerStatus = "STATUS_READY" + LOADBALANCERSTATUS_STATUS_ERROR LoadBalancerStatus = "STATUS_ERROR" + LOADBALANCERSTATUS_STATUS_TERMINATING LoadBalancerStatus = "STATUS_TERMINATING" + LOADBALANCERSTATUS_UNKNOWN_DEFAULT_OPEN_API LoadBalancerStatus = "unknown_default_open_api" +) + +// All allowed values of LoadBalancerStatus enum +var AllowedLoadBalancerStatusEnumValues = []LoadBalancerStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *LoadBalancerStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LoadBalancerStatus(value) + for _, existing := range AllowedLoadBalancerStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOADBALANCERSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLoadBalancerStatusFromValue returns a pointer to a valid LoadBalancerStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLoadBalancerStatusFromValue(v string) (*LoadBalancerStatus, error) { + ev := LoadBalancerStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LoadBalancerStatus: valid values are %v", v, AllowedLoadBalancerStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LoadBalancerStatus) IsValid() bool { + for _, existing := range AllowedLoadBalancerStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LoadBalancer_status value +func (v LoadBalancerStatus) Ptr() *LoadBalancerStatus { + return &v +} + +type NullableLoadBalancerStatus struct { + value *LoadBalancerStatus + isSet bool +} + +func (v NullableLoadBalancerStatus) Get() *LoadBalancerStatus { + return v.value +} + +func (v *NullableLoadBalancerStatus) Set(val *LoadBalancerStatus) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerStatus(val *LoadBalancerStatus) *NullableLoadBalancerStatus { + return &NullableLoadBalancerStatus{value: val, isSet: true} +} + +func (v NullableLoadBalancerStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v1api/model_network.go b/services/loadbalancer/v1api/model_network.go index 6fb822328..8838a9130 100644 --- a/services/loadbalancer/v1api/model_network.go +++ b/services/loadbalancer/v1api/model_network.go @@ -20,9 +20,8 @@ var _ MappedNullable = &Network{} // Network struct for Network type Network struct { // Openstack network ID - NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` - // The role defines how the load balancer is using the network. Currently only ROLE_LISTENERS_AND_TARGETS is supported. - Role *string `json:"role,omitempty"` + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` + Role *NetworkRole `json:"role,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +77,9 @@ func (o *Network) SetNetworkId(v string) { } // GetRole returns the Role field value if set, zero value otherwise. -func (o *Network) GetRole() string { +func (o *Network) GetRole() NetworkRole { if o == nil || IsNil(o.Role) { - var ret string + var ret NetworkRole return ret } return *o.Role @@ -88,7 +87,7 @@ func (o *Network) GetRole() string { // GetRoleOk returns a tuple with the Role field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetRoleOk() (*string, bool) { +func (o *Network) GetRoleOk() (*NetworkRole, bool) { if o == nil || IsNil(o.Role) { return nil, false } @@ -104,8 +103,8 @@ func (o *Network) HasRole() bool { return false } -// SetRole gets a reference to the given string and assigns it to the Role field. -func (o *Network) SetRole(v string) { +// SetRole gets a reference to the given NetworkRole and assigns it to the Role field. +func (o *Network) SetRole(v NetworkRole) { o.Role = &v } diff --git a/services/loadbalancer/v1api/model_network_role.go b/services/loadbalancer/v1api/model_network_role.go new file mode 100644 index 000000000..31c1ec1f4 --- /dev/null +++ b/services/loadbalancer/v1api/model_network_role.go @@ -0,0 +1,117 @@ +/* +STACKIT Network Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// NetworkRole The role defines how the load balancer is using the network. Currently only ROLE_LISTENERS_AND_TARGETS is supported. +type NetworkRole string + +// List of Network_role +const ( + NETWORKROLE_ROLE_UNSPECIFIED NetworkRole = "ROLE_UNSPECIFIED" + NETWORKROLE_ROLE_LISTENERS_AND_TARGETS NetworkRole = "ROLE_LISTENERS_AND_TARGETS" + NETWORKROLE_ROLE_LISTENERS NetworkRole = "ROLE_LISTENERS" + NETWORKROLE_ROLE_TARGETS NetworkRole = "ROLE_TARGETS" + NETWORKROLE_UNKNOWN_DEFAULT_OPEN_API NetworkRole = "unknown_default_open_api" +) + +// All allowed values of NetworkRole enum +var AllowedNetworkRoleEnumValues = []NetworkRole{ + "ROLE_UNSPECIFIED", + "ROLE_LISTENERS_AND_TARGETS", + "ROLE_LISTENERS", + "ROLE_TARGETS", + "unknown_default_open_api", +} + +func (v *NetworkRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NetworkRole(value) + for _, existing := range AllowedNetworkRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = NETWORKROLE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewNetworkRoleFromValue returns a pointer to a valid NetworkRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewNetworkRoleFromValue(v string) (*NetworkRole, error) { + ev := NetworkRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for NetworkRole: valid values are %v", v, AllowedNetworkRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v NetworkRole) IsValid() bool { + for _, existing := range AllowedNetworkRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Network_role value +func (v NetworkRole) Ptr() *NetworkRole { + return &v +} + +type NullableNetworkRole struct { + value *NetworkRole + isSet bool +} + +func (v NullableNetworkRole) Get() *NetworkRole { + return v.value +} + +func (v *NullableNetworkRole) Set(val *NetworkRole) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRole) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRole(val *NetworkRole) *NullableNetworkRole { + return &NullableNetworkRole{value: val, isSet: true} +} + +func (v NullableNetworkRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v1api/model_update_load_balancer_payload.go b/services/loadbalancer/v1api/model_update_load_balancer_payload.go index e36843b80..0ea117ca6 100644 --- a/services/loadbalancer/v1api/model_update_load_balancer_payload.go +++ b/services/loadbalancer/v1api/model_update_load_balancer_payload.go @@ -33,8 +33,8 @@ type UpdateLoadBalancerPayload struct { // Service Plan configures the size of the Load Balancer. Currently supported plans are p10, p50, p250 and p750. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum. PlanId *string `json:"planId,omitempty"` // Transient private load balancer IP address that can change any time. - PrivateAddress *string `json:"privateAddress,omitempty"` - Status *string `json:"status,omitempty"` + PrivateAddress *string `json:"privateAddress,omitempty"` + Status *UpdateLoadBalancerPayloadStatus `json:"status,omitempty"` // List of all target pools which will be used in the load balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case. @@ -318,9 +318,9 @@ func (o *UpdateLoadBalancerPayload) SetPrivateAddress(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *UpdateLoadBalancerPayload) GetStatus() string { +func (o *UpdateLoadBalancerPayload) GetStatus() UpdateLoadBalancerPayloadStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret UpdateLoadBalancerPayloadStatus return ret } return *o.Status @@ -328,7 +328,7 @@ func (o *UpdateLoadBalancerPayload) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateLoadBalancerPayload) GetStatusOk() (*string, bool) { +func (o *UpdateLoadBalancerPayload) GetStatusOk() (*UpdateLoadBalancerPayloadStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -344,8 +344,8 @@ func (o *UpdateLoadBalancerPayload) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *UpdateLoadBalancerPayload) SetStatus(v string) { +// SetStatus gets a reference to the given UpdateLoadBalancerPayloadStatus and assigns it to the Status field. +func (o *UpdateLoadBalancerPayload) SetStatus(v UpdateLoadBalancerPayloadStatus) { o.Status = &v } diff --git a/services/loadbalancer/v1api/model_update_load_balancer_payload_status.go b/services/loadbalancer/v1api/model_update_load_balancer_payload_status.go new file mode 100644 index 000000000..87148ef57 --- /dev/null +++ b/services/loadbalancer/v1api/model_update_load_balancer_payload_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Network Load Balancer API + +### DEPRECATED! This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 1.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// UpdateLoadBalancerPayloadStatus the model 'UpdateLoadBalancerPayloadStatus' +type UpdateLoadBalancerPayloadStatus string + +// List of UpdateLoadBalancerPayload_status +const ( + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_UNSPECIFIED UpdateLoadBalancerPayloadStatus = "STATUS_UNSPECIFIED" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_PENDING UpdateLoadBalancerPayloadStatus = "STATUS_PENDING" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_READY UpdateLoadBalancerPayloadStatus = "STATUS_READY" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_ERROR UpdateLoadBalancerPayloadStatus = "STATUS_ERROR" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_TERMINATING UpdateLoadBalancerPayloadStatus = "STATUS_TERMINATING" + UPDATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API UpdateLoadBalancerPayloadStatus = "unknown_default_open_api" +) + +// All allowed values of UpdateLoadBalancerPayloadStatus enum +var AllowedUpdateLoadBalancerPayloadStatusEnumValues = []UpdateLoadBalancerPayloadStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *UpdateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateLoadBalancerPayloadStatus(value) + for _, existing := range AllowedUpdateLoadBalancerPayloadStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateLoadBalancerPayloadStatusFromValue returns a pointer to a valid UpdateLoadBalancerPayloadStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateLoadBalancerPayloadStatusFromValue(v string) (*UpdateLoadBalancerPayloadStatus, error) { + ev := UpdateLoadBalancerPayloadStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateLoadBalancerPayloadStatus: valid values are %v", v, AllowedUpdateLoadBalancerPayloadStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateLoadBalancerPayloadStatus) IsValid() bool { + for _, existing := range AllowedUpdateLoadBalancerPayloadStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateLoadBalancerPayload_status value +func (v UpdateLoadBalancerPayloadStatus) Ptr() *UpdateLoadBalancerPayloadStatus { + return &v +} + +type NullableUpdateLoadBalancerPayloadStatus struct { + value *UpdateLoadBalancerPayloadStatus + isSet bool +} + +func (v NullableUpdateLoadBalancerPayloadStatus) Get() *UpdateLoadBalancerPayloadStatus { + return v.value +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) Set(val *UpdateLoadBalancerPayloadStatus) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateLoadBalancerPayloadStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateLoadBalancerPayloadStatus(val *UpdateLoadBalancerPayloadStatus) *NullableUpdateLoadBalancerPayloadStatus { + return &NullableUpdateLoadBalancerPayloadStatus{value: val, isSet: true} +} + +func (v NullableUpdateLoadBalancerPayloadStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v2api/model_create_load_balancer_payload.go b/services/loadbalancer/v2api/model_create_load_balancer_payload.go index 2048f6e3d..dd42a55b9 100644 --- a/services/loadbalancer/v2api/model_create_load_balancer_payload.go +++ b/services/loadbalancer/v2api/model_create_load_balancer_payload.go @@ -41,8 +41,8 @@ type CreateLoadBalancerPayload struct { // Transient private load balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` // Region of the LoadBalancer - Region *string `json:"region,omitempty"` - Status *string `json:"status,omitempty"` + Region *string `json:"region,omitempty"` + Status *CreateLoadBalancerPayloadStatus `json:"status,omitempty"` // List of all target pools which will be used in the load balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets. @@ -456,9 +456,9 @@ func (o *CreateLoadBalancerPayload) SetRegion(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateLoadBalancerPayload) GetStatus() string { +func (o *CreateLoadBalancerPayload) GetStatus() CreateLoadBalancerPayloadStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CreateLoadBalancerPayloadStatus return ret } return *o.Status @@ -466,7 +466,7 @@ func (o *CreateLoadBalancerPayload) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateLoadBalancerPayload) GetStatusOk() (*string, bool) { +func (o *CreateLoadBalancerPayload) GetStatusOk() (*CreateLoadBalancerPayloadStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -482,8 +482,8 @@ func (o *CreateLoadBalancerPayload) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CreateLoadBalancerPayload) SetStatus(v string) { +// SetStatus gets a reference to the given CreateLoadBalancerPayloadStatus and assigns it to the Status field. +func (o *CreateLoadBalancerPayload) SetStatus(v CreateLoadBalancerPayloadStatus) { o.Status = &v } diff --git a/services/loadbalancer/v2api/model_create_load_balancer_payload_status.go b/services/loadbalancer/v2api/model_create_load_balancer_payload_status.go new file mode 100644 index 000000000..0c8a9ed60 --- /dev/null +++ b/services/loadbalancer/v2api/model_create_load_balancer_payload_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Network Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateLoadBalancerPayloadStatus the model 'CreateLoadBalancerPayloadStatus' +type CreateLoadBalancerPayloadStatus string + +// List of CreateLoadBalancerPayload_status +const ( + CREATELOADBALANCERPAYLOADSTATUS_STATUS_UNSPECIFIED CreateLoadBalancerPayloadStatus = "STATUS_UNSPECIFIED" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_PENDING CreateLoadBalancerPayloadStatus = "STATUS_PENDING" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_READY CreateLoadBalancerPayloadStatus = "STATUS_READY" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_ERROR CreateLoadBalancerPayloadStatus = "STATUS_ERROR" + CREATELOADBALANCERPAYLOADSTATUS_STATUS_TERMINATING CreateLoadBalancerPayloadStatus = "STATUS_TERMINATING" + CREATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API CreateLoadBalancerPayloadStatus = "unknown_default_open_api" +) + +// All allowed values of CreateLoadBalancerPayloadStatus enum +var AllowedCreateLoadBalancerPayloadStatusEnumValues = []CreateLoadBalancerPayloadStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *CreateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateLoadBalancerPayloadStatus(value) + for _, existing := range AllowedCreateLoadBalancerPayloadStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateLoadBalancerPayloadStatusFromValue returns a pointer to a valid CreateLoadBalancerPayloadStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateLoadBalancerPayloadStatusFromValue(v string) (*CreateLoadBalancerPayloadStatus, error) { + ev := CreateLoadBalancerPayloadStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateLoadBalancerPayloadStatus: valid values are %v", v, AllowedCreateLoadBalancerPayloadStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateLoadBalancerPayloadStatus) IsValid() bool { + for _, existing := range AllowedCreateLoadBalancerPayloadStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateLoadBalancerPayload_status value +func (v CreateLoadBalancerPayloadStatus) Ptr() *CreateLoadBalancerPayloadStatus { + return &v +} + +type NullableCreateLoadBalancerPayloadStatus struct { + value *CreateLoadBalancerPayloadStatus + isSet bool +} + +func (v NullableCreateLoadBalancerPayloadStatus) Get() *CreateLoadBalancerPayloadStatus { + return v.value +} + +func (v *NullableCreateLoadBalancerPayloadStatus) Set(val *CreateLoadBalancerPayloadStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCreateLoadBalancerPayloadStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateLoadBalancerPayloadStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateLoadBalancerPayloadStatus(val *CreateLoadBalancerPayloadStatus) *NullableCreateLoadBalancerPayloadStatus { + return &NullableCreateLoadBalancerPayloadStatus{value: val, isSet: true} +} + +func (v NullableCreateLoadBalancerPayloadStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v2api/model_listener.go b/services/loadbalancer/v2api/model_listener.go index e2d2e38d1..c81d1a9e4 100644 --- a/services/loadbalancer/v2api/model_listener.go +++ b/services/loadbalancer/v2api/model_listener.go @@ -23,9 +23,8 @@ type Listener struct { // Will be used to reference a listener and will replace display name in the future. Currently uses - as the name if no display name is given. Name *string `json:"name,omitempty"` // Port number where we listen for traffic - Port *int32 `json:"port,omitempty"` - // Protocol is the highest network protocol we understand to load balance. Currently only PROTOCOL_TCP, PROTOCOL_TCP_PROXY and PROTOCOL_TLS_PASSTHROUGH are supported. - Protocol *string `json:"protocol,omitempty"` + Port *int32 `json:"port,omitempty"` + Protocol *ListenerProtocol `json:"protocol,omitempty"` // Server Name Indicators config for domains to be routed to the desired target pool for this listener. // Deprecated ServerNameIndicators []ServerNameIndicator `json:"serverNameIndicators,omitempty"` @@ -152,9 +151,9 @@ func (o *Listener) SetPort(v int32) { } // GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *Listener) GetProtocol() string { +func (o *Listener) GetProtocol() ListenerProtocol { if o == nil || IsNil(o.Protocol) { - var ret string + var ret ListenerProtocol return ret } return *o.Protocol @@ -162,7 +161,7 @@ func (o *Listener) GetProtocol() string { // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Listener) GetProtocolOk() (*string, bool) { +func (o *Listener) GetProtocolOk() (*ListenerProtocol, bool) { if o == nil || IsNil(o.Protocol) { return nil, false } @@ -178,8 +177,8 @@ func (o *Listener) HasProtocol() bool { return false } -// SetProtocol gets a reference to the given string and assigns it to the Protocol field. -func (o *Listener) SetProtocol(v string) { +// SetProtocol gets a reference to the given ListenerProtocol and assigns it to the Protocol field. +func (o *Listener) SetProtocol(v ListenerProtocol) { o.Protocol = &v } diff --git a/services/loadbalancer/v2api/model_listener_protocol.go b/services/loadbalancer/v2api/model_listener_protocol.go new file mode 100644 index 000000000..4ff113a07 --- /dev/null +++ b/services/loadbalancer/v2api/model_listener_protocol.go @@ -0,0 +1,119 @@ +/* +STACKIT Network Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListenerProtocol Protocol is the highest network protocol we understand to load balance. Currently only PROTOCOL_TCP, PROTOCOL_TCP_PROXY and PROTOCOL_TLS_PASSTHROUGH are supported. +type ListenerProtocol string + +// List of Listener_protocol +const ( + LISTENERPROTOCOL_PROTOCOL_UNSPECIFIED ListenerProtocol = "PROTOCOL_UNSPECIFIED" + LISTENERPROTOCOL_PROTOCOL_TCP ListenerProtocol = "PROTOCOL_TCP" + LISTENERPROTOCOL_PROTOCOL_UDP ListenerProtocol = "PROTOCOL_UDP" + LISTENERPROTOCOL_PROTOCOL_TCP_PROXY ListenerProtocol = "PROTOCOL_TCP_PROXY" + LISTENERPROTOCOL_PROTOCOL_TLS_PASSTHROUGH ListenerProtocol = "PROTOCOL_TLS_PASSTHROUGH" + LISTENERPROTOCOL_UNKNOWN_DEFAULT_OPEN_API ListenerProtocol = "unknown_default_open_api" +) + +// All allowed values of ListenerProtocol enum +var AllowedListenerProtocolEnumValues = []ListenerProtocol{ + "PROTOCOL_UNSPECIFIED", + "PROTOCOL_TCP", + "PROTOCOL_UDP", + "PROTOCOL_TCP_PROXY", + "PROTOCOL_TLS_PASSTHROUGH", + "unknown_default_open_api", +} + +func (v *ListenerProtocol) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListenerProtocol(value) + for _, existing := range AllowedListenerProtocolEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTENERPROTOCOL_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListenerProtocolFromValue returns a pointer to a valid ListenerProtocol +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListenerProtocolFromValue(v string) (*ListenerProtocol, error) { + ev := ListenerProtocol(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListenerProtocol: valid values are %v", v, AllowedListenerProtocolEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListenerProtocol) IsValid() bool { + for _, existing := range AllowedListenerProtocolEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Listener_protocol value +func (v ListenerProtocol) Ptr() *ListenerProtocol { + return &v +} + +type NullableListenerProtocol struct { + value *ListenerProtocol + isSet bool +} + +func (v NullableListenerProtocol) Get() *ListenerProtocol { + return v.value +} + +func (v *NullableListenerProtocol) Set(val *ListenerProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableListenerProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableListenerProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListenerProtocol(val *ListenerProtocol) *NullableListenerProtocol { + return &NullableListenerProtocol{value: val, isSet: true} +} + +func (v NullableListenerProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListenerProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v2api/model_load_balancer.go b/services/loadbalancer/v2api/model_load_balancer.go index b605b3aaf..5857bad7b 100644 --- a/services/loadbalancer/v2api/model_load_balancer.go +++ b/services/loadbalancer/v2api/model_load_balancer.go @@ -41,8 +41,8 @@ type LoadBalancer struct { // Transient private load balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` // Region of the LoadBalancer - Region *string `json:"region,omitempty"` - Status *string `json:"status,omitempty"` + Region *string `json:"region,omitempty"` + Status *LoadBalancerStatus `json:"status,omitempty"` // List of all target pools which will be used in the load balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets. @@ -456,9 +456,9 @@ func (o *LoadBalancer) SetRegion(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *LoadBalancer) GetStatus() string { +func (o *LoadBalancer) GetStatus() LoadBalancerStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret LoadBalancerStatus return ret } return *o.Status @@ -466,7 +466,7 @@ func (o *LoadBalancer) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LoadBalancer) GetStatusOk() (*string, bool) { +func (o *LoadBalancer) GetStatusOk() (*LoadBalancerStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -482,8 +482,8 @@ func (o *LoadBalancer) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *LoadBalancer) SetStatus(v string) { +// SetStatus gets a reference to the given LoadBalancerStatus and assigns it to the Status field. +func (o *LoadBalancer) SetStatus(v LoadBalancerStatus) { o.Status = &v } diff --git a/services/loadbalancer/v2api/model_load_balancer_error.go b/services/loadbalancer/v2api/model_load_balancer_error.go index e816e6e98..409f57812 100644 --- a/services/loadbalancer/v2api/model_load_balancer_error.go +++ b/services/loadbalancer/v2api/model_load_balancer_error.go @@ -20,9 +20,8 @@ var _ MappedNullable = &LoadBalancerError{} // LoadBalancerError struct for LoadBalancerError type LoadBalancerError struct { // The error description contains additional helpful user information to fix the error state of the load balancer. For example the IP 45.135.247.139 does not exist in the project, then the description will report: Floating IP \"45.135.247.139\" could not be found or if the IP was deleted then you will get a proper error message. - Description *string `json:"description,omitempty"` - // The error type specifies which part of the load balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the load balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error or TYPE_FIP_NOT_FOUND if the IP was deleted. - Type *string `json:"type,omitempty"` + Description *string `json:"description,omitempty"` + Type *LoadBalancerErrorType `json:"type,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +77,9 @@ func (o *LoadBalancerError) SetDescription(v string) { } // GetType returns the Type field value if set, zero value otherwise. -func (o *LoadBalancerError) GetType() string { +func (o *LoadBalancerError) GetType() LoadBalancerErrorType { if o == nil || IsNil(o.Type) { - var ret string + var ret LoadBalancerErrorType return ret } return *o.Type @@ -88,7 +87,7 @@ func (o *LoadBalancerError) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LoadBalancerError) GetTypeOk() (*string, bool) { +func (o *LoadBalancerError) GetTypeOk() (*LoadBalancerErrorType, bool) { if o == nil || IsNil(o.Type) { return nil, false } @@ -104,8 +103,8 @@ func (o *LoadBalancerError) HasType() bool { return false } -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *LoadBalancerError) SetType(v string) { +// SetType gets a reference to the given LoadBalancerErrorType and assigns it to the Type field. +func (o *LoadBalancerError) SetType(v LoadBalancerErrorType) { o.Type = &v } diff --git a/services/loadbalancer/v2api/model_load_balancer_error_type.go b/services/loadbalancer/v2api/model_load_balancer_error_type.go new file mode 100644 index 000000000..2d24944b0 --- /dev/null +++ b/services/loadbalancer/v2api/model_load_balancer_error_type.go @@ -0,0 +1,129 @@ +/* +STACKIT Network Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// LoadBalancerErrorType The error type specifies which part of the load balancer encountered the error. I.e. the API will not check if a provided public IP is actually available in the project. Instead the load balancer with try to use the provided IP and if not available reports TYPE_FIP_NOT_CONFIGURED error or TYPE_FIP_NOT_FOUND if the IP was deleted. +type LoadBalancerErrorType string + +// List of LoadBalancerError_type +const ( + LOADBALANCERERRORTYPE_TYPE_UNSPECIFIED LoadBalancerErrorType = "TYPE_UNSPECIFIED" + LOADBALANCERERRORTYPE_TYPE_INTERNAL LoadBalancerErrorType = "TYPE_INTERNAL" + LOADBALANCERERRORTYPE_TYPE_QUOTA_SECGROUP_EXCEEDED LoadBalancerErrorType = "TYPE_QUOTA_SECGROUP_EXCEEDED" + LOADBALANCERERRORTYPE_TYPE_QUOTA_SECGROUPRULE_EXCEEDED LoadBalancerErrorType = "TYPE_QUOTA_SECGROUPRULE_EXCEEDED" + LOADBALANCERERRORTYPE_TYPE_PORT_NOT_CONFIGURED LoadBalancerErrorType = "TYPE_PORT_NOT_CONFIGURED" + LOADBALANCERERRORTYPE_TYPE_FIP_NOT_CONFIGURED LoadBalancerErrorType = "TYPE_FIP_NOT_CONFIGURED" + LOADBALANCERERRORTYPE_TYPE_TARGET_NOT_ACTIVE LoadBalancerErrorType = "TYPE_TARGET_NOT_ACTIVE" + LOADBALANCERERRORTYPE_TYPE_METRICS_MISCONFIGURED LoadBalancerErrorType = "TYPE_METRICS_MISCONFIGURED" + LOADBALANCERERRORTYPE_TYPE_LOGS_MISCONFIGURED LoadBalancerErrorType = "TYPE_LOGS_MISCONFIGURED" + LOADBALANCERERRORTYPE_TYPE_FIP_NOT_FOUND LoadBalancerErrorType = "TYPE_FIP_NOT_FOUND" + LOADBALANCERERRORTYPE_UNKNOWN_DEFAULT_OPEN_API LoadBalancerErrorType = "unknown_default_open_api" +) + +// All allowed values of LoadBalancerErrorType enum +var AllowedLoadBalancerErrorTypeEnumValues = []LoadBalancerErrorType{ + "TYPE_UNSPECIFIED", + "TYPE_INTERNAL", + "TYPE_QUOTA_SECGROUP_EXCEEDED", + "TYPE_QUOTA_SECGROUPRULE_EXCEEDED", + "TYPE_PORT_NOT_CONFIGURED", + "TYPE_FIP_NOT_CONFIGURED", + "TYPE_TARGET_NOT_ACTIVE", + "TYPE_METRICS_MISCONFIGURED", + "TYPE_LOGS_MISCONFIGURED", + "TYPE_FIP_NOT_FOUND", + "unknown_default_open_api", +} + +func (v *LoadBalancerErrorType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LoadBalancerErrorType(value) + for _, existing := range AllowedLoadBalancerErrorTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOADBALANCERERRORTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLoadBalancerErrorTypeFromValue returns a pointer to a valid LoadBalancerErrorType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLoadBalancerErrorTypeFromValue(v string) (*LoadBalancerErrorType, error) { + ev := LoadBalancerErrorType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LoadBalancerErrorType: valid values are %v", v, AllowedLoadBalancerErrorTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LoadBalancerErrorType) IsValid() bool { + for _, existing := range AllowedLoadBalancerErrorTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LoadBalancerError_type value +func (v LoadBalancerErrorType) Ptr() *LoadBalancerErrorType { + return &v +} + +type NullableLoadBalancerErrorType struct { + value *LoadBalancerErrorType + isSet bool +} + +func (v NullableLoadBalancerErrorType) Get() *LoadBalancerErrorType { + return v.value +} + +func (v *NullableLoadBalancerErrorType) Set(val *LoadBalancerErrorType) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerErrorType) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerErrorType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerErrorType(val *LoadBalancerErrorType) *NullableLoadBalancerErrorType { + return &NullableLoadBalancerErrorType{value: val, isSet: true} +} + +func (v NullableLoadBalancerErrorType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerErrorType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v2api/model_load_balancer_status.go b/services/loadbalancer/v2api/model_load_balancer_status.go new file mode 100644 index 000000000..c7855c6da --- /dev/null +++ b/services/loadbalancer/v2api/model_load_balancer_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Network Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// LoadBalancerStatus the model 'LoadBalancerStatus' +type LoadBalancerStatus string + +// List of LoadBalancer_status +const ( + LOADBALANCERSTATUS_STATUS_UNSPECIFIED LoadBalancerStatus = "STATUS_UNSPECIFIED" + LOADBALANCERSTATUS_STATUS_PENDING LoadBalancerStatus = "STATUS_PENDING" + LOADBALANCERSTATUS_STATUS_READY LoadBalancerStatus = "STATUS_READY" + LOADBALANCERSTATUS_STATUS_ERROR LoadBalancerStatus = "STATUS_ERROR" + LOADBALANCERSTATUS_STATUS_TERMINATING LoadBalancerStatus = "STATUS_TERMINATING" + LOADBALANCERSTATUS_UNKNOWN_DEFAULT_OPEN_API LoadBalancerStatus = "unknown_default_open_api" +) + +// All allowed values of LoadBalancerStatus enum +var AllowedLoadBalancerStatusEnumValues = []LoadBalancerStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *LoadBalancerStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LoadBalancerStatus(value) + for _, existing := range AllowedLoadBalancerStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOADBALANCERSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLoadBalancerStatusFromValue returns a pointer to a valid LoadBalancerStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLoadBalancerStatusFromValue(v string) (*LoadBalancerStatus, error) { + ev := LoadBalancerStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LoadBalancerStatus: valid values are %v", v, AllowedLoadBalancerStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LoadBalancerStatus) IsValid() bool { + for _, existing := range AllowedLoadBalancerStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LoadBalancer_status value +func (v LoadBalancerStatus) Ptr() *LoadBalancerStatus { + return &v +} + +type NullableLoadBalancerStatus struct { + value *LoadBalancerStatus + isSet bool +} + +func (v NullableLoadBalancerStatus) Get() *LoadBalancerStatus { + return v.value +} + +func (v *NullableLoadBalancerStatus) Set(val *LoadBalancerStatus) { + v.value = val + v.isSet = true +} + +func (v NullableLoadBalancerStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableLoadBalancerStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoadBalancerStatus(val *LoadBalancerStatus) *NullableLoadBalancerStatus { + return &NullableLoadBalancerStatus{value: val, isSet: true} +} + +func (v NullableLoadBalancerStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoadBalancerStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v2api/model_network.go b/services/loadbalancer/v2api/model_network.go index 69b326a9a..46c4598b1 100644 --- a/services/loadbalancer/v2api/model_network.go +++ b/services/loadbalancer/v2api/model_network.go @@ -20,9 +20,8 @@ var _ MappedNullable = &Network{} // Network struct for Network type Network struct { // Openstack network ID - NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` - // The role defines how the load balancer is using the network. Currently only ROLE_LISTENERS_AND_TARGETS is supported. - Role *string `json:"role,omitempty"` + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"` + Role *NetworkRole `json:"role,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +77,9 @@ func (o *Network) SetNetworkId(v string) { } // GetRole returns the Role field value if set, zero value otherwise. -func (o *Network) GetRole() string { +func (o *Network) GetRole() NetworkRole { if o == nil || IsNil(o.Role) { - var ret string + var ret NetworkRole return ret } return *o.Role @@ -88,7 +87,7 @@ func (o *Network) GetRole() string { // GetRoleOk returns a tuple with the Role field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetRoleOk() (*string, bool) { +func (o *Network) GetRoleOk() (*NetworkRole, bool) { if o == nil || IsNil(o.Role) { return nil, false } @@ -104,8 +103,8 @@ func (o *Network) HasRole() bool { return false } -// SetRole gets a reference to the given string and assigns it to the Role field. -func (o *Network) SetRole(v string) { +// SetRole gets a reference to the given NetworkRole and assigns it to the Role field. +func (o *Network) SetRole(v NetworkRole) { o.Role = &v } diff --git a/services/loadbalancer/v2api/model_network_role.go b/services/loadbalancer/v2api/model_network_role.go new file mode 100644 index 000000000..bce2546d3 --- /dev/null +++ b/services/loadbalancer/v2api/model_network_role.go @@ -0,0 +1,117 @@ +/* +STACKIT Network Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// NetworkRole The role defines how the load balancer is using the network. Currently only ROLE_LISTENERS_AND_TARGETS is supported. +type NetworkRole string + +// List of Network_role +const ( + NETWORKROLE_ROLE_UNSPECIFIED NetworkRole = "ROLE_UNSPECIFIED" + NETWORKROLE_ROLE_LISTENERS_AND_TARGETS NetworkRole = "ROLE_LISTENERS_AND_TARGETS" + NETWORKROLE_ROLE_LISTENERS NetworkRole = "ROLE_LISTENERS" + NETWORKROLE_ROLE_TARGETS NetworkRole = "ROLE_TARGETS" + NETWORKROLE_UNKNOWN_DEFAULT_OPEN_API NetworkRole = "unknown_default_open_api" +) + +// All allowed values of NetworkRole enum +var AllowedNetworkRoleEnumValues = []NetworkRole{ + "ROLE_UNSPECIFIED", + "ROLE_LISTENERS_AND_TARGETS", + "ROLE_LISTENERS", + "ROLE_TARGETS", + "unknown_default_open_api", +} + +func (v *NetworkRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NetworkRole(value) + for _, existing := range AllowedNetworkRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = NETWORKROLE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewNetworkRoleFromValue returns a pointer to a valid NetworkRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewNetworkRoleFromValue(v string) (*NetworkRole, error) { + ev := NetworkRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for NetworkRole: valid values are %v", v, AllowedNetworkRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v NetworkRole) IsValid() bool { + for _, existing := range AllowedNetworkRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Network_role value +func (v NetworkRole) Ptr() *NetworkRole { + return &v +} + +type NullableNetworkRole struct { + value *NetworkRole + isSet bool +} + +func (v NullableNetworkRole) Get() *NetworkRole { + return v.value +} + +func (v *NullableNetworkRole) Set(val *NetworkRole) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRole) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRole(val *NetworkRole) *NullableNetworkRole { + return &NullableNetworkRole{value: val, isSet: true} +} + +func (v NullableNetworkRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/loadbalancer/v2api/model_update_load_balancer_payload.go b/services/loadbalancer/v2api/model_update_load_balancer_payload.go index 526255d91..269bfabf3 100644 --- a/services/loadbalancer/v2api/model_update_load_balancer_payload.go +++ b/services/loadbalancer/v2api/model_update_load_balancer_payload.go @@ -41,8 +41,8 @@ type UpdateLoadBalancerPayload struct { // Transient private load balancer IP address that can change any time. PrivateAddress *string `json:"privateAddress,omitempty"` // Region of the LoadBalancer - Region *string `json:"region,omitempty"` - Status *string `json:"status,omitempty"` + Region *string `json:"region,omitempty"` + Status *UpdateLoadBalancerPayloadStatus `json:"status,omitempty"` // List of all target pools which will be used in the load balancer. Limited to 20. TargetPools []TargetPool `json:"targetPools,omitempty"` // Security Group that allows the targets to receive traffic from the LoadBalancer. Useful when disableTargetSecurityGroupAssignment=true to manually assign target security groups to targets. @@ -456,9 +456,9 @@ func (o *UpdateLoadBalancerPayload) SetRegion(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *UpdateLoadBalancerPayload) GetStatus() string { +func (o *UpdateLoadBalancerPayload) GetStatus() UpdateLoadBalancerPayloadStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret UpdateLoadBalancerPayloadStatus return ret } return *o.Status @@ -466,7 +466,7 @@ func (o *UpdateLoadBalancerPayload) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateLoadBalancerPayload) GetStatusOk() (*string, bool) { +func (o *UpdateLoadBalancerPayload) GetStatusOk() (*UpdateLoadBalancerPayloadStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -482,8 +482,8 @@ func (o *UpdateLoadBalancerPayload) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *UpdateLoadBalancerPayload) SetStatus(v string) { +// SetStatus gets a reference to the given UpdateLoadBalancerPayloadStatus and assigns it to the Status field. +func (o *UpdateLoadBalancerPayload) SetStatus(v UpdateLoadBalancerPayloadStatus) { o.Status = &v } diff --git a/services/loadbalancer/v2api/model_update_load_balancer_payload_status.go b/services/loadbalancer/v2api/model_update_load_balancer_payload_status.go new file mode 100644 index 000000000..1939d9a13 --- /dev/null +++ b/services/loadbalancer/v2api/model_update_load_balancer_payload_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Network Load Balancer API + +This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// UpdateLoadBalancerPayloadStatus the model 'UpdateLoadBalancerPayloadStatus' +type UpdateLoadBalancerPayloadStatus string + +// List of UpdateLoadBalancerPayload_status +const ( + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_UNSPECIFIED UpdateLoadBalancerPayloadStatus = "STATUS_UNSPECIFIED" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_PENDING UpdateLoadBalancerPayloadStatus = "STATUS_PENDING" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_READY UpdateLoadBalancerPayloadStatus = "STATUS_READY" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_ERROR UpdateLoadBalancerPayloadStatus = "STATUS_ERROR" + UPDATELOADBALANCERPAYLOADSTATUS_STATUS_TERMINATING UpdateLoadBalancerPayloadStatus = "STATUS_TERMINATING" + UPDATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API UpdateLoadBalancerPayloadStatus = "unknown_default_open_api" +) + +// All allowed values of UpdateLoadBalancerPayloadStatus enum +var AllowedUpdateLoadBalancerPayloadStatusEnumValues = []UpdateLoadBalancerPayloadStatus{ + "STATUS_UNSPECIFIED", + "STATUS_PENDING", + "STATUS_READY", + "STATUS_ERROR", + "STATUS_TERMINATING", + "unknown_default_open_api", +} + +func (v *UpdateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateLoadBalancerPayloadStatus(value) + for _, existing := range AllowedUpdateLoadBalancerPayloadStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATELOADBALANCERPAYLOADSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateLoadBalancerPayloadStatusFromValue returns a pointer to a valid UpdateLoadBalancerPayloadStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateLoadBalancerPayloadStatusFromValue(v string) (*UpdateLoadBalancerPayloadStatus, error) { + ev := UpdateLoadBalancerPayloadStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateLoadBalancerPayloadStatus: valid values are %v", v, AllowedUpdateLoadBalancerPayloadStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateLoadBalancerPayloadStatus) IsValid() bool { + for _, existing := range AllowedUpdateLoadBalancerPayloadStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateLoadBalancerPayload_status value +func (v UpdateLoadBalancerPayloadStatus) Ptr() *UpdateLoadBalancerPayloadStatus { + return &v +} + +type NullableUpdateLoadBalancerPayloadStatus struct { + value *UpdateLoadBalancerPayloadStatus + isSet bool +} + +func (v NullableUpdateLoadBalancerPayloadStatus) Get() *UpdateLoadBalancerPayloadStatus { + return v.value +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) Set(val *UpdateLoadBalancerPayloadStatus) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateLoadBalancerPayloadStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateLoadBalancerPayloadStatus(val *UpdateLoadBalancerPayloadStatus) *NullableUpdateLoadBalancerPayloadStatus { + return &NullableUpdateLoadBalancerPayloadStatus{value: val, isSet: true} +} + +func (v NullableUpdateLoadBalancerPayloadStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateLoadBalancerPayloadStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From a2bc24bcd07c1525a4e5f38a315a2f18a2f5d1b1 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 16:10:40 +0200 Subject: [PATCH 18/66] chore(loadbalancer): fix waiters/tests/examples, write changelog, bump version --- CHANGELOG.md | 2 ++ examples/loadbalancer/loadbalancer.go | 4 ++-- services/loadbalancer/CHANGELOG.md | 3 +++ services/loadbalancer/VERSION | 2 +- services/loadbalancer/v2api/wait/wait.go | 14 +++++++------- services/loadbalancer/v2api/wait/wait_test.go | 12 ++++++------ 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8244f866..10a96248f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -206,6 +206,8 @@ - [v1.13.0](services/loadbalancer/CHANGELOG.md#v1130) - **Improvement:** Use new WaiterHelper for LoadBalancer waiters - **Breaking Change:** `v2api/wait/DeleteLoadBalancerWaitHandler` now returns a `LoadBalancer` instead of `struct{}` + - [v1.14.0](services/loadbalancer/CHANGELOG.md#v1140) + - **Feature:** Introduce enums for various attributes - `logme`: - [v0.27.3](services/logme/CHANGELOG.md#v0273) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/examples/loadbalancer/loadbalancer.go b/examples/loadbalancer/loadbalancer.go index 3861775c0..5a8c48633 100644 --- a/examples/loadbalancer/loadbalancer.go +++ b/examples/loadbalancer/loadbalancer.go @@ -44,14 +44,14 @@ func main() { Networks: []loadbalancer.Network{ { NetworkId: utils.Ptr("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), - Role: utils.Ptr("ROLE_LISTENERS_AND_TARGETS"), + Role: loadbalancer.NETWORKROLE_ROLE_LISTENERS_AND_TARGETS.Ptr(), }, }, Listeners: []loadbalancer.Listener{ { DisplayName: utils.Ptr("example-listener"), Port: utils.Ptr(int32(1)), - Protocol: utils.Ptr("PROTOCOL_TCP"), + Protocol: loadbalancer.LISTENERPROTOCOL_PROTOCOL_TCP.Ptr(), TargetPool: utils.Ptr("example-target-pool"), }, }, diff --git a/services/loadbalancer/CHANGELOG.md b/services/loadbalancer/CHANGELOG.md index cba0d2400..10e638c84 100644 --- a/services/loadbalancer/CHANGELOG.md +++ b/services/loadbalancer/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.14.0 +- **Feature:** Introduce enums for various attributes + ## v1.13.0 - **Improvement:** Use new WaiterHelper for LoadBalancer waiters - **Breaking Change:** `v2api/wait/DeleteLoadBalancerWaitHandler` now returns a `LoadBalancer` instead of `struct{}` diff --git a/services/loadbalancer/VERSION b/services/loadbalancer/VERSION index b28120462..79f9beba8 100644 --- a/services/loadbalancer/VERSION +++ b/services/loadbalancer/VERSION @@ -1 +1 @@ -v1.13.0 +v1.14.0 diff --git a/services/loadbalancer/v2api/wait/wait.go b/services/loadbalancer/v2api/wait/wait.go index 7211c00f5..2abee6365 100644 --- a/services/loadbalancer/v2api/wait/wait.go +++ b/services/loadbalancer/v2api/wait/wait.go @@ -22,9 +22,9 @@ const ( // CreateLoadBalancerWaitHandler will wait for load balancer creation func CreateLoadBalancerWaitHandler(ctx context.Context, a loadbalancer.DefaultAPI, projectId, region, instanceName string) *wait.AsyncActionHandler[loadbalancer.LoadBalancer] { - waitConfig := wait.WaiterHelper[loadbalancer.LoadBalancer, string]{ + waitConfig := wait.WaiterHelper[loadbalancer.LoadBalancer, loadbalancer.LoadBalancerStatus]{ FetchInstance: a.GetLoadBalancer(ctx, projectId, region, instanceName).Execute, - GetState: func(r *loadbalancer.LoadBalancer) (string, error) { + GetState: func(r *loadbalancer.LoadBalancer) (loadbalancer.LoadBalancerStatus, error) { if r == nil || r.Status == nil { return "", errors.New("response or status is nil") } @@ -37,8 +37,8 @@ func CreateLoadBalancerWaitHandler(ctx context.Context, a loadbalancer.DefaultAP } return *r.Status, nil }, - ActiveState: []string{LOADBALANCERSTATUS_READY}, - ErrorState: []string{LOADBALANCERSTATUS_TERMINATING, LOADBALANCERSTATUS_ERROR}, + ActiveState: []loadbalancer.LoadBalancerStatus{loadbalancer.LOADBALANCERSTATUS_STATUS_READY}, + ErrorState: []loadbalancer.LoadBalancerStatus{loadbalancer.LOADBALANCERSTATUS_STATUS_TERMINATING, loadbalancer.LOADBALANCERSTATUS_STATUS_ERROR}, } handler := wait.New(waitConfig.Wait()) handler.SetTimeout(45 * time.Minute) @@ -47,15 +47,15 @@ func CreateLoadBalancerWaitHandler(ctx context.Context, a loadbalancer.DefaultAP // DeleteLoadBalancerWaitHandler will wait for load balancer deletion func DeleteLoadBalancerWaitHandler(ctx context.Context, a loadbalancer.DefaultAPI, projectId, region, instanceId string) *wait.AsyncActionHandler[loadbalancer.LoadBalancer] { - waitConfig := wait.WaiterHelper[loadbalancer.LoadBalancer, string]{ + waitConfig := wait.WaiterHelper[loadbalancer.LoadBalancer, loadbalancer.LoadBalancerStatus]{ FetchInstance: a.GetLoadBalancer(ctx, projectId, region, instanceId).Execute, - GetState: func(l *loadbalancer.LoadBalancer) (string, error) { + GetState: func(l *loadbalancer.LoadBalancer) (loadbalancer.LoadBalancerStatus, error) { if l == nil || l.Status == nil { return "", errors.New("response or status is nil") } return *l.Status, nil }, - ErrorState: []string{LOADBALANCERSTATUS_ERROR}, + ErrorState: []loadbalancer.LoadBalancerStatus{loadbalancer.LOADBALANCERSTATUS_STATUS_ERROR}, } handler := wait.New(waitConfig.Wait()) handler.SetTimeout(15 * time.Minute) diff --git a/services/loadbalancer/v2api/wait/wait_test.go b/services/loadbalancer/v2api/wait/wait_test.go index d96e8066a..21dcd575d 100644 --- a/services/loadbalancer/v2api/wait/wait_test.go +++ b/services/loadbalancer/v2api/wait/wait_test.go @@ -17,7 +17,7 @@ const testRegion = "eu01" type mockSettings struct { instanceName string - instanceStatus *string + instanceStatus *loadbalancer.LoadBalancerStatus instanceIsDeleted bool instanceGetFails bool } @@ -49,28 +49,28 @@ func TestCreateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string instanceGetFails bool - instanceStatus *string + instanceStatus *loadbalancer.LoadBalancerStatus wantErr bool wantResp bool }{ { desc: "create_succeeded", instanceGetFails: false, - instanceStatus: utils.Ptr(LOADBALANCERSTATUS_READY), + instanceStatus: loadbalancer.LOADBALANCERSTATUS_STATUS_READY.Ptr(), wantErr: false, wantResp: true, }, { desc: "create_failed", instanceGetFails: false, - instanceStatus: utils.Ptr(LOADBALANCERSTATUS_ERROR), + instanceStatus: loadbalancer.LOADBALANCERSTATUS_STATUS_ERROR.Ptr(), wantErr: true, wantResp: true, }, { desc: "create_failed_2", instanceGetFails: false, - instanceStatus: utils.Ptr(LOADBALANCERSTATUS_TERMINATING), + instanceStatus: loadbalancer.LOADBALANCERSTATUS_STATUS_TERMINATING.Ptr(), wantErr: true, wantResp: true, }, @@ -83,7 +83,7 @@ func TestCreateInstanceWaitHandler(t *testing.T) { { desc: "timeout", instanceGetFails: false, - instanceStatus: utils.Ptr(LOADBALANCERSTATUS_PENDING), + instanceStatus: loadbalancer.LOADBALANCERSTATUS_STATUS_PENDING.Ptr(), wantErr: true, wantResp: false, }, From 6ab11857939eee7362bb1dd0520d9fa5efd0dbb3 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 16:12:25 +0200 Subject: [PATCH 19/66] refac(logme): introduce inline enums --- services/logme/v1api/model_instance.go | 12 +- .../v1api/model_instance_last_operation.go | 24 ++-- .../model_instance_last_operation_state.go | 115 +++++++++++++++++ .../model_instance_last_operation_type.go | 115 +++++++++++++++++ .../logme/v1api/model_instance_parameters.go | 18 +-- ...parameters_opensearch_tls_ciphers_inner.go | 113 ++++++++++++++++ services/logme/v1api/model_instance_status.go | 121 ++++++++++++++++++ 7 files changed, 491 insertions(+), 27 deletions(-) create mode 100644 services/logme/v1api/model_instance_last_operation_state.go create mode 100644 services/logme/v1api/model_instance_last_operation_type.go create mode 100644 services/logme/v1api/model_instance_parameters_opensearch_tls_ciphers_inner.go create mode 100644 services/logme/v1api/model_instance_status.go diff --git a/services/logme/v1api/model_instance.go b/services/logme/v1api/model_instance.go index d46b5dfe7..a185f9823 100644 --- a/services/logme/v1api/model_instance.go +++ b/services/logme/v1api/model_instance.go @@ -34,7 +34,7 @@ type Instance struct { Parameters map[string]interface{} `json:"parameters"` PlanId string `json:"planId"` PlanName string `json:"planName"` - Status *string `json:"status,omitempty"` + Status *InstanceStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -393,9 +393,9 @@ func (o *Instance) SetPlanName(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Instance) GetStatus() string { +func (o *Instance) GetStatus() InstanceStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret InstanceStatus return ret } return *o.Status @@ -403,7 +403,7 @@ func (o *Instance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetStatusOk() (*string, bool) { +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -419,8 +419,8 @@ func (o *Instance) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Instance) SetStatus(v string) { +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { o.Status = &v } diff --git a/services/logme/v1api/model_instance_last_operation.go b/services/logme/v1api/model_instance_last_operation.go index f8a574b2b..5bc2ebf64 100644 --- a/services/logme/v1api/model_instance_last_operation.go +++ b/services/logme/v1api/model_instance_last_operation.go @@ -20,9 +20,9 @@ var _ MappedNullable = &InstanceLastOperation{} // InstanceLastOperation struct for InstanceLastOperation type InstanceLastOperation struct { - Description string `json:"description"` - State string `json:"state"` - Type string `json:"type"` + Description string `json:"description"` + State InstanceLastOperationState `json:"state"` + Type InstanceLastOperationType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +32,7 @@ type _InstanceLastOperation InstanceLastOperation // 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 NewInstanceLastOperation(description string, state string, types string) *InstanceLastOperation { +func NewInstanceLastOperation(description string, state InstanceLastOperationState, types InstanceLastOperationType) *InstanceLastOperation { this := InstanceLastOperation{} this.Description = description this.State = state @@ -73,9 +73,9 @@ func (o *InstanceLastOperation) SetDescription(v string) { } // GetState returns the State field value -func (o *InstanceLastOperation) GetState() string { +func (o *InstanceLastOperation) GetState() InstanceLastOperationState { if o == nil { - var ret string + var ret InstanceLastOperationState return ret } @@ -84,7 +84,7 @@ func (o *InstanceLastOperation) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *InstanceLastOperation) GetStateOk() (*string, bool) { +func (o *InstanceLastOperation) GetStateOk() (*InstanceLastOperationState, bool) { if o == nil { return nil, false } @@ -92,14 +92,14 @@ func (o *InstanceLastOperation) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *InstanceLastOperation) SetState(v string) { +func (o *InstanceLastOperation) SetState(v InstanceLastOperationState) { o.State = v } // GetType returns the Type field value -func (o *InstanceLastOperation) GetType() string { +func (o *InstanceLastOperation) GetType() InstanceLastOperationType { if o == nil { - var ret string + var ret InstanceLastOperationType return ret } @@ -108,7 +108,7 @@ func (o *InstanceLastOperation) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *InstanceLastOperation) GetTypeOk() (*string, bool) { +func (o *InstanceLastOperation) GetTypeOk() (*InstanceLastOperationType, bool) { if o == nil { return nil, false } @@ -116,7 +116,7 @@ func (o *InstanceLastOperation) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *InstanceLastOperation) SetType(v string) { +func (o *InstanceLastOperation) SetType(v InstanceLastOperationType) { o.Type = v } diff --git a/services/logme/v1api/model_instance_last_operation_state.go b/services/logme/v1api/model_instance_last_operation_state.go new file mode 100644 index 000000000..51aaa8b7d --- /dev/null +++ b/services/logme/v1api/model_instance_last_operation_state.go @@ -0,0 +1,115 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationState the model 'InstanceLastOperationState' +type InstanceLastOperationState string + +// List of InstanceLastOperation_state +const ( + INSTANCELASTOPERATIONSTATE_IN_PROGRESS InstanceLastOperationState = "in progress" + INSTANCELASTOPERATIONSTATE_SUCCEEDED InstanceLastOperationState = "succeeded" + INSTANCELASTOPERATIONSTATE_FAILED InstanceLastOperationState = "failed" + INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationState = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationState enum +var AllowedInstanceLastOperationStateEnumValues = []InstanceLastOperationState{ + "in progress", + "succeeded", + "failed", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationState(value) + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationStateFromValue returns a pointer to a valid InstanceLastOperationState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationStateFromValue(v string) (*InstanceLastOperationState, error) { + ev := InstanceLastOperationState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationState: valid values are %v", v, AllowedInstanceLastOperationStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationState) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_state value +func (v InstanceLastOperationState) Ptr() *InstanceLastOperationState { + return &v +} + +type NullableInstanceLastOperationState struct { + value *InstanceLastOperationState + isSet bool +} + +func (v NullableInstanceLastOperationState) Get() *InstanceLastOperationState { + return v.value +} + +func (v *NullableInstanceLastOperationState) Set(val *InstanceLastOperationState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationState(val *InstanceLastOperationState) *NullableInstanceLastOperationState { + return &NullableInstanceLastOperationState{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v1api/model_instance_last_operation_type.go b/services/logme/v1api/model_instance_last_operation_type.go new file mode 100644 index 000000000..9ee3a889a --- /dev/null +++ b/services/logme/v1api/model_instance_last_operation_type.go @@ -0,0 +1,115 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationType the model 'InstanceLastOperationType' +type InstanceLastOperationType string + +// List of InstanceLastOperation_type +const ( + INSTANCELASTOPERATIONTYPE_CREATE InstanceLastOperationType = "create" + INSTANCELASTOPERATIONTYPE_UPDATE InstanceLastOperationType = "update" + INSTANCELASTOPERATIONTYPE_DELETE InstanceLastOperationType = "delete" + INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationType = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationType enum +var AllowedInstanceLastOperationTypeEnumValues = []InstanceLastOperationType{ + "create", + "update", + "delete", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationType(value) + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationTypeFromValue returns a pointer to a valid InstanceLastOperationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationTypeFromValue(v string) (*InstanceLastOperationType, error) { + ev := InstanceLastOperationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationType: valid values are %v", v, AllowedInstanceLastOperationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationType) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_type value +func (v InstanceLastOperationType) Ptr() *InstanceLastOperationType { + return &v +} + +type NullableInstanceLastOperationType struct { + value *InstanceLastOperationType + isSet bool +} + +func (v NullableInstanceLastOperationType) Get() *InstanceLastOperationType { + return v.value +} + +func (v *NullableInstanceLastOperationType) Set(val *InstanceLastOperationType) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationType) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationType(val *InstanceLastOperationType) *NullableInstanceLastOperationType { + return &NullableInstanceLastOperationType{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v1api/model_instance_parameters.go b/services/logme/v1api/model_instance_parameters.go index 6970965ff..3baedfb6b 100644 --- a/services/logme/v1api/model_instance_parameters.go +++ b/services/logme/v1api/model_instance_parameters.go @@ -43,10 +43,10 @@ type InstanceParameters struct { // Frequency of metrics being emitted in seconds MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix *string `json:"metrics_prefix,omitempty"` - MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` - OpensearchTlsCiphers []string `json:"opensearch-tls-ciphers,omitempty"` - OpensearchTlsProtocols []string `json:"opensearch-tls-protocols,omitempty"` + MetricsPrefix *string `json:"metrics_prefix,omitempty"` + MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` + OpensearchTlsCiphers []InstanceParametersOpensearchTlsCiphersInner `json:"opensearch-tls-ciphers,omitempty"` + OpensearchTlsProtocols []string `json:"opensearch-tls-protocols,omitempty"` // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl *string `json:"sgw_acl,omitempty"` Syslog []string `json:"syslog,omitempty"` @@ -721,9 +721,9 @@ func (o *InstanceParameters) SetMonitoringInstanceId(v string) { } // GetOpensearchTlsCiphers returns the OpensearchTlsCiphers field value if set, zero value otherwise. -func (o *InstanceParameters) GetOpensearchTlsCiphers() []string { +func (o *InstanceParameters) GetOpensearchTlsCiphers() []InstanceParametersOpensearchTlsCiphersInner { if o == nil || IsNil(o.OpensearchTlsCiphers) { - var ret []string + var ret []InstanceParametersOpensearchTlsCiphersInner return ret } return o.OpensearchTlsCiphers @@ -731,7 +731,7 @@ func (o *InstanceParameters) GetOpensearchTlsCiphers() []string { // GetOpensearchTlsCiphersOk returns a tuple with the OpensearchTlsCiphers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceParameters) GetOpensearchTlsCiphersOk() ([]string, bool) { +func (o *InstanceParameters) GetOpensearchTlsCiphersOk() ([]InstanceParametersOpensearchTlsCiphersInner, bool) { if o == nil || IsNil(o.OpensearchTlsCiphers) { return nil, false } @@ -747,8 +747,8 @@ func (o *InstanceParameters) HasOpensearchTlsCiphers() bool { return false } -// SetOpensearchTlsCiphers gets a reference to the given []string and assigns it to the OpensearchTlsCiphers field. -func (o *InstanceParameters) SetOpensearchTlsCiphers(v []string) { +// SetOpensearchTlsCiphers gets a reference to the given []InstanceParametersOpensearchTlsCiphersInner and assigns it to the OpensearchTlsCiphers field. +func (o *InstanceParameters) SetOpensearchTlsCiphers(v []InstanceParametersOpensearchTlsCiphersInner) { o.OpensearchTlsCiphers = v } diff --git a/services/logme/v1api/model_instance_parameters_opensearch_tls_ciphers_inner.go b/services/logme/v1api/model_instance_parameters_opensearch_tls_ciphers_inner.go new file mode 100644 index 000000000..6f87eb47a --- /dev/null +++ b/services/logme/v1api/model_instance_parameters_opensearch_tls_ciphers_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersOpensearchTlsCiphersInner the model 'InstanceParametersOpensearchTlsCiphersInner' +type InstanceParametersOpensearchTlsCiphersInner string + +// List of InstanceParameters_opensearch_tls_ciphers_inner +const ( + INSTANCEPARAMETERSOPENSEARCHTLSCIPHERSINNER_TLSV1_2 InstanceParametersOpensearchTlsCiphersInner = "TLSv1.2" + INSTANCEPARAMETERSOPENSEARCHTLSCIPHERSINNER_TLSV1_3 InstanceParametersOpensearchTlsCiphersInner = "TLSv1.3" + INSTANCEPARAMETERSOPENSEARCHTLSCIPHERSINNER_UNKNOWN_DEFAULT_OPEN_API InstanceParametersOpensearchTlsCiphersInner = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersOpensearchTlsCiphersInner enum +var AllowedInstanceParametersOpensearchTlsCiphersInnerEnumValues = []InstanceParametersOpensearchTlsCiphersInner{ + "TLSv1.2", + "TLSv1.3", + "unknown_default_open_api", +} + +func (v *InstanceParametersOpensearchTlsCiphersInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersOpensearchTlsCiphersInner(value) + for _, existing := range AllowedInstanceParametersOpensearchTlsCiphersInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSOPENSEARCHTLSCIPHERSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersOpensearchTlsCiphersInnerFromValue returns a pointer to a valid InstanceParametersOpensearchTlsCiphersInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersOpensearchTlsCiphersInnerFromValue(v string) (*InstanceParametersOpensearchTlsCiphersInner, error) { + ev := InstanceParametersOpensearchTlsCiphersInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersOpensearchTlsCiphersInner: valid values are %v", v, AllowedInstanceParametersOpensearchTlsCiphersInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersOpensearchTlsCiphersInner) IsValid() bool { + for _, existing := range AllowedInstanceParametersOpensearchTlsCiphersInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_opensearch_tls_ciphers_inner value +func (v InstanceParametersOpensearchTlsCiphersInner) Ptr() *InstanceParametersOpensearchTlsCiphersInner { + return &v +} + +type NullableInstanceParametersOpensearchTlsCiphersInner struct { + value *InstanceParametersOpensearchTlsCiphersInner + isSet bool +} + +func (v NullableInstanceParametersOpensearchTlsCiphersInner) Get() *InstanceParametersOpensearchTlsCiphersInner { + return v.value +} + +func (v *NullableInstanceParametersOpensearchTlsCiphersInner) Set(val *InstanceParametersOpensearchTlsCiphersInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersOpensearchTlsCiphersInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersOpensearchTlsCiphersInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersOpensearchTlsCiphersInner(val *InstanceParametersOpensearchTlsCiphersInner) *NullableInstanceParametersOpensearchTlsCiphersInner { + return &NullableInstanceParametersOpensearchTlsCiphersInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersOpensearchTlsCiphersInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersOpensearchTlsCiphersInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v1api/model_instance_status.go b/services/logme/v1api/model_instance_status.go new file mode 100644 index 000000000..2d1b8bb55 --- /dev/null +++ b/services/logme/v1api/model_instance_status.go @@ -0,0 +1,121 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus the model 'InstanceStatus' +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_FAILED InstanceStatus = "failed" + INSTANCESTATUS_STOPPED InstanceStatus = "stopped" + INSTANCESTATUS_CREATING InstanceStatus = "creating" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UPDATING InstanceStatus = "updating" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "active", + "failed", + "stopped", + "creating", + "deleting", + "updating", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 80cb30306949e592cd9b4bb82dda66daf5615459 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 16:22:53 +0200 Subject: [PATCH 20/66] chore(logme): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/logme/CHANGELOG.md | 3 +++ services/logme/VERSION | 2 +- services/logme/v1api/wait/wait.go | 12 +++++------ services/logme/v1api/wait/wait_test.go | 28 +++++++++++++------------- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10a96248f..cb656b120 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -217,6 +217,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v0.28.2](services/logme/CHANGELOG.md#v0282) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` + - [v0.29.0](services/logme/CHANGELOG.md#v0290) + - **Feature:** Introduce enums for various attributes - `logs`: - [v0.7.3](services/logs/CHANGELOG.md#v073) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/logme/CHANGELOG.md b/services/logme/CHANGELOG.md index fe6e13b0e..eeb439a16 100644 --- a/services/logme/CHANGELOG.md +++ b/services/logme/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.29.0 +- **Feature:** Introduce enums for various attributes + ## v0.28.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` diff --git a/services/logme/VERSION b/services/logme/VERSION index f53b7bda1..91d002b8e 100644 --- a/services/logme/VERSION +++ b/services/logme/VERSION @@ -1 +1 @@ -v0.28.2 \ No newline at end of file +v0.29.0 diff --git a/services/logme/v1api/wait/wait.go b/services/logme/v1api/wait/wait.go index c26776e8c..8592711f8 100644 --- a/services/logme/v1api/wait/wait.go +++ b/services/logme/v1api/wait/wait.go @@ -32,9 +32,9 @@ func CreateInstanceWaitHandler(ctx context.Context, a logme.DefaultAPI, projectI return false, nil, fmt.Errorf("create failed for instance with id %s. The response is not valid: the status is missing", instanceId) } switch *s.Status { - case INSTANCESTATUS_ACTIVE: + case logme.INSTANCESTATUS_ACTIVE: return true, s, nil - case INSTANCESTATUS_FAILED: + case logme.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("create failed for instance with id %s: %s", instanceId, s.LastOperation.Description) } return false, nil, nil @@ -54,9 +54,9 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, a logme.DefaultAPI, p return false, nil, fmt.Errorf("update failed for instance with id %s. The response is not valid: the status is missing", instanceId) } switch *s.Status { - case INSTANCESTATUS_ACTIVE: + case logme.INSTANCESTATUS_ACTIVE: return true, s, nil - case INSTANCESTATUS_FAILED: + case logme.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("update failed for instance with id %s: %s", instanceId, s.LastOperation.Description) } return false, nil, nil @@ -73,10 +73,10 @@ func DeleteInstanceWaitHandler(ctx context.Context, a logme.DefaultAPI, projectI if s.Status == nil { return false, nil, fmt.Errorf("delete failed for instance with id %s. The response is not valid: The status is missing", instanceId) } - if *s.Status != INSTANCESTATUS_DELETING { + if *s.Status != logme.INSTANCESTATUS_DELETING { return false, nil, nil } - if *s.Status == INSTANCESTATUS_ACTIVE { + if *s.Status == logme.INSTANCESTATUS_ACTIVE { if strings.Contains(s.LastOperation.Description, "DeleteFailed") || strings.Contains(s.LastOperation.Description, "failed") { return true, nil, fmt.Errorf("instance was deleted successfully but has errors: %s", s.LastOperation.Description) } diff --git a/services/logme/v1api/wait/wait_test.go b/services/logme/v1api/wait/wait_test.go index d3563b985..a5f7f956c 100644 --- a/services/logme/v1api/wait/wait_test.go +++ b/services/logme/v1api/wait/wait_test.go @@ -19,7 +19,7 @@ type mockSettings struct { instanceDeletionSucceedsWithErrors bool instanceResourceId string instanceResourceOperation *string - instanceResourceState string + instanceResourceState logme.InstanceStatus instanceResourceDescription string credentialGetFails bool @@ -36,7 +36,7 @@ func newAPIMock(settings *mockSettings) logme.DefaultAPI { StatusCode: 500, } } - if settings.instanceResourceOperation != nil && *settings.instanceResourceOperation == deleteOperation && settings.instanceResourceState == INSTANCESTATUS_ACTIVE { + if settings.instanceResourceOperation != nil && *settings.instanceResourceOperation == deleteOperation && settings.instanceResourceState == logme.INSTANCESTATUS_ACTIVE { if settings.instanceDeletionSucceedsWithErrors { return &logme.Instance{ InstanceId: &settings.instanceResourceId, @@ -80,21 +80,21 @@ func TestCreateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState logme.InstanceStatus wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: INSTANCESTATUS_ACTIVE, + resourceState: logme.INSTANCESTATUS_ACTIVE, wantErr: false, wantResp: true, }, { desc: "create_failed", getFails: false, - resourceState: INSTANCESTATUS_FAILED, + resourceState: logme.INSTANCESTATUS_FAILED, wantErr: true, wantResp: true, }, @@ -127,7 +127,7 @@ func TestCreateInstanceWaitHandler(t *testing.T) { if tt.wantResp { wantRes = &logme.Instance{ InstanceId: &instanceId, - Status: utils.Ptr(tt.resourceState), + Status: &tt.resourceState, } } @@ -151,21 +151,21 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState logme.InstanceStatus wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: INSTANCESTATUS_ACTIVE, + resourceState: logme.INSTANCESTATUS_ACTIVE, wantErr: false, wantResp: true, }, { desc: "update_failed", getFails: false, - resourceState: INSTANCESTATUS_FAILED, + resourceState: logme.INSTANCESTATUS_FAILED, wantErr: true, wantResp: true, }, @@ -198,7 +198,7 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { if tt.wantResp { wantRes = &logme.Instance{ InstanceId: &instanceId, - Status: utils.Ptr(tt.resourceState), + Status: &tt.resourceState, } } @@ -222,7 +222,7 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc string getFails bool deleteSucceeedsWithErrors bool - resourceState string + resourceState logme.InstanceStatus resourceDescription string wantErr bool wantResp bool @@ -231,7 +231,7 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc: "delete_succeeded", getFails: false, deleteSucceeedsWithErrors: false, - resourceState: INSTANCESTATUS_ACTIVE, + resourceState: logme.INSTANCESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -239,14 +239,14 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc: "delete_failed", getFails: false, deleteSucceeedsWithErrors: false, - resourceState: INSTANCESTATUS_FAILED, + resourceState: logme.INSTANCESTATUS_FAILED, wantErr: true, wantResp: true, }, { desc: "delete_succeeds_with_errors", getFails: false, - resourceState: INSTANCESTATUS_ACTIVE, + resourceState: logme.INSTANCESTATUS_ACTIVE, deleteSucceeedsWithErrors: true, resourceDescription: "Deleting resource: cf failed with error: DeleteFailed", wantErr: true, From cb69347bdccbd92c32cfc9d0a70ef04290e71338 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Tue, 19 May 2026 16:39:50 +0200 Subject: [PATCH 21/66] refac(logs): introduce inline enums --- services/logs/v1alphaapi/api_default.go | 72 +++++------ services/logs/v1alphaapi/api_default_mock.go | 24 ++-- .../logs/v1alphaapi/model_access_token.go | 22 ++-- .../v1alphaapi/model_access_token_status.go | 113 +++++++++++++++++ .../model_create_access_token_payload.go | 12 +- ...list_logs_instances_region_id_parameter.go | 113 +++++++++++++++++ .../logs/v1alphaapi/model_logs_instance.go | 15 ++- .../v1alphaapi/model_logs_instance_status.go | 115 ++++++++++++++++++ .../v1alphaapi/model_permissions_inner.go | 113 +++++++++++++++++ services/logs/v1api/api_default.go | 72 +++++------ services/logs/v1api/api_default_mock.go | 24 ++-- services/logs/v1api/model_access_token.go | 22 ++-- .../logs/v1api/model_access_token_status.go | 113 +++++++++++++++++ .../model_create_access_token_payload.go | 12 +- ...list_logs_instances_region_id_parameter.go | 113 +++++++++++++++++ services/logs/v1api/model_logs_instance.go | 15 ++- .../logs/v1api/model_logs_instance_status.go | 115 ++++++++++++++++++ .../logs/v1api/model_permissions_inner.go | 113 +++++++++++++++++ services/logs/v1betaapi/api_default.go | 72 +++++------ services/logs/v1betaapi/api_default_mock.go | 24 ++-- services/logs/v1betaapi/model_access_token.go | 22 ++-- .../v1betaapi/model_access_token_status.go | 113 +++++++++++++++++ .../model_create_access_token_payload.go | 12 +- ...list_logs_instances_region_id_parameter.go | 113 +++++++++++++++++ .../logs/v1betaapi/model_logs_instance.go | 15 ++- .../v1betaapi/model_logs_instance_status.go | 115 ++++++++++++++++++ .../logs/v1betaapi/model_permissions_inner.go | 113 +++++++++++++++++ 27 files changed, 1578 insertions(+), 219 deletions(-) create mode 100644 services/logs/v1alphaapi/model_access_token_status.go create mode 100644 services/logs/v1alphaapi/model_list_logs_instances_region_id_parameter.go create mode 100644 services/logs/v1alphaapi/model_logs_instance_status.go create mode 100644 services/logs/v1alphaapi/model_permissions_inner.go create mode 100644 services/logs/v1api/model_access_token_status.go create mode 100644 services/logs/v1api/model_list_logs_instances_region_id_parameter.go create mode 100644 services/logs/v1api/model_logs_instance_status.go create mode 100644 services/logs/v1api/model_permissions_inner.go create mode 100644 services/logs/v1betaapi/model_access_token_status.go create mode 100644 services/logs/v1betaapi/model_list_logs_instances_region_id_parameter.go create mode 100644 services/logs/v1betaapi/model_logs_instance_status.go create mode 100644 services/logs/v1betaapi/model_permissions_inner.go diff --git a/services/logs/v1alphaapi/api_default.go b/services/logs/v1alphaapi/api_default.go index b2d84f7bd..499a0f5fd 100644 --- a/services/logs/v1alphaapi/api_default.go +++ b/services/logs/v1alphaapi/api_default.go @@ -34,7 +34,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiCreateAccessTokenRequest */ - CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest + CreateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiCreateAccessTokenRequest // CreateAccessTokenExecute executes the request // @return AccessToken @@ -50,7 +50,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiCreateLogsInstanceRequest */ - CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest + CreateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiCreateLogsInstanceRequest // CreateLogsInstanceExecute executes the request // @return LogsInstance @@ -68,7 +68,7 @@ type DefaultAPI interface { @param tId The access token UUID. @return ApiDeleteAccessTokenRequest */ - DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest + DeleteAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiDeleteAccessTokenRequest // DeleteAccessTokenExecute executes the request DeleteAccessTokenExecute(r ApiDeleteAccessTokenRequest) error @@ -84,7 +84,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiDeleteAllAccessTokensRequest */ - DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest + DeleteAllAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllAccessTokensRequest // DeleteAllAccessTokensExecute executes the request // @return AccessTokenList @@ -101,7 +101,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiDeleteAllExpiredAccessTokensRequest */ - DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest + DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllExpiredAccessTokensRequest // DeleteAllExpiredAccessTokensExecute executes the request // @return AccessTokenList @@ -118,7 +118,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiDeleteLogsInstanceRequest */ - DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest + DeleteLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteLogsInstanceRequest // DeleteLogsInstanceExecute executes the request DeleteLogsInstanceExecute(r ApiDeleteLogsInstanceRequest) error @@ -135,7 +135,7 @@ type DefaultAPI interface { @param tId The access token UUID. @return ApiGetAccessTokenRequest */ - GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest + GetAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiGetAccessTokenRequest // GetAccessTokenExecute executes the request // @return AccessToken @@ -152,7 +152,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiGetLogsInstanceRequest */ - GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest + GetLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiGetLogsInstanceRequest // GetLogsInstanceExecute executes the request // @return LogsInstance @@ -169,7 +169,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiListAccessTokensRequest */ - ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest + ListAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiListAccessTokensRequest // ListAccessTokensExecute executes the request // @return AccessTokenList @@ -185,7 +185,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiListLogsInstancesRequest */ - ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest + ListLogsInstances(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiListLogsInstancesRequest // ListLogsInstancesExecute executes the request // @return LogsInstancesList @@ -203,7 +203,7 @@ type DefaultAPI interface { @param tId The access token UUID. @return ApiUpdateAccessTokenRequest */ - UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest + UpdateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiUpdateAccessTokenRequest // UpdateAccessTokenExecute executes the request UpdateAccessTokenExecute(r ApiUpdateAccessTokenRequest) error @@ -219,7 +219,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiUpdateLogsInstanceRequest */ - UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest + UpdateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiUpdateLogsInstanceRequest // UpdateLogsInstanceExecute executes the request // @return LogsInstance @@ -233,7 +233,7 @@ type ApiCreateAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string createAccessTokenPayload *CreateAccessTokenPayload } @@ -258,7 +258,7 @@ Create a new Logs instance access token @param instanceId The Logs Instance UUID. @return ApiCreateAccessTokenRequest */ -func (a *DefaultAPIService) CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest { +func (a *DefaultAPIService) CreateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiCreateAccessTokenRequest { return ApiCreateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -378,7 +378,7 @@ type ApiCreateLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter createLogsInstancePayload *CreateLogsInstancePayload } @@ -401,7 +401,7 @@ Creates a new Logs instance within the project. @param regionId The STACKIT region name the resource is located in. @return ApiCreateLogsInstanceRequest */ -func (a *DefaultAPIService) CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest { +func (a *DefaultAPIService) CreateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiCreateLogsInstanceRequest { return ApiCreateLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -519,7 +519,7 @@ type ApiDeleteAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string tId string } @@ -540,7 +540,7 @@ Deletes a Logs instance access token @param tId The access token UUID. @return ApiDeleteAccessTokenRequest */ -func (a *DefaultAPIService) DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest { +func (a *DefaultAPIService) DeleteAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiDeleteAccessTokenRequest { return ApiDeleteAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -644,7 +644,7 @@ type ApiDeleteAllAccessTokensRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -663,7 +663,7 @@ Deletes all access tokens available for a Logs instance @param instanceId The Logs Instance UUID. @return ApiDeleteAllAccessTokensRequest */ -func (a *DefaultAPIService) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest { +func (a *DefaultAPIService) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllAccessTokensRequest { return ApiDeleteAllAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -778,7 +778,7 @@ type ApiDeleteAllExpiredAccessTokensRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -797,7 +797,7 @@ Deletes all expired access tokens @param instanceId The Logs Instance UUID. @return ApiDeleteAllExpiredAccessTokensRequest */ -func (a *DefaultAPIService) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { +func (a *DefaultAPIService) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { return ApiDeleteAllExpiredAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -912,7 +912,7 @@ type ApiDeleteLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -931,7 +931,7 @@ Deletes the given Logs instance. @param instanceId The Logs Instance UUID. @return ApiDeleteLogsInstanceRequest */ -func (a *DefaultAPIService) DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest { +func (a *DefaultAPIService) DeleteLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteLogsInstanceRequest { return ApiDeleteLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -1033,7 +1033,7 @@ type ApiGetAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string tId string } @@ -1054,7 +1054,7 @@ Get the information of the given access token. @param tId The access token UUID. @return ApiGetAccessTokenRequest */ -func (a *DefaultAPIService) GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest { +func (a *DefaultAPIService) GetAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiGetAccessTokenRequest { return ApiGetAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -1171,7 +1171,7 @@ type ApiGetLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -1190,7 +1190,7 @@ Returns the details for the given Logs instance. @param instanceId The Logs Instance UUID. @return ApiGetLogsInstanceRequest */ -func (a *DefaultAPIService) GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest { +func (a *DefaultAPIService) GetLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiGetLogsInstanceRequest { return ApiGetLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -1305,7 +1305,7 @@ type ApiListAccessTokensRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -1324,7 +1324,7 @@ Returns a list of access tokens created for a Logs instance @param instanceId The Logs Instance UUID. @return ApiListAccessTokensRequest */ -func (a *DefaultAPIService) ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest { +func (a *DefaultAPIService) ListAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiListAccessTokensRequest { return ApiListAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -1439,7 +1439,7 @@ type ApiListLogsInstancesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter } func (r ApiListLogsInstancesRequest) Execute() (*LogsInstancesList, error) { @@ -1456,7 +1456,7 @@ Returns a list of all Logs instances within the project. @param regionId The STACKIT region name the resource is located in. @return ApiListLogsInstancesRequest */ -func (a *DefaultAPIService) ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest { +func (a *DefaultAPIService) ListLogsInstances(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiListLogsInstancesRequest { return ApiListLogsInstancesRequest{ ApiService: a, ctx: ctx, @@ -1569,7 +1569,7 @@ type ApiUpdateAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string tId string updateAccessTokenPayload *UpdateAccessTokenPayload @@ -1596,7 +1596,7 @@ Updates the given access token. @param tId The access token UUID. @return ApiUpdateAccessTokenRequest */ -func (a *DefaultAPIService) UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest { +func (a *DefaultAPIService) UpdateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiUpdateAccessTokenRequest { return ApiUpdateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -1705,7 +1705,7 @@ type ApiUpdateLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string updateLogsInstancePayload *UpdateLogsInstancePayload } @@ -1730,7 +1730,7 @@ Updates the given Logs instance. @param instanceId The Logs Instance UUID. @return ApiUpdateLogsInstanceRequest */ -func (a *DefaultAPIService) UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest { +func (a *DefaultAPIService) UpdateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiUpdateLogsInstanceRequest { return ApiUpdateLogsInstanceRequest{ ApiService: a, ctx: ctx, diff --git a/services/logs/v1alphaapi/api_default_mock.go b/services/logs/v1alphaapi/api_default_mock.go index f0edc4347..3dcd13638 100644 --- a/services/logs/v1alphaapi/api_default_mock.go +++ b/services/logs/v1alphaapi/api_default_mock.go @@ -46,7 +46,7 @@ type DefaultAPIServiceMock struct { UpdateLogsInstanceExecuteMock *func(r ApiUpdateLogsInstanceRequest) (*LogsInstance, error) } -func (a DefaultAPIServiceMock) CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest { +func (a DefaultAPIServiceMock) CreateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiCreateAccessTokenRequest { return ApiCreateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -66,7 +66,7 @@ func (a DefaultAPIServiceMock) CreateAccessTokenExecute(r ApiCreateAccessTokenRe return (*a.CreateAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest { +func (a DefaultAPIServiceMock) CreateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiCreateLogsInstanceRequest { return ApiCreateLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -85,7 +85,7 @@ func (a DefaultAPIServiceMock) CreateLogsInstanceExecute(r ApiCreateLogsInstance return (*a.CreateLogsInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest { +func (a DefaultAPIServiceMock) DeleteAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiDeleteAccessTokenRequest { return ApiDeleteAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -105,7 +105,7 @@ func (a DefaultAPIServiceMock) DeleteAccessTokenExecute(r ApiDeleteAccessTokenRe return (*a.DeleteAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest { +func (a DefaultAPIServiceMock) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllAccessTokensRequest { return ApiDeleteAllAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -125,7 +125,7 @@ func (a DefaultAPIServiceMock) DeleteAllAccessTokensExecute(r ApiDeleteAllAccess return (*a.DeleteAllAccessTokensExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { +func (a DefaultAPIServiceMock) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { return ApiDeleteAllExpiredAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -145,7 +145,7 @@ func (a DefaultAPIServiceMock) DeleteAllExpiredAccessTokensExecute(r ApiDeleteAl return (*a.DeleteAllExpiredAccessTokensExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest { +func (a DefaultAPIServiceMock) DeleteLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteLogsInstanceRequest { return ApiDeleteLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -164,7 +164,7 @@ func (a DefaultAPIServiceMock) DeleteLogsInstanceExecute(r ApiDeleteLogsInstance return (*a.DeleteLogsInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest { +func (a DefaultAPIServiceMock) GetAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiGetAccessTokenRequest { return ApiGetAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -185,7 +185,7 @@ func (a DefaultAPIServiceMock) GetAccessTokenExecute(r ApiGetAccessTokenRequest) return (*a.GetAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest { +func (a DefaultAPIServiceMock) GetLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiGetLogsInstanceRequest { return ApiGetLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -205,7 +205,7 @@ func (a DefaultAPIServiceMock) GetLogsInstanceExecute(r ApiGetLogsInstanceReques return (*a.GetLogsInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest { +func (a DefaultAPIServiceMock) ListAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiListAccessTokensRequest { return ApiListAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -225,7 +225,7 @@ func (a DefaultAPIServiceMock) ListAccessTokensExecute(r ApiListAccessTokensRequ return (*a.ListAccessTokensExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest { +func (a DefaultAPIServiceMock) ListLogsInstances(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiListLogsInstancesRequest { return ApiListLogsInstancesRequest{ ApiService: a, ctx: ctx, @@ -244,7 +244,7 @@ func (a DefaultAPIServiceMock) ListLogsInstancesExecute(r ApiListLogsInstancesRe return (*a.ListLogsInstancesExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest { +func (a DefaultAPIServiceMock) UpdateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiUpdateAccessTokenRequest { return ApiUpdateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -264,7 +264,7 @@ func (a DefaultAPIServiceMock) UpdateAccessTokenExecute(r ApiUpdateAccessTokenRe return (*a.UpdateAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest { +func (a DefaultAPIServiceMock) UpdateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiUpdateLogsInstanceRequest { return ApiUpdateLogsInstanceRequest{ ApiService: a, ctx: ctx, diff --git a/services/logs/v1alphaapi/model_access_token.go b/services/logs/v1alphaapi/model_access_token.go index cf94f1ba1..3bcec3867 100644 --- a/services/logs/v1alphaapi/model_access_token.go +++ b/services/logs/v1alphaapi/model_access_token.go @@ -34,8 +34,8 @@ type AccessToken struct { // An auto generated unique id which identifies the access token. Id string `json:"id"` // The access permissions granted to the access token. - Permissions []string `json:"permissions"` - Status string `json:"status"` + Permissions []PermissionsInner `json:"permissions"` + Status AccessTokenStatus `json:"status"` // The date and time util an access token is valid to (inclusively). ValidUntil *time.Time `json:"validUntil,omitempty"` AdditionalProperties map[string]interface{} @@ -47,7 +47,7 @@ type _AccessToken AccessToken // 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 NewAccessToken(creator string, displayName string, expires bool, id string, permissions []string, status string) *AccessToken { +func NewAccessToken(creator string, displayName string, expires bool, id string, permissions []PermissionsInner, status AccessTokenStatus) *AccessToken { this := AccessToken{} this.Creator = creator this.DisplayName = displayName @@ -227,9 +227,9 @@ func (o *AccessToken) SetId(v string) { } // GetPermissions returns the Permissions field value -func (o *AccessToken) GetPermissions() []string { +func (o *AccessToken) GetPermissions() []PermissionsInner { if o == nil { - var ret []string + var ret []PermissionsInner return ret } @@ -238,7 +238,7 @@ func (o *AccessToken) GetPermissions() []string { // GetPermissionsOk returns a tuple with the Permissions field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetPermissionsOk() ([]string, bool) { +func (o *AccessToken) GetPermissionsOk() ([]PermissionsInner, bool) { if o == nil { return nil, false } @@ -246,14 +246,14 @@ func (o *AccessToken) GetPermissionsOk() ([]string, bool) { } // SetPermissions sets field value -func (o *AccessToken) SetPermissions(v []string) { +func (o *AccessToken) SetPermissions(v []PermissionsInner) { o.Permissions = v } // GetStatus returns the Status field value -func (o *AccessToken) GetStatus() string { +func (o *AccessToken) GetStatus() AccessTokenStatus { if o == nil { - var ret string + var ret AccessTokenStatus return ret } @@ -262,7 +262,7 @@ func (o *AccessToken) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetStatusOk() (*string, bool) { +func (o *AccessToken) GetStatusOk() (*AccessTokenStatus, bool) { if o == nil { return nil, false } @@ -270,7 +270,7 @@ func (o *AccessToken) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *AccessToken) SetStatus(v string) { +func (o *AccessToken) SetStatus(v AccessTokenStatus) { o.Status = v } diff --git a/services/logs/v1alphaapi/model_access_token_status.go b/services/logs/v1alphaapi/model_access_token_status.go new file mode 100644 index 000000000..c9b715702 --- /dev/null +++ b/services/logs/v1alphaapi/model_access_token_status.go @@ -0,0 +1,113 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1alpha.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// AccessTokenStatus the model 'AccessTokenStatus' +type AccessTokenStatus string + +// List of accessToken_status +const ( + ACCESSTOKENSTATUS_ACTIVE AccessTokenStatus = "active" + ACCESSTOKENSTATUS_EXPIRED AccessTokenStatus = "expired" + ACCESSTOKENSTATUS_UNKNOWN_DEFAULT_OPEN_API AccessTokenStatus = "unknown_default_open_api" +) + +// All allowed values of AccessTokenStatus enum +var AllowedAccessTokenStatusEnumValues = []AccessTokenStatus{ + "active", + "expired", + "unknown_default_open_api", +} + +func (v *AccessTokenStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AccessTokenStatus(value) + for _, existing := range AllowedAccessTokenStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ACCESSTOKENSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAccessTokenStatusFromValue returns a pointer to a valid AccessTokenStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAccessTokenStatusFromValue(v string) (*AccessTokenStatus, error) { + ev := AccessTokenStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AccessTokenStatus: valid values are %v", v, AllowedAccessTokenStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AccessTokenStatus) IsValid() bool { + for _, existing := range AllowedAccessTokenStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to accessToken_status value +func (v AccessTokenStatus) Ptr() *AccessTokenStatus { + return &v +} + +type NullableAccessTokenStatus struct { + value *AccessTokenStatus + isSet bool +} + +func (v NullableAccessTokenStatus) Get() *AccessTokenStatus { + return v.value +} + +func (v *NullableAccessTokenStatus) Set(val *AccessTokenStatus) { + v.value = val + v.isSet = true +} + +func (v NullableAccessTokenStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessTokenStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessTokenStatus(val *AccessTokenStatus) *NullableAccessTokenStatus { + return &NullableAccessTokenStatus{value: val, isSet: true} +} + +func (v NullableAccessTokenStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessTokenStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1alphaapi/model_create_access_token_payload.go b/services/logs/v1alphaapi/model_create_access_token_payload.go index 87a60f03e..2875374ce 100644 --- a/services/logs/v1alphaapi/model_create_access_token_payload.go +++ b/services/logs/v1alphaapi/model_create_access_token_payload.go @@ -27,7 +27,7 @@ type CreateAccessTokenPayload struct { // A lifetime period for an access token in days. If unset the token will not expire. Lifetime *int32 `json:"lifetime,omitempty"` // The access permissions granted to the access token. - Permissions []string `json:"permissions"` + Permissions []PermissionsInner `json:"permissions"` AdditionalProperties map[string]interface{} } @@ -37,7 +37,7 @@ type _CreateAccessTokenPayload CreateAccessTokenPayload // 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 NewCreateAccessTokenPayload(displayName string, permissions []string) *CreateAccessTokenPayload { +func NewCreateAccessTokenPayload(displayName string, permissions []PermissionsInner) *CreateAccessTokenPayload { this := CreateAccessTokenPayload{} this.DisplayName = displayName this.Permissions = permissions @@ -141,9 +141,9 @@ func (o *CreateAccessTokenPayload) SetLifetime(v int32) { } // GetPermissions returns the Permissions field value -func (o *CreateAccessTokenPayload) GetPermissions() []string { +func (o *CreateAccessTokenPayload) GetPermissions() []PermissionsInner { if o == nil { - var ret []string + var ret []PermissionsInner return ret } @@ -152,7 +152,7 @@ func (o *CreateAccessTokenPayload) GetPermissions() []string { // GetPermissionsOk returns a tuple with the Permissions field value // and a boolean to check if the value has been set. -func (o *CreateAccessTokenPayload) GetPermissionsOk() ([]string, bool) { +func (o *CreateAccessTokenPayload) GetPermissionsOk() ([]PermissionsInner, bool) { if o == nil { return nil, false } @@ -160,7 +160,7 @@ func (o *CreateAccessTokenPayload) GetPermissionsOk() ([]string, bool) { } // SetPermissions sets field value -func (o *CreateAccessTokenPayload) SetPermissions(v []string) { +func (o *CreateAccessTokenPayload) SetPermissions(v []PermissionsInner) { o.Permissions = v } diff --git a/services/logs/v1alphaapi/model_list_logs_instances_region_id_parameter.go b/services/logs/v1alphaapi/model_list_logs_instances_region_id_parameter.go new file mode 100644 index 000000000..431963413 --- /dev/null +++ b/services/logs/v1alphaapi/model_list_logs_instances_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1alpha.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// ListLogsInstancesRegionIdParameter the model 'ListLogsInstancesRegionIdParameter' +type ListLogsInstancesRegionIdParameter string + +// List of ListLogsInstances_regionId_parameter +const ( + LISTLOGSINSTANCESREGIONIDPARAMETER_EU01 ListLogsInstancesRegionIdParameter = "eu01" + LISTLOGSINSTANCESREGIONIDPARAMETER_EU02 ListLogsInstancesRegionIdParameter = "eu02" + LISTLOGSINSTANCESREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListLogsInstancesRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of ListLogsInstancesRegionIdParameter enum +var AllowedListLogsInstancesRegionIdParameterEnumValues = []ListLogsInstancesRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListLogsInstancesRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListLogsInstancesRegionIdParameter(value) + for _, existing := range AllowedListLogsInstancesRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTLOGSINSTANCESREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListLogsInstancesRegionIdParameterFromValue returns a pointer to a valid ListLogsInstancesRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListLogsInstancesRegionIdParameterFromValue(v string) (*ListLogsInstancesRegionIdParameter, error) { + ev := ListLogsInstancesRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListLogsInstancesRegionIdParameter: valid values are %v", v, AllowedListLogsInstancesRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListLogsInstancesRegionIdParameter) IsValid() bool { + for _, existing := range AllowedListLogsInstancesRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListLogsInstances_regionId_parameter value +func (v ListLogsInstancesRegionIdParameter) Ptr() *ListLogsInstancesRegionIdParameter { + return &v +} + +type NullableListLogsInstancesRegionIdParameter struct { + value *ListLogsInstancesRegionIdParameter + isSet bool +} + +func (v NullableListLogsInstancesRegionIdParameter) Get() *ListLogsInstancesRegionIdParameter { + return v.value +} + +func (v *NullableListLogsInstancesRegionIdParameter) Set(val *ListLogsInstancesRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListLogsInstancesRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListLogsInstancesRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListLogsInstancesRegionIdParameter(val *ListLogsInstancesRegionIdParameter) *NullableListLogsInstancesRegionIdParameter { + return &NullableListLogsInstancesRegionIdParameter{value: val, isSet: true} +} + +func (v NullableListLogsInstancesRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListLogsInstancesRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1alphaapi/model_logs_instance.go b/services/logs/v1alphaapi/model_logs_instance.go index aeb077868..b83e21d63 100644 --- a/services/logs/v1alphaapi/model_logs_instance.go +++ b/services/logs/v1alphaapi/model_logs_instance.go @@ -42,9 +42,8 @@ type LogsInstance struct { // The Logs instance's query URL QueryUrl *string `json:"queryUrl,omitempty"` // The log retention time in days. - RetentionDays int32 `json:"retentionDays"` - // The current status of the Logs instance. - Status string `json:"status"` + RetentionDays int32 `json:"retentionDays"` + Status LogsInstanceStatus `json:"status"` AdditionalProperties map[string]interface{} } @@ -54,7 +53,7 @@ type _LogsInstance LogsInstance // 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 NewLogsInstance(created time.Time, displayName string, id string, retentionDays int32, status string) *LogsInstance { +func NewLogsInstance(created time.Time, displayName string, id string, retentionDays int32, status LogsInstanceStatus) *LogsInstance { this := LogsInstance{} this.Created = created this.DisplayName = displayName @@ -393,9 +392,9 @@ func (o *LogsInstance) SetRetentionDays(v int32) { } // GetStatus returns the Status field value -func (o *LogsInstance) GetStatus() string { +func (o *LogsInstance) GetStatus() LogsInstanceStatus { if o == nil { - var ret string + var ret LogsInstanceStatus return ret } @@ -404,7 +403,7 @@ func (o *LogsInstance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *LogsInstance) GetStatusOk() (*string, bool) { +func (o *LogsInstance) GetStatusOk() (*LogsInstanceStatus, bool) { if o == nil { return nil, false } @@ -412,7 +411,7 @@ func (o *LogsInstance) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *LogsInstance) SetStatus(v string) { +func (o *LogsInstance) SetStatus(v LogsInstanceStatus) { o.Status = v } diff --git a/services/logs/v1alphaapi/model_logs_instance_status.go b/services/logs/v1alphaapi/model_logs_instance_status.go new file mode 100644 index 000000000..bd83f34bd --- /dev/null +++ b/services/logs/v1alphaapi/model_logs_instance_status.go @@ -0,0 +1,115 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1alpha.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// LogsInstanceStatus The current status of the Logs instance. +type LogsInstanceStatus string + +// List of logsInstance_status +const ( + LOGSINSTANCESTATUS_ACTIVE LogsInstanceStatus = "active" + LOGSINSTANCESTATUS_DELETING LogsInstanceStatus = "deleting" + LOGSINSTANCESTATUS_RECONCILING LogsInstanceStatus = "reconciling" + LOGSINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API LogsInstanceStatus = "unknown_default_open_api" +) + +// All allowed values of LogsInstanceStatus enum +var AllowedLogsInstanceStatusEnumValues = []LogsInstanceStatus{ + "active", + "deleting", + "reconciling", + "unknown_default_open_api", +} + +func (v *LogsInstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LogsInstanceStatus(value) + for _, existing := range AllowedLogsInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOGSINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLogsInstanceStatusFromValue returns a pointer to a valid LogsInstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLogsInstanceStatusFromValue(v string) (*LogsInstanceStatus, error) { + ev := LogsInstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LogsInstanceStatus: valid values are %v", v, AllowedLogsInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LogsInstanceStatus) IsValid() bool { + for _, existing := range AllowedLogsInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to logsInstance_status value +func (v LogsInstanceStatus) Ptr() *LogsInstanceStatus { + return &v +} + +type NullableLogsInstanceStatus struct { + value *LogsInstanceStatus + isSet bool +} + +func (v NullableLogsInstanceStatus) Get() *LogsInstanceStatus { + return v.value +} + +func (v *NullableLogsInstanceStatus) Set(val *LogsInstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableLogsInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableLogsInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLogsInstanceStatus(val *LogsInstanceStatus) *NullableLogsInstanceStatus { + return &NullableLogsInstanceStatus{value: val, isSet: true} +} + +func (v NullableLogsInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLogsInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1alphaapi/model_permissions_inner.go b/services/logs/v1alphaapi/model_permissions_inner.go new file mode 100644 index 000000000..673af7f23 --- /dev/null +++ b/services/logs/v1alphaapi/model_permissions_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1alpha.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// PermissionsInner the model 'PermissionsInner' +type PermissionsInner string + +// List of permissions_inner +const ( + PERMISSIONSINNER_READ PermissionsInner = "read" + PERMISSIONSINNER_WRITE PermissionsInner = "write" + PERMISSIONSINNER_UNKNOWN_DEFAULT_OPEN_API PermissionsInner = "unknown_default_open_api" +) + +// All allowed values of PermissionsInner enum +var AllowedPermissionsInnerEnumValues = []PermissionsInner{ + "read", + "write", + "unknown_default_open_api", +} + +func (v *PermissionsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PermissionsInner(value) + for _, existing := range AllowedPermissionsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PERMISSIONSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPermissionsInnerFromValue returns a pointer to a valid PermissionsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPermissionsInnerFromValue(v string) (*PermissionsInner, error) { + ev := PermissionsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PermissionsInner: valid values are %v", v, AllowedPermissionsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PermissionsInner) IsValid() bool { + for _, existing := range AllowedPermissionsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to permissions_inner value +func (v PermissionsInner) Ptr() *PermissionsInner { + return &v +} + +type NullablePermissionsInner struct { + value *PermissionsInner + isSet bool +} + +func (v NullablePermissionsInner) Get() *PermissionsInner { + return v.value +} + +func (v *NullablePermissionsInner) Set(val *PermissionsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePermissionsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePermissionsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermissionsInner(val *PermissionsInner) *NullablePermissionsInner { + return &NullablePermissionsInner{value: val, isSet: true} +} + +func (v NullablePermissionsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermissionsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1api/api_default.go b/services/logs/v1api/api_default.go index 038928e51..af1516fcb 100644 --- a/services/logs/v1api/api_default.go +++ b/services/logs/v1api/api_default.go @@ -34,7 +34,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiCreateAccessTokenRequest */ - CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest + CreateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiCreateAccessTokenRequest // CreateAccessTokenExecute executes the request // @return AccessToken @@ -50,7 +50,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiCreateLogsInstanceRequest */ - CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest + CreateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiCreateLogsInstanceRequest // CreateLogsInstanceExecute executes the request // @return LogsInstance @@ -68,7 +68,7 @@ type DefaultAPI interface { @param tId The access token UUID. @return ApiDeleteAccessTokenRequest */ - DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest + DeleteAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiDeleteAccessTokenRequest // DeleteAccessTokenExecute executes the request DeleteAccessTokenExecute(r ApiDeleteAccessTokenRequest) error @@ -84,7 +84,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiDeleteAllAccessTokensRequest */ - DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest + DeleteAllAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllAccessTokensRequest // DeleteAllAccessTokensExecute executes the request // @return AccessTokenList @@ -101,7 +101,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiDeleteAllExpiredAccessTokensRequest */ - DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest + DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllExpiredAccessTokensRequest // DeleteAllExpiredAccessTokensExecute executes the request // @return AccessTokenList @@ -118,7 +118,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiDeleteLogsInstanceRequest */ - DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest + DeleteLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteLogsInstanceRequest // DeleteLogsInstanceExecute executes the request DeleteLogsInstanceExecute(r ApiDeleteLogsInstanceRequest) error @@ -135,7 +135,7 @@ type DefaultAPI interface { @param tId The access token UUID. @return ApiGetAccessTokenRequest */ - GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest + GetAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiGetAccessTokenRequest // GetAccessTokenExecute executes the request // @return AccessToken @@ -152,7 +152,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiGetLogsInstanceRequest */ - GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest + GetLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiGetLogsInstanceRequest // GetLogsInstanceExecute executes the request // @return LogsInstance @@ -169,7 +169,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiListAccessTokensRequest */ - ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest + ListAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiListAccessTokensRequest // ListAccessTokensExecute executes the request // @return AccessTokenList @@ -185,7 +185,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiListLogsInstancesRequest */ - ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest + ListLogsInstances(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiListLogsInstancesRequest // ListLogsInstancesExecute executes the request // @return LogsInstancesList @@ -203,7 +203,7 @@ type DefaultAPI interface { @param tId The access token UUID. @return ApiUpdateAccessTokenRequest */ - UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest + UpdateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiUpdateAccessTokenRequest // UpdateAccessTokenExecute executes the request UpdateAccessTokenExecute(r ApiUpdateAccessTokenRequest) error @@ -219,7 +219,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiUpdateLogsInstanceRequest */ - UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest + UpdateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiUpdateLogsInstanceRequest // UpdateLogsInstanceExecute executes the request // @return LogsInstance @@ -233,7 +233,7 @@ type ApiCreateAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string createAccessTokenPayload *CreateAccessTokenPayload } @@ -258,7 +258,7 @@ Create a new Logs instance access token @param instanceId The Logs Instance UUID. @return ApiCreateAccessTokenRequest */ -func (a *DefaultAPIService) CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest { +func (a *DefaultAPIService) CreateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiCreateAccessTokenRequest { return ApiCreateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -378,7 +378,7 @@ type ApiCreateLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter createLogsInstancePayload *CreateLogsInstancePayload } @@ -401,7 +401,7 @@ Creates a new Logs instance within the project. @param regionId The STACKIT region name the resource is located in. @return ApiCreateLogsInstanceRequest */ -func (a *DefaultAPIService) CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest { +func (a *DefaultAPIService) CreateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiCreateLogsInstanceRequest { return ApiCreateLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -519,7 +519,7 @@ type ApiDeleteAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string tId string } @@ -540,7 +540,7 @@ Deletes a Logs instance access token @param tId The access token UUID. @return ApiDeleteAccessTokenRequest */ -func (a *DefaultAPIService) DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest { +func (a *DefaultAPIService) DeleteAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiDeleteAccessTokenRequest { return ApiDeleteAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -644,7 +644,7 @@ type ApiDeleteAllAccessTokensRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -663,7 +663,7 @@ Deletes all access tokens available for a Logs instance @param instanceId The Logs Instance UUID. @return ApiDeleteAllAccessTokensRequest */ -func (a *DefaultAPIService) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest { +func (a *DefaultAPIService) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllAccessTokensRequest { return ApiDeleteAllAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -778,7 +778,7 @@ type ApiDeleteAllExpiredAccessTokensRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -797,7 +797,7 @@ Deletes all expired access tokens @param instanceId The Logs Instance UUID. @return ApiDeleteAllExpiredAccessTokensRequest */ -func (a *DefaultAPIService) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { +func (a *DefaultAPIService) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { return ApiDeleteAllExpiredAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -912,7 +912,7 @@ type ApiDeleteLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -931,7 +931,7 @@ Deletes the given Logs instance. @param instanceId The Logs Instance UUID. @return ApiDeleteLogsInstanceRequest */ -func (a *DefaultAPIService) DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest { +func (a *DefaultAPIService) DeleteLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteLogsInstanceRequest { return ApiDeleteLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -1033,7 +1033,7 @@ type ApiGetAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string tId string } @@ -1054,7 +1054,7 @@ Get the information of the given access token. @param tId The access token UUID. @return ApiGetAccessTokenRequest */ -func (a *DefaultAPIService) GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest { +func (a *DefaultAPIService) GetAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiGetAccessTokenRequest { return ApiGetAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -1171,7 +1171,7 @@ type ApiGetLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -1190,7 +1190,7 @@ Returns the details for the given Logs instance. @param instanceId The Logs Instance UUID. @return ApiGetLogsInstanceRequest */ -func (a *DefaultAPIService) GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest { +func (a *DefaultAPIService) GetLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiGetLogsInstanceRequest { return ApiGetLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -1305,7 +1305,7 @@ type ApiListAccessTokensRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -1324,7 +1324,7 @@ Returns a list of access tokens created for a Logs instance @param instanceId The Logs Instance UUID. @return ApiListAccessTokensRequest */ -func (a *DefaultAPIService) ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest { +func (a *DefaultAPIService) ListAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiListAccessTokensRequest { return ApiListAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -1439,7 +1439,7 @@ type ApiListLogsInstancesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter } func (r ApiListLogsInstancesRequest) Execute() (*LogsInstancesList, error) { @@ -1456,7 +1456,7 @@ Returns a list of all Logs instances within the project. @param regionId The STACKIT region name the resource is located in. @return ApiListLogsInstancesRequest */ -func (a *DefaultAPIService) ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest { +func (a *DefaultAPIService) ListLogsInstances(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiListLogsInstancesRequest { return ApiListLogsInstancesRequest{ ApiService: a, ctx: ctx, @@ -1569,7 +1569,7 @@ type ApiUpdateAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string tId string updateAccessTokenPayload *UpdateAccessTokenPayload @@ -1596,7 +1596,7 @@ Updates the given access token. @param tId The access token UUID. @return ApiUpdateAccessTokenRequest */ -func (a *DefaultAPIService) UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest { +func (a *DefaultAPIService) UpdateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiUpdateAccessTokenRequest { return ApiUpdateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -1705,7 +1705,7 @@ type ApiUpdateLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string updateLogsInstancePayload *UpdateLogsInstancePayload } @@ -1730,7 +1730,7 @@ Updates the given Logs instance. @param instanceId The Logs Instance UUID. @return ApiUpdateLogsInstanceRequest */ -func (a *DefaultAPIService) UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest { +func (a *DefaultAPIService) UpdateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiUpdateLogsInstanceRequest { return ApiUpdateLogsInstanceRequest{ ApiService: a, ctx: ctx, diff --git a/services/logs/v1api/api_default_mock.go b/services/logs/v1api/api_default_mock.go index 741e37fee..e671e62b1 100644 --- a/services/logs/v1api/api_default_mock.go +++ b/services/logs/v1api/api_default_mock.go @@ -46,7 +46,7 @@ type DefaultAPIServiceMock struct { UpdateLogsInstanceExecuteMock *func(r ApiUpdateLogsInstanceRequest) (*LogsInstance, error) } -func (a DefaultAPIServiceMock) CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest { +func (a DefaultAPIServiceMock) CreateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiCreateAccessTokenRequest { return ApiCreateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -66,7 +66,7 @@ func (a DefaultAPIServiceMock) CreateAccessTokenExecute(r ApiCreateAccessTokenRe return (*a.CreateAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest { +func (a DefaultAPIServiceMock) CreateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiCreateLogsInstanceRequest { return ApiCreateLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -85,7 +85,7 @@ func (a DefaultAPIServiceMock) CreateLogsInstanceExecute(r ApiCreateLogsInstance return (*a.CreateLogsInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest { +func (a DefaultAPIServiceMock) DeleteAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiDeleteAccessTokenRequest { return ApiDeleteAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -105,7 +105,7 @@ func (a DefaultAPIServiceMock) DeleteAccessTokenExecute(r ApiDeleteAccessTokenRe return (*a.DeleteAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest { +func (a DefaultAPIServiceMock) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllAccessTokensRequest { return ApiDeleteAllAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -125,7 +125,7 @@ func (a DefaultAPIServiceMock) DeleteAllAccessTokensExecute(r ApiDeleteAllAccess return (*a.DeleteAllAccessTokensExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { +func (a DefaultAPIServiceMock) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { return ApiDeleteAllExpiredAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -145,7 +145,7 @@ func (a DefaultAPIServiceMock) DeleteAllExpiredAccessTokensExecute(r ApiDeleteAl return (*a.DeleteAllExpiredAccessTokensExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest { +func (a DefaultAPIServiceMock) DeleteLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteLogsInstanceRequest { return ApiDeleteLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -164,7 +164,7 @@ func (a DefaultAPIServiceMock) DeleteLogsInstanceExecute(r ApiDeleteLogsInstance return (*a.DeleteLogsInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest { +func (a DefaultAPIServiceMock) GetAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiGetAccessTokenRequest { return ApiGetAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -185,7 +185,7 @@ func (a DefaultAPIServiceMock) GetAccessTokenExecute(r ApiGetAccessTokenRequest) return (*a.GetAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest { +func (a DefaultAPIServiceMock) GetLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiGetLogsInstanceRequest { return ApiGetLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -205,7 +205,7 @@ func (a DefaultAPIServiceMock) GetLogsInstanceExecute(r ApiGetLogsInstanceReques return (*a.GetLogsInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest { +func (a DefaultAPIServiceMock) ListAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiListAccessTokensRequest { return ApiListAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -225,7 +225,7 @@ func (a DefaultAPIServiceMock) ListAccessTokensExecute(r ApiListAccessTokensRequ return (*a.ListAccessTokensExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest { +func (a DefaultAPIServiceMock) ListLogsInstances(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiListLogsInstancesRequest { return ApiListLogsInstancesRequest{ ApiService: a, ctx: ctx, @@ -244,7 +244,7 @@ func (a DefaultAPIServiceMock) ListLogsInstancesExecute(r ApiListLogsInstancesRe return (*a.ListLogsInstancesExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest { +func (a DefaultAPIServiceMock) UpdateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiUpdateAccessTokenRequest { return ApiUpdateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -264,7 +264,7 @@ func (a DefaultAPIServiceMock) UpdateAccessTokenExecute(r ApiUpdateAccessTokenRe return (*a.UpdateAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest { +func (a DefaultAPIServiceMock) UpdateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiUpdateLogsInstanceRequest { return ApiUpdateLogsInstanceRequest{ ApiService: a, ctx: ctx, diff --git a/services/logs/v1api/model_access_token.go b/services/logs/v1api/model_access_token.go index ebe0c5953..ed184e386 100644 --- a/services/logs/v1api/model_access_token.go +++ b/services/logs/v1api/model_access_token.go @@ -34,8 +34,8 @@ type AccessToken struct { // An auto generated unique id which identifies the access token. Id string `json:"id"` // The access permissions granted to the access token. - Permissions []string `json:"permissions"` - Status string `json:"status"` + Permissions []PermissionsInner `json:"permissions"` + Status AccessTokenStatus `json:"status"` // The date and time util an access token is valid to (inclusively). ValidUntil *time.Time `json:"validUntil,omitempty"` AdditionalProperties map[string]interface{} @@ -47,7 +47,7 @@ type _AccessToken AccessToken // 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 NewAccessToken(creator string, displayName string, expires bool, id string, permissions []string, status string) *AccessToken { +func NewAccessToken(creator string, displayName string, expires bool, id string, permissions []PermissionsInner, status AccessTokenStatus) *AccessToken { this := AccessToken{} this.Creator = creator this.DisplayName = displayName @@ -227,9 +227,9 @@ func (o *AccessToken) SetId(v string) { } // GetPermissions returns the Permissions field value -func (o *AccessToken) GetPermissions() []string { +func (o *AccessToken) GetPermissions() []PermissionsInner { if o == nil { - var ret []string + var ret []PermissionsInner return ret } @@ -238,7 +238,7 @@ func (o *AccessToken) GetPermissions() []string { // GetPermissionsOk returns a tuple with the Permissions field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetPermissionsOk() ([]string, bool) { +func (o *AccessToken) GetPermissionsOk() ([]PermissionsInner, bool) { if o == nil { return nil, false } @@ -246,14 +246,14 @@ func (o *AccessToken) GetPermissionsOk() ([]string, bool) { } // SetPermissions sets field value -func (o *AccessToken) SetPermissions(v []string) { +func (o *AccessToken) SetPermissions(v []PermissionsInner) { o.Permissions = v } // GetStatus returns the Status field value -func (o *AccessToken) GetStatus() string { +func (o *AccessToken) GetStatus() AccessTokenStatus { if o == nil { - var ret string + var ret AccessTokenStatus return ret } @@ -262,7 +262,7 @@ func (o *AccessToken) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetStatusOk() (*string, bool) { +func (o *AccessToken) GetStatusOk() (*AccessTokenStatus, bool) { if o == nil { return nil, false } @@ -270,7 +270,7 @@ func (o *AccessToken) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *AccessToken) SetStatus(v string) { +func (o *AccessToken) SetStatus(v AccessTokenStatus) { o.Status = v } diff --git a/services/logs/v1api/model_access_token_status.go b/services/logs/v1api/model_access_token_status.go new file mode 100644 index 000000000..ea0b6649c --- /dev/null +++ b/services/logs/v1api/model_access_token_status.go @@ -0,0 +1,113 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// AccessTokenStatus the model 'AccessTokenStatus' +type AccessTokenStatus string + +// List of accessToken_status +const ( + ACCESSTOKENSTATUS_ACTIVE AccessTokenStatus = "active" + ACCESSTOKENSTATUS_EXPIRED AccessTokenStatus = "expired" + ACCESSTOKENSTATUS_UNKNOWN_DEFAULT_OPEN_API AccessTokenStatus = "unknown_default_open_api" +) + +// All allowed values of AccessTokenStatus enum +var AllowedAccessTokenStatusEnumValues = []AccessTokenStatus{ + "active", + "expired", + "unknown_default_open_api", +} + +func (v *AccessTokenStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AccessTokenStatus(value) + for _, existing := range AllowedAccessTokenStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ACCESSTOKENSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAccessTokenStatusFromValue returns a pointer to a valid AccessTokenStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAccessTokenStatusFromValue(v string) (*AccessTokenStatus, error) { + ev := AccessTokenStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AccessTokenStatus: valid values are %v", v, AllowedAccessTokenStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AccessTokenStatus) IsValid() bool { + for _, existing := range AllowedAccessTokenStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to accessToken_status value +func (v AccessTokenStatus) Ptr() *AccessTokenStatus { + return &v +} + +type NullableAccessTokenStatus struct { + value *AccessTokenStatus + isSet bool +} + +func (v NullableAccessTokenStatus) Get() *AccessTokenStatus { + return v.value +} + +func (v *NullableAccessTokenStatus) Set(val *AccessTokenStatus) { + v.value = val + v.isSet = true +} + +func (v NullableAccessTokenStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessTokenStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessTokenStatus(val *AccessTokenStatus) *NullableAccessTokenStatus { + return &NullableAccessTokenStatus{value: val, isSet: true} +} + +func (v NullableAccessTokenStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessTokenStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1api/model_create_access_token_payload.go b/services/logs/v1api/model_create_access_token_payload.go index 43a0fa3de..9630d8a46 100644 --- a/services/logs/v1api/model_create_access_token_payload.go +++ b/services/logs/v1api/model_create_access_token_payload.go @@ -27,7 +27,7 @@ type CreateAccessTokenPayload struct { // A lifetime period for an access token in days. If unset the token will not expire. Lifetime *int32 `json:"lifetime,omitempty"` // The access permissions granted to the access token. - Permissions []string `json:"permissions"` + Permissions []PermissionsInner `json:"permissions"` AdditionalProperties map[string]interface{} } @@ -37,7 +37,7 @@ type _CreateAccessTokenPayload CreateAccessTokenPayload // 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 NewCreateAccessTokenPayload(displayName string, permissions []string) *CreateAccessTokenPayload { +func NewCreateAccessTokenPayload(displayName string, permissions []PermissionsInner) *CreateAccessTokenPayload { this := CreateAccessTokenPayload{} this.DisplayName = displayName this.Permissions = permissions @@ -141,9 +141,9 @@ func (o *CreateAccessTokenPayload) SetLifetime(v int32) { } // GetPermissions returns the Permissions field value -func (o *CreateAccessTokenPayload) GetPermissions() []string { +func (o *CreateAccessTokenPayload) GetPermissions() []PermissionsInner { if o == nil { - var ret []string + var ret []PermissionsInner return ret } @@ -152,7 +152,7 @@ func (o *CreateAccessTokenPayload) GetPermissions() []string { // GetPermissionsOk returns a tuple with the Permissions field value // and a boolean to check if the value has been set. -func (o *CreateAccessTokenPayload) GetPermissionsOk() ([]string, bool) { +func (o *CreateAccessTokenPayload) GetPermissionsOk() ([]PermissionsInner, bool) { if o == nil { return nil, false } @@ -160,7 +160,7 @@ func (o *CreateAccessTokenPayload) GetPermissionsOk() ([]string, bool) { } // SetPermissions sets field value -func (o *CreateAccessTokenPayload) SetPermissions(v []string) { +func (o *CreateAccessTokenPayload) SetPermissions(v []PermissionsInner) { o.Permissions = v } diff --git a/services/logs/v1api/model_list_logs_instances_region_id_parameter.go b/services/logs/v1api/model_list_logs_instances_region_id_parameter.go new file mode 100644 index 000000000..a19ea3d52 --- /dev/null +++ b/services/logs/v1api/model_list_logs_instances_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ListLogsInstancesRegionIdParameter the model 'ListLogsInstancesRegionIdParameter' +type ListLogsInstancesRegionIdParameter string + +// List of ListLogsInstances_regionId_parameter +const ( + LISTLOGSINSTANCESREGIONIDPARAMETER_EU01 ListLogsInstancesRegionIdParameter = "eu01" + LISTLOGSINSTANCESREGIONIDPARAMETER_EU02 ListLogsInstancesRegionIdParameter = "eu02" + LISTLOGSINSTANCESREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListLogsInstancesRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of ListLogsInstancesRegionIdParameter enum +var AllowedListLogsInstancesRegionIdParameterEnumValues = []ListLogsInstancesRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListLogsInstancesRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListLogsInstancesRegionIdParameter(value) + for _, existing := range AllowedListLogsInstancesRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTLOGSINSTANCESREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListLogsInstancesRegionIdParameterFromValue returns a pointer to a valid ListLogsInstancesRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListLogsInstancesRegionIdParameterFromValue(v string) (*ListLogsInstancesRegionIdParameter, error) { + ev := ListLogsInstancesRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListLogsInstancesRegionIdParameter: valid values are %v", v, AllowedListLogsInstancesRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListLogsInstancesRegionIdParameter) IsValid() bool { + for _, existing := range AllowedListLogsInstancesRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListLogsInstances_regionId_parameter value +func (v ListLogsInstancesRegionIdParameter) Ptr() *ListLogsInstancesRegionIdParameter { + return &v +} + +type NullableListLogsInstancesRegionIdParameter struct { + value *ListLogsInstancesRegionIdParameter + isSet bool +} + +func (v NullableListLogsInstancesRegionIdParameter) Get() *ListLogsInstancesRegionIdParameter { + return v.value +} + +func (v *NullableListLogsInstancesRegionIdParameter) Set(val *ListLogsInstancesRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListLogsInstancesRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListLogsInstancesRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListLogsInstancesRegionIdParameter(val *ListLogsInstancesRegionIdParameter) *NullableListLogsInstancesRegionIdParameter { + return &NullableListLogsInstancesRegionIdParameter{value: val, isSet: true} +} + +func (v NullableListLogsInstancesRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListLogsInstancesRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1api/model_logs_instance.go b/services/logs/v1api/model_logs_instance.go index 72c8a4837..360e4fbfa 100644 --- a/services/logs/v1api/model_logs_instance.go +++ b/services/logs/v1api/model_logs_instance.go @@ -42,9 +42,8 @@ type LogsInstance struct { // The Logs instance's query URL QueryUrl *string `json:"queryUrl,omitempty"` // The log retention time in days. - RetentionDays int32 `json:"retentionDays"` - // The current status of the Logs instance. - Status string `json:"status"` + RetentionDays int32 `json:"retentionDays"` + Status LogsInstanceStatus `json:"status"` AdditionalProperties map[string]interface{} } @@ -54,7 +53,7 @@ type _LogsInstance LogsInstance // 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 NewLogsInstance(created time.Time, displayName string, id string, retentionDays int32, status string) *LogsInstance { +func NewLogsInstance(created time.Time, displayName string, id string, retentionDays int32, status LogsInstanceStatus) *LogsInstance { this := LogsInstance{} this.Created = created this.DisplayName = displayName @@ -393,9 +392,9 @@ func (o *LogsInstance) SetRetentionDays(v int32) { } // GetStatus returns the Status field value -func (o *LogsInstance) GetStatus() string { +func (o *LogsInstance) GetStatus() LogsInstanceStatus { if o == nil { - var ret string + var ret LogsInstanceStatus return ret } @@ -404,7 +403,7 @@ func (o *LogsInstance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *LogsInstance) GetStatusOk() (*string, bool) { +func (o *LogsInstance) GetStatusOk() (*LogsInstanceStatus, bool) { if o == nil { return nil, false } @@ -412,7 +411,7 @@ func (o *LogsInstance) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *LogsInstance) SetStatus(v string) { +func (o *LogsInstance) SetStatus(v LogsInstanceStatus) { o.Status = v } diff --git a/services/logs/v1api/model_logs_instance_status.go b/services/logs/v1api/model_logs_instance_status.go new file mode 100644 index 000000000..680fdc04a --- /dev/null +++ b/services/logs/v1api/model_logs_instance_status.go @@ -0,0 +1,115 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// LogsInstanceStatus The current status of the Logs instance. +type LogsInstanceStatus string + +// List of logsInstance_status +const ( + LOGSINSTANCESTATUS_ACTIVE LogsInstanceStatus = "active" + LOGSINSTANCESTATUS_DELETING LogsInstanceStatus = "deleting" + LOGSINSTANCESTATUS_RECONCILING LogsInstanceStatus = "reconciling" + LOGSINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API LogsInstanceStatus = "unknown_default_open_api" +) + +// All allowed values of LogsInstanceStatus enum +var AllowedLogsInstanceStatusEnumValues = []LogsInstanceStatus{ + "active", + "deleting", + "reconciling", + "unknown_default_open_api", +} + +func (v *LogsInstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LogsInstanceStatus(value) + for _, existing := range AllowedLogsInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOGSINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLogsInstanceStatusFromValue returns a pointer to a valid LogsInstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLogsInstanceStatusFromValue(v string) (*LogsInstanceStatus, error) { + ev := LogsInstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LogsInstanceStatus: valid values are %v", v, AllowedLogsInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LogsInstanceStatus) IsValid() bool { + for _, existing := range AllowedLogsInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to logsInstance_status value +func (v LogsInstanceStatus) Ptr() *LogsInstanceStatus { + return &v +} + +type NullableLogsInstanceStatus struct { + value *LogsInstanceStatus + isSet bool +} + +func (v NullableLogsInstanceStatus) Get() *LogsInstanceStatus { + return v.value +} + +func (v *NullableLogsInstanceStatus) Set(val *LogsInstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableLogsInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableLogsInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLogsInstanceStatus(val *LogsInstanceStatus) *NullableLogsInstanceStatus { + return &NullableLogsInstanceStatus{value: val, isSet: true} +} + +func (v NullableLogsInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLogsInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1api/model_permissions_inner.go b/services/logs/v1api/model_permissions_inner.go new file mode 100644 index 000000000..ce982eafa --- /dev/null +++ b/services/logs/v1api/model_permissions_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// PermissionsInner the model 'PermissionsInner' +type PermissionsInner string + +// List of permissions_inner +const ( + PERMISSIONSINNER_READ PermissionsInner = "read" + PERMISSIONSINNER_WRITE PermissionsInner = "write" + PERMISSIONSINNER_UNKNOWN_DEFAULT_OPEN_API PermissionsInner = "unknown_default_open_api" +) + +// All allowed values of PermissionsInner enum +var AllowedPermissionsInnerEnumValues = []PermissionsInner{ + "read", + "write", + "unknown_default_open_api", +} + +func (v *PermissionsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PermissionsInner(value) + for _, existing := range AllowedPermissionsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PERMISSIONSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPermissionsInnerFromValue returns a pointer to a valid PermissionsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPermissionsInnerFromValue(v string) (*PermissionsInner, error) { + ev := PermissionsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PermissionsInner: valid values are %v", v, AllowedPermissionsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PermissionsInner) IsValid() bool { + for _, existing := range AllowedPermissionsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to permissions_inner value +func (v PermissionsInner) Ptr() *PermissionsInner { + return &v +} + +type NullablePermissionsInner struct { + value *PermissionsInner + isSet bool +} + +func (v NullablePermissionsInner) Get() *PermissionsInner { + return v.value +} + +func (v *NullablePermissionsInner) Set(val *PermissionsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePermissionsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePermissionsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermissionsInner(val *PermissionsInner) *NullablePermissionsInner { + return &NullablePermissionsInner{value: val, isSet: true} +} + +func (v NullablePermissionsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermissionsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1betaapi/api_default.go b/services/logs/v1betaapi/api_default.go index bbc91c87b..5147e19ce 100644 --- a/services/logs/v1betaapi/api_default.go +++ b/services/logs/v1betaapi/api_default.go @@ -34,7 +34,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiCreateAccessTokenRequest */ - CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest + CreateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiCreateAccessTokenRequest // CreateAccessTokenExecute executes the request // @return AccessToken @@ -50,7 +50,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiCreateLogsInstanceRequest */ - CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest + CreateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiCreateLogsInstanceRequest // CreateLogsInstanceExecute executes the request // @return LogsInstance @@ -68,7 +68,7 @@ type DefaultAPI interface { @param tId The access token UUID. @return ApiDeleteAccessTokenRequest */ - DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest + DeleteAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiDeleteAccessTokenRequest // DeleteAccessTokenExecute executes the request DeleteAccessTokenExecute(r ApiDeleteAccessTokenRequest) error @@ -84,7 +84,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiDeleteAllAccessTokensRequest */ - DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest + DeleteAllAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllAccessTokensRequest // DeleteAllAccessTokensExecute executes the request // @return AccessTokenList @@ -101,7 +101,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiDeleteAllExpiredAccessTokensRequest */ - DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest + DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllExpiredAccessTokensRequest // DeleteAllExpiredAccessTokensExecute executes the request // @return AccessTokenList @@ -118,7 +118,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiDeleteLogsInstanceRequest */ - DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest + DeleteLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteLogsInstanceRequest // DeleteLogsInstanceExecute executes the request DeleteLogsInstanceExecute(r ApiDeleteLogsInstanceRequest) error @@ -135,7 +135,7 @@ type DefaultAPI interface { @param tId The access token UUID. @return ApiGetAccessTokenRequest */ - GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest + GetAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiGetAccessTokenRequest // GetAccessTokenExecute executes the request // @return AccessToken @@ -152,7 +152,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiGetLogsInstanceRequest */ - GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest + GetLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiGetLogsInstanceRequest // GetLogsInstanceExecute executes the request // @return LogsInstance @@ -169,7 +169,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiListAccessTokensRequest */ - ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest + ListAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiListAccessTokensRequest // ListAccessTokensExecute executes the request // @return AccessTokenList @@ -185,7 +185,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiListLogsInstancesRequest */ - ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest + ListLogsInstances(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiListLogsInstancesRequest // ListLogsInstancesExecute executes the request // @return LogsInstancesList @@ -203,7 +203,7 @@ type DefaultAPI interface { @param tId The access token UUID. @return ApiUpdateAccessTokenRequest */ - UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest + UpdateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiUpdateAccessTokenRequest // UpdateAccessTokenExecute executes the request UpdateAccessTokenExecute(r ApiUpdateAccessTokenRequest) error @@ -219,7 +219,7 @@ type DefaultAPI interface { @param instanceId The Logs Instance UUID. @return ApiUpdateLogsInstanceRequest */ - UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest + UpdateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiUpdateLogsInstanceRequest // UpdateLogsInstanceExecute executes the request // @return LogsInstance @@ -233,7 +233,7 @@ type ApiCreateAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string createAccessTokenPayload *CreateAccessTokenPayload } @@ -258,7 +258,7 @@ Create a new Logs instance access token @param instanceId The Logs Instance UUID. @return ApiCreateAccessTokenRequest */ -func (a *DefaultAPIService) CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest { +func (a *DefaultAPIService) CreateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiCreateAccessTokenRequest { return ApiCreateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -378,7 +378,7 @@ type ApiCreateLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter createLogsInstancePayload *CreateLogsInstancePayload } @@ -401,7 +401,7 @@ Creates a new Logs instance within the project. @param regionId The STACKIT region name the resource is located in. @return ApiCreateLogsInstanceRequest */ -func (a *DefaultAPIService) CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest { +func (a *DefaultAPIService) CreateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiCreateLogsInstanceRequest { return ApiCreateLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -519,7 +519,7 @@ type ApiDeleteAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string tId string } @@ -540,7 +540,7 @@ Deletes a Logs instance access token @param tId The access token UUID. @return ApiDeleteAccessTokenRequest */ -func (a *DefaultAPIService) DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest { +func (a *DefaultAPIService) DeleteAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiDeleteAccessTokenRequest { return ApiDeleteAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -644,7 +644,7 @@ type ApiDeleteAllAccessTokensRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -663,7 +663,7 @@ Deletes all access tokens available for a Logs instance @param instanceId The Logs Instance UUID. @return ApiDeleteAllAccessTokensRequest */ -func (a *DefaultAPIService) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest { +func (a *DefaultAPIService) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllAccessTokensRequest { return ApiDeleteAllAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -778,7 +778,7 @@ type ApiDeleteAllExpiredAccessTokensRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -797,7 +797,7 @@ Deletes all expired access tokens @param instanceId The Logs Instance UUID. @return ApiDeleteAllExpiredAccessTokensRequest */ -func (a *DefaultAPIService) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { +func (a *DefaultAPIService) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { return ApiDeleteAllExpiredAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -912,7 +912,7 @@ type ApiDeleteLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -931,7 +931,7 @@ Deletes the given Logs instance. @param instanceId The Logs Instance UUID. @return ApiDeleteLogsInstanceRequest */ -func (a *DefaultAPIService) DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest { +func (a *DefaultAPIService) DeleteLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteLogsInstanceRequest { return ApiDeleteLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -1033,7 +1033,7 @@ type ApiGetAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string tId string } @@ -1054,7 +1054,7 @@ Get the information of the given access token. @param tId The access token UUID. @return ApiGetAccessTokenRequest */ -func (a *DefaultAPIService) GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest { +func (a *DefaultAPIService) GetAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiGetAccessTokenRequest { return ApiGetAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -1171,7 +1171,7 @@ type ApiGetLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -1190,7 +1190,7 @@ Returns the details for the given Logs instance. @param instanceId The Logs Instance UUID. @return ApiGetLogsInstanceRequest */ -func (a *DefaultAPIService) GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest { +func (a *DefaultAPIService) GetLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiGetLogsInstanceRequest { return ApiGetLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -1305,7 +1305,7 @@ type ApiListAccessTokensRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string } @@ -1324,7 +1324,7 @@ Returns a list of access tokens created for a Logs instance @param instanceId The Logs Instance UUID. @return ApiListAccessTokensRequest */ -func (a *DefaultAPIService) ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest { +func (a *DefaultAPIService) ListAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiListAccessTokensRequest { return ApiListAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -1439,7 +1439,7 @@ type ApiListLogsInstancesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter } func (r ApiListLogsInstancesRequest) Execute() (*LogsInstancesList, error) { @@ -1456,7 +1456,7 @@ Returns a list of all Logs instances within the project. @param regionId The STACKIT region name the resource is located in. @return ApiListLogsInstancesRequest */ -func (a *DefaultAPIService) ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest { +func (a *DefaultAPIService) ListLogsInstances(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiListLogsInstancesRequest { return ApiListLogsInstancesRequest{ ApiService: a, ctx: ctx, @@ -1569,7 +1569,7 @@ type ApiUpdateAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string tId string updateAccessTokenPayload *UpdateAccessTokenPayload @@ -1596,7 +1596,7 @@ Updates the given access token. @param tId The access token UUID. @return ApiUpdateAccessTokenRequest */ -func (a *DefaultAPIService) UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest { +func (a *DefaultAPIService) UpdateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiUpdateAccessTokenRequest { return ApiUpdateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -1705,7 +1705,7 @@ type ApiUpdateLogsInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListLogsInstancesRegionIdParameter instanceId string updateLogsInstancePayload *UpdateLogsInstancePayload } @@ -1730,7 +1730,7 @@ Updates the given Logs instance. @param instanceId The Logs Instance UUID. @return ApiUpdateLogsInstanceRequest */ -func (a *DefaultAPIService) UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest { +func (a *DefaultAPIService) UpdateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiUpdateLogsInstanceRequest { return ApiUpdateLogsInstanceRequest{ ApiService: a, ctx: ctx, diff --git a/services/logs/v1betaapi/api_default_mock.go b/services/logs/v1betaapi/api_default_mock.go index 213c40462..8f2c5db84 100644 --- a/services/logs/v1betaapi/api_default_mock.go +++ b/services/logs/v1betaapi/api_default_mock.go @@ -46,7 +46,7 @@ type DefaultAPIServiceMock struct { UpdateLogsInstanceExecuteMock *func(r ApiUpdateLogsInstanceRequest) (*LogsInstance, error) } -func (a DefaultAPIServiceMock) CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest { +func (a DefaultAPIServiceMock) CreateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiCreateAccessTokenRequest { return ApiCreateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -66,7 +66,7 @@ func (a DefaultAPIServiceMock) CreateAccessTokenExecute(r ApiCreateAccessTokenRe return (*a.CreateAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest { +func (a DefaultAPIServiceMock) CreateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiCreateLogsInstanceRequest { return ApiCreateLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -85,7 +85,7 @@ func (a DefaultAPIServiceMock) CreateLogsInstanceExecute(r ApiCreateLogsInstance return (*a.CreateLogsInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest { +func (a DefaultAPIServiceMock) DeleteAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiDeleteAccessTokenRequest { return ApiDeleteAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -105,7 +105,7 @@ func (a DefaultAPIServiceMock) DeleteAccessTokenExecute(r ApiDeleteAccessTokenRe return (*a.DeleteAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest { +func (a DefaultAPIServiceMock) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllAccessTokensRequest { return ApiDeleteAllAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -125,7 +125,7 @@ func (a DefaultAPIServiceMock) DeleteAllAccessTokensExecute(r ApiDeleteAllAccess return (*a.DeleteAllAccessTokensExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { +func (a DefaultAPIServiceMock) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { return ApiDeleteAllExpiredAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -145,7 +145,7 @@ func (a DefaultAPIServiceMock) DeleteAllExpiredAccessTokensExecute(r ApiDeleteAl return (*a.DeleteAllExpiredAccessTokensExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest { +func (a DefaultAPIServiceMock) DeleteLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiDeleteLogsInstanceRequest { return ApiDeleteLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -164,7 +164,7 @@ func (a DefaultAPIServiceMock) DeleteLogsInstanceExecute(r ApiDeleteLogsInstance return (*a.DeleteLogsInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest { +func (a DefaultAPIServiceMock) GetAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiGetAccessTokenRequest { return ApiGetAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -185,7 +185,7 @@ func (a DefaultAPIServiceMock) GetAccessTokenExecute(r ApiGetAccessTokenRequest) return (*a.GetAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest { +func (a DefaultAPIServiceMock) GetLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiGetLogsInstanceRequest { return ApiGetLogsInstanceRequest{ ApiService: a, ctx: ctx, @@ -205,7 +205,7 @@ func (a DefaultAPIServiceMock) GetLogsInstanceExecute(r ApiGetLogsInstanceReques return (*a.GetLogsInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest { +func (a DefaultAPIServiceMock) ListAccessTokens(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiListAccessTokensRequest { return ApiListAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -225,7 +225,7 @@ func (a DefaultAPIServiceMock) ListAccessTokensExecute(r ApiListAccessTokensRequ return (*a.ListAccessTokensExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest { +func (a DefaultAPIServiceMock) ListLogsInstances(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter) ApiListLogsInstancesRequest { return ApiListLogsInstancesRequest{ ApiService: a, ctx: ctx, @@ -244,7 +244,7 @@ func (a DefaultAPIServiceMock) ListLogsInstancesExecute(r ApiListLogsInstancesRe return (*a.ListLogsInstancesExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest { +func (a DefaultAPIServiceMock) UpdateAccessToken(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string, tId string) ApiUpdateAccessTokenRequest { return ApiUpdateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -264,7 +264,7 @@ func (a DefaultAPIServiceMock) UpdateAccessTokenExecute(r ApiUpdateAccessTokenRe return (*a.UpdateAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest { +func (a DefaultAPIServiceMock) UpdateLogsInstance(ctx context.Context, projectId string, regionId ListLogsInstancesRegionIdParameter, instanceId string) ApiUpdateLogsInstanceRequest { return ApiUpdateLogsInstanceRequest{ ApiService: a, ctx: ctx, diff --git a/services/logs/v1betaapi/model_access_token.go b/services/logs/v1betaapi/model_access_token.go index 7e25014f8..540b9ecda 100644 --- a/services/logs/v1betaapi/model_access_token.go +++ b/services/logs/v1betaapi/model_access_token.go @@ -34,8 +34,8 @@ type AccessToken struct { // An auto generated unique id which identifies the access token. Id string `json:"id"` // The access permissions granted to the access token. - Permissions []string `json:"permissions"` - Status string `json:"status"` + Permissions []PermissionsInner `json:"permissions"` + Status AccessTokenStatus `json:"status"` // The date and time util an access token is valid to (inclusively). ValidUntil *time.Time `json:"validUntil,omitempty"` AdditionalProperties map[string]interface{} @@ -47,7 +47,7 @@ type _AccessToken AccessToken // 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 NewAccessToken(creator string, displayName string, expires bool, id string, permissions []string, status string) *AccessToken { +func NewAccessToken(creator string, displayName string, expires bool, id string, permissions []PermissionsInner, status AccessTokenStatus) *AccessToken { this := AccessToken{} this.Creator = creator this.DisplayName = displayName @@ -227,9 +227,9 @@ func (o *AccessToken) SetId(v string) { } // GetPermissions returns the Permissions field value -func (o *AccessToken) GetPermissions() []string { +func (o *AccessToken) GetPermissions() []PermissionsInner { if o == nil { - var ret []string + var ret []PermissionsInner return ret } @@ -238,7 +238,7 @@ func (o *AccessToken) GetPermissions() []string { // GetPermissionsOk returns a tuple with the Permissions field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetPermissionsOk() ([]string, bool) { +func (o *AccessToken) GetPermissionsOk() ([]PermissionsInner, bool) { if o == nil { return nil, false } @@ -246,14 +246,14 @@ func (o *AccessToken) GetPermissionsOk() ([]string, bool) { } // SetPermissions sets field value -func (o *AccessToken) SetPermissions(v []string) { +func (o *AccessToken) SetPermissions(v []PermissionsInner) { o.Permissions = v } // GetStatus returns the Status field value -func (o *AccessToken) GetStatus() string { +func (o *AccessToken) GetStatus() AccessTokenStatus { if o == nil { - var ret string + var ret AccessTokenStatus return ret } @@ -262,7 +262,7 @@ func (o *AccessToken) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *AccessToken) GetStatusOk() (*string, bool) { +func (o *AccessToken) GetStatusOk() (*AccessTokenStatus, bool) { if o == nil { return nil, false } @@ -270,7 +270,7 @@ func (o *AccessToken) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *AccessToken) SetStatus(v string) { +func (o *AccessToken) SetStatus(v AccessTokenStatus) { o.Status = v } diff --git a/services/logs/v1betaapi/model_access_token_status.go b/services/logs/v1betaapi/model_access_token_status.go new file mode 100644 index 000000000..61d4c4d68 --- /dev/null +++ b/services/logs/v1betaapi/model_access_token_status.go @@ -0,0 +1,113 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// AccessTokenStatus the model 'AccessTokenStatus' +type AccessTokenStatus string + +// List of accessToken_status +const ( + ACCESSTOKENSTATUS_ACTIVE AccessTokenStatus = "active" + ACCESSTOKENSTATUS_EXPIRED AccessTokenStatus = "expired" + ACCESSTOKENSTATUS_UNKNOWN_DEFAULT_OPEN_API AccessTokenStatus = "unknown_default_open_api" +) + +// All allowed values of AccessTokenStatus enum +var AllowedAccessTokenStatusEnumValues = []AccessTokenStatus{ + "active", + "expired", + "unknown_default_open_api", +} + +func (v *AccessTokenStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AccessTokenStatus(value) + for _, existing := range AllowedAccessTokenStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ACCESSTOKENSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAccessTokenStatusFromValue returns a pointer to a valid AccessTokenStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAccessTokenStatusFromValue(v string) (*AccessTokenStatus, error) { + ev := AccessTokenStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AccessTokenStatus: valid values are %v", v, AllowedAccessTokenStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AccessTokenStatus) IsValid() bool { + for _, existing := range AllowedAccessTokenStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to accessToken_status value +func (v AccessTokenStatus) Ptr() *AccessTokenStatus { + return &v +} + +type NullableAccessTokenStatus struct { + value *AccessTokenStatus + isSet bool +} + +func (v NullableAccessTokenStatus) Get() *AccessTokenStatus { + return v.value +} + +func (v *NullableAccessTokenStatus) Set(val *AccessTokenStatus) { + v.value = val + v.isSet = true +} + +func (v NullableAccessTokenStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessTokenStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessTokenStatus(val *AccessTokenStatus) *NullableAccessTokenStatus { + return &NullableAccessTokenStatus{value: val, isSet: true} +} + +func (v NullableAccessTokenStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessTokenStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1betaapi/model_create_access_token_payload.go b/services/logs/v1betaapi/model_create_access_token_payload.go index f2280d98c..a2e69efa4 100644 --- a/services/logs/v1betaapi/model_create_access_token_payload.go +++ b/services/logs/v1betaapi/model_create_access_token_payload.go @@ -27,7 +27,7 @@ type CreateAccessTokenPayload struct { // A lifetime period for an access token in days. If unset the token will not expire. Lifetime *int32 `json:"lifetime,omitempty"` // The access permissions granted to the access token. - Permissions []string `json:"permissions"` + Permissions []PermissionsInner `json:"permissions"` AdditionalProperties map[string]interface{} } @@ -37,7 +37,7 @@ type _CreateAccessTokenPayload CreateAccessTokenPayload // 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 NewCreateAccessTokenPayload(displayName string, permissions []string) *CreateAccessTokenPayload { +func NewCreateAccessTokenPayload(displayName string, permissions []PermissionsInner) *CreateAccessTokenPayload { this := CreateAccessTokenPayload{} this.DisplayName = displayName this.Permissions = permissions @@ -141,9 +141,9 @@ func (o *CreateAccessTokenPayload) SetLifetime(v int32) { } // GetPermissions returns the Permissions field value -func (o *CreateAccessTokenPayload) GetPermissions() []string { +func (o *CreateAccessTokenPayload) GetPermissions() []PermissionsInner { if o == nil { - var ret []string + var ret []PermissionsInner return ret } @@ -152,7 +152,7 @@ func (o *CreateAccessTokenPayload) GetPermissions() []string { // GetPermissionsOk returns a tuple with the Permissions field value // and a boolean to check if the value has been set. -func (o *CreateAccessTokenPayload) GetPermissionsOk() ([]string, bool) { +func (o *CreateAccessTokenPayload) GetPermissionsOk() ([]PermissionsInner, bool) { if o == nil { return nil, false } @@ -160,7 +160,7 @@ func (o *CreateAccessTokenPayload) GetPermissionsOk() ([]string, bool) { } // SetPermissions sets field value -func (o *CreateAccessTokenPayload) SetPermissions(v []string) { +func (o *CreateAccessTokenPayload) SetPermissions(v []PermissionsInner) { o.Permissions = v } diff --git a/services/logs/v1betaapi/model_list_logs_instances_region_id_parameter.go b/services/logs/v1betaapi/model_list_logs_instances_region_id_parameter.go new file mode 100644 index 000000000..efec38aa6 --- /dev/null +++ b/services/logs/v1betaapi/model_list_logs_instances_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ListLogsInstancesRegionIdParameter the model 'ListLogsInstancesRegionIdParameter' +type ListLogsInstancesRegionIdParameter string + +// List of ListLogsInstances_regionId_parameter +const ( + LISTLOGSINSTANCESREGIONIDPARAMETER_EU01 ListLogsInstancesRegionIdParameter = "eu01" + LISTLOGSINSTANCESREGIONIDPARAMETER_EU02 ListLogsInstancesRegionIdParameter = "eu02" + LISTLOGSINSTANCESREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListLogsInstancesRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of ListLogsInstancesRegionIdParameter enum +var AllowedListLogsInstancesRegionIdParameterEnumValues = []ListLogsInstancesRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListLogsInstancesRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListLogsInstancesRegionIdParameter(value) + for _, existing := range AllowedListLogsInstancesRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTLOGSINSTANCESREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListLogsInstancesRegionIdParameterFromValue returns a pointer to a valid ListLogsInstancesRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListLogsInstancesRegionIdParameterFromValue(v string) (*ListLogsInstancesRegionIdParameter, error) { + ev := ListLogsInstancesRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListLogsInstancesRegionIdParameter: valid values are %v", v, AllowedListLogsInstancesRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListLogsInstancesRegionIdParameter) IsValid() bool { + for _, existing := range AllowedListLogsInstancesRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListLogsInstances_regionId_parameter value +func (v ListLogsInstancesRegionIdParameter) Ptr() *ListLogsInstancesRegionIdParameter { + return &v +} + +type NullableListLogsInstancesRegionIdParameter struct { + value *ListLogsInstancesRegionIdParameter + isSet bool +} + +func (v NullableListLogsInstancesRegionIdParameter) Get() *ListLogsInstancesRegionIdParameter { + return v.value +} + +func (v *NullableListLogsInstancesRegionIdParameter) Set(val *ListLogsInstancesRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListLogsInstancesRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListLogsInstancesRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListLogsInstancesRegionIdParameter(val *ListLogsInstancesRegionIdParameter) *NullableListLogsInstancesRegionIdParameter { + return &NullableListLogsInstancesRegionIdParameter{value: val, isSet: true} +} + +func (v NullableListLogsInstancesRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListLogsInstancesRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1betaapi/model_logs_instance.go b/services/logs/v1betaapi/model_logs_instance.go index 7de96f433..068c43965 100644 --- a/services/logs/v1betaapi/model_logs_instance.go +++ b/services/logs/v1betaapi/model_logs_instance.go @@ -42,9 +42,8 @@ type LogsInstance struct { // The Logs instance's query URL QueryUrl *string `json:"queryUrl,omitempty"` // The log retention time in days. - RetentionDays int32 `json:"retentionDays"` - // The current status of the Logs instance. - Status string `json:"status"` + RetentionDays int32 `json:"retentionDays"` + Status LogsInstanceStatus `json:"status"` AdditionalProperties map[string]interface{} } @@ -54,7 +53,7 @@ type _LogsInstance LogsInstance // 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 NewLogsInstance(created time.Time, displayName string, id string, retentionDays int32, status string) *LogsInstance { +func NewLogsInstance(created time.Time, displayName string, id string, retentionDays int32, status LogsInstanceStatus) *LogsInstance { this := LogsInstance{} this.Created = created this.DisplayName = displayName @@ -393,9 +392,9 @@ func (o *LogsInstance) SetRetentionDays(v int32) { } // GetStatus returns the Status field value -func (o *LogsInstance) GetStatus() string { +func (o *LogsInstance) GetStatus() LogsInstanceStatus { if o == nil { - var ret string + var ret LogsInstanceStatus return ret } @@ -404,7 +403,7 @@ func (o *LogsInstance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *LogsInstance) GetStatusOk() (*string, bool) { +func (o *LogsInstance) GetStatusOk() (*LogsInstanceStatus, bool) { if o == nil { return nil, false } @@ -412,7 +411,7 @@ func (o *LogsInstance) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *LogsInstance) SetStatus(v string) { +func (o *LogsInstance) SetStatus(v LogsInstanceStatus) { o.Status = v } diff --git a/services/logs/v1betaapi/model_logs_instance_status.go b/services/logs/v1betaapi/model_logs_instance_status.go new file mode 100644 index 000000000..c81abf034 --- /dev/null +++ b/services/logs/v1betaapi/model_logs_instance_status.go @@ -0,0 +1,115 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// LogsInstanceStatus The current status of the Logs instance. +type LogsInstanceStatus string + +// List of logsInstance_status +const ( + LOGSINSTANCESTATUS_ACTIVE LogsInstanceStatus = "active" + LOGSINSTANCESTATUS_DELETING LogsInstanceStatus = "deleting" + LOGSINSTANCESTATUS_RECONCILING LogsInstanceStatus = "reconciling" + LOGSINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API LogsInstanceStatus = "unknown_default_open_api" +) + +// All allowed values of LogsInstanceStatus enum +var AllowedLogsInstanceStatusEnumValues = []LogsInstanceStatus{ + "active", + "deleting", + "reconciling", + "unknown_default_open_api", +} + +func (v *LogsInstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LogsInstanceStatus(value) + for _, existing := range AllowedLogsInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOGSINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLogsInstanceStatusFromValue returns a pointer to a valid LogsInstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLogsInstanceStatusFromValue(v string) (*LogsInstanceStatus, error) { + ev := LogsInstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LogsInstanceStatus: valid values are %v", v, AllowedLogsInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LogsInstanceStatus) IsValid() bool { + for _, existing := range AllowedLogsInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to logsInstance_status value +func (v LogsInstanceStatus) Ptr() *LogsInstanceStatus { + return &v +} + +type NullableLogsInstanceStatus struct { + value *LogsInstanceStatus + isSet bool +} + +func (v NullableLogsInstanceStatus) Get() *LogsInstanceStatus { + return v.value +} + +func (v *NullableLogsInstanceStatus) Set(val *LogsInstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableLogsInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableLogsInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLogsInstanceStatus(val *LogsInstanceStatus) *NullableLogsInstanceStatus { + return &NullableLogsInstanceStatus{value: val, isSet: true} +} + +func (v NullableLogsInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLogsInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logs/v1betaapi/model_permissions_inner.go b/services/logs/v1betaapi/model_permissions_inner.go new file mode 100644 index 000000000..a4fdc095a --- /dev/null +++ b/services/logs/v1betaapi/model_permissions_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// PermissionsInner the model 'PermissionsInner' +type PermissionsInner string + +// List of permissions_inner +const ( + PERMISSIONSINNER_READ PermissionsInner = "read" + PERMISSIONSINNER_WRITE PermissionsInner = "write" + PERMISSIONSINNER_UNKNOWN_DEFAULT_OPEN_API PermissionsInner = "unknown_default_open_api" +) + +// All allowed values of PermissionsInner enum +var AllowedPermissionsInnerEnumValues = []PermissionsInner{ + "read", + "write", + "unknown_default_open_api", +} + +func (v *PermissionsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PermissionsInner(value) + for _, existing := range AllowedPermissionsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PERMISSIONSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPermissionsInnerFromValue returns a pointer to a valid PermissionsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPermissionsInnerFromValue(v string) (*PermissionsInner, error) { + ev := PermissionsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PermissionsInner: valid values are %v", v, AllowedPermissionsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PermissionsInner) IsValid() bool { + for _, existing := range AllowedPermissionsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to permissions_inner value +func (v PermissionsInner) Ptr() *PermissionsInner { + return &v +} + +type NullablePermissionsInner struct { + value *PermissionsInner + isSet bool +} + +func (v NullablePermissionsInner) Get() *PermissionsInner { + return v.value +} + +func (v *NullablePermissionsInner) Set(val *PermissionsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePermissionsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePermissionsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermissionsInner(val *PermissionsInner) *NullablePermissionsInner { + return &NullablePermissionsInner{value: val, isSet: true} +} + +func (v NullablePermissionsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermissionsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 3068dbbb1ce9ca512804b3cb633b833db2fcc74f Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 12:13:50 +0200 Subject: [PATCH 22/66] chore(logs): fix waiters/tests/examples, write changelog, bump version --- CHANGELOG.md | 2 ++ examples/logs/logs.go | 4 ++-- services/logs/CHANGELOG.md | 3 +++ services/logs/VERSION | 2 +- services/logs/v1api/wait/wait.go | 24 ++++++++---------------- services/logs/v1api/wait/wait_test.go | 8 ++++---- 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb656b120..9c03dba49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -230,6 +230,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` - [v0.9.0](services/logs/CHANGELOG.md#v090) - **Improvement:** Use new WaiterHelper for Logs waiters + - [v0.10.0](services/logs/CHANGELOG.md#v0100) + - **Feature:** Introduce enums for various attributes - `mariadb`: - [v0.27.3](services/mariadb/CHANGELOG.md#v0273) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/examples/logs/logs.go b/examples/logs/logs.go index cde5abf28..62ac24ec2 100644 --- a/examples/logs/logs.go +++ b/examples/logs/logs.go @@ -12,7 +12,7 @@ func main() { ctx := context.Background() projectId := "PROJECT_ID" // the uuid of your STACKIT project - regionId := "eu01" + regionId := logs.LISTLOGSINSTANCESREGIONIDPARAMETER_EU01 client, err := logs.NewAPIClient() if err != nil { @@ -63,7 +63,7 @@ func main() { // Create an Access Token createTokenPayload := logs.CreateAccessTokenPayload{ DisplayName: "my-access-token", - Permissions: []string{"read"}, + Permissions: []logs.PermissionsInner{logs.PERMISSIONSINNER_READ}, } createTokenResp, err := client.DefaultAPI.CreateAccessToken(ctx, projectId, regionId, createdInstance). CreateAccessTokenPayload(createTokenPayload). diff --git a/services/logs/CHANGELOG.md b/services/logs/CHANGELOG.md index e1e965e2f..d5ff27407 100644 --- a/services/logs/CHANGELOG.md +++ b/services/logs/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.10.0 +- **Feature:** Introduce enums for various attributes + ## v0.9.0 - **Improvement:** Use new WaiterHelper for Logs waiters diff --git a/services/logs/VERSION b/services/logs/VERSION index 7965b36d6..f78dc3652 100644 --- a/services/logs/VERSION +++ b/services/logs/VERSION @@ -1 +1 @@ -v0.9.0 \ No newline at end of file +v0.10.0 \ No newline at end of file diff --git a/services/logs/v1api/wait/wait.go b/services/logs/v1api/wait/wait.go index 013134648..e21b1eeee 100644 --- a/services/logs/v1api/wait/wait.go +++ b/services/logs/v1api/wait/wait.go @@ -11,26 +11,18 @@ import ( logs "github.com/stackitcloud/stackit-sdk-go/services/logs/v1api" ) -const ( - instanceStatusActive = "active" - instanceStatusDeleting = "deleting" -) - // CreateLogsInstanceWaitHandler will wait for logs instance creation -func CreateLogsInstanceWaitHandler(ctx context.Context, client logs.DefaultAPI, projectID, region, instanceID string) *wait.AsyncActionHandler[logs.LogsInstance] { - waitConfig := wait.WaiterHelper[logs.LogsInstance, string]{ +func CreateLogsInstanceWaitHandler(ctx context.Context, client logs.DefaultAPI, projectID string, region logs.ListLogsInstancesRegionIdParameter, instanceID string) *wait.AsyncActionHandler[logs.LogsInstance] { + waitConfig := wait.WaiterHelper[logs.LogsInstance, logs.LogsInstanceStatus]{ FetchInstance: client.GetLogsInstance(ctx, projectID, region, instanceID).Execute, - GetState: func(l *logs.LogsInstance) (string, error) { + GetState: func(l *logs.LogsInstance) (logs.LogsInstanceStatus, error) { if l == nil { return "", fmt.Errorf("empty response") } - if l.Status == "" { - return "", fmt.Errorf("instance status is empty") - } return l.Status, nil }, - ActiveState: []string{instanceStatusActive}, - ErrorState: []string{instanceStatusDeleting}, + ActiveState: []logs.LogsInstanceStatus{logs.LOGSINSTANCESTATUS_ACTIVE}, + ErrorState: []logs.LogsInstanceStatus{logs.LOGSINSTANCESTATUS_DELETING}, } handler := wait.New(waitConfig.Wait()) @@ -39,10 +31,10 @@ func CreateLogsInstanceWaitHandler(ctx context.Context, client logs.DefaultAPI, } // DeleteLogsInstanceWaitHandler will wait for logs instance deletion -func DeleteLogsInstanceWaitHandler(ctx context.Context, client logs.DefaultAPI, projectID, region, instanceID string) *wait.AsyncActionHandler[logs.LogsInstance] { - waitConfig := wait.WaiterHelper[logs.LogsInstance, string]{ +func DeleteLogsInstanceWaitHandler(ctx context.Context, client logs.DefaultAPI, projectID string, region logs.ListLogsInstancesRegionIdParameter, instanceID string) *wait.AsyncActionHandler[logs.LogsInstance] { + waitConfig := wait.WaiterHelper[logs.LogsInstance, logs.LogsInstanceStatus]{ FetchInstance: client.GetLogsInstance(ctx, projectID, region, instanceID).Execute, - GetState: func(l *logs.LogsInstance) (string, error) { + GetState: func(l *logs.LogsInstance) (logs.LogsInstanceStatus, error) { if l == nil { return "", errors.New("empty response") } diff --git a/services/logs/v1api/wait/wait_test.go b/services/logs/v1api/wait/wait_test.go index 9298efa6a..3e37d2770 100644 --- a/services/logs/v1api/wait/wait_test.go +++ b/services/logs/v1api/wait/wait_test.go @@ -41,7 +41,7 @@ func newAPIMock(settings mockSettings) logs.DefaultAPI { var projectId = uuid.NewString() var instanceId = uuid.NewString() -const region = "eu01" +const region = logs.LISTLOGSINSTANCESREGIONIDPARAMETER_EU01 func TestCreateLogsInstanceWaitHandler(t *testing.T) { tests := []struct { @@ -60,7 +60,7 @@ func TestCreateLogsInstanceWaitHandler(t *testing.T) { returnInstance: true, getLogsResponse: &logs.LogsInstance{ Id: instanceId, - Status: instanceStatusActive, + Status: logs.LOGSINSTANCESTATUS_ACTIVE, }, }, { @@ -71,7 +71,7 @@ func TestCreateLogsInstanceWaitHandler(t *testing.T) { returnInstance: true, getLogsResponse: &logs.LogsInstance{ Id: instanceId, - Status: instanceStatusActive, + Status: logs.LOGSINSTANCESTATUS_ACTIVE, }, }, { @@ -92,7 +92,7 @@ func TestCreateLogsInstanceWaitHandler(t *testing.T) { returnInstance: false, getLogsResponse: &logs.LogsInstance{ Id: instanceId, - Status: instanceStatusDeleting, + Status: logs.LOGSINSTANCESTATUS_DELETING, }, }, } From e2a8b6b937f43040d365141ee888d12f8c7280a4 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 12:14:54 +0200 Subject: [PATCH 23/66] refac(mariadb): introduce inline enums --- services/mariadb/v1api/model_instance.go | 12 +- .../v1api/model_instance_last_operation.go | 24 ++-- .../model_instance_last_operation_state.go | 115 +++++++++++++++++ .../model_instance_last_operation_type.go | 115 +++++++++++++++++ .../mariadb/v1api/model_instance_status.go | 121 ++++++++++++++++++ 5 files changed, 369 insertions(+), 18 deletions(-) create mode 100644 services/mariadb/v1api/model_instance_last_operation_state.go create mode 100644 services/mariadb/v1api/model_instance_last_operation_type.go create mode 100644 services/mariadb/v1api/model_instance_status.go diff --git a/services/mariadb/v1api/model_instance.go b/services/mariadb/v1api/model_instance.go index c36fd868e..0057dc157 100644 --- a/services/mariadb/v1api/model_instance.go +++ b/services/mariadb/v1api/model_instance.go @@ -34,7 +34,7 @@ type Instance struct { Parameters map[string]interface{} `json:"parameters"` PlanId string `json:"planId"` PlanName string `json:"planName"` - Status *string `json:"status,omitempty"` + Status *InstanceStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -393,9 +393,9 @@ func (o *Instance) SetPlanName(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Instance) GetStatus() string { +func (o *Instance) GetStatus() InstanceStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret InstanceStatus return ret } return *o.Status @@ -403,7 +403,7 @@ func (o *Instance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetStatusOk() (*string, bool) { +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -419,8 +419,8 @@ func (o *Instance) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Instance) SetStatus(v string) { +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { o.Status = &v } diff --git a/services/mariadb/v1api/model_instance_last_operation.go b/services/mariadb/v1api/model_instance_last_operation.go index 6b5387650..34e2ee6ed 100644 --- a/services/mariadb/v1api/model_instance_last_operation.go +++ b/services/mariadb/v1api/model_instance_last_operation.go @@ -20,9 +20,9 @@ var _ MappedNullable = &InstanceLastOperation{} // InstanceLastOperation struct for InstanceLastOperation type InstanceLastOperation struct { - Description string `json:"description"` - State string `json:"state"` - Type string `json:"type"` + Description string `json:"description"` + State InstanceLastOperationState `json:"state"` + Type InstanceLastOperationType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +32,7 @@ type _InstanceLastOperation InstanceLastOperation // 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 NewInstanceLastOperation(description string, state string, types string) *InstanceLastOperation { +func NewInstanceLastOperation(description string, state InstanceLastOperationState, types InstanceLastOperationType) *InstanceLastOperation { this := InstanceLastOperation{} this.Description = description this.State = state @@ -73,9 +73,9 @@ func (o *InstanceLastOperation) SetDescription(v string) { } // GetState returns the State field value -func (o *InstanceLastOperation) GetState() string { +func (o *InstanceLastOperation) GetState() InstanceLastOperationState { if o == nil { - var ret string + var ret InstanceLastOperationState return ret } @@ -84,7 +84,7 @@ func (o *InstanceLastOperation) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *InstanceLastOperation) GetStateOk() (*string, bool) { +func (o *InstanceLastOperation) GetStateOk() (*InstanceLastOperationState, bool) { if o == nil { return nil, false } @@ -92,14 +92,14 @@ func (o *InstanceLastOperation) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *InstanceLastOperation) SetState(v string) { +func (o *InstanceLastOperation) SetState(v InstanceLastOperationState) { o.State = v } // GetType returns the Type field value -func (o *InstanceLastOperation) GetType() string { +func (o *InstanceLastOperation) GetType() InstanceLastOperationType { if o == nil { - var ret string + var ret InstanceLastOperationType return ret } @@ -108,7 +108,7 @@ func (o *InstanceLastOperation) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *InstanceLastOperation) GetTypeOk() (*string, bool) { +func (o *InstanceLastOperation) GetTypeOk() (*InstanceLastOperationType, bool) { if o == nil { return nil, false } @@ -116,7 +116,7 @@ func (o *InstanceLastOperation) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *InstanceLastOperation) SetType(v string) { +func (o *InstanceLastOperation) SetType(v InstanceLastOperationType) { o.Type = v } diff --git a/services/mariadb/v1api/model_instance_last_operation_state.go b/services/mariadb/v1api/model_instance_last_operation_state.go new file mode 100644 index 000000000..f4b3ca6fd --- /dev/null +++ b/services/mariadb/v1api/model_instance_last_operation_state.go @@ -0,0 +1,115 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationState the model 'InstanceLastOperationState' +type InstanceLastOperationState string + +// List of InstanceLastOperation_state +const ( + INSTANCELASTOPERATIONSTATE_IN_PROGRESS InstanceLastOperationState = "in progress" + INSTANCELASTOPERATIONSTATE_SUCCEEDED InstanceLastOperationState = "succeeded" + INSTANCELASTOPERATIONSTATE_FAILED InstanceLastOperationState = "failed" + INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationState = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationState enum +var AllowedInstanceLastOperationStateEnumValues = []InstanceLastOperationState{ + "in progress", + "succeeded", + "failed", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationState(value) + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationStateFromValue returns a pointer to a valid InstanceLastOperationState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationStateFromValue(v string) (*InstanceLastOperationState, error) { + ev := InstanceLastOperationState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationState: valid values are %v", v, AllowedInstanceLastOperationStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationState) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_state value +func (v InstanceLastOperationState) Ptr() *InstanceLastOperationState { + return &v +} + +type NullableInstanceLastOperationState struct { + value *InstanceLastOperationState + isSet bool +} + +func (v NullableInstanceLastOperationState) Get() *InstanceLastOperationState { + return v.value +} + +func (v *NullableInstanceLastOperationState) Set(val *InstanceLastOperationState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationState(val *InstanceLastOperationState) *NullableInstanceLastOperationState { + return &NullableInstanceLastOperationState{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v1api/model_instance_last_operation_type.go b/services/mariadb/v1api/model_instance_last_operation_type.go new file mode 100644 index 000000000..fd9fb8d38 --- /dev/null +++ b/services/mariadb/v1api/model_instance_last_operation_type.go @@ -0,0 +1,115 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationType the model 'InstanceLastOperationType' +type InstanceLastOperationType string + +// List of InstanceLastOperation_type +const ( + INSTANCELASTOPERATIONTYPE_CREATE InstanceLastOperationType = "create" + INSTANCELASTOPERATIONTYPE_UPDATE InstanceLastOperationType = "update" + INSTANCELASTOPERATIONTYPE_DELETE InstanceLastOperationType = "delete" + INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationType = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationType enum +var AllowedInstanceLastOperationTypeEnumValues = []InstanceLastOperationType{ + "create", + "update", + "delete", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationType(value) + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationTypeFromValue returns a pointer to a valid InstanceLastOperationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationTypeFromValue(v string) (*InstanceLastOperationType, error) { + ev := InstanceLastOperationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationType: valid values are %v", v, AllowedInstanceLastOperationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationType) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_type value +func (v InstanceLastOperationType) Ptr() *InstanceLastOperationType { + return &v +} + +type NullableInstanceLastOperationType struct { + value *InstanceLastOperationType + isSet bool +} + +func (v NullableInstanceLastOperationType) Get() *InstanceLastOperationType { + return v.value +} + +func (v *NullableInstanceLastOperationType) Set(val *InstanceLastOperationType) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationType) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationType(val *InstanceLastOperationType) *NullableInstanceLastOperationType { + return &NullableInstanceLastOperationType{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mariadb/v1api/model_instance_status.go b/services/mariadb/v1api/model_instance_status.go new file mode 100644 index 000000000..14e8dd83a --- /dev/null +++ b/services/mariadb/v1api/model_instance_status.go @@ -0,0 +1,121 @@ +/* +STACKIT MariaDB API + +The STACKIT MariaDB API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus the model 'InstanceStatus' +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_FAILED InstanceStatus = "failed" + INSTANCESTATUS_STOPPED InstanceStatus = "stopped" + INSTANCESTATUS_CREATING InstanceStatus = "creating" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UPDATING InstanceStatus = "updating" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "active", + "failed", + "stopped", + "creating", + "deleting", + "updating", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 84eb2e9d70aebd414e0156fb982d0da9dfedd4ae Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 12:24:32 +0200 Subject: [PATCH 24/66] chore(mariadb): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/mariadb/CHANGELOG.md | 3 +++ services/mariadb/VERSION | 2 +- services/mariadb/v1api/wait/wait.go | 12 +++++------ services/mariadb/v1api/wait/wait_test.go | 26 ++++++++++++------------ 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c03dba49..cbefa963e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -241,6 +241,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v0.28.2](services/mariadb/CHANGELOG.md#v282) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` + - [v0.29.0](services/mariadb/CHANGELOG.md#v0290) + - **Feature:** Introduce enums for various attributes - `modelserving`: - [v0.8.3](services/modelserving/CHANGELOG.md#v083) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/mariadb/CHANGELOG.md b/services/mariadb/CHANGELOG.md index 569b1b632..f88cabe23 100644 --- a/services/mariadb/CHANGELOG.md +++ b/services/mariadb/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.29.0 +- **Feature:** Introduce enums for various attributes + ## v0.28.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` diff --git a/services/mariadb/VERSION b/services/mariadb/VERSION index f53b7bda1..5bc296535 100644 --- a/services/mariadb/VERSION +++ b/services/mariadb/VERSION @@ -1 +1 @@ -v0.28.2 \ No newline at end of file +v0.29.0 \ No newline at end of file diff --git a/services/mariadb/v1api/wait/wait.go b/services/mariadb/v1api/wait/wait.go index 0330dc14f..4ef31af4e 100644 --- a/services/mariadb/v1api/wait/wait.go +++ b/services/mariadb/v1api/wait/wait.go @@ -32,9 +32,9 @@ func CreateInstanceWaitHandler(ctx context.Context, a mariadb.DefaultAPI, projec return false, nil, fmt.Errorf("create failed for instance with id %s. The response is not valid: the status is missing", instanceId) } switch *s.Status { - case INSTANCESTATUS_ACTIVE: + case mariadb.INSTANCESTATUS_ACTIVE: return true, s, nil - case INSTANCESTATUS_FAILED: + case mariadb.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("create failed for instance with id %s: %s", instanceId, s.LastOperation.Description) } return false, nil, nil @@ -54,9 +54,9 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, a mariadb.DefaultAPI, return false, nil, fmt.Errorf("update failed for instance with id %s. The response is not valid: the instance id or the status are missing", instanceId) } switch *s.Status { - case INSTANCESTATUS_ACTIVE: + case mariadb.INSTANCESTATUS_ACTIVE: return true, s, nil - case INSTANCESTATUS_FAILED: + case mariadb.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("update failed for instance with id %s: %s", instanceId, s.LastOperation.Description) } return false, nil, nil @@ -73,10 +73,10 @@ func DeleteInstanceWaitHandler(ctx context.Context, a mariadb.DefaultAPI, projec if s.Status == nil { return false, nil, fmt.Errorf("delete failed for instance with id %s. The response is not valid: The status is missing", instanceId) } - if *s.Status != INSTANCESTATUS_DELETING { + if *s.Status != mariadb.INSTANCESTATUS_DELETING { return false, nil, nil } - if *s.Status == INSTANCESTATUS_ACTIVE { + if *s.Status == mariadb.INSTANCESTATUS_ACTIVE { if strings.Contains(s.LastOperation.Description, "DeleteFailed") || strings.Contains(s.LastOperation.Description, "failed") { return true, nil, fmt.Errorf("instance was deleted successfully but has errors: %s", s.LastOperation.Description) } diff --git a/services/mariadb/v1api/wait/wait_test.go b/services/mariadb/v1api/wait/wait_test.go index a98a66d7c..0b266d0e6 100644 --- a/services/mariadb/v1api/wait/wait_test.go +++ b/services/mariadb/v1api/wait/wait_test.go @@ -20,7 +20,7 @@ type mockSettings struct { instanceDeletionSucceedsWithErrors bool instanceResourceId string instanceResourceOperation *string - instanceResourceState *string + instanceResourceState *mariadb.InstanceStatus instanceResourceDescription string credentialGetFails bool @@ -81,21 +81,21 @@ func TestCreateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState *string + resourceState *mariadb.InstanceStatus wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(mariadb.INSTANCESTATUS_ACTIVE), wantErr: false, wantResp: true, }, { desc: "create_failed", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: utils.Ptr(mariadb.INSTANCESTATUS_FAILED), wantErr: true, wantResp: true, }, @@ -108,7 +108,7 @@ func TestCreateInstanceWaitHandler(t *testing.T) { { desc: "timeout", getFails: false, - resourceState: utils.Ptr("ANOTHER STATE"), + resourceState: utils.Ptr(mariadb.INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API), wantErr: true, wantResp: false, }, @@ -152,21 +152,21 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState *string + resourceState *mariadb.InstanceStatus wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(mariadb.INSTANCESTATUS_ACTIVE), wantErr: false, wantResp: true, }, { desc: "update_failed", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: utils.Ptr(mariadb.INSTANCESTATUS_FAILED), wantErr: true, wantResp: true, }, @@ -179,7 +179,7 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { { desc: "timeout", getFails: false, - resourceState: utils.Ptr("ANOTHER STATE"), + resourceState: utils.Ptr(mariadb.INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API), wantErr: true, wantResp: false, }, @@ -223,7 +223,7 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc string getFails bool deleteSucceeedsWithErrors bool - resourceState *string + resourceState *mariadb.InstanceStatus resourceDescription string wantErr bool }{ @@ -231,20 +231,20 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc: "delete_succeeded", getFails: false, deleteSucceeedsWithErrors: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(mariadb.INSTANCESTATUS_ACTIVE), wantErr: false, }, { desc: "delete_failed", getFails: false, deleteSucceeedsWithErrors: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: utils.Ptr(mariadb.INSTANCESTATUS_FAILED), wantErr: true, }, { desc: "delete_succeeds_with_errors", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(mariadb.INSTANCESTATUS_ACTIVE), deleteSucceeedsWithErrors: true, resourceDescription: "Deleting resource: cf failed with error: DeleteFailed", wantErr: true, From fbe8c16f4b6508a7fae4ca2bfc846842f4aae296 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 12:25:31 +0200 Subject: [PATCH 25/66] refac(modelserving): introduce inline enums --- .../v1api/model_chat_model_details.go | 46 +++---- .../v1api/model_chat_model_details_bits.go | 120 ++++++++++++++++++ .../model_chat_model_details_category.go | 116 +++++++++++++++++ ..._chat_model_details_quantization_method.go | 114 +++++++++++++++++ .../v1api/model_embedding_model_details.go | 16 +-- .../model_embedding_model_details_category.go | 116 +++++++++++++++++ services/modelserving/v1api/model_model.go | 34 ++--- .../v1api/model_model_category.go | 116 +++++++++++++++++ .../modelserving/v1api/model_model_type.go | 118 +++++++++++++++++ services/modelserving/v1api/model_token.go | 22 ++-- .../modelserving/v1api/model_token_created.go | 24 ++-- .../v1api/model_token_created_state.go | 116 +++++++++++++++++ .../modelserving/v1api/model_token_state.go | 118 +++++++++++++++++ 13 files changed, 1005 insertions(+), 71 deletions(-) create mode 100644 services/modelserving/v1api/model_chat_model_details_bits.go create mode 100644 services/modelserving/v1api/model_chat_model_details_category.go create mode 100644 services/modelserving/v1api/model_chat_model_details_quantization_method.go create mode 100644 services/modelserving/v1api/model_embedding_model_details_category.go create mode 100644 services/modelserving/v1api/model_model_category.go create mode 100644 services/modelserving/v1api/model_model_type.go create mode 100644 services/modelserving/v1api/model_token_created_state.go create mode 100644 services/modelserving/v1api/model_token_state.go diff --git a/services/modelserving/v1api/model_chat_model_details.go b/services/modelserving/v1api/model_chat_model_details.go index ca541c338..ca17b6130 100644 --- a/services/modelserving/v1api/model_chat_model_details.go +++ b/services/modelserving/v1api/model_chat_model_details.go @@ -21,17 +21,17 @@ var _ MappedNullable = &ChatModelDetails{} // ChatModelDetails struct for ChatModelDetails type ChatModelDetails struct { - Bits *int32 `json:"bits,omitempty"` - Category string `json:"category"` - ContextLength int64 `json:"contextLength"` - Description string `json:"description" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` - DisplayedName string `json:"displayedName" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` + Bits *ChatModelDetailsBits `json:"bits,omitempty"` + Category ChatModelDetailsCategory `json:"category"` + ContextLength int64 `json:"contextLength"` + Description string `json:"description" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` + DisplayedName string `json:"displayedName" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` // generated uuid to identify a model Id string `json:"id"` // huggingface name - Name string `json:"name" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` - QuantizationMethod *string `json:"quantizationMethod,omitempty"` - Region string `json:"region"` + Name string `json:"name" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` + QuantizationMethod *ChatModelDetailsQuantizationMethod `json:"quantizationMethod,omitempty"` + Region string `json:"region"` // model size in bytes Size int64 `json:"size"` Skus []SKU `json:"skus"` @@ -47,7 +47,7 @@ type _ChatModelDetails ChatModelDetails // 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 NewChatModelDetails(category string, contextLength int64, description string, displayedName string, id string, name string, region string, size int64, skus []SKU, tags []string, url string) *ChatModelDetails { +func NewChatModelDetails(category ChatModelDetailsCategory, contextLength int64, description string, displayedName string, id string, name string, region string, size int64, skus []SKU, tags []string, url string) *ChatModelDetails { this := ChatModelDetails{} this.Category = category this.ContextLength = contextLength @@ -72,9 +72,9 @@ func NewChatModelDetailsWithDefaults() *ChatModelDetails { } // GetBits returns the Bits field value if set, zero value otherwise. -func (o *ChatModelDetails) GetBits() int32 { +func (o *ChatModelDetails) GetBits() ChatModelDetailsBits { if o == nil || IsNil(o.Bits) { - var ret int32 + var ret ChatModelDetailsBits return ret } return *o.Bits @@ -82,7 +82,7 @@ func (o *ChatModelDetails) GetBits() int32 { // GetBitsOk returns a tuple with the Bits field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ChatModelDetails) GetBitsOk() (*int32, bool) { +func (o *ChatModelDetails) GetBitsOk() (*ChatModelDetailsBits, bool) { if o == nil || IsNil(o.Bits) { return nil, false } @@ -98,15 +98,15 @@ func (o *ChatModelDetails) HasBits() bool { return false } -// SetBits gets a reference to the given int32 and assigns it to the Bits field. -func (o *ChatModelDetails) SetBits(v int32) { +// SetBits gets a reference to the given ChatModelDetailsBits and assigns it to the Bits field. +func (o *ChatModelDetails) SetBits(v ChatModelDetailsBits) { o.Bits = &v } // GetCategory returns the Category field value -func (o *ChatModelDetails) GetCategory() string { +func (o *ChatModelDetails) GetCategory() ChatModelDetailsCategory { if o == nil { - var ret string + var ret ChatModelDetailsCategory return ret } @@ -115,7 +115,7 @@ func (o *ChatModelDetails) GetCategory() string { // GetCategoryOk returns a tuple with the Category field value // and a boolean to check if the value has been set. -func (o *ChatModelDetails) GetCategoryOk() (*string, bool) { +func (o *ChatModelDetails) GetCategoryOk() (*ChatModelDetailsCategory, bool) { if o == nil { return nil, false } @@ -123,7 +123,7 @@ func (o *ChatModelDetails) GetCategoryOk() (*string, bool) { } // SetCategory sets field value -func (o *ChatModelDetails) SetCategory(v string) { +func (o *ChatModelDetails) SetCategory(v ChatModelDetailsCategory) { o.Category = v } @@ -248,9 +248,9 @@ func (o *ChatModelDetails) SetName(v string) { } // GetQuantizationMethod returns the QuantizationMethod field value if set, zero value otherwise. -func (o *ChatModelDetails) GetQuantizationMethod() string { +func (o *ChatModelDetails) GetQuantizationMethod() ChatModelDetailsQuantizationMethod { if o == nil || IsNil(o.QuantizationMethod) { - var ret string + var ret ChatModelDetailsQuantizationMethod return ret } return *o.QuantizationMethod @@ -258,7 +258,7 @@ func (o *ChatModelDetails) GetQuantizationMethod() string { // GetQuantizationMethodOk returns a tuple with the QuantizationMethod field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ChatModelDetails) GetQuantizationMethodOk() (*string, bool) { +func (o *ChatModelDetails) GetQuantizationMethodOk() (*ChatModelDetailsQuantizationMethod, bool) { if o == nil || IsNil(o.QuantizationMethod) { return nil, false } @@ -274,8 +274,8 @@ func (o *ChatModelDetails) HasQuantizationMethod() bool { return false } -// SetQuantizationMethod gets a reference to the given string and assigns it to the QuantizationMethod field. -func (o *ChatModelDetails) SetQuantizationMethod(v string) { +// SetQuantizationMethod gets a reference to the given ChatModelDetailsQuantizationMethod and assigns it to the QuantizationMethod field. +func (o *ChatModelDetails) SetQuantizationMethod(v ChatModelDetailsQuantizationMethod) { o.QuantizationMethod = &v } diff --git a/services/modelserving/v1api/model_chat_model_details_bits.go b/services/modelserving/v1api/model_chat_model_details_bits.go new file mode 100644 index 000000000..77e2c2da2 --- /dev/null +++ b/services/modelserving/v1api/model_chat_model_details_bits.go @@ -0,0 +1,120 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +Contact: model-serving@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ChatModelDetailsBits the model 'ChatModelDetailsBits' +type ChatModelDetailsBits int32 + +// List of ChatModelDetails_bits +const ( + CHATMODELDETAILSBITS_ONE_BIT ChatModelDetailsBits = 1 + CHATMODELDETAILSBITS_TWO_BITS ChatModelDetailsBits = 2 + CHATMODELDETAILSBITS_FOUR_BITS ChatModelDetailsBits = 4 + CHATMODELDETAILSBITS_EIGHT_BITS ChatModelDetailsBits = 8 + CHATMODELDETAILSBITS_SIXTEEN_BITS ChatModelDetailsBits = 16 + CHATMODELDETAILSBITS__unknown_default_open_api ChatModelDetailsBits = 11184809 +) + +// All allowed values of ChatModelDetailsBits enum +var AllowedChatModelDetailsBitsEnumValues = []ChatModelDetailsBits{ + 1, + 2, + 4, + 8, + 16, + 11184809, +} + +func (v *ChatModelDetailsBits) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ChatModelDetailsBits(value) + for _, existing := range AllowedChatModelDetailsBitsEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CHATMODELDETAILSBITS__unknown_default_open_api + return nil +} + +// NewChatModelDetailsBitsFromValue returns a pointer to a valid ChatModelDetailsBits +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewChatModelDetailsBitsFromValue(v int32) (*ChatModelDetailsBits, error) { + ev := ChatModelDetailsBits(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ChatModelDetailsBits: valid values are %v", v, AllowedChatModelDetailsBitsEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ChatModelDetailsBits) IsValid() bool { + for _, existing := range AllowedChatModelDetailsBitsEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ChatModelDetails_bits value +func (v ChatModelDetailsBits) Ptr() *ChatModelDetailsBits { + return &v +} + +type NullableChatModelDetailsBits struct { + value *ChatModelDetailsBits + isSet bool +} + +func (v NullableChatModelDetailsBits) Get() *ChatModelDetailsBits { + return v.value +} + +func (v *NullableChatModelDetailsBits) Set(val *ChatModelDetailsBits) { + v.value = val + v.isSet = true +} + +func (v NullableChatModelDetailsBits) IsSet() bool { + return v.isSet +} + +func (v *NullableChatModelDetailsBits) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChatModelDetailsBits(val *ChatModelDetailsBits) *NullableChatModelDetailsBits { + return &NullableChatModelDetailsBits{value: val, isSet: true} +} + +func (v NullableChatModelDetailsBits) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChatModelDetailsBits) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/v1api/model_chat_model_details_category.go b/services/modelserving/v1api/model_chat_model_details_category.go new file mode 100644 index 000000000..db414b80e --- /dev/null +++ b/services/modelserving/v1api/model_chat_model_details_category.go @@ -0,0 +1,116 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +Contact: model-serving@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ChatModelDetailsCategory the model 'ChatModelDetailsCategory' +type ChatModelDetailsCategory string + +// List of ChatModelDetails_category +const ( + CHATMODELDETAILSCATEGORY_STANDARD ChatModelDetailsCategory = "standard" + CHATMODELDETAILSCATEGORY_PLUS ChatModelDetailsCategory = "plus" + CHATMODELDETAILSCATEGORY_PREMIUM ChatModelDetailsCategory = "premium" + CHATMODELDETAILSCATEGORY_UNKNOWN_DEFAULT_OPEN_API ChatModelDetailsCategory = "unknown_default_open_api" +) + +// All allowed values of ChatModelDetailsCategory enum +var AllowedChatModelDetailsCategoryEnumValues = []ChatModelDetailsCategory{ + "standard", + "plus", + "premium", + "unknown_default_open_api", +} + +func (v *ChatModelDetailsCategory) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ChatModelDetailsCategory(value) + for _, existing := range AllowedChatModelDetailsCategoryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CHATMODELDETAILSCATEGORY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewChatModelDetailsCategoryFromValue returns a pointer to a valid ChatModelDetailsCategory +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewChatModelDetailsCategoryFromValue(v string) (*ChatModelDetailsCategory, error) { + ev := ChatModelDetailsCategory(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ChatModelDetailsCategory: valid values are %v", v, AllowedChatModelDetailsCategoryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ChatModelDetailsCategory) IsValid() bool { + for _, existing := range AllowedChatModelDetailsCategoryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ChatModelDetails_category value +func (v ChatModelDetailsCategory) Ptr() *ChatModelDetailsCategory { + return &v +} + +type NullableChatModelDetailsCategory struct { + value *ChatModelDetailsCategory + isSet bool +} + +func (v NullableChatModelDetailsCategory) Get() *ChatModelDetailsCategory { + return v.value +} + +func (v *NullableChatModelDetailsCategory) Set(val *ChatModelDetailsCategory) { + v.value = val + v.isSet = true +} + +func (v NullableChatModelDetailsCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableChatModelDetailsCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChatModelDetailsCategory(val *ChatModelDetailsCategory) *NullableChatModelDetailsCategory { + return &NullableChatModelDetailsCategory{value: val, isSet: true} +} + +func (v NullableChatModelDetailsCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChatModelDetailsCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/v1api/model_chat_model_details_quantization_method.go b/services/modelserving/v1api/model_chat_model_details_quantization_method.go new file mode 100644 index 000000000..efe51d8a1 --- /dev/null +++ b/services/modelserving/v1api/model_chat_model_details_quantization_method.go @@ -0,0 +1,114 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +Contact: model-serving@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ChatModelDetailsQuantizationMethod the model 'ChatModelDetailsQuantizationMethod' +type ChatModelDetailsQuantizationMethod string + +// List of ChatModelDetails_quantizationMethod +const ( + CHATMODELDETAILSQUANTIZATIONMETHOD_PTQ ChatModelDetailsQuantizationMethod = "PTQ" + CHATMODELDETAILSQUANTIZATIONMETHOD_QAT ChatModelDetailsQuantizationMethod = "QAT" + CHATMODELDETAILSQUANTIZATIONMETHOD_UNKNOWN_DEFAULT_OPEN_API ChatModelDetailsQuantizationMethod = "unknown_default_open_api" +) + +// All allowed values of ChatModelDetailsQuantizationMethod enum +var AllowedChatModelDetailsQuantizationMethodEnumValues = []ChatModelDetailsQuantizationMethod{ + "PTQ", + "QAT", + "unknown_default_open_api", +} + +func (v *ChatModelDetailsQuantizationMethod) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ChatModelDetailsQuantizationMethod(value) + for _, existing := range AllowedChatModelDetailsQuantizationMethodEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CHATMODELDETAILSQUANTIZATIONMETHOD_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewChatModelDetailsQuantizationMethodFromValue returns a pointer to a valid ChatModelDetailsQuantizationMethod +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewChatModelDetailsQuantizationMethodFromValue(v string) (*ChatModelDetailsQuantizationMethod, error) { + ev := ChatModelDetailsQuantizationMethod(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ChatModelDetailsQuantizationMethod: valid values are %v", v, AllowedChatModelDetailsQuantizationMethodEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ChatModelDetailsQuantizationMethod) IsValid() bool { + for _, existing := range AllowedChatModelDetailsQuantizationMethodEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ChatModelDetails_quantizationMethod value +func (v ChatModelDetailsQuantizationMethod) Ptr() *ChatModelDetailsQuantizationMethod { + return &v +} + +type NullableChatModelDetailsQuantizationMethod struct { + value *ChatModelDetailsQuantizationMethod + isSet bool +} + +func (v NullableChatModelDetailsQuantizationMethod) Get() *ChatModelDetailsQuantizationMethod { + return v.value +} + +func (v *NullableChatModelDetailsQuantizationMethod) Set(val *ChatModelDetailsQuantizationMethod) { + v.value = val + v.isSet = true +} + +func (v NullableChatModelDetailsQuantizationMethod) IsSet() bool { + return v.isSet +} + +func (v *NullableChatModelDetailsQuantizationMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChatModelDetailsQuantizationMethod(val *ChatModelDetailsQuantizationMethod) *NullableChatModelDetailsQuantizationMethod { + return &NullableChatModelDetailsQuantizationMethod{value: val, isSet: true} +} + +func (v NullableChatModelDetailsQuantizationMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChatModelDetailsQuantizationMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/v1api/model_embedding_model_details.go b/services/modelserving/v1api/model_embedding_model_details.go index faeaebbdf..2c283c700 100644 --- a/services/modelserving/v1api/model_embedding_model_details.go +++ b/services/modelserving/v1api/model_embedding_model_details.go @@ -21,9 +21,9 @@ var _ MappedNullable = &EmbeddingModelDetails{} // EmbeddingModelDetails struct for EmbeddingModelDetails type EmbeddingModelDetails struct { - Category string `json:"category"` - Description string `json:"description" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` - DisplayedName string `json:"displayedName" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` + Category EmbeddingModelDetailsCategory `json:"category"` + Description string `json:"description" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` + DisplayedName string `json:"displayedName" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` // generated uuid to identify a model Id string `json:"id"` // huggingface name @@ -43,7 +43,7 @@ type _EmbeddingModelDetails EmbeddingModelDetails // 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 NewEmbeddingModelDetails(category string, description string, displayedName string, id string, name string, outputDimension int64, region string, skus []SKU, url string) *EmbeddingModelDetails { +func NewEmbeddingModelDetails(category EmbeddingModelDetailsCategory, description string, displayedName string, id string, name string, outputDimension int64, region string, skus []SKU, url string) *EmbeddingModelDetails { this := EmbeddingModelDetails{} this.Category = category this.Description = description @@ -66,9 +66,9 @@ func NewEmbeddingModelDetailsWithDefaults() *EmbeddingModelDetails { } // GetCategory returns the Category field value -func (o *EmbeddingModelDetails) GetCategory() string { +func (o *EmbeddingModelDetails) GetCategory() EmbeddingModelDetailsCategory { if o == nil { - var ret string + var ret EmbeddingModelDetailsCategory return ret } @@ -77,7 +77,7 @@ func (o *EmbeddingModelDetails) GetCategory() string { // GetCategoryOk returns a tuple with the Category field value // and a boolean to check if the value has been set. -func (o *EmbeddingModelDetails) GetCategoryOk() (*string, bool) { +func (o *EmbeddingModelDetails) GetCategoryOk() (*EmbeddingModelDetailsCategory, bool) { if o == nil { return nil, false } @@ -85,7 +85,7 @@ func (o *EmbeddingModelDetails) GetCategoryOk() (*string, bool) { } // SetCategory sets field value -func (o *EmbeddingModelDetails) SetCategory(v string) { +func (o *EmbeddingModelDetails) SetCategory(v EmbeddingModelDetailsCategory) { o.Category = v } diff --git a/services/modelserving/v1api/model_embedding_model_details_category.go b/services/modelserving/v1api/model_embedding_model_details_category.go new file mode 100644 index 000000000..5d34771d4 --- /dev/null +++ b/services/modelserving/v1api/model_embedding_model_details_category.go @@ -0,0 +1,116 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +Contact: model-serving@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// EmbeddingModelDetailsCategory the model 'EmbeddingModelDetailsCategory' +type EmbeddingModelDetailsCategory string + +// List of EmbeddingModelDetails_category +const ( + EMBEDDINGMODELDETAILSCATEGORY_STANDARD EmbeddingModelDetailsCategory = "standard" + EMBEDDINGMODELDETAILSCATEGORY_PLUS EmbeddingModelDetailsCategory = "plus" + EMBEDDINGMODELDETAILSCATEGORY_PREMIUM EmbeddingModelDetailsCategory = "premium" + EMBEDDINGMODELDETAILSCATEGORY_UNKNOWN_DEFAULT_OPEN_API EmbeddingModelDetailsCategory = "unknown_default_open_api" +) + +// All allowed values of EmbeddingModelDetailsCategory enum +var AllowedEmbeddingModelDetailsCategoryEnumValues = []EmbeddingModelDetailsCategory{ + "standard", + "plus", + "premium", + "unknown_default_open_api", +} + +func (v *EmbeddingModelDetailsCategory) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EmbeddingModelDetailsCategory(value) + for _, existing := range AllowedEmbeddingModelDetailsCategoryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = EMBEDDINGMODELDETAILSCATEGORY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewEmbeddingModelDetailsCategoryFromValue returns a pointer to a valid EmbeddingModelDetailsCategory +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEmbeddingModelDetailsCategoryFromValue(v string) (*EmbeddingModelDetailsCategory, error) { + ev := EmbeddingModelDetailsCategory(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EmbeddingModelDetailsCategory: valid values are %v", v, AllowedEmbeddingModelDetailsCategoryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EmbeddingModelDetailsCategory) IsValid() bool { + for _, existing := range AllowedEmbeddingModelDetailsCategoryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EmbeddingModelDetails_category value +func (v EmbeddingModelDetailsCategory) Ptr() *EmbeddingModelDetailsCategory { + return &v +} + +type NullableEmbeddingModelDetailsCategory struct { + value *EmbeddingModelDetailsCategory + isSet bool +} + +func (v NullableEmbeddingModelDetailsCategory) Get() *EmbeddingModelDetailsCategory { + return v.value +} + +func (v *NullableEmbeddingModelDetailsCategory) Set(val *EmbeddingModelDetailsCategory) { + v.value = val + v.isSet = true +} + +func (v NullableEmbeddingModelDetailsCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableEmbeddingModelDetailsCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmbeddingModelDetailsCategory(val *EmbeddingModelDetailsCategory) *NullableEmbeddingModelDetailsCategory { + return &NullableEmbeddingModelDetailsCategory{value: val, isSet: true} +} + +func (v NullableEmbeddingModelDetailsCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmbeddingModelDetailsCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/v1api/model_model.go b/services/modelserving/v1api/model_model.go index f498846f0..2b5c25f63 100644 --- a/services/modelserving/v1api/model_model.go +++ b/services/modelserving/v1api/model_model.go @@ -21,17 +21,17 @@ var _ MappedNullable = &Model{} // Model struct for Model type Model struct { - Category string `json:"category"` - Description string `json:"description" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` - DisplayedName string `json:"displayedName" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` + Category ModelCategory `json:"category"` + Description string `json:"description" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` + DisplayedName string `json:"displayedName" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` // generated uuid to identify a model Id string `json:"id"` // huggingface name - Name string `json:"name"` - Region string `json:"region"` - Skus []SKU `json:"skus"` - Tags []string `json:"tags,omitempty"` - Type string `json:"type"` + Name string `json:"name"` + Region string `json:"region"` + Skus []SKU `json:"skus"` + Tags []string `json:"tags,omitempty"` + Type ModelType `json:"type"` // url of the model Url string `json:"url"` AdditionalProperties map[string]interface{} @@ -43,7 +43,7 @@ type _Model Model // 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 NewModel(category string, description string, displayedName string, id string, name string, region string, skus []SKU, types string, url string) *Model { +func NewModel(category ModelCategory, description string, displayedName string, id string, name string, region string, skus []SKU, types ModelType, url string) *Model { this := Model{} this.Category = category this.Description = description @@ -66,9 +66,9 @@ func NewModelWithDefaults() *Model { } // GetCategory returns the Category field value -func (o *Model) GetCategory() string { +func (o *Model) GetCategory() ModelCategory { if o == nil { - var ret string + var ret ModelCategory return ret } @@ -77,7 +77,7 @@ func (o *Model) GetCategory() string { // GetCategoryOk returns a tuple with the Category field value // and a boolean to check if the value has been set. -func (o *Model) GetCategoryOk() (*string, bool) { +func (o *Model) GetCategoryOk() (*ModelCategory, bool) { if o == nil { return nil, false } @@ -85,7 +85,7 @@ func (o *Model) GetCategoryOk() (*string, bool) { } // SetCategory sets field value -func (o *Model) SetCategory(v string) { +func (o *Model) SetCategory(v ModelCategory) { o.Category = v } @@ -266,9 +266,9 @@ func (o *Model) SetTags(v []string) { } // GetType returns the Type field value -func (o *Model) GetType() string { +func (o *Model) GetType() ModelType { if o == nil { - var ret string + var ret ModelType return ret } @@ -277,7 +277,7 @@ func (o *Model) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *Model) GetTypeOk() (*string, bool) { +func (o *Model) GetTypeOk() (*ModelType, bool) { if o == nil { return nil, false } @@ -285,7 +285,7 @@ func (o *Model) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *Model) SetType(v string) { +func (o *Model) SetType(v ModelType) { o.Type = v } diff --git a/services/modelserving/v1api/model_model_category.go b/services/modelserving/v1api/model_model_category.go new file mode 100644 index 000000000..977cf4812 --- /dev/null +++ b/services/modelserving/v1api/model_model_category.go @@ -0,0 +1,116 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +Contact: model-serving@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ModelCategory the model 'ModelCategory' +type ModelCategory string + +// List of Model_category +const ( + MODELCATEGORY_STANDARD ModelCategory = "standard" + MODELCATEGORY_PLUS ModelCategory = "plus" + MODELCATEGORY_PREMIUM ModelCategory = "premium" + MODELCATEGORY_UNKNOWN_DEFAULT_OPEN_API ModelCategory = "unknown_default_open_api" +) + +// All allowed values of ModelCategory enum +var AllowedModelCategoryEnumValues = []ModelCategory{ + "standard", + "plus", + "premium", + "unknown_default_open_api", +} + +func (v *ModelCategory) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ModelCategory(value) + for _, existing := range AllowedModelCategoryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = MODELCATEGORY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewModelCategoryFromValue returns a pointer to a valid ModelCategory +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewModelCategoryFromValue(v string) (*ModelCategory, error) { + ev := ModelCategory(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ModelCategory: valid values are %v", v, AllowedModelCategoryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ModelCategory) IsValid() bool { + for _, existing := range AllowedModelCategoryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Model_category value +func (v ModelCategory) Ptr() *ModelCategory { + return &v +} + +type NullableModelCategory struct { + value *ModelCategory + isSet bool +} + +func (v NullableModelCategory) Get() *ModelCategory { + return v.value +} + +func (v *NullableModelCategory) Set(val *ModelCategory) { + v.value = val + v.isSet = true +} + +func (v NullableModelCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableModelCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModelCategory(val *ModelCategory) *NullableModelCategory { + return &NullableModelCategory{value: val, isSet: true} +} + +func (v NullableModelCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModelCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/v1api/model_model_type.go b/services/modelserving/v1api/model_model_type.go new file mode 100644 index 000000000..d0063e885 --- /dev/null +++ b/services/modelserving/v1api/model_model_type.go @@ -0,0 +1,118 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +Contact: model-serving@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ModelType the model 'ModelType' +type ModelType string + +// List of Model_type +const ( + MODELTYPE_CHAT ModelType = "chat" + MODELTYPE_EMBEDDING ModelType = "embedding" + MODELTYPE_AUDIO ModelType = "audio" + MODELTYPE_IMAGE ModelType = "image" + MODELTYPE_UNKNOWN_DEFAULT_OPEN_API ModelType = "unknown_default_open_api" +) + +// All allowed values of ModelType enum +var AllowedModelTypeEnumValues = []ModelType{ + "chat", + "embedding", + "audio", + "image", + "unknown_default_open_api", +} + +func (v *ModelType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ModelType(value) + for _, existing := range AllowedModelTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = MODELTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewModelTypeFromValue returns a pointer to a valid ModelType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewModelTypeFromValue(v string) (*ModelType, error) { + ev := ModelType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ModelType: valid values are %v", v, AllowedModelTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ModelType) IsValid() bool { + for _, existing := range AllowedModelTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Model_type value +func (v ModelType) Ptr() *ModelType { + return &v +} + +type NullableModelType struct { + value *ModelType + isSet bool +} + +func (v NullableModelType) Get() *ModelType { + return v.value +} + +func (v *NullableModelType) Set(val *ModelType) { + v.value = val + v.isSet = true +} + +func (v NullableModelType) IsSet() bool { + return v.isSet +} + +func (v *NullableModelType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModelType(val *ModelType) *NullableModelType { + return &NullableModelType{value: val, isSet: true} +} + +func (v NullableModelType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModelType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/v1api/model_token.go b/services/modelserving/v1api/model_token.go index 4dd48b920..74500ae9d 100644 --- a/services/modelserving/v1api/model_token.go +++ b/services/modelserving/v1api/model_token.go @@ -22,12 +22,12 @@ var _ MappedNullable = &Token{} // Token struct for Token type Token struct { - Description *string `json:"description,omitempty" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` - Id string `json:"id"` - Name string `json:"name" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` - Region string `json:"region"` - State string `json:"state"` - ValidUntil time.Time `json:"validUntil"` + Description *string `json:"description,omitempty" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` + Id string `json:"id"` + Name string `json:"name" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` + Region string `json:"region"` + State TokenState `json:"state"` + ValidUntil time.Time `json:"validUntil"` AdditionalProperties map[string]interface{} } @@ -37,7 +37,7 @@ type _Token Token // 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 NewToken(id string, name string, region string, state string, validUntil time.Time) *Token { +func NewToken(id string, name string, region string, state TokenState, validUntil time.Time) *Token { this := Token{} this.Id = id this.Name = name @@ -160,9 +160,9 @@ func (o *Token) SetRegion(v string) { } // GetState returns the State field value -func (o *Token) GetState() string { +func (o *Token) GetState() TokenState { if o == nil { - var ret string + var ret TokenState return ret } @@ -171,7 +171,7 @@ func (o *Token) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *Token) GetStateOk() (*string, bool) { +func (o *Token) GetStateOk() (*TokenState, bool) { if o == nil { return nil, false } @@ -179,7 +179,7 @@ func (o *Token) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *Token) SetState(v string) { +func (o *Token) SetState(v TokenState) { o.State = v } diff --git a/services/modelserving/v1api/model_token_created.go b/services/modelserving/v1api/model_token_created.go index 65d7ab7ae..550862e32 100644 --- a/services/modelserving/v1api/model_token_created.go +++ b/services/modelserving/v1api/model_token_created.go @@ -22,13 +22,13 @@ var _ MappedNullable = &TokenCreated{} // TokenCreated struct for TokenCreated type TokenCreated struct { - Content string `json:"content" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` - Description *string `json:"description,omitempty" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` - Id string `json:"id"` - Name string `json:"name" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` - Region string `json:"region"` - State string `json:"state"` - ValidUntil time.Time `json:"validUntil"` + Content string `json:"content" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` + Description *string `json:"description,omitempty" validate:"regexp=^[0-9a-zA-Z\\\\s.:\\/\\\\-]+$"` + Id string `json:"id"` + Name string `json:"name" validate:"regexp=^[0-9a-zA-Z\\\\s_-]+$"` + Region string `json:"region"` + State TokenCreatedState `json:"state"` + ValidUntil time.Time `json:"validUntil"` AdditionalProperties map[string]interface{} } @@ -38,7 +38,7 @@ type _TokenCreated TokenCreated // 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 NewTokenCreated(content string, id string, name string, region string, state string, validUntil time.Time) *TokenCreated { +func NewTokenCreated(content string, id string, name string, region string, state TokenCreatedState, validUntil time.Time) *TokenCreated { this := TokenCreated{} this.Content = content this.Id = id @@ -186,9 +186,9 @@ func (o *TokenCreated) SetRegion(v string) { } // GetState returns the State field value -func (o *TokenCreated) GetState() string { +func (o *TokenCreated) GetState() TokenCreatedState { if o == nil { - var ret string + var ret TokenCreatedState return ret } @@ -197,7 +197,7 @@ func (o *TokenCreated) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *TokenCreated) GetStateOk() (*string, bool) { +func (o *TokenCreated) GetStateOk() (*TokenCreatedState, bool) { if o == nil { return nil, false } @@ -205,7 +205,7 @@ func (o *TokenCreated) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *TokenCreated) SetState(v string) { +func (o *TokenCreated) SetState(v TokenCreatedState) { o.State = v } diff --git a/services/modelserving/v1api/model_token_created_state.go b/services/modelserving/v1api/model_token_created_state.go new file mode 100644 index 000000000..b9a3d1c0d --- /dev/null +++ b/services/modelserving/v1api/model_token_created_state.go @@ -0,0 +1,116 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +Contact: model-serving@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// TokenCreatedState the model 'TokenCreatedState' +type TokenCreatedState string + +// List of TokenCreated_state +const ( + TOKENCREATEDSTATE_CREATING TokenCreatedState = "creating" + TOKENCREATEDSTATE_ACTIVE TokenCreatedState = "active" + TOKENCREATEDSTATE_DELETING TokenCreatedState = "deleting" + TOKENCREATEDSTATE_UNKNOWN_DEFAULT_OPEN_API TokenCreatedState = "unknown_default_open_api" +) + +// All allowed values of TokenCreatedState enum +var AllowedTokenCreatedStateEnumValues = []TokenCreatedState{ + "creating", + "active", + "deleting", + "unknown_default_open_api", +} + +func (v *TokenCreatedState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TokenCreatedState(value) + for _, existing := range AllowedTokenCreatedStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TOKENCREATEDSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTokenCreatedStateFromValue returns a pointer to a valid TokenCreatedState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTokenCreatedStateFromValue(v string) (*TokenCreatedState, error) { + ev := TokenCreatedState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TokenCreatedState: valid values are %v", v, AllowedTokenCreatedStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TokenCreatedState) IsValid() bool { + for _, existing := range AllowedTokenCreatedStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TokenCreated_state value +func (v TokenCreatedState) Ptr() *TokenCreatedState { + return &v +} + +type NullableTokenCreatedState struct { + value *TokenCreatedState + isSet bool +} + +func (v NullableTokenCreatedState) Get() *TokenCreatedState { + return v.value +} + +func (v *NullableTokenCreatedState) Set(val *TokenCreatedState) { + v.value = val + v.isSet = true +} + +func (v NullableTokenCreatedState) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenCreatedState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenCreatedState(val *TokenCreatedState) *NullableTokenCreatedState { + return &NullableTokenCreatedState{value: val, isSet: true} +} + +func (v NullableTokenCreatedState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenCreatedState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/modelserving/v1api/model_token_state.go b/services/modelserving/v1api/model_token_state.go new file mode 100644 index 000000000..376c89581 --- /dev/null +++ b/services/modelserving/v1api/model_token_state.go @@ -0,0 +1,118 @@ +/* +STACKIT Model Serving API + +This API provides endpoints for the model serving api + +API version: 1.0.0 +Contact: model-serving@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// TokenState the model 'TokenState' +type TokenState string + +// List of Token_state +const ( + TOKENSTATE_CREATING TokenState = "creating" + TOKENSTATE_ACTIVE TokenState = "active" + TOKENSTATE_DELETING TokenState = "deleting" + TOKENSTATE_INACTIVE TokenState = "inactive" + TOKENSTATE_UNKNOWN_DEFAULT_OPEN_API TokenState = "unknown_default_open_api" +) + +// All allowed values of TokenState enum +var AllowedTokenStateEnumValues = []TokenState{ + "creating", + "active", + "deleting", + "inactive", + "unknown_default_open_api", +} + +func (v *TokenState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TokenState(value) + for _, existing := range AllowedTokenStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TOKENSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTokenStateFromValue returns a pointer to a valid TokenState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTokenStateFromValue(v string) (*TokenState, error) { + ev := TokenState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TokenState: valid values are %v", v, AllowedTokenStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TokenState) IsValid() bool { + for _, existing := range AllowedTokenStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Token_state value +func (v TokenState) Ptr() *TokenState { + return &v +} + +type NullableTokenState struct { + value *TokenState + isSet bool +} + +func (v NullableTokenState) Get() *TokenState { + return v.value +} + +func (v *NullableTokenState) Set(val *TokenState) { + v.value = val + v.isSet = true +} + +func (v NullableTokenState) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenState(val *TokenState) *NullableTokenState { + return &NullableTokenState{value: val, isSet: true} +} + +func (v NullableTokenState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From ad7b26bc95f4c3b6a0451a7bfc96650f3ff75680 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 12:32:22 +0200 Subject: [PATCH 26/66] chore(modelserving): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/modelserving/CHANGELOG.md | 3 +++ services/modelserving/VERSION | 2 +- services/modelserving/v1api/wait/wait.go | 16 ++++++++-------- services/modelserving/v1api/wait/wait_test.go | 14 +++++++------- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbefa963e..fa03024f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -254,6 +254,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` - [v0.10.0](services/modelserving/CHANGELOG.md#v0100) - **Improvement:** Use new WaiterHelper for modelserving waiters + - [v0.11.0](services/modelserving/CHANGELOG.md#v0110) + - **Feature:** Introduce enums for various attributes - `mongodbflex`: - [v1.7.3](services/mongodbflex/CHANGELOG.md#v173) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/modelserving/CHANGELOG.md b/services/modelserving/CHANGELOG.md index ba4718efd..ad65f6ff3 100644 --- a/services/modelserving/CHANGELOG.md +++ b/services/modelserving/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.11.0 +- **Feature:** Introduce enums for various attributes + ## v0.10.0 - **Improvement:** Use new WaiterHelper for modelserving waiters diff --git a/services/modelserving/VERSION b/services/modelserving/VERSION index f78dc3652..fd2726c91 100644 --- a/services/modelserving/VERSION +++ b/services/modelserving/VERSION @@ -1 +1 @@ -v0.10.0 \ No newline at end of file +v0.11.0 diff --git a/services/modelserving/v1api/wait/wait.go b/services/modelserving/v1api/wait/wait.go index 5e0058597..5d168580c 100644 --- a/services/modelserving/v1api/wait/wait.go +++ b/services/modelserving/v1api/wait/wait.go @@ -17,16 +17,16 @@ const ( ) func CreateModelServingWaitHandler(ctx context.Context, a modelserving.DefaultAPI, region, projectId, tokenId string) *wait.AsyncActionHandler[modelserving.GetTokenResponse] { - waitConfig := wait.WaiterHelper[modelserving.GetTokenResponse, string]{ + waitConfig := wait.WaiterHelper[modelserving.GetTokenResponse, modelserving.TokenState]{ FetchInstance: a.GetToken(ctx, region, projectId, tokenId).Execute, - GetState: func(response *modelserving.GetTokenResponse) (string, error) { + GetState: func(response *modelserving.GetTokenResponse) (modelserving.TokenState, error) { if response == nil { return "", errors.New("empty response") } return response.Token.State, nil }, - ActiveState: []string{TOKENSTATE_ACTIVE}, - ErrorState: []string{}, + ActiveState: []modelserving.TokenState{modelserving.TOKENSTATE_ACTIVE}, + ErrorState: []modelserving.TokenState{}, } handler := wait.New(waitConfig.Wait()) @@ -43,16 +43,16 @@ func UpdateModelServingWaitHandler(ctx context.Context, a modelserving.DefaultAP } func DeleteModelServingWaitHandler(ctx context.Context, a modelserving.DefaultAPI, region, projectId, tokenId string) *wait.AsyncActionHandler[modelserving.GetTokenResponse] { - waitConfig := wait.WaiterHelper[modelserving.GetTokenResponse, string]{ + waitConfig := wait.WaiterHelper[modelserving.GetTokenResponse, modelserving.TokenState]{ FetchInstance: a.GetToken(ctx, region, projectId, tokenId).Execute, - GetState: func(response *modelserving.GetTokenResponse) (string, error) { + GetState: func(response *modelserving.GetTokenResponse) (modelserving.TokenState, error) { if response == nil { return "", errors.New("empty response") } return response.Token.State, nil }, - ActiveState: []string{}, - ErrorState: []string{}, + ActiveState: []modelserving.TokenState{}, + ErrorState: []modelserving.TokenState{}, } handler := wait.New(waitConfig.Wait()) diff --git a/services/modelserving/v1api/wait/wait_test.go b/services/modelserving/v1api/wait/wait_test.go index f85cb4d82..8940add88 100644 --- a/services/modelserving/v1api/wait/wait_test.go +++ b/services/modelserving/v1api/wait/wait_test.go @@ -15,7 +15,7 @@ import ( type mockSettings struct { getFails bool - resourceState string + resourceState modelserving.TokenState statusCode int } @@ -43,7 +43,7 @@ func TestCreateModelServingWaitHandler(t *testing.T) { desc string getFails bool statusCode int - resourceState string + resourceState modelserving.TokenState wantErr bool wantResp bool }{ @@ -51,7 +51,7 @@ func TestCreateModelServingWaitHandler(t *testing.T) { desc: "create_succeeded", getFails: false, statusCode: 200, - resourceState: TOKENSTATE_ACTIVE, + resourceState: modelserving.TOKENSTATE_ACTIVE, wantErr: false, wantResp: true, }, @@ -111,7 +111,7 @@ func TestUpdateModelServingWaitHandler(t *testing.T) { desc string getFails bool statusCode int - resourceState string + resourceState modelserving.TokenState wantErr bool wantResp bool }{ @@ -119,7 +119,7 @@ func TestUpdateModelServingWaitHandler(t *testing.T) { desc: "update_succeeded", getFails: false, statusCode: 200, - resourceState: TOKENSTATE_ACTIVE, + resourceState: modelserving.TOKENSTATE_ACTIVE, wantErr: false, wantResp: true, }, @@ -179,7 +179,7 @@ func TestDeleteModelServingWaitHandler(t *testing.T) { desc string getFails bool statusCode int - resourceState string + resourceState modelserving.TokenState wantErr bool wantResp bool }{ @@ -195,7 +195,7 @@ func TestDeleteModelServingWaitHandler(t *testing.T) { desc: "delete_in_progress", getFails: false, statusCode: 200, - resourceState: TOKENSTATE_DELETING, + resourceState: modelserving.TOKENSTATE_DELETING, wantErr: true, // Should timeout since delete is not complete wantResp: false, }, From 9421e85b8057ba47568b353e9bfc0217dac6d4a7 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 12:34:52 +0200 Subject: [PATCH 27/66] refac(mongodbflex): introduce inline enums --- services/mongodbflex/v1api/model_instance.go | 31 ++-- .../v1api/model_instance_list_instance.go | 17 +- .../model_instance_list_instance_status.go | 120 ++++++++++++++ .../v1api/model_instance_status.go | 120 ++++++++++++++ services/mongodbflex/v2api/api_default.go | 150 +++++++++--------- .../mongodbflex/v2api/api_default_mock.go | 50 +++--- .../model_clone_instance_region_parameter.go | 114 +++++++++++++ .../model_create_instance_region_parameter.go | 114 +++++++++++++ .../model_create_user_region_parameter.go | 114 +++++++++++++ .../model_delete_instance_region_parameter.go | 114 +++++++++++++ .../model_delete_user_region_parameter.go | 114 +++++++++++++ .../model_get_backup_region_parameter.go | 114 +++++++++++++ .../model_get_instance_region_parameter.go | 114 +++++++++++++ .../v2api/model_get_user_region_parameter.go | 114 +++++++++++++ services/mongodbflex/v2api/model_instance.go | 31 ++-- .../v2api/model_instance_list_instance.go | 17 +- .../model_instance_list_instance_status.go | 120 ++++++++++++++ .../v2api/model_instance_status.go | 120 ++++++++++++++ ...t_advisor_slow_queries_region_parameter.go | 114 +++++++++++++ .../model_list_backups_region_parameter.go | 114 +++++++++++++ .../model_list_flavors_region_parameter.go | 114 +++++++++++++ .../model_list_instances_region_parameter.go | 114 +++++++++++++ .../model_list_metrics_region_parameter.go | 114 +++++++++++++ ...odel_list_restore_jobs_region_parameter.go | 114 +++++++++++++ .../model_list_storages_region_parameter.go | 114 +++++++++++++ ...list_suggested_indexes_region_parameter.go | 114 +++++++++++++ .../model_list_users_region_parameter.go | 114 +++++++++++++ .../model_list_versions_region_parameter.go | 114 +++++++++++++ ...artial_update_instance_region_parameter.go | 114 +++++++++++++ ...el_partial_update_user_region_parameter.go | 114 +++++++++++++ .../model_reset_user_region_parameter.go | 114 +++++++++++++ ...model_restore_instance_region_parameter.go | 114 +++++++++++++ ...update_backup_schedule_region_parameter.go | 114 +++++++++++++ .../model_update_instance_region_parameter.go | 114 +++++++++++++ .../model_update_user_region_parameter.go | 114 +++++++++++++ 35 files changed, 3476 insertions(+), 150 deletions(-) create mode 100644 services/mongodbflex/v1api/model_instance_list_instance_status.go create mode 100644 services/mongodbflex/v1api/model_instance_status.go create mode 100644 services/mongodbflex/v2api/model_clone_instance_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_create_instance_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_create_user_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_delete_instance_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_delete_user_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_get_backup_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_get_instance_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_get_user_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_instance_list_instance_status.go create mode 100644 services/mongodbflex/v2api/model_instance_status.go create mode 100644 services/mongodbflex/v2api/model_list_advisor_slow_queries_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_list_backups_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_list_flavors_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_list_instances_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_list_metrics_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_list_restore_jobs_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_list_storages_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_list_suggested_indexes_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_list_users_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_list_versions_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_partial_update_instance_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_partial_update_user_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_reset_user_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_restore_instance_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_update_backup_schedule_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_update_instance_region_parameter.go create mode 100644 services/mongodbflex/v2api/model_update_user_region_parameter.go diff --git a/services/mongodbflex/v1api/model_instance.go b/services/mongodbflex/v1api/model_instance.go index 910102def..075eaecae 100644 --- a/services/mongodbflex/v1api/model_instance.go +++ b/services/mongodbflex/v1api/model_instance.go @@ -20,17 +20,16 @@ var _ MappedNullable = &Instance{} // Instance struct for Instance type Instance struct { - Acl *ACL `json:"acl,omitempty"` - BackupSchedule *string `json:"backupSchedule,omitempty"` - Flavor *Flavor `json:"flavor,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Options *map[string]string `json:"options,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - // The current status of the instance. - Status *string `json:"status,omitempty"` - Storage *Storage `json:"storage,omitempty"` - Version *string `json:"version,omitempty"` + Acl *ACL `json:"acl,omitempty"` + BackupSchedule *string `json:"backupSchedule,omitempty"` + Flavor *Flavor `json:"flavor,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Status *InstanceStatus `json:"status,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` AdditionalProperties map[string]interface{} } @@ -278,9 +277,9 @@ func (o *Instance) SetReplicas(v int32) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Instance) GetStatus() string { +func (o *Instance) GetStatus() InstanceStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret InstanceStatus return ret } return *o.Status @@ -288,7 +287,7 @@ func (o *Instance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetStatusOk() (*string, bool) { +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -304,8 +303,8 @@ func (o *Instance) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Instance) SetStatus(v string) { +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { o.Status = &v } diff --git a/services/mongodbflex/v1api/model_instance_list_instance.go b/services/mongodbflex/v1api/model_instance_list_instance.go index cb806edc7..e7d2c8459 100644 --- a/services/mongodbflex/v1api/model_instance_list_instance.go +++ b/services/mongodbflex/v1api/model_instance_list_instance.go @@ -20,10 +20,9 @@ var _ MappedNullable = &InstanceListInstance{} // InstanceListInstance struct for InstanceListInstance type InstanceListInstance struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - // The current status of the instance. - Status *string `json:"status,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Status *InstanceListInstanceStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -111,9 +110,9 @@ func (o *InstanceListInstance) SetName(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *InstanceListInstance) GetStatus() string { +func (o *InstanceListInstance) GetStatus() InstanceListInstanceStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret InstanceListInstanceStatus return ret } return *o.Status @@ -121,7 +120,7 @@ func (o *InstanceListInstance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceListInstance) GetStatusOk() (*string, bool) { +func (o *InstanceListInstance) GetStatusOk() (*InstanceListInstanceStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -137,8 +136,8 @@ func (o *InstanceListInstance) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *InstanceListInstance) SetStatus(v string) { +// SetStatus gets a reference to the given InstanceListInstanceStatus and assigns it to the Status field. +func (o *InstanceListInstance) SetStatus(v InstanceListInstanceStatus) { o.Status = &v } diff --git a/services/mongodbflex/v1api/model_instance_list_instance_status.go b/services/mongodbflex/v1api/model_instance_list_instance_status.go new file mode 100644 index 000000000..5c73da0ed --- /dev/null +++ b/services/mongodbflex/v1api/model_instance_list_instance_status.go @@ -0,0 +1,120 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceListInstanceStatus The current status of the instance. +type InstanceListInstanceStatus string + +// List of instance_ListInstance_status +const ( + INSTANCELISTINSTANCESTATUS_READY InstanceListInstanceStatus = "READY" + INSTANCELISTINSTANCESTATUS_PENDING InstanceListInstanceStatus = "PENDING" + INSTANCELISTINSTANCESTATUS_PROCESSING InstanceListInstanceStatus = "PROCESSING" + INSTANCELISTINSTANCESTATUS_FAILED InstanceListInstanceStatus = "FAILED" + INSTANCELISTINSTANCESTATUS_UNKNOWN InstanceListInstanceStatus = "UNKNOWN" + INSTANCELISTINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceListInstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceListInstanceStatus enum +var AllowedInstanceListInstanceStatusEnumValues = []InstanceListInstanceStatus{ + "READY", + "PENDING", + "PROCESSING", + "FAILED", + "UNKNOWN", + "unknown_default_open_api", +} + +func (v *InstanceListInstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceListInstanceStatus(value) + for _, existing := range AllowedInstanceListInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELISTINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceListInstanceStatusFromValue returns a pointer to a valid InstanceListInstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceListInstanceStatusFromValue(v string) (*InstanceListInstanceStatus, error) { + ev := InstanceListInstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceListInstanceStatus: valid values are %v", v, AllowedInstanceListInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceListInstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceListInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance_ListInstance_status value +func (v InstanceListInstanceStatus) Ptr() *InstanceListInstanceStatus { + return &v +} + +type NullableInstanceListInstanceStatus struct { + value *InstanceListInstanceStatus + isSet bool +} + +func (v NullableInstanceListInstanceStatus) Get() *InstanceListInstanceStatus { + return v.value +} + +func (v *NullableInstanceListInstanceStatus) Set(val *InstanceListInstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceListInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceListInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceListInstanceStatus(val *InstanceListInstanceStatus) *NullableInstanceListInstanceStatus { + return &NullableInstanceListInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceListInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceListInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v1api/model_instance_status.go b/services/mongodbflex/v1api/model_instance_status.go new file mode 100644 index 000000000..3fe59bc6c --- /dev/null +++ b/services/mongodbflex/v1api/model_instance_status.go @@ -0,0 +1,120 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 1.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus The current status of the instance. +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_READY InstanceStatus = "READY" + INSTANCESTATUS_PENDING InstanceStatus = "PENDING" + INSTANCESTATUS_PROCESSING InstanceStatus = "PROCESSING" + INSTANCESTATUS_FAILED InstanceStatus = "FAILED" + INSTANCESTATUS_UNKNOWN InstanceStatus = "UNKNOWN" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "READY", + "PENDING", + "PROCESSING", + "FAILED", + "UNKNOWN", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/api_default.go b/services/mongodbflex/v2api/api_default.go index abbada290..cc75e89a0 100644 --- a/services/mongodbflex/v2api/api_default.go +++ b/services/mongodbflex/v2api/api_default.go @@ -36,7 +36,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCloneInstanceRequest */ - CloneInstance(ctx context.Context, projectId string, instanceId string, region string) ApiCloneInstanceRequest + CloneInstance(ctx context.Context, projectId string, instanceId string, region CloneInstanceRegionParameter) ApiCloneInstanceRequest // CloneInstanceExecute executes the request // @return CloneInstanceResponse @@ -52,7 +52,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateInstanceRequest */ - CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest // CreateInstanceExecute executes the request // @return CreateInstanceResponse @@ -69,7 +69,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateUserRequest */ - CreateUser(ctx context.Context, projectId string, instanceId string, region string) ApiCreateUserRequest + CreateUser(ctx context.Context, projectId string, instanceId string, region CreateUserRegionParameter) ApiCreateUserRequest // CreateUserExecute executes the request // @return CreateUserResponse @@ -86,7 +86,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiDeleteInstanceRequest */ - DeleteInstance(ctx context.Context, projectId string, instanceId string, region string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, instanceId string, region DeleteInstanceRegionParameter) ApiDeleteInstanceRequest // DeleteInstanceExecute executes the request DeleteInstanceExecute(r ApiDeleteInstanceRequest) error @@ -103,7 +103,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiDeleteUserRequest */ - DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiDeleteUserRequest + DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region DeleteUserRegionParameter) ApiDeleteUserRequest // DeleteUserExecute executes the request DeleteUserExecute(r ApiDeleteUserRequest) error @@ -120,7 +120,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetBackupRequest */ - GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region string) ApiGetBackupRequest + GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region GetBackupRegionParameter) ApiGetBackupRequest // GetBackupExecute executes the request // @return GetBackupResponse @@ -137,7 +137,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetInstanceRequest */ - GetInstance(ctx context.Context, projectId string, instanceId string, region string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, instanceId string, region GetInstanceRegionParameter) ApiGetInstanceRequest // GetInstanceExecute executes the request // @return InstanceResponse @@ -155,7 +155,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetUserRequest */ - GetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiGetUserRequest + GetUser(ctx context.Context, projectId string, instanceId string, userId string, region GetUserRegionParameter) ApiGetUserRequest // GetUserExecute executes the request // @return GetUserResponse @@ -172,7 +172,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListAdvisorSlowQueriesRequest */ - ListAdvisorSlowQueries(ctx context.Context, projectId string, instanceId string, region string) ApiListAdvisorSlowQueriesRequest + ListAdvisorSlowQueries(ctx context.Context, projectId string, instanceId string, region ListAdvisorSlowQueriesRegionParameter) ApiListAdvisorSlowQueriesRequest // ListAdvisorSlowQueriesExecute executes the request // @return HandlersInstancesSlowQueriesResponse @@ -189,7 +189,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListBackupsRequest */ - ListBackups(ctx context.Context, projectId string, instanceId string, region string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, instanceId string, region ListBackupsRegionParameter) ApiListBackupsRequest // ListBackupsExecute executes the request // @return ListBackupsResponse @@ -205,7 +205,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListFlavorsRequest */ - ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest + ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest // ListFlavorsExecute executes the request // @return ListFlavorsResponse @@ -221,7 +221,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListInstancesRequest */ - ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest // ListInstancesExecute executes the request // @return ListInstancesResponse @@ -239,7 +239,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListMetricsRequest */ - ListMetrics(ctx context.Context, projectId string, instanceId string, metric string, region string) ApiListMetricsRequest + ListMetrics(ctx context.Context, projectId string, instanceId string, metric string, region ListMetricsRegionParameter) ApiListMetricsRequest // ListMetricsExecute executes the request // @return ListMetricsResponse @@ -256,7 +256,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListRestoreJobsRequest */ - ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region string) ApiListRestoreJobsRequest + ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region ListRestoreJobsRegionParameter) ApiListRestoreJobsRequest // ListRestoreJobsExecute executes the request // @return ListRestoreJobsResponse @@ -273,7 +273,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListStoragesRequest */ - ListStorages(ctx context.Context, projectId string, flavor string, region string) ApiListStoragesRequest + ListStorages(ctx context.Context, projectId string, flavor string, region ListStoragesRegionParameter) ApiListStoragesRequest // ListStoragesExecute executes the request // @return ListStoragesResponse @@ -290,7 +290,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListSuggestedIndexesRequest */ - ListSuggestedIndexes(ctx context.Context, projectId string, instanceId string, region string) ApiListSuggestedIndexesRequest + ListSuggestedIndexes(ctx context.Context, projectId string, instanceId string, region ListSuggestedIndexesRegionParameter) ApiListSuggestedIndexesRequest // ListSuggestedIndexesExecute executes the request // @return HandlersInstancesSuggestedIndexesResponse @@ -307,7 +307,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListUsersRequest */ - ListUsers(ctx context.Context, projectId string, instanceId string, region string) ApiListUsersRequest + ListUsers(ctx context.Context, projectId string, instanceId string, region ListUsersRegionParameter) ApiListUsersRequest // ListUsersExecute executes the request // @return ListUsersResponse @@ -323,7 +323,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListVersionsRequest */ - ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest + ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest // ListVersionsExecute executes the request // @return ListVersionsResponse @@ -340,7 +340,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiPartialUpdateInstanceRequest */ - PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiPartialUpdateInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region PartialUpdateInstanceRegionParameter) ApiPartialUpdateInstanceRequest // PartialUpdateInstanceExecute executes the request // @return UpdateInstanceResponse @@ -358,7 +358,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiPartialUpdateUserRequest */ - PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiPartialUpdateUserRequest + PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region PartialUpdateUserRegionParameter) ApiPartialUpdateUserRequest // PartialUpdateUserExecute executes the request PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error @@ -375,7 +375,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiResetUserRequest */ - ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiResetUserRequest + ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region ResetUserRegionParameter) ApiResetUserRequest // ResetUserExecute executes the request // @return User @@ -392,7 +392,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiRestoreInstanceRequest */ - RestoreInstance(ctx context.Context, projectId string, instanceId string, region string) ApiRestoreInstanceRequest + RestoreInstance(ctx context.Context, projectId string, instanceId string, region RestoreInstanceRegionParameter) ApiRestoreInstanceRequest // RestoreInstanceExecute executes the request // @return RestoreInstanceResponse @@ -409,7 +409,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiUpdateBackupScheduleRequest */ - UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateBackupScheduleRequest + UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string, region UpdateBackupScheduleRegionParameter) ApiUpdateBackupScheduleRequest // UpdateBackupScheduleExecute executes the request // @return BackupSchedule @@ -426,7 +426,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiUpdateInstanceRequest */ - UpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateInstanceRequest + UpdateInstance(ctx context.Context, projectId string, instanceId string, region UpdateInstanceRegionParameter) ApiUpdateInstanceRequest // UpdateInstanceExecute executes the request // @return UpdateInstanceResponse @@ -444,7 +444,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiUpdateUserRequest */ - UpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiUpdateUserRequest + UpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region UpdateUserRegionParameter) ApiUpdateUserRequest // UpdateUserExecute executes the request UpdateUserExecute(r ApiUpdateUserRequest) error @@ -458,7 +458,7 @@ type ApiCloneInstanceRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region CloneInstanceRegionParameter cloneInstancePayload *CloneInstancePayload } @@ -484,7 +484,7 @@ As an example a valid timestamp look like "2023-04-20T15:05:15Z" @param region The region which should be addressed @return ApiCloneInstanceRequest */ -func (a *DefaultAPIService) CloneInstance(ctx context.Context, projectId string, instanceId string, region string) ApiCloneInstanceRequest { +func (a *DefaultAPIService) CloneInstance(ctx context.Context, projectId string, instanceId string, region CloneInstanceRegionParameter) ApiCloneInstanceRequest { return ApiCloneInstanceRequest{ ApiService: a, ctx: ctx, @@ -625,7 +625,7 @@ type ApiCreateInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region CreateInstanceRegionParameter createInstancePayload *CreateInstancePayload } @@ -649,7 +649,7 @@ Create and deploys an instance
Note that the time format for the backupSche @param region The region which should be addressed @return ApiCreateInstanceRequest */ -func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ ApiService: a, ctx: ctx, @@ -800,7 +800,7 @@ type ApiCreateUserRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region CreateUserRegionParameter createUserPayload *CreateUserPayload } @@ -825,7 +825,7 @@ create a new user for a mongodb instance @param region The region which should be addressed @return ApiCreateUserRequest */ -func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, instanceId string, region string) ApiCreateUserRequest { +func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, instanceId string, region CreateUserRegionParameter) ApiCreateUserRequest { return ApiCreateUserRequest{ ApiService: a, ctx: ctx, @@ -989,7 +989,7 @@ type ApiDeleteInstanceRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region DeleteInstanceRegionParameter } func (r ApiDeleteInstanceRequest) Execute() error { @@ -1007,7 +1007,7 @@ removes an instance @param region The region which should be addressed @return ApiDeleteInstanceRequest */ -func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, instanceId string, region string) ApiDeleteInstanceRequest { +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, instanceId string, region DeleteInstanceRegionParameter) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -1143,7 +1143,7 @@ type ApiDeleteUserRequest struct { projectId string instanceId string userId string - region string + region DeleteUserRegionParameter } func (r ApiDeleteUserRequest) Execute() error { @@ -1162,7 +1162,7 @@ delete mongodb user @param region The region which should be addressed @return ApiDeleteUserRequest */ -func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiDeleteUserRequest { +func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region DeleteUserRegionParameter) ApiDeleteUserRequest { return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, @@ -1300,7 +1300,7 @@ type ApiGetBackupRequest struct { projectId string instanceId string backupId string - region string + region GetBackupRegionParameter } func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { @@ -1319,7 +1319,7 @@ Get details about a specific backup @param region The region which should be addressed @return ApiGetBackupRequest */ -func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region string) ApiGetBackupRequest { +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region GetBackupRegionParameter) ApiGetBackupRequest { return ApiGetBackupRequest{ ApiService: a, ctx: ctx, @@ -1458,7 +1458,7 @@ type ApiGetInstanceRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region GetInstanceRegionParameter } func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { @@ -1476,7 +1476,7 @@ gets information of an instance @param region The region which should be addressed @return ApiGetInstanceRequest */ -func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, instanceId string, region string) ApiGetInstanceRequest { +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, instanceId string, region GetInstanceRegionParameter) ApiGetInstanceRequest { return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, @@ -1614,7 +1614,7 @@ type ApiGetUserRequest struct { projectId string instanceId string userId string - region string + region GetUserRegionParameter } func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { @@ -1633,7 +1633,7 @@ get detailed information of a user of a mongodb instance @param region The region which should be addressed @return ApiGetUserRequest */ -func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiGetUserRequest { +func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, instanceId string, userId string, region GetUserRegionParameter) ApiGetUserRequest { return ApiGetUserRequest{ ApiService: a, ctx: ctx, @@ -1783,7 +1783,7 @@ type ApiListAdvisorSlowQueriesRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListAdvisorSlowQueriesRegionParameter } func (r ApiListAdvisorSlowQueriesRequest) Execute() (*HandlersInstancesSlowQueriesResponse, error) { @@ -1801,7 +1801,7 @@ gets slow queries from the Opsmanager performance advisor @param region The region which should be addressed @return ApiListAdvisorSlowQueriesRequest */ -func (a *DefaultAPIService) ListAdvisorSlowQueries(ctx context.Context, projectId string, instanceId string, region string) ApiListAdvisorSlowQueriesRequest { +func (a *DefaultAPIService) ListAdvisorSlowQueries(ctx context.Context, projectId string, instanceId string, region ListAdvisorSlowQueriesRegionParameter) ApiListAdvisorSlowQueriesRequest { return ApiListAdvisorSlowQueriesRequest{ ApiService: a, ctx: ctx, @@ -1949,7 +1949,7 @@ type ApiListBackupsRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListBackupsRegionParameter } func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { @@ -1967,7 +1967,7 @@ List backups of an instance @param region The region which should be addressed @return ApiListBackupsRequest */ -func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, instanceId string, region string) ApiListBackupsRequest { +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, instanceId string, region ListBackupsRegionParameter) ApiListBackupsRequest { return ApiListBackupsRequest{ ApiService: a, ctx: ctx, @@ -2103,7 +2103,7 @@ type ApiListFlavorsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListFlavorsRegionParameter } func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { @@ -2120,7 +2120,7 @@ returns all possible flavors @param region The region which should be addressed @return ApiListFlavorsRequest */ -func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { +func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest { return ApiListFlavorsRequest{ ApiService: a, ctx: ctx, @@ -2255,7 +2255,7 @@ type ApiListInstancesRequest struct { ApiService DefaultAPI projectId string tag *string - region string + region ListInstancesRegionParameter } // instance tag @@ -2278,7 +2278,7 @@ list all instances for a projectID @param region The region which should be addressed @return ApiListInstancesRequest */ -func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest { return ApiListInstancesRequest{ ApiService: a, ctx: ctx, @@ -2419,7 +2419,7 @@ type ApiListMetricsRequest struct { instanceId string metric string granularity *string - region string + region ListMetricsRegionParameter period *string start *string end *string @@ -2465,7 +2465,7 @@ returns metrics for an instance @param region The region which should be addressed @return ApiListMetricsRequest */ -func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, instanceId string, metric string, region string) ApiListMetricsRequest { +func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, instanceId string, metric string, region ListMetricsRegionParameter) ApiListMetricsRequest { return ApiListMetricsRequest{ ApiService: a, ctx: ctx, @@ -2628,7 +2628,7 @@ type ApiListRestoreJobsRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListRestoreJobsRegionParameter } func (r ApiListRestoreJobsRequest) Execute() (*ListRestoreJobsResponse, error) { @@ -2646,7 +2646,7 @@ List restore jobs of an instance @param region The region which should be addressed @return ApiListRestoreJobsRequest */ -func (a *DefaultAPIService) ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region string) ApiListRestoreJobsRequest { +func (a *DefaultAPIService) ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region ListRestoreJobsRegionParameter) ApiListRestoreJobsRequest { return ApiListRestoreJobsRequest{ ApiService: a, ctx: ctx, @@ -2783,7 +2783,7 @@ type ApiListStoragesRequest struct { ApiService DefaultAPI projectId string flavor string - region string + region ListStoragesRegionParameter } func (r ApiListStoragesRequest) Execute() (*ListStoragesResponse, error) { @@ -2801,7 +2801,7 @@ returns the storage for a certain flavor @param region The region which should be addressed @return ApiListStoragesRequest */ -func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, flavor string, region string) ApiListStoragesRequest { +func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, flavor string, region ListStoragesRegionParameter) ApiListStoragesRequest { return ApiListStoragesRequest{ ApiService: a, ctx: ctx, @@ -2938,7 +2938,7 @@ type ApiListSuggestedIndexesRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListSuggestedIndexesRegionParameter } func (r ApiListSuggestedIndexesRequest) Execute() (*HandlersInstancesSuggestedIndexesResponse, error) { @@ -2956,7 +2956,7 @@ gets suggested indexes from the Opsmanager performance advisor @param region The region which should be addressed @return ApiListSuggestedIndexesRequest */ -func (a *DefaultAPIService) ListSuggestedIndexes(ctx context.Context, projectId string, instanceId string, region string) ApiListSuggestedIndexesRequest { +func (a *DefaultAPIService) ListSuggestedIndexes(ctx context.Context, projectId string, instanceId string, region ListSuggestedIndexesRegionParameter) ApiListSuggestedIndexesRequest { return ApiListSuggestedIndexesRequest{ ApiService: a, ctx: ctx, @@ -3104,7 +3104,7 @@ type ApiListUsersRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListUsersRegionParameter } func (r ApiListUsersRequest) Execute() (*ListUsersResponse, error) { @@ -3122,7 +3122,7 @@ list all users for a mongodb instance @param region The region which should be addressed @return ApiListUsersRequest */ -func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, instanceId string, region string) ApiListUsersRequest { +func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, instanceId string, region ListUsersRegionParameter) ApiListUsersRequest { return ApiListUsersRequest{ ApiService: a, ctx: ctx, @@ -3269,7 +3269,7 @@ type ApiListVersionsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListVersionsRegionParameter } func (r ApiListVersionsRequest) Execute() (*ListVersionsResponse, error) { @@ -3286,7 +3286,7 @@ returns all available versions for creating endpoint @param region The region which should be addressed @return ApiListVersionsRequest */ -func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { +func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest { return ApiListVersionsRequest{ ApiService: a, ctx: ctx, @@ -3410,7 +3410,7 @@ type ApiPartialUpdateInstanceRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region PartialUpdateInstanceRegionParameter partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -3435,7 +3435,7 @@ Updates a deployment plan
Note that the time format for the backupSchedule @param region The region which should be addressed @return ApiPartialUpdateInstanceRequest */ -func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiPartialUpdateInstanceRequest { +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region PartialUpdateInstanceRegionParameter) ApiPartialUpdateInstanceRequest { return ApiPartialUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -3600,7 +3600,7 @@ type ApiPartialUpdateUserRequest struct { projectId string instanceId string userId string - region string + region PartialUpdateUserRegionParameter partialUpdateUserPayload *PartialUpdateUserPayload } @@ -3626,7 +3626,7 @@ updates user for a mongodb instance @param region The region which should be addressed @return ApiPartialUpdateUserRequest */ -func (a *DefaultAPIService) PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiPartialUpdateUserRequest { +func (a *DefaultAPIService) PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region PartialUpdateUserRegionParameter) ApiPartialUpdateUserRequest { return ApiPartialUpdateUserRequest{ ApiService: a, ctx: ctx, @@ -3769,7 +3769,7 @@ type ApiResetUserRequest struct { projectId string instanceId string userId string - region string + region ResetUserRegionParameter } func (r ApiResetUserRequest) Execute() (*User, error) { @@ -3788,7 +3788,7 @@ resets mongodb user's password @param region The region which should be addressed @return ApiResetUserRequest */ -func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiResetUserRequest { +func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region ResetUserRegionParameter) ApiResetUserRequest { return ApiResetUserRequest{ ApiService: a, ctx: ctx, @@ -3938,7 +3938,7 @@ type ApiRestoreInstanceRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region RestoreInstanceRegionParameter restoreInstancePayload *RestoreInstancePayload } @@ -3963,7 +3963,7 @@ Restore an instance based on snapshot @param region The region which should be addressed @return ApiRestoreInstanceRequest */ -func (a *DefaultAPIService) RestoreInstance(ctx context.Context, projectId string, instanceId string, region string) ApiRestoreInstanceRequest { +func (a *DefaultAPIService) RestoreInstance(ctx context.Context, projectId string, instanceId string, region RestoreInstanceRegionParameter) ApiRestoreInstanceRequest { return ApiRestoreInstanceRequest{ ApiService: a, ctx: ctx, @@ -4105,7 +4105,7 @@ type ApiUpdateBackupScheduleRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region UpdateBackupScheduleRegionParameter updateBackupSchedulePayload *UpdateBackupSchedulePayload } @@ -4130,7 +4130,7 @@ Updates a backup schedule
Note that the time format is in UTC @param region The region which should be addressed @return ApiUpdateBackupScheduleRequest */ -func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateBackupScheduleRequest { +func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string, region UpdateBackupScheduleRegionParameter) ApiUpdateBackupScheduleRequest { return ApiUpdateBackupScheduleRequest{ ApiService: a, ctx: ctx, @@ -4272,7 +4272,7 @@ type ApiUpdateInstanceRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region UpdateInstanceRegionParameter updateInstancePayload *UpdateInstancePayload } @@ -4297,7 +4297,7 @@ Updates a deployment plan
Note that the time format for the backupSchedule @param region The region which should be addressed @return ApiUpdateInstanceRequest */ -func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateInstanceRequest { +func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, instanceId string, region UpdateInstanceRegionParameter) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -4462,7 +4462,7 @@ type ApiUpdateUserRequest struct { projectId string instanceId string userId string - region string + region UpdateUserRegionParameter updateUserPayload *UpdateUserPayload } @@ -4488,7 +4488,7 @@ updates user for a mongodb instance @param region The region which should be addressed @return ApiUpdateUserRequest */ -func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiUpdateUserRequest { +func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region UpdateUserRegionParameter) ApiUpdateUserRequest { return ApiUpdateUserRequest{ ApiService: a, ctx: ctx, diff --git a/services/mongodbflex/v2api/api_default_mock.go b/services/mongodbflex/v2api/api_default_mock.go index 6a29dbfb0..b8c7010f0 100644 --- a/services/mongodbflex/v2api/api_default_mock.go +++ b/services/mongodbflex/v2api/api_default_mock.go @@ -73,7 +73,7 @@ type DefaultAPIServiceMock struct { UpdateUserExecuteMock *func(r ApiUpdateUserRequest) error } -func (a DefaultAPIServiceMock) CloneInstance(ctx context.Context, projectId string, instanceId string, region string) ApiCloneInstanceRequest { +func (a DefaultAPIServiceMock) CloneInstance(ctx context.Context, projectId string, instanceId string, region CloneInstanceRegionParameter) ApiCloneInstanceRequest { return ApiCloneInstanceRequest{ ApiService: a, ctx: ctx, @@ -93,7 +93,7 @@ func (a DefaultAPIServiceMock) CloneInstanceExecute(r ApiCloneInstanceRequest) ( return (*a.CloneInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ ApiService: a, ctx: ctx, @@ -112,7 +112,7 @@ func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) return (*a.CreateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, instanceId string, region string) ApiCreateUserRequest { +func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, instanceId string, region CreateUserRegionParameter) ApiCreateUserRequest { return ApiCreateUserRequest{ ApiService: a, ctx: ctx, @@ -132,7 +132,7 @@ func (a DefaultAPIServiceMock) CreateUserExecute(r ApiCreateUserRequest) (*Creat return (*a.CreateUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, instanceId string, region string) ApiDeleteInstanceRequest { +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, instanceId string, region DeleteInstanceRegionParameter) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -151,7 +151,7 @@ func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) return (*a.DeleteInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiDeleteUserRequest { +func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region DeleteUserRegionParameter) ApiDeleteUserRequest { return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, @@ -171,7 +171,7 @@ func (a DefaultAPIServiceMock) DeleteUserExecute(r ApiDeleteUserRequest) error { return (*a.DeleteUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region string) ApiGetBackupRequest { +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region GetBackupRegionParameter) ApiGetBackupRequest { return ApiGetBackupRequest{ ApiService: a, ctx: ctx, @@ -192,7 +192,7 @@ func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*GetBack return (*a.GetBackupExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, instanceId string, region string) ApiGetInstanceRequest { +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, instanceId string, region GetInstanceRegionParameter) ApiGetInstanceRequest { return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, @@ -212,7 +212,7 @@ func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Ins return (*a.GetInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiGetUserRequest { +func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, instanceId string, userId string, region GetUserRegionParameter) ApiGetUserRequest { return ApiGetUserRequest{ ApiService: a, ctx: ctx, @@ -233,7 +233,7 @@ func (a DefaultAPIServiceMock) GetUserExecute(r ApiGetUserRequest) (*GetUserResp return (*a.GetUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListAdvisorSlowQueries(ctx context.Context, projectId string, instanceId string, region string) ApiListAdvisorSlowQueriesRequest { +func (a DefaultAPIServiceMock) ListAdvisorSlowQueries(ctx context.Context, projectId string, instanceId string, region ListAdvisorSlowQueriesRegionParameter) ApiListAdvisorSlowQueriesRequest { return ApiListAdvisorSlowQueriesRequest{ ApiService: a, ctx: ctx, @@ -253,7 +253,7 @@ func (a DefaultAPIServiceMock) ListAdvisorSlowQueriesExecute(r ApiListAdvisorSlo return (*a.ListAdvisorSlowQueriesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, instanceId string, region string) ApiListBackupsRequest { +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, instanceId string, region ListBackupsRegionParameter) ApiListBackupsRequest { return ApiListBackupsRequest{ ApiService: a, ctx: ctx, @@ -273,7 +273,7 @@ func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*Lis return (*a.ListBackupsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { +func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest { return ApiListFlavorsRequest{ ApiService: a, ctx: ctx, @@ -292,7 +292,7 @@ func (a DefaultAPIServiceMock) ListFlavorsExecute(r ApiListFlavorsRequest) (*Lis return (*a.ListFlavorsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest { return ApiListInstancesRequest{ ApiService: a, ctx: ctx, @@ -311,7 +311,7 @@ func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) ( return (*a.ListInstancesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, instanceId string, metric string, region string) ApiListMetricsRequest { +func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, instanceId string, metric string, region ListMetricsRegionParameter) ApiListMetricsRequest { return ApiListMetricsRequest{ ApiService: a, ctx: ctx, @@ -332,7 +332,7 @@ func (a DefaultAPIServiceMock) ListMetricsExecute(r ApiListMetricsRequest) (*Lis return (*a.ListMetricsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region string) ApiListRestoreJobsRequest { +func (a DefaultAPIServiceMock) ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region ListRestoreJobsRegionParameter) ApiListRestoreJobsRequest { return ApiListRestoreJobsRequest{ ApiService: a, ctx: ctx, @@ -352,7 +352,7 @@ func (a DefaultAPIServiceMock) ListRestoreJobsExecute(r ApiListRestoreJobsReques return (*a.ListRestoreJobsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, flavor string, region string) ApiListStoragesRequest { +func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, flavor string, region ListStoragesRegionParameter) ApiListStoragesRequest { return ApiListStoragesRequest{ ApiService: a, ctx: ctx, @@ -372,7 +372,7 @@ func (a DefaultAPIServiceMock) ListStoragesExecute(r ApiListStoragesRequest) (*L return (*a.ListStoragesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListSuggestedIndexes(ctx context.Context, projectId string, instanceId string, region string) ApiListSuggestedIndexesRequest { +func (a DefaultAPIServiceMock) ListSuggestedIndexes(ctx context.Context, projectId string, instanceId string, region ListSuggestedIndexesRegionParameter) ApiListSuggestedIndexesRequest { return ApiListSuggestedIndexesRequest{ ApiService: a, ctx: ctx, @@ -392,7 +392,7 @@ func (a DefaultAPIServiceMock) ListSuggestedIndexesExecute(r ApiListSuggestedInd return (*a.ListSuggestedIndexesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, instanceId string, region string) ApiListUsersRequest { +func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, instanceId string, region ListUsersRegionParameter) ApiListUsersRequest { return ApiListUsersRequest{ ApiService: a, ctx: ctx, @@ -412,7 +412,7 @@ func (a DefaultAPIServiceMock) ListUsersExecute(r ApiListUsersRequest) (*ListUse return (*a.ListUsersExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { +func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest { return ApiListVersionsRequest{ ApiService: a, ctx: ctx, @@ -431,7 +431,7 @@ func (a DefaultAPIServiceMock) ListVersionsExecute(r ApiListVersionsRequest) (*L return (*a.ListVersionsExecuteMock)(r) } -func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiPartialUpdateInstanceRequest { +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region PartialUpdateInstanceRegionParameter) ApiPartialUpdateInstanceRequest { return ApiPartialUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -451,7 +451,7 @@ func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateIn return (*a.PartialUpdateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiPartialUpdateUserRequest { +func (a DefaultAPIServiceMock) PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region PartialUpdateUserRegionParameter) ApiPartialUpdateUserRequest { return ApiPartialUpdateUserRequest{ ApiService: a, ctx: ctx, @@ -471,7 +471,7 @@ func (a DefaultAPIServiceMock) PartialUpdateUserExecute(r ApiPartialUpdateUserRe return (*a.PartialUpdateUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiResetUserRequest { +func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region ResetUserRegionParameter) ApiResetUserRequest { return ApiResetUserRequest{ ApiService: a, ctx: ctx, @@ -492,7 +492,7 @@ func (a DefaultAPIServiceMock) ResetUserExecute(r ApiResetUserRequest) (*User, e return (*a.ResetUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) RestoreInstance(ctx context.Context, projectId string, instanceId string, region string) ApiRestoreInstanceRequest { +func (a DefaultAPIServiceMock) RestoreInstance(ctx context.Context, projectId string, instanceId string, region RestoreInstanceRegionParameter) ApiRestoreInstanceRequest { return ApiRestoreInstanceRequest{ ApiService: a, ctx: ctx, @@ -512,7 +512,7 @@ func (a DefaultAPIServiceMock) RestoreInstanceExecute(r ApiRestoreInstanceReques return (*a.RestoreInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateBackupScheduleRequest { +func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string, region UpdateBackupScheduleRegionParameter) ApiUpdateBackupScheduleRequest { return ApiUpdateBackupScheduleRequest{ ApiService: a, ctx: ctx, @@ -532,7 +532,7 @@ func (a DefaultAPIServiceMock) UpdateBackupScheduleExecute(r ApiUpdateBackupSche return (*a.UpdateBackupScheduleExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateInstanceRequest { +func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, instanceId string, region UpdateInstanceRegionParameter) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -552,7 +552,7 @@ func (a DefaultAPIServiceMock) UpdateInstanceExecute(r ApiUpdateInstanceRequest) return (*a.UpdateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiUpdateUserRequest { +func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, instanceId string, userId string, region UpdateUserRegionParameter) ApiUpdateUserRequest { return ApiUpdateUserRequest{ ApiService: a, ctx: ctx, diff --git a/services/mongodbflex/v2api/model_clone_instance_region_parameter.go b/services/mongodbflex/v2api/model_clone_instance_region_parameter.go new file mode 100644 index 000000000..38e4d95c9 --- /dev/null +++ b/services/mongodbflex/v2api/model_clone_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CloneInstanceRegionParameter the model 'CloneInstanceRegionParameter' +type CloneInstanceRegionParameter string + +// List of CloneInstance_region_parameter +const ( + CLONEINSTANCEREGIONPARAMETER_EU01 CloneInstanceRegionParameter = "eu01" + CLONEINSTANCEREGIONPARAMETER_EU02 CloneInstanceRegionParameter = "eu02" + CLONEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CloneInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of CloneInstanceRegionParameter enum +var AllowedCloneInstanceRegionParameterEnumValues = []CloneInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *CloneInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CloneInstanceRegionParameter(value) + for _, existing := range AllowedCloneInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CLONEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCloneInstanceRegionParameterFromValue returns a pointer to a valid CloneInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCloneInstanceRegionParameterFromValue(v string) (*CloneInstanceRegionParameter, error) { + ev := CloneInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CloneInstanceRegionParameter: valid values are %v", v, AllowedCloneInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CloneInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedCloneInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CloneInstance_region_parameter value +func (v CloneInstanceRegionParameter) Ptr() *CloneInstanceRegionParameter { + return &v +} + +type NullableCloneInstanceRegionParameter struct { + value *CloneInstanceRegionParameter + isSet bool +} + +func (v NullableCloneInstanceRegionParameter) Get() *CloneInstanceRegionParameter { + return v.value +} + +func (v *NullableCloneInstanceRegionParameter) Set(val *CloneInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableCloneInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneInstanceRegionParameter(val *CloneInstanceRegionParameter) *NullableCloneInstanceRegionParameter { + return &NullableCloneInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableCloneInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_create_instance_region_parameter.go b/services/mongodbflex/v2api/model_create_instance_region_parameter.go new file mode 100644 index 000000000..75a6a113e --- /dev/null +++ b/services/mongodbflex/v2api/model_create_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateInstanceRegionParameter the model 'CreateInstanceRegionParameter' +type CreateInstanceRegionParameter string + +// List of CreateInstance_region_parameter +const ( + CREATEINSTANCEREGIONPARAMETER_EU01 CreateInstanceRegionParameter = "eu01" + CREATEINSTANCEREGIONPARAMETER_EU02 CreateInstanceRegionParameter = "eu02" + CREATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of CreateInstanceRegionParameter enum +var AllowedCreateInstanceRegionParameterEnumValues = []CreateInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *CreateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateInstanceRegionParameter(value) + for _, existing := range AllowedCreateInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateInstanceRegionParameterFromValue returns a pointer to a valid CreateInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateInstanceRegionParameterFromValue(v string) (*CreateInstanceRegionParameter, error) { + ev := CreateInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateInstanceRegionParameter: valid values are %v", v, AllowedCreateInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedCreateInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateInstance_region_parameter value +func (v CreateInstanceRegionParameter) Ptr() *CreateInstanceRegionParameter { + return &v +} + +type NullableCreateInstanceRegionParameter struct { + value *CreateInstanceRegionParameter + isSet bool +} + +func (v NullableCreateInstanceRegionParameter) Get() *CreateInstanceRegionParameter { + return v.value +} + +func (v *NullableCreateInstanceRegionParameter) Set(val *CreateInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceRegionParameter(val *CreateInstanceRegionParameter) *NullableCreateInstanceRegionParameter { + return &NullableCreateInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableCreateInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_create_user_region_parameter.go b/services/mongodbflex/v2api/model_create_user_region_parameter.go new file mode 100644 index 000000000..440de0dab --- /dev/null +++ b/services/mongodbflex/v2api/model_create_user_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateUserRegionParameter the model 'CreateUserRegionParameter' +type CreateUserRegionParameter string + +// List of CreateUser_region_parameter +const ( + CREATEUSERREGIONPARAMETER_EU01 CreateUserRegionParameter = "eu01" + CREATEUSERREGIONPARAMETER_EU02 CreateUserRegionParameter = "eu02" + CREATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of CreateUserRegionParameter enum +var AllowedCreateUserRegionParameterEnumValues = []CreateUserRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *CreateUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateUserRegionParameter(value) + for _, existing := range AllowedCreateUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateUserRegionParameterFromValue returns a pointer to a valid CreateUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateUserRegionParameterFromValue(v string) (*CreateUserRegionParameter, error) { + ev := CreateUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateUserRegionParameter: valid values are %v", v, AllowedCreateUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateUserRegionParameter) IsValid() bool { + for _, existing := range AllowedCreateUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateUser_region_parameter value +func (v CreateUserRegionParameter) Ptr() *CreateUserRegionParameter { + return &v +} + +type NullableCreateUserRegionParameter struct { + value *CreateUserRegionParameter + isSet bool +} + +func (v NullableCreateUserRegionParameter) Get() *CreateUserRegionParameter { + return v.value +} + +func (v *NullableCreateUserRegionParameter) Set(val *CreateUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserRegionParameter(val *CreateUserRegionParameter) *NullableCreateUserRegionParameter { + return &NullableCreateUserRegionParameter{value: val, isSet: true} +} + +func (v NullableCreateUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_delete_instance_region_parameter.go b/services/mongodbflex/v2api/model_delete_instance_region_parameter.go new file mode 100644 index 000000000..9945f01bc --- /dev/null +++ b/services/mongodbflex/v2api/model_delete_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// DeleteInstanceRegionParameter the model 'DeleteInstanceRegionParameter' +type DeleteInstanceRegionParameter string + +// List of DeleteInstance_region_parameter +const ( + DELETEINSTANCEREGIONPARAMETER_EU01 DeleteInstanceRegionParameter = "eu01" + DELETEINSTANCEREGIONPARAMETER_EU02 DeleteInstanceRegionParameter = "eu02" + DELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of DeleteInstanceRegionParameter enum +var AllowedDeleteInstanceRegionParameterEnumValues = []DeleteInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *DeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeleteInstanceRegionParameter(value) + for _, existing := range AllowedDeleteInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDeleteInstanceRegionParameterFromValue returns a pointer to a valid DeleteInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeleteInstanceRegionParameterFromValue(v string) (*DeleteInstanceRegionParameter, error) { + ev := DeleteInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeleteInstanceRegionParameter: valid values are %v", v, AllowedDeleteInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeleteInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedDeleteInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteInstance_region_parameter value +func (v DeleteInstanceRegionParameter) Ptr() *DeleteInstanceRegionParameter { + return &v +} + +type NullableDeleteInstanceRegionParameter struct { + value *DeleteInstanceRegionParameter + isSet bool +} + +func (v NullableDeleteInstanceRegionParameter) Get() *DeleteInstanceRegionParameter { + return v.value +} + +func (v *NullableDeleteInstanceRegionParameter) Set(val *DeleteInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteInstanceRegionParameter(val *DeleteInstanceRegionParameter) *NullableDeleteInstanceRegionParameter { + return &NullableDeleteInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableDeleteInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_delete_user_region_parameter.go b/services/mongodbflex/v2api/model_delete_user_region_parameter.go new file mode 100644 index 000000000..aba03e38b --- /dev/null +++ b/services/mongodbflex/v2api/model_delete_user_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// DeleteUserRegionParameter the model 'DeleteUserRegionParameter' +type DeleteUserRegionParameter string + +// List of DeleteUser_region_parameter +const ( + DELETEUSERREGIONPARAMETER_EU01 DeleteUserRegionParameter = "eu01" + DELETEUSERREGIONPARAMETER_EU02 DeleteUserRegionParameter = "eu02" + DELETEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of DeleteUserRegionParameter enum +var AllowedDeleteUserRegionParameterEnumValues = []DeleteUserRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *DeleteUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeleteUserRegionParameter(value) + for _, existing := range AllowedDeleteUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DELETEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDeleteUserRegionParameterFromValue returns a pointer to a valid DeleteUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeleteUserRegionParameterFromValue(v string) (*DeleteUserRegionParameter, error) { + ev := DeleteUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeleteUserRegionParameter: valid values are %v", v, AllowedDeleteUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeleteUserRegionParameter) IsValid() bool { + for _, existing := range AllowedDeleteUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteUser_region_parameter value +func (v DeleteUserRegionParameter) Ptr() *DeleteUserRegionParameter { + return &v +} + +type NullableDeleteUserRegionParameter struct { + value *DeleteUserRegionParameter + isSet bool +} + +func (v NullableDeleteUserRegionParameter) Get() *DeleteUserRegionParameter { + return v.value +} + +func (v *NullableDeleteUserRegionParameter) Set(val *DeleteUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteUserRegionParameter(val *DeleteUserRegionParameter) *NullableDeleteUserRegionParameter { + return &NullableDeleteUserRegionParameter{value: val, isSet: true} +} + +func (v NullableDeleteUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_get_backup_region_parameter.go b/services/mongodbflex/v2api/model_get_backup_region_parameter.go new file mode 100644 index 000000000..b3fe655e1 --- /dev/null +++ b/services/mongodbflex/v2api/model_get_backup_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetBackupRegionParameter the model 'GetBackupRegionParameter' +type GetBackupRegionParameter string + +// List of GetBackup_region_parameter +const ( + GETBACKUPREGIONPARAMETER_EU01 GetBackupRegionParameter = "eu01" + GETBACKUPREGIONPARAMETER_EU02 GetBackupRegionParameter = "eu02" + GETBACKUPREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetBackupRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetBackupRegionParameter enum +var AllowedGetBackupRegionParameterEnumValues = []GetBackupRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetBackupRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetBackupRegionParameter(value) + for _, existing := range AllowedGetBackupRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETBACKUPREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetBackupRegionParameterFromValue returns a pointer to a valid GetBackupRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetBackupRegionParameterFromValue(v string) (*GetBackupRegionParameter, error) { + ev := GetBackupRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetBackupRegionParameter: valid values are %v", v, AllowedGetBackupRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetBackupRegionParameter) IsValid() bool { + for _, existing := range AllowedGetBackupRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetBackup_region_parameter value +func (v GetBackupRegionParameter) Ptr() *GetBackupRegionParameter { + return &v +} + +type NullableGetBackupRegionParameter struct { + value *GetBackupRegionParameter + isSet bool +} + +func (v NullableGetBackupRegionParameter) Get() *GetBackupRegionParameter { + return v.value +} + +func (v *NullableGetBackupRegionParameter) Set(val *GetBackupRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupRegionParameter(val *GetBackupRegionParameter) *NullableGetBackupRegionParameter { + return &NullableGetBackupRegionParameter{value: val, isSet: true} +} + +func (v NullableGetBackupRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_get_instance_region_parameter.go b/services/mongodbflex/v2api/model_get_instance_region_parameter.go new file mode 100644 index 000000000..586b9f630 --- /dev/null +++ b/services/mongodbflex/v2api/model_get_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetInstanceRegionParameter the model 'GetInstanceRegionParameter' +type GetInstanceRegionParameter string + +// List of GetInstance_region_parameter +const ( + GETINSTANCEREGIONPARAMETER_EU01 GetInstanceRegionParameter = "eu01" + GETINSTANCEREGIONPARAMETER_EU02 GetInstanceRegionParameter = "eu02" + GETINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetInstanceRegionParameter enum +var AllowedGetInstanceRegionParameterEnumValues = []GetInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetInstanceRegionParameter(value) + for _, existing := range AllowedGetInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetInstanceRegionParameterFromValue returns a pointer to a valid GetInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetInstanceRegionParameterFromValue(v string) (*GetInstanceRegionParameter, error) { + ev := GetInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetInstanceRegionParameter: valid values are %v", v, AllowedGetInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedGetInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetInstance_region_parameter value +func (v GetInstanceRegionParameter) Ptr() *GetInstanceRegionParameter { + return &v +} + +type NullableGetInstanceRegionParameter struct { + value *GetInstanceRegionParameter + isSet bool +} + +func (v NullableGetInstanceRegionParameter) Get() *GetInstanceRegionParameter { + return v.value +} + +func (v *NullableGetInstanceRegionParameter) Set(val *GetInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetInstanceRegionParameter(val *GetInstanceRegionParameter) *NullableGetInstanceRegionParameter { + return &NullableGetInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableGetInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_get_user_region_parameter.go b/services/mongodbflex/v2api/model_get_user_region_parameter.go new file mode 100644 index 000000000..69dc71950 --- /dev/null +++ b/services/mongodbflex/v2api/model_get_user_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetUserRegionParameter the model 'GetUserRegionParameter' +type GetUserRegionParameter string + +// List of GetUser_region_parameter +const ( + GETUSERREGIONPARAMETER_EU01 GetUserRegionParameter = "eu01" + GETUSERREGIONPARAMETER_EU02 GetUserRegionParameter = "eu02" + GETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetUserRegionParameter enum +var AllowedGetUserRegionParameterEnumValues = []GetUserRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetUserRegionParameter(value) + for _, existing := range AllowedGetUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetUserRegionParameterFromValue returns a pointer to a valid GetUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetUserRegionParameterFromValue(v string) (*GetUserRegionParameter, error) { + ev := GetUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetUserRegionParameter: valid values are %v", v, AllowedGetUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetUserRegionParameter) IsValid() bool { + for _, existing := range AllowedGetUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetUser_region_parameter value +func (v GetUserRegionParameter) Ptr() *GetUserRegionParameter { + return &v +} + +type NullableGetUserRegionParameter struct { + value *GetUserRegionParameter + isSet bool +} + +func (v NullableGetUserRegionParameter) Get() *GetUserRegionParameter { + return v.value +} + +func (v *NullableGetUserRegionParameter) Set(val *GetUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetUserRegionParameter(val *GetUserRegionParameter) *NullableGetUserRegionParameter { + return &NullableGetUserRegionParameter{value: val, isSet: true} +} + +func (v NullableGetUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_instance.go b/services/mongodbflex/v2api/model_instance.go index 28ae5b809..7b1f16ed1 100644 --- a/services/mongodbflex/v2api/model_instance.go +++ b/services/mongodbflex/v2api/model_instance.go @@ -20,17 +20,16 @@ var _ MappedNullable = &Instance{} // Instance struct for Instance type Instance struct { - Acl *ACL `json:"acl,omitempty"` - BackupSchedule *string `json:"backupSchedule,omitempty"` - Flavor *Flavor `json:"flavor,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Options *map[string]string `json:"options,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - // The current status of the instance. - Status *string `json:"status,omitempty"` - Storage *Storage `json:"storage,omitempty"` - Version *string `json:"version,omitempty"` + Acl *ACL `json:"acl,omitempty"` + BackupSchedule *string `json:"backupSchedule,omitempty"` + Flavor *Flavor `json:"flavor,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Options *map[string]string `json:"options,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Status *InstanceStatus `json:"status,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Version *string `json:"version,omitempty"` AdditionalProperties map[string]interface{} } @@ -278,9 +277,9 @@ func (o *Instance) SetReplicas(v int32) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Instance) GetStatus() string { +func (o *Instance) GetStatus() InstanceStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret InstanceStatus return ret } return *o.Status @@ -288,7 +287,7 @@ func (o *Instance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetStatusOk() (*string, bool) { +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -304,8 +303,8 @@ func (o *Instance) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Instance) SetStatus(v string) { +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { o.Status = &v } diff --git a/services/mongodbflex/v2api/model_instance_list_instance.go b/services/mongodbflex/v2api/model_instance_list_instance.go index dabb69775..e2a550df8 100644 --- a/services/mongodbflex/v2api/model_instance_list_instance.go +++ b/services/mongodbflex/v2api/model_instance_list_instance.go @@ -20,10 +20,9 @@ var _ MappedNullable = &InstanceListInstance{} // InstanceListInstance struct for InstanceListInstance type InstanceListInstance struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - // The current status of the instance. - Status *string `json:"status,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Status *InstanceListInstanceStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -111,9 +110,9 @@ func (o *InstanceListInstance) SetName(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *InstanceListInstance) GetStatus() string { +func (o *InstanceListInstance) GetStatus() InstanceListInstanceStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret InstanceListInstanceStatus return ret } return *o.Status @@ -121,7 +120,7 @@ func (o *InstanceListInstance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceListInstance) GetStatusOk() (*string, bool) { +func (o *InstanceListInstance) GetStatusOk() (*InstanceListInstanceStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -137,8 +136,8 @@ func (o *InstanceListInstance) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *InstanceListInstance) SetStatus(v string) { +// SetStatus gets a reference to the given InstanceListInstanceStatus and assigns it to the Status field. +func (o *InstanceListInstance) SetStatus(v InstanceListInstanceStatus) { o.Status = &v } diff --git a/services/mongodbflex/v2api/model_instance_list_instance_status.go b/services/mongodbflex/v2api/model_instance_list_instance_status.go new file mode 100644 index 000000000..53718dea7 --- /dev/null +++ b/services/mongodbflex/v2api/model_instance_list_instance_status.go @@ -0,0 +1,120 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceListInstanceStatus The current status of the instance. +type InstanceListInstanceStatus string + +// List of instance_ListInstance_status +const ( + INSTANCELISTINSTANCESTATUS_READY InstanceListInstanceStatus = "READY" + INSTANCELISTINSTANCESTATUS_PENDING InstanceListInstanceStatus = "PENDING" + INSTANCELISTINSTANCESTATUS_PROCESSING InstanceListInstanceStatus = "PROCESSING" + INSTANCELISTINSTANCESTATUS_FAILED InstanceListInstanceStatus = "FAILED" + INSTANCELISTINSTANCESTATUS_UNKNOWN InstanceListInstanceStatus = "UNKNOWN" + INSTANCELISTINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceListInstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceListInstanceStatus enum +var AllowedInstanceListInstanceStatusEnumValues = []InstanceListInstanceStatus{ + "READY", + "PENDING", + "PROCESSING", + "FAILED", + "UNKNOWN", + "unknown_default_open_api", +} + +func (v *InstanceListInstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceListInstanceStatus(value) + for _, existing := range AllowedInstanceListInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELISTINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceListInstanceStatusFromValue returns a pointer to a valid InstanceListInstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceListInstanceStatusFromValue(v string) (*InstanceListInstanceStatus, error) { + ev := InstanceListInstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceListInstanceStatus: valid values are %v", v, AllowedInstanceListInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceListInstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceListInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance_ListInstance_status value +func (v InstanceListInstanceStatus) Ptr() *InstanceListInstanceStatus { + return &v +} + +type NullableInstanceListInstanceStatus struct { + value *InstanceListInstanceStatus + isSet bool +} + +func (v NullableInstanceListInstanceStatus) Get() *InstanceListInstanceStatus { + return v.value +} + +func (v *NullableInstanceListInstanceStatus) Set(val *InstanceListInstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceListInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceListInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceListInstanceStatus(val *InstanceListInstanceStatus) *NullableInstanceListInstanceStatus { + return &NullableInstanceListInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceListInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceListInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_instance_status.go b/services/mongodbflex/v2api/model_instance_status.go new file mode 100644 index 000000000..413183ebd --- /dev/null +++ b/services/mongodbflex/v2api/model_instance_status.go @@ -0,0 +1,120 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus The current status of the instance. +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_READY InstanceStatus = "READY" + INSTANCESTATUS_PENDING InstanceStatus = "PENDING" + INSTANCESTATUS_PROCESSING InstanceStatus = "PROCESSING" + INSTANCESTATUS_FAILED InstanceStatus = "FAILED" + INSTANCESTATUS_UNKNOWN InstanceStatus = "UNKNOWN" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "READY", + "PENDING", + "PROCESSING", + "FAILED", + "UNKNOWN", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_list_advisor_slow_queries_region_parameter.go b/services/mongodbflex/v2api/model_list_advisor_slow_queries_region_parameter.go new file mode 100644 index 000000000..889bbca79 --- /dev/null +++ b/services/mongodbflex/v2api/model_list_advisor_slow_queries_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListAdvisorSlowQueriesRegionParameter the model 'ListAdvisorSlowQueriesRegionParameter' +type ListAdvisorSlowQueriesRegionParameter string + +// List of ListAdvisorSlowQueries_region_parameter +const ( + LISTADVISORSLOWQUERIESREGIONPARAMETER_EU01 ListAdvisorSlowQueriesRegionParameter = "eu01" + LISTADVISORSLOWQUERIESREGIONPARAMETER_EU02 ListAdvisorSlowQueriesRegionParameter = "eu02" + LISTADVISORSLOWQUERIESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListAdvisorSlowQueriesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListAdvisorSlowQueriesRegionParameter enum +var AllowedListAdvisorSlowQueriesRegionParameterEnumValues = []ListAdvisorSlowQueriesRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListAdvisorSlowQueriesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListAdvisorSlowQueriesRegionParameter(value) + for _, existing := range AllowedListAdvisorSlowQueriesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTADVISORSLOWQUERIESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListAdvisorSlowQueriesRegionParameterFromValue returns a pointer to a valid ListAdvisorSlowQueriesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListAdvisorSlowQueriesRegionParameterFromValue(v string) (*ListAdvisorSlowQueriesRegionParameter, error) { + ev := ListAdvisorSlowQueriesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListAdvisorSlowQueriesRegionParameter: valid values are %v", v, AllowedListAdvisorSlowQueriesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListAdvisorSlowQueriesRegionParameter) IsValid() bool { + for _, existing := range AllowedListAdvisorSlowQueriesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListAdvisorSlowQueries_region_parameter value +func (v ListAdvisorSlowQueriesRegionParameter) Ptr() *ListAdvisorSlowQueriesRegionParameter { + return &v +} + +type NullableListAdvisorSlowQueriesRegionParameter struct { + value *ListAdvisorSlowQueriesRegionParameter + isSet bool +} + +func (v NullableListAdvisorSlowQueriesRegionParameter) Get() *ListAdvisorSlowQueriesRegionParameter { + return v.value +} + +func (v *NullableListAdvisorSlowQueriesRegionParameter) Set(val *ListAdvisorSlowQueriesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListAdvisorSlowQueriesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListAdvisorSlowQueriesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListAdvisorSlowQueriesRegionParameter(val *ListAdvisorSlowQueriesRegionParameter) *NullableListAdvisorSlowQueriesRegionParameter { + return &NullableListAdvisorSlowQueriesRegionParameter{value: val, isSet: true} +} + +func (v NullableListAdvisorSlowQueriesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListAdvisorSlowQueriesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_list_backups_region_parameter.go b/services/mongodbflex/v2api/model_list_backups_region_parameter.go new file mode 100644 index 000000000..a3f56c2fb --- /dev/null +++ b/services/mongodbflex/v2api/model_list_backups_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListBackupsRegionParameter the model 'ListBackupsRegionParameter' +type ListBackupsRegionParameter string + +// List of ListBackups_region_parameter +const ( + LISTBACKUPSREGIONPARAMETER_EU01 ListBackupsRegionParameter = "eu01" + LISTBACKUPSREGIONPARAMETER_EU02 ListBackupsRegionParameter = "eu02" + LISTBACKUPSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListBackupsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListBackupsRegionParameter enum +var AllowedListBackupsRegionParameterEnumValues = []ListBackupsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListBackupsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListBackupsRegionParameter(value) + for _, existing := range AllowedListBackupsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTBACKUPSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListBackupsRegionParameterFromValue returns a pointer to a valid ListBackupsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListBackupsRegionParameterFromValue(v string) (*ListBackupsRegionParameter, error) { + ev := ListBackupsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListBackupsRegionParameter: valid values are %v", v, AllowedListBackupsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListBackupsRegionParameter) IsValid() bool { + for _, existing := range AllowedListBackupsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListBackups_region_parameter value +func (v ListBackupsRegionParameter) Ptr() *ListBackupsRegionParameter { + return &v +} + +type NullableListBackupsRegionParameter struct { + value *ListBackupsRegionParameter + isSet bool +} + +func (v NullableListBackupsRegionParameter) Get() *ListBackupsRegionParameter { + return v.value +} + +func (v *NullableListBackupsRegionParameter) Set(val *ListBackupsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsRegionParameter(val *ListBackupsRegionParameter) *NullableListBackupsRegionParameter { + return &NullableListBackupsRegionParameter{value: val, isSet: true} +} + +func (v NullableListBackupsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_list_flavors_region_parameter.go b/services/mongodbflex/v2api/model_list_flavors_region_parameter.go new file mode 100644 index 000000000..ad59c7823 --- /dev/null +++ b/services/mongodbflex/v2api/model_list_flavors_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListFlavorsRegionParameter the model 'ListFlavorsRegionParameter' +type ListFlavorsRegionParameter string + +// List of ListFlavors_region_parameter +const ( + LISTFLAVORSREGIONPARAMETER_EU01 ListFlavorsRegionParameter = "eu01" + LISTFLAVORSREGIONPARAMETER_EU02 ListFlavorsRegionParameter = "eu02" + LISTFLAVORSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListFlavorsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListFlavorsRegionParameter enum +var AllowedListFlavorsRegionParameterEnumValues = []ListFlavorsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListFlavorsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListFlavorsRegionParameter(value) + for _, existing := range AllowedListFlavorsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTFLAVORSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListFlavorsRegionParameterFromValue returns a pointer to a valid ListFlavorsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListFlavorsRegionParameterFromValue(v string) (*ListFlavorsRegionParameter, error) { + ev := ListFlavorsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListFlavorsRegionParameter: valid values are %v", v, AllowedListFlavorsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListFlavorsRegionParameter) IsValid() bool { + for _, existing := range AllowedListFlavorsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListFlavors_region_parameter value +func (v ListFlavorsRegionParameter) Ptr() *ListFlavorsRegionParameter { + return &v +} + +type NullableListFlavorsRegionParameter struct { + value *ListFlavorsRegionParameter + isSet bool +} + +func (v NullableListFlavorsRegionParameter) Get() *ListFlavorsRegionParameter { + return v.value +} + +func (v *NullableListFlavorsRegionParameter) Set(val *ListFlavorsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListFlavorsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlavorsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlavorsRegionParameter(val *ListFlavorsRegionParameter) *NullableListFlavorsRegionParameter { + return &NullableListFlavorsRegionParameter{value: val, isSet: true} +} + +func (v NullableListFlavorsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlavorsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_list_instances_region_parameter.go b/services/mongodbflex/v2api/model_list_instances_region_parameter.go new file mode 100644 index 000000000..d4aa79567 --- /dev/null +++ b/services/mongodbflex/v2api/model_list_instances_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListInstancesRegionParameter the model 'ListInstancesRegionParameter' +type ListInstancesRegionParameter string + +// List of ListInstances_region_parameter +const ( + LISTINSTANCESREGIONPARAMETER_EU01 ListInstancesRegionParameter = "eu01" + LISTINSTANCESREGIONPARAMETER_EU02 ListInstancesRegionParameter = "eu02" + LISTINSTANCESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListInstancesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListInstancesRegionParameter enum +var AllowedListInstancesRegionParameterEnumValues = []ListInstancesRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListInstancesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListInstancesRegionParameter(value) + for _, existing := range AllowedListInstancesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTINSTANCESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListInstancesRegionParameterFromValue returns a pointer to a valid ListInstancesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListInstancesRegionParameterFromValue(v string) (*ListInstancesRegionParameter, error) { + ev := ListInstancesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListInstancesRegionParameter: valid values are %v", v, AllowedListInstancesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListInstancesRegionParameter) IsValid() bool { + for _, existing := range AllowedListInstancesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListInstances_region_parameter value +func (v ListInstancesRegionParameter) Ptr() *ListInstancesRegionParameter { + return &v +} + +type NullableListInstancesRegionParameter struct { + value *ListInstancesRegionParameter + isSet bool +} + +func (v NullableListInstancesRegionParameter) Get() *ListInstancesRegionParameter { + return v.value +} + +func (v *NullableListInstancesRegionParameter) Set(val *ListInstancesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesRegionParameter(val *ListInstancesRegionParameter) *NullableListInstancesRegionParameter { + return &NullableListInstancesRegionParameter{value: val, isSet: true} +} + +func (v NullableListInstancesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_list_metrics_region_parameter.go b/services/mongodbflex/v2api/model_list_metrics_region_parameter.go new file mode 100644 index 000000000..cb1574806 --- /dev/null +++ b/services/mongodbflex/v2api/model_list_metrics_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListMetricsRegionParameter the model 'ListMetricsRegionParameter' +type ListMetricsRegionParameter string + +// List of ListMetrics_region_parameter +const ( + LISTMETRICSREGIONPARAMETER_EU01 ListMetricsRegionParameter = "eu01" + LISTMETRICSREGIONPARAMETER_EU02 ListMetricsRegionParameter = "eu02" + LISTMETRICSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListMetricsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListMetricsRegionParameter enum +var AllowedListMetricsRegionParameterEnumValues = []ListMetricsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListMetricsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListMetricsRegionParameter(value) + for _, existing := range AllowedListMetricsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTMETRICSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListMetricsRegionParameterFromValue returns a pointer to a valid ListMetricsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListMetricsRegionParameterFromValue(v string) (*ListMetricsRegionParameter, error) { + ev := ListMetricsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListMetricsRegionParameter: valid values are %v", v, AllowedListMetricsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListMetricsRegionParameter) IsValid() bool { + for _, existing := range AllowedListMetricsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListMetrics_region_parameter value +func (v ListMetricsRegionParameter) Ptr() *ListMetricsRegionParameter { + return &v +} + +type NullableListMetricsRegionParameter struct { + value *ListMetricsRegionParameter + isSet bool +} + +func (v NullableListMetricsRegionParameter) Get() *ListMetricsRegionParameter { + return v.value +} + +func (v *NullableListMetricsRegionParameter) Set(val *ListMetricsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListMetricsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListMetricsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListMetricsRegionParameter(val *ListMetricsRegionParameter) *NullableListMetricsRegionParameter { + return &NullableListMetricsRegionParameter{value: val, isSet: true} +} + +func (v NullableListMetricsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListMetricsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_list_restore_jobs_region_parameter.go b/services/mongodbflex/v2api/model_list_restore_jobs_region_parameter.go new file mode 100644 index 000000000..ccdd605bd --- /dev/null +++ b/services/mongodbflex/v2api/model_list_restore_jobs_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListRestoreJobsRegionParameter the model 'ListRestoreJobsRegionParameter' +type ListRestoreJobsRegionParameter string + +// List of ListRestoreJobs_region_parameter +const ( + LISTRESTOREJOBSREGIONPARAMETER_EU01 ListRestoreJobsRegionParameter = "eu01" + LISTRESTOREJOBSREGIONPARAMETER_EU02 ListRestoreJobsRegionParameter = "eu02" + LISTRESTOREJOBSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRestoreJobsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListRestoreJobsRegionParameter enum +var AllowedListRestoreJobsRegionParameterEnumValues = []ListRestoreJobsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListRestoreJobsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRestoreJobsRegionParameter(value) + for _, existing := range AllowedListRestoreJobsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRESTOREJOBSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRestoreJobsRegionParameterFromValue returns a pointer to a valid ListRestoreJobsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRestoreJobsRegionParameterFromValue(v string) (*ListRestoreJobsRegionParameter, error) { + ev := ListRestoreJobsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRestoreJobsRegionParameter: valid values are %v", v, AllowedListRestoreJobsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRestoreJobsRegionParameter) IsValid() bool { + for _, existing := range AllowedListRestoreJobsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRestoreJobs_region_parameter value +func (v ListRestoreJobsRegionParameter) Ptr() *ListRestoreJobsRegionParameter { + return &v +} + +type NullableListRestoreJobsRegionParameter struct { + value *ListRestoreJobsRegionParameter + isSet bool +} + +func (v NullableListRestoreJobsRegionParameter) Get() *ListRestoreJobsRegionParameter { + return v.value +} + +func (v *NullableListRestoreJobsRegionParameter) Set(val *ListRestoreJobsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRestoreJobsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRestoreJobsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRestoreJobsRegionParameter(val *ListRestoreJobsRegionParameter) *NullableListRestoreJobsRegionParameter { + return &NullableListRestoreJobsRegionParameter{value: val, isSet: true} +} + +func (v NullableListRestoreJobsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRestoreJobsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_list_storages_region_parameter.go b/services/mongodbflex/v2api/model_list_storages_region_parameter.go new file mode 100644 index 000000000..59ed26e32 --- /dev/null +++ b/services/mongodbflex/v2api/model_list_storages_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListStoragesRegionParameter the model 'ListStoragesRegionParameter' +type ListStoragesRegionParameter string + +// List of ListStorages_region_parameter +const ( + LISTSTORAGESREGIONPARAMETER_EU01 ListStoragesRegionParameter = "eu01" + LISTSTORAGESREGIONPARAMETER_EU02 ListStoragesRegionParameter = "eu02" + LISTSTORAGESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListStoragesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListStoragesRegionParameter enum +var AllowedListStoragesRegionParameterEnumValues = []ListStoragesRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListStoragesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListStoragesRegionParameter(value) + for _, existing := range AllowedListStoragesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTSTORAGESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListStoragesRegionParameterFromValue returns a pointer to a valid ListStoragesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListStoragesRegionParameterFromValue(v string) (*ListStoragesRegionParameter, error) { + ev := ListStoragesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListStoragesRegionParameter: valid values are %v", v, AllowedListStoragesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListStoragesRegionParameter) IsValid() bool { + for _, existing := range AllowedListStoragesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListStorages_region_parameter value +func (v ListStoragesRegionParameter) Ptr() *ListStoragesRegionParameter { + return &v +} + +type NullableListStoragesRegionParameter struct { + value *ListStoragesRegionParameter + isSet bool +} + +func (v NullableListStoragesRegionParameter) Get() *ListStoragesRegionParameter { + return v.value +} + +func (v *NullableListStoragesRegionParameter) Set(val *ListStoragesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListStoragesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListStoragesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListStoragesRegionParameter(val *ListStoragesRegionParameter) *NullableListStoragesRegionParameter { + return &NullableListStoragesRegionParameter{value: val, isSet: true} +} + +func (v NullableListStoragesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListStoragesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_list_suggested_indexes_region_parameter.go b/services/mongodbflex/v2api/model_list_suggested_indexes_region_parameter.go new file mode 100644 index 000000000..b611cdee2 --- /dev/null +++ b/services/mongodbflex/v2api/model_list_suggested_indexes_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListSuggestedIndexesRegionParameter the model 'ListSuggestedIndexesRegionParameter' +type ListSuggestedIndexesRegionParameter string + +// List of ListSuggestedIndexes_region_parameter +const ( + LISTSUGGESTEDINDEXESREGIONPARAMETER_EU01 ListSuggestedIndexesRegionParameter = "eu01" + LISTSUGGESTEDINDEXESREGIONPARAMETER_EU02 ListSuggestedIndexesRegionParameter = "eu02" + LISTSUGGESTEDINDEXESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListSuggestedIndexesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListSuggestedIndexesRegionParameter enum +var AllowedListSuggestedIndexesRegionParameterEnumValues = []ListSuggestedIndexesRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListSuggestedIndexesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListSuggestedIndexesRegionParameter(value) + for _, existing := range AllowedListSuggestedIndexesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTSUGGESTEDINDEXESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListSuggestedIndexesRegionParameterFromValue returns a pointer to a valid ListSuggestedIndexesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListSuggestedIndexesRegionParameterFromValue(v string) (*ListSuggestedIndexesRegionParameter, error) { + ev := ListSuggestedIndexesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListSuggestedIndexesRegionParameter: valid values are %v", v, AllowedListSuggestedIndexesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListSuggestedIndexesRegionParameter) IsValid() bool { + for _, existing := range AllowedListSuggestedIndexesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListSuggestedIndexes_region_parameter value +func (v ListSuggestedIndexesRegionParameter) Ptr() *ListSuggestedIndexesRegionParameter { + return &v +} + +type NullableListSuggestedIndexesRegionParameter struct { + value *ListSuggestedIndexesRegionParameter + isSet bool +} + +func (v NullableListSuggestedIndexesRegionParameter) Get() *ListSuggestedIndexesRegionParameter { + return v.value +} + +func (v *NullableListSuggestedIndexesRegionParameter) Set(val *ListSuggestedIndexesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListSuggestedIndexesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListSuggestedIndexesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListSuggestedIndexesRegionParameter(val *ListSuggestedIndexesRegionParameter) *NullableListSuggestedIndexesRegionParameter { + return &NullableListSuggestedIndexesRegionParameter{value: val, isSet: true} +} + +func (v NullableListSuggestedIndexesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListSuggestedIndexesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_list_users_region_parameter.go b/services/mongodbflex/v2api/model_list_users_region_parameter.go new file mode 100644 index 000000000..262221e8e --- /dev/null +++ b/services/mongodbflex/v2api/model_list_users_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListUsersRegionParameter the model 'ListUsersRegionParameter' +type ListUsersRegionParameter string + +// List of ListUsers_region_parameter +const ( + LISTUSERSREGIONPARAMETER_EU01 ListUsersRegionParameter = "eu01" + LISTUSERSREGIONPARAMETER_EU02 ListUsersRegionParameter = "eu02" + LISTUSERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListUsersRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListUsersRegionParameter enum +var AllowedListUsersRegionParameterEnumValues = []ListUsersRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListUsersRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListUsersRegionParameter(value) + for _, existing := range AllowedListUsersRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTUSERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListUsersRegionParameterFromValue returns a pointer to a valid ListUsersRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListUsersRegionParameterFromValue(v string) (*ListUsersRegionParameter, error) { + ev := ListUsersRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListUsersRegionParameter: valid values are %v", v, AllowedListUsersRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListUsersRegionParameter) IsValid() bool { + for _, existing := range AllowedListUsersRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListUsers_region_parameter value +func (v ListUsersRegionParameter) Ptr() *ListUsersRegionParameter { + return &v +} + +type NullableListUsersRegionParameter struct { + value *ListUsersRegionParameter + isSet bool +} + +func (v NullableListUsersRegionParameter) Get() *ListUsersRegionParameter { + return v.value +} + +func (v *NullableListUsersRegionParameter) Set(val *ListUsersRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListUsersRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListUsersRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUsersRegionParameter(val *ListUsersRegionParameter) *NullableListUsersRegionParameter { + return &NullableListUsersRegionParameter{value: val, isSet: true} +} + +func (v NullableListUsersRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUsersRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_list_versions_region_parameter.go b/services/mongodbflex/v2api/model_list_versions_region_parameter.go new file mode 100644 index 000000000..26e9e682f --- /dev/null +++ b/services/mongodbflex/v2api/model_list_versions_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListVersionsRegionParameter the model 'ListVersionsRegionParameter' +type ListVersionsRegionParameter string + +// List of ListVersions_region_parameter +const ( + LISTVERSIONSREGIONPARAMETER_EU01 ListVersionsRegionParameter = "eu01" + LISTVERSIONSREGIONPARAMETER_EU02 ListVersionsRegionParameter = "eu02" + LISTVERSIONSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListVersionsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListVersionsRegionParameter enum +var AllowedListVersionsRegionParameterEnumValues = []ListVersionsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListVersionsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListVersionsRegionParameter(value) + for _, existing := range AllowedListVersionsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTVERSIONSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListVersionsRegionParameterFromValue returns a pointer to a valid ListVersionsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListVersionsRegionParameterFromValue(v string) (*ListVersionsRegionParameter, error) { + ev := ListVersionsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListVersionsRegionParameter: valid values are %v", v, AllowedListVersionsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListVersionsRegionParameter) IsValid() bool { + for _, existing := range AllowedListVersionsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListVersions_region_parameter value +func (v ListVersionsRegionParameter) Ptr() *ListVersionsRegionParameter { + return &v +} + +type NullableListVersionsRegionParameter struct { + value *ListVersionsRegionParameter + isSet bool +} + +func (v NullableListVersionsRegionParameter) Get() *ListVersionsRegionParameter { + return v.value +} + +func (v *NullableListVersionsRegionParameter) Set(val *ListVersionsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListVersionsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListVersionsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListVersionsRegionParameter(val *ListVersionsRegionParameter) *NullableListVersionsRegionParameter { + return &NullableListVersionsRegionParameter{value: val, isSet: true} +} + +func (v NullableListVersionsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListVersionsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_partial_update_instance_region_parameter.go b/services/mongodbflex/v2api/model_partial_update_instance_region_parameter.go new file mode 100644 index 000000000..1079ea9b7 --- /dev/null +++ b/services/mongodbflex/v2api/model_partial_update_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// PartialUpdateInstanceRegionParameter the model 'PartialUpdateInstanceRegionParameter' +type PartialUpdateInstanceRegionParameter string + +// List of PartialUpdateInstance_region_parameter +const ( + PARTIALUPDATEINSTANCEREGIONPARAMETER_EU01 PartialUpdateInstanceRegionParameter = "eu01" + PARTIALUPDATEINSTANCEREGIONPARAMETER_EU02 PartialUpdateInstanceRegionParameter = "eu02" + PARTIALUPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API PartialUpdateInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateInstanceRegionParameter enum +var AllowedPartialUpdateInstanceRegionParameterEnumValues = []PartialUpdateInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *PartialUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateInstanceRegionParameter(value) + for _, existing := range AllowedPartialUpdateInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateInstanceRegionParameterFromValue returns a pointer to a valid PartialUpdateInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateInstanceRegionParameterFromValue(v string) (*PartialUpdateInstanceRegionParameter, error) { + ev := PartialUpdateInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateInstanceRegionParameter: valid values are %v", v, AllowedPartialUpdateInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedPartialUpdateInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateInstance_region_parameter value +func (v PartialUpdateInstanceRegionParameter) Ptr() *PartialUpdateInstanceRegionParameter { + return &v +} + +type NullablePartialUpdateInstanceRegionParameter struct { + value *PartialUpdateInstanceRegionParameter + isSet bool +} + +func (v NullablePartialUpdateInstanceRegionParameter) Get() *PartialUpdateInstanceRegionParameter { + return v.value +} + +func (v *NullablePartialUpdateInstanceRegionParameter) Set(val *PartialUpdateInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstanceRegionParameter(val *PartialUpdateInstanceRegionParameter) *NullablePartialUpdateInstanceRegionParameter { + return &NullablePartialUpdateInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_partial_update_user_region_parameter.go b/services/mongodbflex/v2api/model_partial_update_user_region_parameter.go new file mode 100644 index 000000000..7bd234c50 --- /dev/null +++ b/services/mongodbflex/v2api/model_partial_update_user_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// PartialUpdateUserRegionParameter the model 'PartialUpdateUserRegionParameter' +type PartialUpdateUserRegionParameter string + +// List of PartialUpdateUser_region_parameter +const ( + PARTIALUPDATEUSERREGIONPARAMETER_EU01 PartialUpdateUserRegionParameter = "eu01" + PARTIALUPDATEUSERREGIONPARAMETER_EU02 PartialUpdateUserRegionParameter = "eu02" + PARTIALUPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API PartialUpdateUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateUserRegionParameter enum +var AllowedPartialUpdateUserRegionParameterEnumValues = []PartialUpdateUserRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *PartialUpdateUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateUserRegionParameter(value) + for _, existing := range AllowedPartialUpdateUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateUserRegionParameterFromValue returns a pointer to a valid PartialUpdateUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateUserRegionParameterFromValue(v string) (*PartialUpdateUserRegionParameter, error) { + ev := PartialUpdateUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateUserRegionParameter: valid values are %v", v, AllowedPartialUpdateUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateUserRegionParameter) IsValid() bool { + for _, existing := range AllowedPartialUpdateUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateUser_region_parameter value +func (v PartialUpdateUserRegionParameter) Ptr() *PartialUpdateUserRegionParameter { + return &v +} + +type NullablePartialUpdateUserRegionParameter struct { + value *PartialUpdateUserRegionParameter + isSet bool +} + +func (v NullablePartialUpdateUserRegionParameter) Get() *PartialUpdateUserRegionParameter { + return v.value +} + +func (v *NullablePartialUpdateUserRegionParameter) Set(val *PartialUpdateUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateUserRegionParameter(val *PartialUpdateUserRegionParameter) *NullablePartialUpdateUserRegionParameter { + return &NullablePartialUpdateUserRegionParameter{value: val, isSet: true} +} + +func (v NullablePartialUpdateUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_reset_user_region_parameter.go b/services/mongodbflex/v2api/model_reset_user_region_parameter.go new file mode 100644 index 000000000..cfe4d61c8 --- /dev/null +++ b/services/mongodbflex/v2api/model_reset_user_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ResetUserRegionParameter the model 'ResetUserRegionParameter' +type ResetUserRegionParameter string + +// List of ResetUser_region_parameter +const ( + RESETUSERREGIONPARAMETER_EU01 ResetUserRegionParameter = "eu01" + RESETUSERREGIONPARAMETER_EU02 ResetUserRegionParameter = "eu02" + RESETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ResetUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ResetUserRegionParameter enum +var AllowedResetUserRegionParameterEnumValues = []ResetUserRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ResetUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ResetUserRegionParameter(value) + for _, existing := range AllowedResetUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = RESETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewResetUserRegionParameterFromValue returns a pointer to a valid ResetUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewResetUserRegionParameterFromValue(v string) (*ResetUserRegionParameter, error) { + ev := ResetUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ResetUserRegionParameter: valid values are %v", v, AllowedResetUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ResetUserRegionParameter) IsValid() bool { + for _, existing := range AllowedResetUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ResetUser_region_parameter value +func (v ResetUserRegionParameter) Ptr() *ResetUserRegionParameter { + return &v +} + +type NullableResetUserRegionParameter struct { + value *ResetUserRegionParameter + isSet bool +} + +func (v NullableResetUserRegionParameter) Get() *ResetUserRegionParameter { + return v.value +} + +func (v *NullableResetUserRegionParameter) Set(val *ResetUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableResetUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableResetUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResetUserRegionParameter(val *ResetUserRegionParameter) *NullableResetUserRegionParameter { + return &NullableResetUserRegionParameter{value: val, isSet: true} +} + +func (v NullableResetUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResetUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_restore_instance_region_parameter.go b/services/mongodbflex/v2api/model_restore_instance_region_parameter.go new file mode 100644 index 000000000..db280eaba --- /dev/null +++ b/services/mongodbflex/v2api/model_restore_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// RestoreInstanceRegionParameter the model 'RestoreInstanceRegionParameter' +type RestoreInstanceRegionParameter string + +// List of RestoreInstance_region_parameter +const ( + RESTOREINSTANCEREGIONPARAMETER_EU01 RestoreInstanceRegionParameter = "eu01" + RESTOREINSTANCEREGIONPARAMETER_EU02 RestoreInstanceRegionParameter = "eu02" + RESTOREINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API RestoreInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of RestoreInstanceRegionParameter enum +var AllowedRestoreInstanceRegionParameterEnumValues = []RestoreInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *RestoreInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RestoreInstanceRegionParameter(value) + for _, existing := range AllowedRestoreInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = RESTOREINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewRestoreInstanceRegionParameterFromValue returns a pointer to a valid RestoreInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRestoreInstanceRegionParameterFromValue(v string) (*RestoreInstanceRegionParameter, error) { + ev := RestoreInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RestoreInstanceRegionParameter: valid values are %v", v, AllowedRestoreInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RestoreInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedRestoreInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RestoreInstance_region_parameter value +func (v RestoreInstanceRegionParameter) Ptr() *RestoreInstanceRegionParameter { + return &v +} + +type NullableRestoreInstanceRegionParameter struct { + value *RestoreInstanceRegionParameter + isSet bool +} + +func (v NullableRestoreInstanceRegionParameter) Get() *RestoreInstanceRegionParameter { + return v.value +} + +func (v *NullableRestoreInstanceRegionParameter) Set(val *RestoreInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreInstanceRegionParameter(val *RestoreInstanceRegionParameter) *NullableRestoreInstanceRegionParameter { + return &NullableRestoreInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableRestoreInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_update_backup_schedule_region_parameter.go b/services/mongodbflex/v2api/model_update_backup_schedule_region_parameter.go new file mode 100644 index 000000000..ce69abcea --- /dev/null +++ b/services/mongodbflex/v2api/model_update_backup_schedule_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// UpdateBackupScheduleRegionParameter the model 'UpdateBackupScheduleRegionParameter' +type UpdateBackupScheduleRegionParameter string + +// List of UpdateBackupSchedule_region_parameter +const ( + UPDATEBACKUPSCHEDULEREGIONPARAMETER_EU01 UpdateBackupScheduleRegionParameter = "eu01" + UPDATEBACKUPSCHEDULEREGIONPARAMETER_EU02 UpdateBackupScheduleRegionParameter = "eu02" + UPDATEBACKUPSCHEDULEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API UpdateBackupScheduleRegionParameter = "unknown_default_open_api" +) + +// All allowed values of UpdateBackupScheduleRegionParameter enum +var AllowedUpdateBackupScheduleRegionParameterEnumValues = []UpdateBackupScheduleRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *UpdateBackupScheduleRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateBackupScheduleRegionParameter(value) + for _, existing := range AllowedUpdateBackupScheduleRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATEBACKUPSCHEDULEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateBackupScheduleRegionParameterFromValue returns a pointer to a valid UpdateBackupScheduleRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateBackupScheduleRegionParameterFromValue(v string) (*UpdateBackupScheduleRegionParameter, error) { + ev := UpdateBackupScheduleRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateBackupScheduleRegionParameter: valid values are %v", v, AllowedUpdateBackupScheduleRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateBackupScheduleRegionParameter) IsValid() bool { + for _, existing := range AllowedUpdateBackupScheduleRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateBackupSchedule_region_parameter value +func (v UpdateBackupScheduleRegionParameter) Ptr() *UpdateBackupScheduleRegionParameter { + return &v +} + +type NullableUpdateBackupScheduleRegionParameter struct { + value *UpdateBackupScheduleRegionParameter + isSet bool +} + +func (v NullableUpdateBackupScheduleRegionParameter) Get() *UpdateBackupScheduleRegionParameter { + return v.value +} + +func (v *NullableUpdateBackupScheduleRegionParameter) Set(val *UpdateBackupScheduleRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupScheduleRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupScheduleRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupScheduleRegionParameter(val *UpdateBackupScheduleRegionParameter) *NullableUpdateBackupScheduleRegionParameter { + return &NullableUpdateBackupScheduleRegionParameter{value: val, isSet: true} +} + +func (v NullableUpdateBackupScheduleRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupScheduleRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_update_instance_region_parameter.go b/services/mongodbflex/v2api/model_update_instance_region_parameter.go new file mode 100644 index 000000000..4f4225060 --- /dev/null +++ b/services/mongodbflex/v2api/model_update_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// UpdateInstanceRegionParameter the model 'UpdateInstanceRegionParameter' +type UpdateInstanceRegionParameter string + +// List of UpdateInstance_region_parameter +const ( + UPDATEINSTANCEREGIONPARAMETER_EU01 UpdateInstanceRegionParameter = "eu01" + UPDATEINSTANCEREGIONPARAMETER_EU02 UpdateInstanceRegionParameter = "eu02" + UPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API UpdateInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of UpdateInstanceRegionParameter enum +var AllowedUpdateInstanceRegionParameterEnumValues = []UpdateInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *UpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateInstanceRegionParameter(value) + for _, existing := range AllowedUpdateInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateInstanceRegionParameterFromValue returns a pointer to a valid UpdateInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateInstanceRegionParameterFromValue(v string) (*UpdateInstanceRegionParameter, error) { + ev := UpdateInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateInstanceRegionParameter: valid values are %v", v, AllowedUpdateInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedUpdateInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateInstance_region_parameter value +func (v UpdateInstanceRegionParameter) Ptr() *UpdateInstanceRegionParameter { + return &v +} + +type NullableUpdateInstanceRegionParameter struct { + value *UpdateInstanceRegionParameter + isSet bool +} + +func (v NullableUpdateInstanceRegionParameter) Get() *UpdateInstanceRegionParameter { + return v.value +} + +func (v *NullableUpdateInstanceRegionParameter) Set(val *UpdateInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstanceRegionParameter(val *UpdateInstanceRegionParameter) *NullableUpdateInstanceRegionParameter { + return &NullableUpdateInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableUpdateInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/v2api/model_update_user_region_parameter.go b/services/mongodbflex/v2api/model_update_user_region_parameter.go new file mode 100644 index 000000000..a62aaba03 --- /dev/null +++ b/services/mongodbflex/v2api/model_update_user_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// UpdateUserRegionParameter the model 'UpdateUserRegionParameter' +type UpdateUserRegionParameter string + +// List of UpdateUser_region_parameter +const ( + UPDATEUSERREGIONPARAMETER_EU01 UpdateUserRegionParameter = "eu01" + UPDATEUSERREGIONPARAMETER_EU02 UpdateUserRegionParameter = "eu02" + UPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API UpdateUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of UpdateUserRegionParameter enum +var AllowedUpdateUserRegionParameterEnumValues = []UpdateUserRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *UpdateUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateUserRegionParameter(value) + for _, existing := range AllowedUpdateUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateUserRegionParameterFromValue returns a pointer to a valid UpdateUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateUserRegionParameterFromValue(v string) (*UpdateUserRegionParameter, error) { + ev := UpdateUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateUserRegionParameter: valid values are %v", v, AllowedUpdateUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateUserRegionParameter) IsValid() bool { + for _, existing := range AllowedUpdateUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateUser_region_parameter value +func (v UpdateUserRegionParameter) Ptr() *UpdateUserRegionParameter { + return &v +} + +type NullableUpdateUserRegionParameter struct { + value *UpdateUserRegionParameter + isSet bool +} + +func (v NullableUpdateUserRegionParameter) Get() *UpdateUserRegionParameter { + return v.value +} + +func (v *NullableUpdateUserRegionParameter) Set(val *UpdateUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserRegionParameter(val *UpdateUserRegionParameter) *NullableUpdateUserRegionParameter { + return &NullableUpdateUserRegionParameter{value: val, isSet: true} +} + +func (v NullableUpdateUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 70251fa1517c833d436452da3f1975a818e5582a Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 12:51:29 +0200 Subject: [PATCH 28/66] chore(mongodbflex): fix waiters/tests/examples, write changelog, bump version --- CHANGELOG.md | 2 ++ examples/mongodbflex/mongodbflex.go | 8 +++--- services/mongodbflex/CHANGELOG.md | 3 ++ services/mongodbflex/VERSION | 2 +- services/mongodbflex/v2api/wait/wait.go | 28 +++++++++--------- services/mongodbflex/v2api/wait/wait_test.go | 30 ++++++++++---------- 6 files changed, 39 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa03024f4..2169f76e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -267,6 +267,8 @@ - **Bugfix**: **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v1.8.3](services/mongodbflex/CHANGELOG.md#v183) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` + - [v1.9.0](services/mongodbflex/CHANGELOG.md#v190) + - **Feature:** Introduce enums for various attributes - `objectstorage`: - [v1.7.2](services/objectstorage/CHANGELOG.md#v172) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/examples/mongodbflex/mongodbflex.go b/examples/mongodbflex/mongodbflex.go index 7075ae768..2a7f3b67c 100644 --- a/examples/mongodbflex/mongodbflex.go +++ b/examples/mongodbflex/mongodbflex.go @@ -23,7 +23,7 @@ func main() { } // Get the MongoDB Flex instances for your project - getInstancesResp, err := mongodbflexClient.DefaultAPI.ListInstances(context.Background(), projectId, region).Tag("tag").Execute() + getInstancesResp, err := mongodbflexClient.DefaultAPI.ListInstances(context.Background(), projectId, mongodbflex.ListInstancesRegionParameter(region)).Tag("tag").Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ListInstances`: %v\n", err) os.Exit(1) @@ -44,7 +44,7 @@ func main() { Database: "default", Roles: []string{"read"}, } - _, err = mongodbflexClient.DefaultAPI.CreateUser(context.Background(), projectId, instanceId, region).CreateUserPayload(createUserPayload).Execute() + _, err = mongodbflexClient.DefaultAPI.CreateUser(context.Background(), projectId, instanceId, mongodbflex.CreateUserRegionParameter(region)).CreateUserPayload(createUserPayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `CreateUser`: %v\n", err) os.Exit(1) @@ -57,7 +57,7 @@ func main() { BackupId: "BACKUP_ID", InstanceId: instanceId, } - _, err = mongodbflexClient.DefaultAPI.RestoreInstance(context.Background(), projectId, instanceId, region).RestoreInstancePayload(restoreInstancePayload).Execute() + _, err = mongodbflexClient.DefaultAPI.RestoreInstance(context.Background(), projectId, instanceId, mongodbflex.RestoreInstanceRegionParameter(region)).RestoreInstancePayload(restoreInstancePayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `RestoreInstance`: %v\n", err) os.Exit(1) @@ -65,7 +65,7 @@ func main() { fmt.Printf("Restoring instance \"%s\" from backup \"%s\".\n", instanceId, "BACKUP_ID") - _, err = wait.RestoreInstanceWaitHandler(context.Background(), mongodbflexClient.DefaultAPI, projectId, instanceId, "BACKUP_ID", region).WaitWithContext(context.Background()) + _, err = wait.RestoreInstanceWaitHandler(context.Background(), mongodbflexClient.DefaultAPI, projectId, instanceId, "BACKUP_ID", mongodbflex.ListRestoreJobsRegionParameter(region)).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "Error when waiting for restore to finish: %v\n", err) os.Exit(1) diff --git a/services/mongodbflex/CHANGELOG.md b/services/mongodbflex/CHANGELOG.md index 0842a68b1..057fcad09 100644 --- a/services/mongodbflex/CHANGELOG.md +++ b/services/mongodbflex/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.9.0 +- **Feature:** Introduce enums for various attributes + ## v1.8.3 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` diff --git a/services/mongodbflex/VERSION b/services/mongodbflex/VERSION index 25b56915a..295e37c0e 100644 --- a/services/mongodbflex/VERSION +++ b/services/mongodbflex/VERSION @@ -1 +1 @@ -v1.8.3 \ No newline at end of file +v1.9.0 diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index 932de4fd4..bf16be24f 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -26,7 +26,7 @@ const ( ) // CreateInstanceWaitHandler will wait for instance creation -func CreateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { +func CreateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId string, region mongodbflex.GetInstanceRegionParameter) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { handler := wait.New(func() (waitFinished bool, response *mongodbflex.InstanceResponse, err error) { s, err := a.GetInstance(ctx, projectId, instanceId, region).Execute() if err != nil { @@ -40,13 +40,13 @@ func CreateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pr return true, s, fmt.Errorf("instance with id %s has unexpected status %s", instanceId, *s.Item.Status) case "": return false, nil, nil - case INSTANCESTATUS_PROCESSING: + case mongodbflex.INSTANCESTATUS_PROCESSING: return false, nil, nil - case INSTANCESTATUS_UNKNOWN: + case mongodbflex.INSTANCESTATUS_UNKNOWN: return false, nil, nil - case INSTANCESTATUS_READY: + case mongodbflex.INSTANCESTATUS_READY: return true, s, nil - case INSTANCESTATUS_FAILED: + case mongodbflex.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("create failed for instance with id %s", instanceId) } }) @@ -56,11 +56,11 @@ func CreateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pr } // CloneInstanceWaitHandler will wait for instance clone to be created -func CloneInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { +func CloneInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId string, region mongodbflex.GetInstanceRegionParameter) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { return CreateInstanceWaitHandler(ctx, a, projectId, instanceId, region) } -func RestoreInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, backupId, region string) *wait.AsyncActionHandler[mongodbflex.ListRestoreJobsResponse] { +func RestoreInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, backupId string, region mongodbflex.ListRestoreJobsRegionParameter) *wait.AsyncActionHandler[mongodbflex.ListRestoreJobsResponse] { handler := wait.New(func() (waitFinished bool, response *mongodbflex.ListRestoreJobsResponse, err error) { s, err := a.ListRestoreJobs(ctx, projectId, instanceId, region).Execute() if err != nil { @@ -105,7 +105,7 @@ func RestoreInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, p } // UpdateInstanceWaitHandler will wait for instance update -func UpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { +func UpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId string, region mongodbflex.GetInstanceRegionParameter) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { handler := wait.New(func() (waitFinished bool, response *mongodbflex.InstanceResponse, err error) { s, err := a.GetInstance(ctx, projectId, instanceId, region).Execute() if err != nil { @@ -119,13 +119,13 @@ func UpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pr return true, s, fmt.Errorf("instance with id %s has unexpected status %s", instanceId, *s.Item.Status) case "": return false, nil, nil - case INSTANCESTATUS_PROCESSING: + case mongodbflex.INSTANCESTATUS_PROCESSING: return false, nil, nil - case INSTANCESTATUS_UNKNOWN: + case mongodbflex.INSTANCESTATUS_UNKNOWN: return false, nil, nil - case INSTANCESTATUS_READY: + case mongodbflex.INSTANCESTATUS_READY: return true, s, nil - case INSTANCESTATUS_FAILED: + case mongodbflex.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("update failed for instance with id %s", instanceId) } }) @@ -134,12 +134,12 @@ func UpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pr } // PartialUpdateInstanceWaitHandler will wait for instance update -func PartialUpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { +func PartialUpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId string, region mongodbflex.GetInstanceRegionParameter) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { return UpdateInstanceWaitHandler(ctx, a, projectId, instanceId, region) } // DeleteInstanceWaitHandler will wait for instance deletion -func DeleteInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[struct{}] { +func DeleteInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId string, region mongodbflex.GetInstanceRegionParameter) *wait.AsyncActionHandler[struct{}] { handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { _, err = a.GetInstance(ctx, projectId, instanceId, region).Execute() if err == nil { diff --git a/services/mongodbflex/v2api/wait/wait_test.go b/services/mongodbflex/v2api/wait/wait_test.go index 67e39849d..eecb1bfce 100644 --- a/services/mongodbflex/v2api/wait/wait_test.go +++ b/services/mongodbflex/v2api/wait/wait_test.go @@ -17,7 +17,7 @@ const testRegion = "eu01" type mockSettings struct { instanceId string - instanceState *string + instanceState *mongodbflex.InstanceStatus instanceIsDeleted bool instanceGetFails bool @@ -71,7 +71,7 @@ func TestCreateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string instanceGetFails bool - instanceState *string + instanceState *mongodbflex.InstanceStatus usersGetErrorStatus int wantErr bool wantResp bool @@ -79,21 +79,21 @@ func TestCreateInstanceWaitHandler(t *testing.T) { { desc: "create_succeeded", instanceGetFails: false, - instanceState: utils.Ptr(INSTANCESTATUS_READY), + instanceState: utils.Ptr(mongodbflex.INSTANCESTATUS_READY), wantErr: false, wantResp: true, }, { desc: "create_failed", instanceGetFails: false, - instanceState: utils.Ptr(INSTANCESTATUS_FAILED), + instanceState: utils.Ptr(mongodbflex.INSTANCESTATUS_FAILED), wantErr: true, wantResp: true, }, { desc: "create_failed_2", instanceGetFails: false, - instanceState: utils.Ptr(""), + instanceState: utils.Ptr(mongodbflex.InstanceStatus("")), wantErr: true, wantResp: false, }, @@ -106,7 +106,7 @@ func TestCreateInstanceWaitHandler(t *testing.T) { { desc: "timeout", instanceGetFails: false, - instanceState: utils.Ptr(INSTANCESTATUS_PROCESSING), + instanceState: utils.Ptr(mongodbflex.INSTANCESTATUS_PROCESSING), wantErr: true, wantResp: false, }, @@ -151,28 +151,28 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string instanceGetFails bool - instanceState *string + instanceState *mongodbflex.InstanceStatus wantErr bool wantResp bool }{ { desc: "update_succeeded", instanceGetFails: false, - instanceState: utils.Ptr(INSTANCESTATUS_READY), + instanceState: utils.Ptr(mongodbflex.INSTANCESTATUS_READY), wantErr: false, wantResp: true, }, { desc: "update_failed", instanceGetFails: false, - instanceState: utils.Ptr(INSTANCESTATUS_FAILED), + instanceState: utils.Ptr(mongodbflex.INSTANCESTATUS_FAILED), wantErr: true, wantResp: true, }, { desc: "update_failed_2", instanceGetFails: false, - instanceState: utils.Ptr(""), + instanceState: utils.Ptr(mongodbflex.InstanceStatus("")), wantErr: true, wantResp: false, }, @@ -185,7 +185,7 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { { desc: "timeout", instanceGetFails: false, - instanceState: utils.Ptr(INSTANCESTATUS_PROCESSING), + instanceState: utils.Ptr(mongodbflex.INSTANCESTATUS_PROCESSING), wantErr: true, wantResp: false, }, @@ -230,19 +230,19 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { tests := []struct { desc string instanceGetFails bool - instanceState *string + instanceState *mongodbflex.InstanceStatus wantErr bool }{ { desc: "delete_succeeded", instanceGetFails: false, - instanceState: utils.Ptr(INSTANCESTATUS_READY), + instanceState: utils.Ptr(mongodbflex.INSTANCESTATUS_READY), wantErr: false, }, { desc: "delete_failed", instanceGetFails: false, - instanceState: utils.Ptr(INSTANCESTATUS_FAILED), + instanceState: utils.Ptr(mongodbflex.INSTANCESTATUS_FAILED), wantErr: true, }, { @@ -258,7 +258,7 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { apiClient := newAPIMock(&mockSettings{ instanceGetFails: tt.instanceGetFails, - instanceIsDeleted: tt.instanceState != nil && *tt.instanceState == INSTANCESTATUS_READY, + instanceIsDeleted: tt.instanceState != nil && *tt.instanceState == mongodbflex.INSTANCESTATUS_READY, instanceId: instanceId, instanceState: tt.instanceState, }) From 8b8b93e6913c59d37c3268dc8b2cab36b0a2162b Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 12:52:28 +0200 Subject: [PATCH 29/66] refac(observability): introduce inline enums --- services/observability/v1api/api_default.go | 20 +-- services/observability/v1api/model_action.go | 124 ++++++++++++++++ ...te_backup_backup_target_parameter_inner.go | 118 +++++++++++++++ ..._schedule_backup_target_parameter_inner.go | 118 +++++++++++++++ .../model_create_scrape_config_payload.go | 15 +- ...g_payload_metrics_relabel_configs_inner.go | 17 ++- ...ad_metrics_relabel_configs_inner_action.go | 124 ++++++++++++++++ ...del_create_scrape_config_payload_scheme.go | 114 +++++++++++++++ .../v1api/model_get_instance_response.go | 12 +- .../observability/v1api/model_instance.go | 12 +- services/observability/v1api/model_job.go | 16 +-- ...schedules_backup_target_parameter_inner.go | 118 +++++++++++++++ ...t_backups_backup_target_parameter_inner.go | 118 +++++++++++++++ .../v1api/model_metrics_relabel_config.go | 16 +-- ...ial_update_scrape_configs_request_inner.go | 15 +- ...est_inner_metrics_relabel_configs_inner.go | 17 ++- ...er_metrics_relabel_configs_inner_action.go | 124 ++++++++++++++++ ...ate_scrape_configs_request_inner_scheme.go | 114 +++++++++++++++ .../v1api/model_project_instance_full.go | 12 +- ...restore_backup_restore_target_parameter.go | 118 +++++++++++++++ services/observability/v1api/model_scheme.go | 114 +++++++++++++++ services/observability/v1api/model_state.go | 136 ++++++++++++++++++ services/observability/v1api/model_status.go | 128 +++++++++++++++++ .../observability/v1api/model_status_1.go | 128 +++++++++++++++++ .../model_update_scrape_config_payload.go | 15 +- ...g_payload_metrics_relabel_configs_inner.go | 17 ++- ...ad_metrics_relabel_configs_inner_action.go | 124 ++++++++++++++++ ...del_update_scrape_config_payload_scheme.go | 114 +++++++++++++++ 28 files changed, 2023 insertions(+), 95 deletions(-) create mode 100644 services/observability/v1api/model_action.go create mode 100644 services/observability/v1api/model_create_backup_backup_target_parameter_inner.go create mode 100644 services/observability/v1api/model_create_backup_schedule_backup_target_parameter_inner.go create mode 100644 services/observability/v1api/model_create_scrape_config_payload_metrics_relabel_configs_inner_action.go create mode 100644 services/observability/v1api/model_create_scrape_config_payload_scheme.go create mode 100644 services/observability/v1api/model_list_backup_schedules_backup_target_parameter_inner.go create mode 100644 services/observability/v1api/model_list_backups_backup_target_parameter_inner.go create mode 100644 services/observability/v1api/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner_action.go create mode 100644 services/observability/v1api/model_partial_update_scrape_configs_request_inner_scheme.go create mode 100644 services/observability/v1api/model_restore_backup_restore_target_parameter.go create mode 100644 services/observability/v1api/model_scheme.go create mode 100644 services/observability/v1api/model_state.go create mode 100644 services/observability/v1api/model_status.go create mode 100644 services/observability/v1api/model_status_1.go create mode 100644 services/observability/v1api/model_update_scrape_config_payload_metrics_relabel_configs_inner_action.go create mode 100644 services/observability/v1api/model_update_scrape_config_payload_scheme.go diff --git a/services/observability/v1api/api_default.go b/services/observability/v1api/api_default.go index ec7d678ab..c2155429f 100644 --- a/services/observability/v1api/api_default.go +++ b/services/observability/v1api/api_default.go @@ -2539,11 +2539,11 @@ type ApiCreateBackupRequest struct { ApiService DefaultAPI instanceId string projectId string - backupTarget *[]string + backupTarget *[]CreateBackupBackupTargetParameterInner } // List of backup targets -func (r ApiCreateBackupRequest) BackupTarget(backupTarget []string) ApiCreateBackupRequest { +func (r ApiCreateBackupRequest) BackupTarget(backupTarget []CreateBackupBackupTargetParameterInner) ApiCreateBackupRequest { r.backupTarget = &backupTarget return r } @@ -2690,7 +2690,7 @@ type ApiCreateBackupScheduleRequest struct { instanceId string projectId string createBackupSchedulePayload *CreateBackupSchedulePayload - backupTarget *[]string + backupTarget *[]CreateBackupScheduleBackupTargetParameterInner } func (r ApiCreateBackupScheduleRequest) CreateBackupSchedulePayload(createBackupSchedulePayload CreateBackupSchedulePayload) ApiCreateBackupScheduleRequest { @@ -2699,7 +2699,7 @@ func (r ApiCreateBackupScheduleRequest) CreateBackupSchedulePayload(createBackup } // List of backup targets -func (r ApiCreateBackupScheduleRequest) BackupTarget(backupTarget []string) ApiCreateBackupScheduleRequest { +func (r ApiCreateBackupScheduleRequest) BackupTarget(backupTarget []CreateBackupScheduleBackupTargetParameterInner) ApiCreateBackupScheduleRequest { r.backupTarget = &backupTarget return r } @@ -11486,11 +11486,11 @@ type ApiListBackupSchedulesRequest struct { ApiService DefaultAPI instanceId string projectId string - backupTarget *[]string + backupTarget *[]ListBackupSchedulesBackupTargetParameterInner } // List of backup targets -func (r ApiListBackupSchedulesRequest) BackupTarget(backupTarget []string) ApiListBackupSchedulesRequest { +func (r ApiListBackupSchedulesRequest) BackupTarget(backupTarget []ListBackupSchedulesBackupTargetParameterInner) ApiListBackupSchedulesRequest { r.backupTarget = &backupTarget return r } @@ -11625,11 +11625,11 @@ type ApiListBackupsRequest struct { ApiService DefaultAPI instanceId string projectId string - backupTarget *[]string + backupTarget *[]ListBackupsBackupTargetParameterInner } // List of backup targets -func (r ApiListBackupsRequest) BackupTarget(backupTarget []string) ApiListBackupsRequest { +func (r ApiListBackupsRequest) BackupTarget(backupTarget []ListBackupsBackupTargetParameterInner) ApiListBackupsRequest { r.backupTarget = &backupTarget return r } @@ -14561,11 +14561,11 @@ type ApiRestoreBackupRequest struct { backupDate string instanceId string projectId string - restoreTarget *string + restoreTarget *RestoreBackupRestoreTargetParameter } // List of restore targets -func (r ApiRestoreBackupRequest) RestoreTarget(restoreTarget string) ApiRestoreBackupRequest { +func (r ApiRestoreBackupRequest) RestoreTarget(restoreTarget RestoreBackupRestoreTargetParameter) ApiRestoreBackupRequest { r.restoreTarget = &restoreTarget return r } diff --git a/services/observability/v1api/model_action.go b/services/observability/v1api/model_action.go new file mode 100644 index 000000000..5b464ac22 --- /dev/null +++ b/services/observability/v1api/model_action.go @@ -0,0 +1,124 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// Action the model 'Action' +type Action string + +// List of Action +const ( + ACTION_REPLACE Action = "replace" + ACTION_KEEP Action = "keep" + ACTION_DROP Action = "drop" + ACTION_HASHMOD Action = "hashmod" + ACTION_LABELMAP Action = "labelmap" + ACTION_LABELDROP Action = "labeldrop" + ACTION_LABELKEEP Action = "labelkeep" + ACTION_UNKNOWN_DEFAULT_OPEN_API Action = "unknown_default_open_api" +) + +// All allowed values of Action enum +var AllowedActionEnumValues = []Action{ + "replace", + "keep", + "drop", + "hashmod", + "labelmap", + "labeldrop", + "labelkeep", + "unknown_default_open_api", +} + +func (v *Action) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Action(value) + for _, existing := range AllowedActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewActionFromValue returns a pointer to a valid Action +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewActionFromValue(v string) (*Action, error) { + ev := Action(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Action: valid values are %v", v, AllowedActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Action) IsValid() bool { + for _, existing := range AllowedActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Action value +func (v Action) Ptr() *Action { + return &v +} + +type NullableAction struct { + value *Action + isSet bool +} + +func (v NullableAction) Get() *Action { + return v.value +} + +func (v *NullableAction) Set(val *Action) { + v.value = val + v.isSet = true +} + +func (v NullableAction) IsSet() bool { + return v.isSet +} + +func (v *NullableAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAction(val *Action) *NullableAction { + return &NullableAction{value: val, isSet: true} +} + +func (v NullableAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_create_backup_backup_target_parameter_inner.go b/services/observability/v1api/model_create_backup_backup_target_parameter_inner.go new file mode 100644 index 000000000..d19a1c63f --- /dev/null +++ b/services/observability/v1api/model_create_backup_backup_target_parameter_inner.go @@ -0,0 +1,118 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CreateBackupBackupTargetParameterInner the model 'CreateBackupBackupTargetParameterInner' +type CreateBackupBackupTargetParameterInner string + +// List of CreateBackup_backupTarget_parameter_inner +const ( + CREATEBACKUPBACKUPTARGETPARAMETERINNER_ALERT_CONFIG CreateBackupBackupTargetParameterInner = "alertConfig" + CREATEBACKUPBACKUPTARGETPARAMETERINNER_ALERT_RULES CreateBackupBackupTargetParameterInner = "alertRules" + CREATEBACKUPBACKUPTARGETPARAMETERINNER_SCRAPE_CONFIG CreateBackupBackupTargetParameterInner = "scrapeConfig" + CREATEBACKUPBACKUPTARGETPARAMETERINNER_GRAFANA CreateBackupBackupTargetParameterInner = "grafana" + CREATEBACKUPBACKUPTARGETPARAMETERINNER_UNKNOWN_DEFAULT_OPEN_API CreateBackupBackupTargetParameterInner = "unknown_default_open_api" +) + +// All allowed values of CreateBackupBackupTargetParameterInner enum +var AllowedCreateBackupBackupTargetParameterInnerEnumValues = []CreateBackupBackupTargetParameterInner{ + "alertConfig", + "alertRules", + "scrapeConfig", + "grafana", + "unknown_default_open_api", +} + +func (v *CreateBackupBackupTargetParameterInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateBackupBackupTargetParameterInner(value) + for _, existing := range AllowedCreateBackupBackupTargetParameterInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEBACKUPBACKUPTARGETPARAMETERINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateBackupBackupTargetParameterInnerFromValue returns a pointer to a valid CreateBackupBackupTargetParameterInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateBackupBackupTargetParameterInnerFromValue(v string) (*CreateBackupBackupTargetParameterInner, error) { + ev := CreateBackupBackupTargetParameterInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateBackupBackupTargetParameterInner: valid values are %v", v, AllowedCreateBackupBackupTargetParameterInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateBackupBackupTargetParameterInner) IsValid() bool { + for _, existing := range AllowedCreateBackupBackupTargetParameterInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateBackup_backupTarget_parameter_inner value +func (v CreateBackupBackupTargetParameterInner) Ptr() *CreateBackupBackupTargetParameterInner { + return &v +} + +type NullableCreateBackupBackupTargetParameterInner struct { + value *CreateBackupBackupTargetParameterInner + isSet bool +} + +func (v NullableCreateBackupBackupTargetParameterInner) Get() *CreateBackupBackupTargetParameterInner { + return v.value +} + +func (v *NullableCreateBackupBackupTargetParameterInner) Set(val *CreateBackupBackupTargetParameterInner) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupBackupTargetParameterInner) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupBackupTargetParameterInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupBackupTargetParameterInner(val *CreateBackupBackupTargetParameterInner) *NullableCreateBackupBackupTargetParameterInner { + return &NullableCreateBackupBackupTargetParameterInner{value: val, isSet: true} +} + +func (v NullableCreateBackupBackupTargetParameterInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupBackupTargetParameterInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_create_backup_schedule_backup_target_parameter_inner.go b/services/observability/v1api/model_create_backup_schedule_backup_target_parameter_inner.go new file mode 100644 index 000000000..a983a1df0 --- /dev/null +++ b/services/observability/v1api/model_create_backup_schedule_backup_target_parameter_inner.go @@ -0,0 +1,118 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CreateBackupScheduleBackupTargetParameterInner the model 'CreateBackupScheduleBackupTargetParameterInner' +type CreateBackupScheduleBackupTargetParameterInner string + +// List of CreateBackupSchedule_backupTarget_parameter_inner +const ( + CREATEBACKUPSCHEDULEBACKUPTARGETPARAMETERINNER_ALERT_CONFIG CreateBackupScheduleBackupTargetParameterInner = "alertConfig" + CREATEBACKUPSCHEDULEBACKUPTARGETPARAMETERINNER_ALERT_RULES CreateBackupScheduleBackupTargetParameterInner = "alertRules" + CREATEBACKUPSCHEDULEBACKUPTARGETPARAMETERINNER_SCRAPE_CONFIG CreateBackupScheduleBackupTargetParameterInner = "scrapeConfig" + CREATEBACKUPSCHEDULEBACKUPTARGETPARAMETERINNER_GRAFANA CreateBackupScheduleBackupTargetParameterInner = "grafana" + CREATEBACKUPSCHEDULEBACKUPTARGETPARAMETERINNER_UNKNOWN_DEFAULT_OPEN_API CreateBackupScheduleBackupTargetParameterInner = "unknown_default_open_api" +) + +// All allowed values of CreateBackupScheduleBackupTargetParameterInner enum +var AllowedCreateBackupScheduleBackupTargetParameterInnerEnumValues = []CreateBackupScheduleBackupTargetParameterInner{ + "alertConfig", + "alertRules", + "scrapeConfig", + "grafana", + "unknown_default_open_api", +} + +func (v *CreateBackupScheduleBackupTargetParameterInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateBackupScheduleBackupTargetParameterInner(value) + for _, existing := range AllowedCreateBackupScheduleBackupTargetParameterInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEBACKUPSCHEDULEBACKUPTARGETPARAMETERINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateBackupScheduleBackupTargetParameterInnerFromValue returns a pointer to a valid CreateBackupScheduleBackupTargetParameterInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateBackupScheduleBackupTargetParameterInnerFromValue(v string) (*CreateBackupScheduleBackupTargetParameterInner, error) { + ev := CreateBackupScheduleBackupTargetParameterInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateBackupScheduleBackupTargetParameterInner: valid values are %v", v, AllowedCreateBackupScheduleBackupTargetParameterInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateBackupScheduleBackupTargetParameterInner) IsValid() bool { + for _, existing := range AllowedCreateBackupScheduleBackupTargetParameterInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateBackupSchedule_backupTarget_parameter_inner value +func (v CreateBackupScheduleBackupTargetParameterInner) Ptr() *CreateBackupScheduleBackupTargetParameterInner { + return &v +} + +type NullableCreateBackupScheduleBackupTargetParameterInner struct { + value *CreateBackupScheduleBackupTargetParameterInner + isSet bool +} + +func (v NullableCreateBackupScheduleBackupTargetParameterInner) Get() *CreateBackupScheduleBackupTargetParameterInner { + return v.value +} + +func (v *NullableCreateBackupScheduleBackupTargetParameterInner) Set(val *CreateBackupScheduleBackupTargetParameterInner) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupScheduleBackupTargetParameterInner) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupScheduleBackupTargetParameterInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupScheduleBackupTargetParameterInner(val *CreateBackupScheduleBackupTargetParameterInner) *NullableCreateBackupScheduleBackupTargetParameterInner { + return &NullableCreateBackupScheduleBackupTargetParameterInner{value: val, isSet: true} +} + +func (v NullableCreateBackupScheduleBackupTargetParameterInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupScheduleBackupTargetParameterInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_create_scrape_config_payload.go b/services/observability/v1api/model_create_scrape_config_payload.go index 69f8ca81d..90ddfeb83 100644 --- a/services/observability/v1api/model_create_scrape_config_payload.go +++ b/services/observability/v1api/model_create_scrape_config_payload.go @@ -40,9 +40,8 @@ type CreateScrapeConfigPayload struct { // Optional http params `Additional Validators:` * should not contain more than 5 keys * each key and value should not have more than 200 characters Params map[string]interface{} `json:"params,omitempty"` // Per-scrape limit on number of scraped samples that will be accepted. If more than this number of samples are present after metric relabeling the entire scrape will be treated as failed. The total limit depends on the service plan target limits * samples - SampleLimit *float32 `json:"sampleLimit,omitempty"` - // Configures the protocol scheme used for requests. https or http - Scheme string `json:"scheme"` + SampleLimit *float32 `json:"sampleLimit,omitempty"` + Scheme CreateScrapeConfigPayloadScheme `json:"scheme"` // How frequently to scrape targets from this job. E.g. 5m `Additional Validators:` * must be a valid time format* must be >= 60s ScrapeInterval string `json:"scrapeInterval"` // Per-scrape timeout when scraping this job. `Additional Validators:` * must be a valid time format* must be smaller than scrapeInterval @@ -59,7 +58,7 @@ type _CreateScrapeConfigPayload CreateScrapeConfigPayload // 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 NewCreateScrapeConfigPayload(jobName string, scheme string, scrapeInterval string, scrapeTimeout string, staticConfigs []CreateScrapeConfigPayloadStaticConfigsInner) *CreateScrapeConfigPayload { +func NewCreateScrapeConfigPayload(jobName string, scheme CreateScrapeConfigPayloadScheme, scrapeInterval string, scrapeTimeout string, staticConfigs []CreateScrapeConfigPayloadStaticConfigsInner) *CreateScrapeConfigPayload { this := CreateScrapeConfigPayload{} var honorLabels bool = false this.HonorLabels = &honorLabels @@ -434,9 +433,9 @@ func (o *CreateScrapeConfigPayload) SetSampleLimit(v float32) { } // GetScheme returns the Scheme field value -func (o *CreateScrapeConfigPayload) GetScheme() string { +func (o *CreateScrapeConfigPayload) GetScheme() CreateScrapeConfigPayloadScheme { if o == nil { - var ret string + var ret CreateScrapeConfigPayloadScheme return ret } @@ -445,7 +444,7 @@ func (o *CreateScrapeConfigPayload) GetScheme() string { // GetSchemeOk returns a tuple with the Scheme field value // and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayload) GetSchemeOk() (*string, bool) { +func (o *CreateScrapeConfigPayload) GetSchemeOk() (*CreateScrapeConfigPayloadScheme, bool) { if o == nil { return nil, false } @@ -453,7 +452,7 @@ func (o *CreateScrapeConfigPayload) GetSchemeOk() (*string, bool) { } // SetScheme sets field value -func (o *CreateScrapeConfigPayload) SetScheme(v string) { +func (o *CreateScrapeConfigPayload) SetScheme(v CreateScrapeConfigPayloadScheme) { o.Scheme = v } diff --git a/services/observability/v1api/model_create_scrape_config_payload_metrics_relabel_configs_inner.go b/services/observability/v1api/model_create_scrape_config_payload_metrics_relabel_configs_inner.go index 6812ef703..7a4eb8dc5 100644 --- a/services/observability/v1api/model_create_scrape_config_payload_metrics_relabel_configs_inner.go +++ b/services/observability/v1api/model_create_scrape_config_payload_metrics_relabel_configs_inner.go @@ -20,8 +20,7 @@ var _ MappedNullable = &CreateScrapeConfigPayloadMetricsRelabelConfigsInner{} // CreateScrapeConfigPayloadMetricsRelabelConfigsInner struct for CreateScrapeConfigPayloadMetricsRelabelConfigsInner type CreateScrapeConfigPayloadMetricsRelabelConfigsInner struct { - // Action to perform based on regex matching. `Additional Validators:` * if action is replace, targetLabel needs to be in body - Action *string `json:"action,omitempty"` + Action *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction `json:"action,omitempty"` // Modulus to take of the hash of the source label values. Modulus *float32 `json:"modulus,omitempty"` // Regular expression against which the extracted value is matched. @@ -45,7 +44,7 @@ type _CreateScrapeConfigPayloadMetricsRelabelConfigsInner CreateScrapeConfigPayl // will change when the set of required properties is changed func NewCreateScrapeConfigPayloadMetricsRelabelConfigsInner() *CreateScrapeConfigPayloadMetricsRelabelConfigsInner { this := CreateScrapeConfigPayloadMetricsRelabelConfigsInner{} - var action string = "replace" + var action CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_REPLACE this.Action = &action var regex string = ".*" this.Regex = ®ex @@ -61,7 +60,7 @@ func NewCreateScrapeConfigPayloadMetricsRelabelConfigsInner() *CreateScrapeConfi // but it doesn't guarantee that properties required by API are set func NewCreateScrapeConfigPayloadMetricsRelabelConfigsInnerWithDefaults() *CreateScrapeConfigPayloadMetricsRelabelConfigsInner { this := CreateScrapeConfigPayloadMetricsRelabelConfigsInner{} - var action string = "replace" + var action CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_REPLACE this.Action = &action var regex string = ".*" this.Regex = ®ex @@ -73,9 +72,9 @@ func NewCreateScrapeConfigPayloadMetricsRelabelConfigsInnerWithDefaults() *Creat } // GetAction returns the Action field value if set, zero value otherwise. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetAction() string { +func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetAction() CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { if o == nil || IsNil(o.Action) { - var ret string + var ret CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction return ret } return *o.Action @@ -83,7 +82,7 @@ func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetAction() string // GetActionOk returns a tuple with the Action field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetActionOk() (*string, bool) { +func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) GetActionOk() (*CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction, bool) { if o == nil || IsNil(o.Action) { return nil, false } @@ -99,8 +98,8 @@ func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) HasAction() bool { return false } -// SetAction gets a reference to the given string and assigns it to the Action field. -func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) SetAction(v string) { +// SetAction gets a reference to the given CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction and assigns it to the Action field. +func (o *CreateScrapeConfigPayloadMetricsRelabelConfigsInner) SetAction(v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) { o.Action = &v } diff --git a/services/observability/v1api/model_create_scrape_config_payload_metrics_relabel_configs_inner_action.go b/services/observability/v1api/model_create_scrape_config_payload_metrics_relabel_configs_inner_action.go new file mode 100644 index 000000000..283a8f21a --- /dev/null +++ b/services/observability/v1api/model_create_scrape_config_payload_metrics_relabel_configs_inner_action.go @@ -0,0 +1,124 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction Action to perform based on regex matching. `Additional Validators:` * if action is replace, targetLabel needs to be in body +type CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction string + +// List of CreateScrapeConfigPayload_metricsRelabelConfigs_inner_action +const ( + CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_REPLACE CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "replace" + CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_KEEP CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "keep" + CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_DROP CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "drop" + CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_HASHMOD CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "hashmod" + CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_LABELMAP CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "labelmap" + CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_LABELDROP CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "labeldrop" + CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_LABELKEEP CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "labelkeep" + CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_UNKNOWN_DEFAULT_OPEN_API CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "unknown_default_open_api" +) + +// All allowed values of CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction enum +var AllowedCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues = []CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction{ + "replace", + "keep", + "drop", + "hashmod", + "labelmap", + "labeldrop", + "labelkeep", + "unknown_default_open_api", +} + +func (v *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction(value) + for _, existing := range AllowedCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionFromValue returns a pointer to a valid CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionFromValue(v string) (*CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction, error) { + ev := CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction: valid values are %v", v, AllowedCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) IsValid() bool { + for _, existing := range AllowedCreateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateScrapeConfigPayload_metricsRelabelConfigs_inner_action value +func (v CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Ptr() *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { + return &v +} + +type NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction struct { + value *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction + isSet bool +} + +func (v NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Get() *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { + return v.value +} + +func (v *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Set(val *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) { + v.value = val + v.isSet = true +} + +func (v NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction(val *CreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { + return &NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction{value: val, isSet: true} +} + +func (v NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_create_scrape_config_payload_scheme.go b/services/observability/v1api/model_create_scrape_config_payload_scheme.go new file mode 100644 index 000000000..ff1b63fc5 --- /dev/null +++ b/services/observability/v1api/model_create_scrape_config_payload_scheme.go @@ -0,0 +1,114 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CreateScrapeConfigPayloadScheme Configures the protocol scheme used for requests. https or http +type CreateScrapeConfigPayloadScheme string + +// List of CreateScrapeConfigPayload_scheme +const ( + CREATESCRAPECONFIGPAYLOADSCHEME_HTTP CreateScrapeConfigPayloadScheme = "http" + CREATESCRAPECONFIGPAYLOADSCHEME_HTTPS CreateScrapeConfigPayloadScheme = "https" + CREATESCRAPECONFIGPAYLOADSCHEME_UNKNOWN_DEFAULT_OPEN_API CreateScrapeConfigPayloadScheme = "unknown_default_open_api" +) + +// All allowed values of CreateScrapeConfigPayloadScheme enum +var AllowedCreateScrapeConfigPayloadSchemeEnumValues = []CreateScrapeConfigPayloadScheme{ + "http", + "https", + "unknown_default_open_api", +} + +func (v *CreateScrapeConfigPayloadScheme) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateScrapeConfigPayloadScheme(value) + for _, existing := range AllowedCreateScrapeConfigPayloadSchemeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATESCRAPECONFIGPAYLOADSCHEME_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateScrapeConfigPayloadSchemeFromValue returns a pointer to a valid CreateScrapeConfigPayloadScheme +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateScrapeConfigPayloadSchemeFromValue(v string) (*CreateScrapeConfigPayloadScheme, error) { + ev := CreateScrapeConfigPayloadScheme(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateScrapeConfigPayloadScheme: valid values are %v", v, AllowedCreateScrapeConfigPayloadSchemeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateScrapeConfigPayloadScheme) IsValid() bool { + for _, existing := range AllowedCreateScrapeConfigPayloadSchemeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateScrapeConfigPayload_scheme value +func (v CreateScrapeConfigPayloadScheme) Ptr() *CreateScrapeConfigPayloadScheme { + return &v +} + +type NullableCreateScrapeConfigPayloadScheme struct { + value *CreateScrapeConfigPayloadScheme + isSet bool +} + +func (v NullableCreateScrapeConfigPayloadScheme) Get() *CreateScrapeConfigPayloadScheme { + return v.value +} + +func (v *NullableCreateScrapeConfigPayloadScheme) Set(val *CreateScrapeConfigPayloadScheme) { + v.value = val + v.isSet = true +} + +func (v NullableCreateScrapeConfigPayloadScheme) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateScrapeConfigPayloadScheme) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateScrapeConfigPayloadScheme(val *CreateScrapeConfigPayloadScheme) *NullableCreateScrapeConfigPayloadScheme { + return &NullableCreateScrapeConfigPayloadScheme{value: val, isSet: true} +} + +func (v NullableCreateScrapeConfigPayloadScheme) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateScrapeConfigPayloadScheme) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_get_instance_response.go b/services/observability/v1api/model_get_instance_response.go index 4b0912421..faabcfff9 100644 --- a/services/observability/v1api/model_get_instance_response.go +++ b/services/observability/v1api/model_get_instance_response.go @@ -33,7 +33,7 @@ type GetInstanceResponse struct { PlanName string `json:"planName"` PlanSchema *string `json:"planSchema,omitempty"` ServiceName string `json:"serviceName"` - Status string `json:"status"` + Status Status `json:"status"` AdditionalProperties map[string]interface{} } @@ -43,7 +43,7 @@ type _GetInstanceResponse GetInstanceResponse // 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 NewGetInstanceResponse(dashboardUrl string, id string, instance InstanceSensitiveData, message string, planId string, planName string, serviceName string, status string) *GetInstanceResponse { +func NewGetInstanceResponse(dashboardUrl string, id string, instance InstanceSensitiveData, message string, planId string, planName string, serviceName string, status Status) *GetInstanceResponse { this := GetInstanceResponse{} this.DashboardUrl = dashboardUrl this.Id = id @@ -412,9 +412,9 @@ func (o *GetInstanceResponse) SetServiceName(v string) { } // GetStatus returns the Status field value -func (o *GetInstanceResponse) GetStatus() string { +func (o *GetInstanceResponse) GetStatus() Status { if o == nil { - var ret string + var ret Status return ret } @@ -423,7 +423,7 @@ func (o *GetInstanceResponse) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *GetInstanceResponse) GetStatusOk() (*string, bool) { +func (o *GetInstanceResponse) GetStatusOk() (*Status, bool) { if o == nil { return nil, false } @@ -431,7 +431,7 @@ func (o *GetInstanceResponse) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *GetInstanceResponse) SetStatus(v string) { +func (o *GetInstanceResponse) SetStatus(v Status) { o.Status = v } diff --git a/services/observability/v1api/model_instance.go b/services/observability/v1api/model_instance.go index 0066ebb8f..54ae03297 100644 --- a/services/observability/v1api/model_instance.go +++ b/services/observability/v1api/model_instance.go @@ -30,7 +30,7 @@ type Instance struct { MetricsRetentionTimeRaw int32 `json:"metricsRetentionTimeRaw"` Name *string `json:"name,omitempty"` Plan PlanModel `json:"plan"` - State *string `json:"state,omitempty"` + State *State `json:"state,omitempty"` AdditionalProperties map[string]interface{} } @@ -286,9 +286,9 @@ func (o *Instance) SetPlan(v PlanModel) { } // GetState returns the State field value if set, zero value otherwise. -func (o *Instance) GetState() string { +func (o *Instance) GetState() State { if o == nil || IsNil(o.State) { - var ret string + var ret State return ret } return *o.State @@ -296,7 +296,7 @@ func (o *Instance) 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 *Instance) GetStateOk() (*string, bool) { +func (o *Instance) GetStateOk() (*State, bool) { if o == nil || IsNil(o.State) { return nil, false } @@ -312,8 +312,8 @@ func (o *Instance) HasState() bool { return false } -// SetState gets a reference to the given string and assigns it to the State field. -func (o *Instance) SetState(v string) { +// SetState gets a reference to the given State and assigns it to the State field. +func (o *Instance) SetState(v State) { o.State = &v } diff --git a/services/observability/v1api/model_job.go b/services/observability/v1api/model_job.go index 89e054142..f549c9a8e 100644 --- a/services/observability/v1api/model_job.go +++ b/services/observability/v1api/model_job.go @@ -32,7 +32,7 @@ type Job struct { Oauth2 *OAuth2 `json:"oauth2,omitempty"` Params *map[string][]string `json:"params,omitempty"` SampleLimit *int32 `json:"sampleLimit,omitempty"` - Scheme *string `json:"scheme,omitempty"` + Scheme *Scheme `json:"scheme,omitempty"` ScrapeInterval string `json:"scrapeInterval"` ScrapeTimeout string `json:"scrapeTimeout"` StaticConfigs []StaticConfigs `json:"staticConfigs"` @@ -55,7 +55,7 @@ func NewJob(jobName string, scrapeInterval string, scrapeTimeout string, staticC this.JobName = jobName var metricsPath string = "/metrics" this.MetricsPath = &metricsPath - var scheme string = "http" + var scheme Scheme = SCHEME_HTTP this.Scheme = &scheme this.ScrapeInterval = scrapeInterval this.ScrapeTimeout = scrapeTimeout @@ -74,7 +74,7 @@ func NewJobWithDefaults() *Job { this.HonorTimeStamps = &honorTimeStamps var metricsPath string = "/metrics" this.MetricsPath = &metricsPath - var scheme string = "http" + var scheme Scheme = SCHEME_HTTP this.Scheme = &scheme return &this } @@ -424,9 +424,9 @@ func (o *Job) SetSampleLimit(v int32) { } // GetScheme returns the Scheme field value if set, zero value otherwise. -func (o *Job) GetScheme() string { +func (o *Job) GetScheme() Scheme { if o == nil || IsNil(o.Scheme) { - var ret string + var ret Scheme return ret } return *o.Scheme @@ -434,7 +434,7 @@ func (o *Job) GetScheme() string { // GetSchemeOk returns a tuple with the Scheme field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Job) GetSchemeOk() (*string, bool) { +func (o *Job) GetSchemeOk() (*Scheme, bool) { if o == nil || IsNil(o.Scheme) { return nil, false } @@ -450,8 +450,8 @@ func (o *Job) HasScheme() bool { return false } -// SetScheme gets a reference to the given string and assigns it to the Scheme field. -func (o *Job) SetScheme(v string) { +// SetScheme gets a reference to the given Scheme and assigns it to the Scheme field. +func (o *Job) SetScheme(v Scheme) { o.Scheme = &v } diff --git a/services/observability/v1api/model_list_backup_schedules_backup_target_parameter_inner.go b/services/observability/v1api/model_list_backup_schedules_backup_target_parameter_inner.go new file mode 100644 index 000000000..429b109a0 --- /dev/null +++ b/services/observability/v1api/model_list_backup_schedules_backup_target_parameter_inner.go @@ -0,0 +1,118 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ListBackupSchedulesBackupTargetParameterInner the model 'ListBackupSchedulesBackupTargetParameterInner' +type ListBackupSchedulesBackupTargetParameterInner string + +// List of ListBackupSchedules_backupTarget_parameter_inner +const ( + LISTBACKUPSCHEDULESBACKUPTARGETPARAMETERINNER_ALERT_CONFIG ListBackupSchedulesBackupTargetParameterInner = "alertConfig" + LISTBACKUPSCHEDULESBACKUPTARGETPARAMETERINNER_ALERT_RULES ListBackupSchedulesBackupTargetParameterInner = "alertRules" + LISTBACKUPSCHEDULESBACKUPTARGETPARAMETERINNER_SCRAPE_CONFIG ListBackupSchedulesBackupTargetParameterInner = "scrapeConfig" + LISTBACKUPSCHEDULESBACKUPTARGETPARAMETERINNER_GRAFANA ListBackupSchedulesBackupTargetParameterInner = "grafana" + LISTBACKUPSCHEDULESBACKUPTARGETPARAMETERINNER_UNKNOWN_DEFAULT_OPEN_API ListBackupSchedulesBackupTargetParameterInner = "unknown_default_open_api" +) + +// All allowed values of ListBackupSchedulesBackupTargetParameterInner enum +var AllowedListBackupSchedulesBackupTargetParameterInnerEnumValues = []ListBackupSchedulesBackupTargetParameterInner{ + "alertConfig", + "alertRules", + "scrapeConfig", + "grafana", + "unknown_default_open_api", +} + +func (v *ListBackupSchedulesBackupTargetParameterInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListBackupSchedulesBackupTargetParameterInner(value) + for _, existing := range AllowedListBackupSchedulesBackupTargetParameterInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTBACKUPSCHEDULESBACKUPTARGETPARAMETERINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListBackupSchedulesBackupTargetParameterInnerFromValue returns a pointer to a valid ListBackupSchedulesBackupTargetParameterInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListBackupSchedulesBackupTargetParameterInnerFromValue(v string) (*ListBackupSchedulesBackupTargetParameterInner, error) { + ev := ListBackupSchedulesBackupTargetParameterInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListBackupSchedulesBackupTargetParameterInner: valid values are %v", v, AllowedListBackupSchedulesBackupTargetParameterInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListBackupSchedulesBackupTargetParameterInner) IsValid() bool { + for _, existing := range AllowedListBackupSchedulesBackupTargetParameterInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListBackupSchedules_backupTarget_parameter_inner value +func (v ListBackupSchedulesBackupTargetParameterInner) Ptr() *ListBackupSchedulesBackupTargetParameterInner { + return &v +} + +type NullableListBackupSchedulesBackupTargetParameterInner struct { + value *ListBackupSchedulesBackupTargetParameterInner + isSet bool +} + +func (v NullableListBackupSchedulesBackupTargetParameterInner) Get() *ListBackupSchedulesBackupTargetParameterInner { + return v.value +} + +func (v *NullableListBackupSchedulesBackupTargetParameterInner) Set(val *ListBackupSchedulesBackupTargetParameterInner) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupSchedulesBackupTargetParameterInner) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupSchedulesBackupTargetParameterInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupSchedulesBackupTargetParameterInner(val *ListBackupSchedulesBackupTargetParameterInner) *NullableListBackupSchedulesBackupTargetParameterInner { + return &NullableListBackupSchedulesBackupTargetParameterInner{value: val, isSet: true} +} + +func (v NullableListBackupSchedulesBackupTargetParameterInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupSchedulesBackupTargetParameterInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_list_backups_backup_target_parameter_inner.go b/services/observability/v1api/model_list_backups_backup_target_parameter_inner.go new file mode 100644 index 000000000..8dfbe3415 --- /dev/null +++ b/services/observability/v1api/model_list_backups_backup_target_parameter_inner.go @@ -0,0 +1,118 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ListBackupsBackupTargetParameterInner the model 'ListBackupsBackupTargetParameterInner' +type ListBackupsBackupTargetParameterInner string + +// List of ListBackups_backupTarget_parameter_inner +const ( + LISTBACKUPSBACKUPTARGETPARAMETERINNER_ALERT_CONFIG ListBackupsBackupTargetParameterInner = "alertConfig" + LISTBACKUPSBACKUPTARGETPARAMETERINNER_ALERT_RULES ListBackupsBackupTargetParameterInner = "alertRules" + LISTBACKUPSBACKUPTARGETPARAMETERINNER_SCRAPE_CONFIG ListBackupsBackupTargetParameterInner = "scrapeConfig" + LISTBACKUPSBACKUPTARGETPARAMETERINNER_GRAFANA ListBackupsBackupTargetParameterInner = "grafana" + LISTBACKUPSBACKUPTARGETPARAMETERINNER_UNKNOWN_DEFAULT_OPEN_API ListBackupsBackupTargetParameterInner = "unknown_default_open_api" +) + +// All allowed values of ListBackupsBackupTargetParameterInner enum +var AllowedListBackupsBackupTargetParameterInnerEnumValues = []ListBackupsBackupTargetParameterInner{ + "alertConfig", + "alertRules", + "scrapeConfig", + "grafana", + "unknown_default_open_api", +} + +func (v *ListBackupsBackupTargetParameterInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListBackupsBackupTargetParameterInner(value) + for _, existing := range AllowedListBackupsBackupTargetParameterInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTBACKUPSBACKUPTARGETPARAMETERINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListBackupsBackupTargetParameterInnerFromValue returns a pointer to a valid ListBackupsBackupTargetParameterInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListBackupsBackupTargetParameterInnerFromValue(v string) (*ListBackupsBackupTargetParameterInner, error) { + ev := ListBackupsBackupTargetParameterInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListBackupsBackupTargetParameterInner: valid values are %v", v, AllowedListBackupsBackupTargetParameterInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListBackupsBackupTargetParameterInner) IsValid() bool { + for _, existing := range AllowedListBackupsBackupTargetParameterInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListBackups_backupTarget_parameter_inner value +func (v ListBackupsBackupTargetParameterInner) Ptr() *ListBackupsBackupTargetParameterInner { + return &v +} + +type NullableListBackupsBackupTargetParameterInner struct { + value *ListBackupsBackupTargetParameterInner + isSet bool +} + +func (v NullableListBackupsBackupTargetParameterInner) Get() *ListBackupsBackupTargetParameterInner { + return v.value +} + +func (v *NullableListBackupsBackupTargetParameterInner) Set(val *ListBackupsBackupTargetParameterInner) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsBackupTargetParameterInner) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsBackupTargetParameterInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsBackupTargetParameterInner(val *ListBackupsBackupTargetParameterInner) *NullableListBackupsBackupTargetParameterInner { + return &NullableListBackupsBackupTargetParameterInner{value: val, isSet: true} +} + +func (v NullableListBackupsBackupTargetParameterInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsBackupTargetParameterInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_metrics_relabel_config.go b/services/observability/v1api/model_metrics_relabel_config.go index d0b0c41f9..9485e440d 100644 --- a/services/observability/v1api/model_metrics_relabel_config.go +++ b/services/observability/v1api/model_metrics_relabel_config.go @@ -21,7 +21,7 @@ var _ MappedNullable = &MetricsRelabelConfig{} // MetricsRelabelConfig struct for MetricsRelabelConfig type MetricsRelabelConfig struct { - Action *string `json:"action,omitempty"` + Action *Action `json:"action,omitempty"` Modulus *int32 `json:"modulus,omitempty"` Regex *string `json:"regex,omitempty"` Replacement *string `json:"replacement,omitempty"` @@ -39,7 +39,7 @@ type _MetricsRelabelConfig MetricsRelabelConfig // will change when the set of required properties is changed func NewMetricsRelabelConfig(sourceLabels []string) *MetricsRelabelConfig { this := MetricsRelabelConfig{} - var action string = "replace" + var action Action = ACTION_REPLACE this.Action = &action var regex string = ".*" this.Regex = ®ex @@ -56,7 +56,7 @@ func NewMetricsRelabelConfig(sourceLabels []string) *MetricsRelabelConfig { // but it doesn't guarantee that properties required by API are set func NewMetricsRelabelConfigWithDefaults() *MetricsRelabelConfig { this := MetricsRelabelConfig{} - var action string = "replace" + var action Action = ACTION_REPLACE this.Action = &action var regex string = ".*" this.Regex = ®ex @@ -68,9 +68,9 @@ func NewMetricsRelabelConfigWithDefaults() *MetricsRelabelConfig { } // GetAction returns the Action field value if set, zero value otherwise. -func (o *MetricsRelabelConfig) GetAction() string { +func (o *MetricsRelabelConfig) GetAction() Action { if o == nil || IsNil(o.Action) { - var ret string + var ret Action return ret } return *o.Action @@ -78,7 +78,7 @@ func (o *MetricsRelabelConfig) GetAction() string { // GetActionOk returns a tuple with the Action field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MetricsRelabelConfig) GetActionOk() (*string, bool) { +func (o *MetricsRelabelConfig) GetActionOk() (*Action, bool) { if o == nil || IsNil(o.Action) { return nil, false } @@ -94,8 +94,8 @@ func (o *MetricsRelabelConfig) HasAction() bool { return false } -// SetAction gets a reference to the given string and assigns it to the Action field. -func (o *MetricsRelabelConfig) SetAction(v string) { +// SetAction gets a reference to the given Action and assigns it to the Action field. +func (o *MetricsRelabelConfig) SetAction(v Action) { o.Action = &v } diff --git a/services/observability/v1api/model_partial_update_scrape_configs_request_inner.go b/services/observability/v1api/model_partial_update_scrape_configs_request_inner.go index 8ba50af7d..e041fd0a7 100644 --- a/services/observability/v1api/model_partial_update_scrape_configs_request_inner.go +++ b/services/observability/v1api/model_partial_update_scrape_configs_request_inner.go @@ -40,9 +40,8 @@ type PartialUpdateScrapeConfigsRequestInner struct { // Optional http params `Additional Validators:` * should not contain more than 5 keys * each key and value should not have more than 200 characters Params map[string]interface{} `json:"params,omitempty"` // Per-scrape limit on number of scraped samples that will be accepted. If more than this number of samples are present after metric relabeling the entire scrape will be treated as failed. The total limit depends on the service plan target limits * samples - SampleLimit *float32 `json:"sampleLimit,omitempty"` - // Configures the protocol scheme used for requests. https or http - Scheme string `json:"scheme"` + SampleLimit *float32 `json:"sampleLimit,omitempty"` + Scheme PartialUpdateScrapeConfigsRequestInnerScheme `json:"scheme"` // How frequently to scrape targets from this job. E.g. 5m `Additional Validators:` * must be a valid time format* must be >= 60s ScrapeInterval string `json:"scrapeInterval"` // Per-scrape timeout when scraping this job. `Additional Validators:` * must be a valid time format* must be smaller than scrapeInterval @@ -59,7 +58,7 @@ type _PartialUpdateScrapeConfigsRequestInner PartialUpdateScrapeConfigsRequestIn // 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 NewPartialUpdateScrapeConfigsRequestInner(jobName string, scheme string, scrapeInterval string, scrapeTimeout string, staticConfigs []PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) *PartialUpdateScrapeConfigsRequestInner { +func NewPartialUpdateScrapeConfigsRequestInner(jobName string, scheme PartialUpdateScrapeConfigsRequestInnerScheme, scrapeInterval string, scrapeTimeout string, staticConfigs []PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner) *PartialUpdateScrapeConfigsRequestInner { this := PartialUpdateScrapeConfigsRequestInner{} var honorLabels bool = false this.HonorLabels = &honorLabels @@ -434,9 +433,9 @@ func (o *PartialUpdateScrapeConfigsRequestInner) SetSampleLimit(v float32) { } // GetScheme returns the Scheme field value -func (o *PartialUpdateScrapeConfigsRequestInner) GetScheme() string { +func (o *PartialUpdateScrapeConfigsRequestInner) GetScheme() PartialUpdateScrapeConfigsRequestInnerScheme { if o == nil { - var ret string + var ret PartialUpdateScrapeConfigsRequestInnerScheme return ret } @@ -445,7 +444,7 @@ func (o *PartialUpdateScrapeConfigsRequestInner) GetScheme() string { // GetSchemeOk returns a tuple with the Scheme field value // and a boolean to check if the value has been set. -func (o *PartialUpdateScrapeConfigsRequestInner) GetSchemeOk() (*string, bool) { +func (o *PartialUpdateScrapeConfigsRequestInner) GetSchemeOk() (*PartialUpdateScrapeConfigsRequestInnerScheme, bool) { if o == nil { return nil, false } @@ -453,7 +452,7 @@ func (o *PartialUpdateScrapeConfigsRequestInner) GetSchemeOk() (*string, bool) { } // SetScheme sets field value -func (o *PartialUpdateScrapeConfigsRequestInner) SetScheme(v string) { +func (o *PartialUpdateScrapeConfigsRequestInner) SetScheme(v PartialUpdateScrapeConfigsRequestInnerScheme) { o.Scheme = v } diff --git a/services/observability/v1api/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner.go b/services/observability/v1api/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner.go index 5e59e38de..dafb2a2bb 100644 --- a/services/observability/v1api/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner.go +++ b/services/observability/v1api/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner.go @@ -20,8 +20,7 @@ var _ MappedNullable = &PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConf // PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner struct for PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner struct { - // Action to perform based on regex matching. `Additional Validators:` * if action is replace, targetLabel needs to be in body - Action *string `json:"action,omitempty"` + Action *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction `json:"action,omitempty"` // Modulus to take of the hash of the source label values. Modulus *float32 `json:"modulus,omitempty"` // Regular expression against which the extracted value is matched. @@ -45,7 +44,7 @@ type _PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner PartialUp // will change when the set of required properties is changed func NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner() *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner { this := PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner{} - var action string = "replace" + var action PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_REPLACE this.Action = &action var regex string = ".*" this.Regex = ®ex @@ -61,7 +60,7 @@ func NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner() *Part // but it doesn't guarantee that properties required by API are set func NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerWithDefaults() *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner { this := PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner{} - var action string = "replace" + var action PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_REPLACE this.Action = &action var regex string = ".*" this.Regex = ®ex @@ -73,9 +72,9 @@ func NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerWithDefa } // GetAction returns the Action field value if set, zero value otherwise. -func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetAction() string { +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetAction() PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction { if o == nil || IsNil(o.Action) { - var ret string + var ret PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction return ret } return *o.Action @@ -83,7 +82,7 @@ func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetAc // GetActionOk returns a tuple with the Action field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetActionOk() (*string, bool) { +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) GetActionOk() (*PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction, bool) { if o == nil || IsNil(o.Action) { return nil, false } @@ -99,8 +98,8 @@ func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) HasAc return false } -// SetAction gets a reference to the given string and assigns it to the Action field. -func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) SetAction(v string) { +// SetAction gets a reference to the given PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction and assigns it to the Action field. +func (o *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner) SetAction(v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) { o.Action = &v } diff --git a/services/observability/v1api/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner_action.go b/services/observability/v1api/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner_action.go new file mode 100644 index 000000000..79afbe259 --- /dev/null +++ b/services/observability/v1api/model_partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner_action.go @@ -0,0 +1,124 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction Action to perform based on regex matching. `Additional Validators:` * if action is replace, targetLabel needs to be in body +type PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction string + +// List of PartialUpdateScrapeConfigs_request_inner_metricsRelabelConfigs_inner_action +const ( + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_REPLACE PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "replace" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_KEEP PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "keep" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_DROP PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "drop" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_HASHMOD PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "hashmod" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_LABELMAP PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "labelmap" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_LABELDROP PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "labeldrop" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_LABELKEEP PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "labelkeep" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_UNKNOWN_DEFAULT_OPEN_API PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction enum +var AllowedPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionEnumValues = []PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction{ + "replace", + "keep", + "drop", + "hashmod", + "labelmap", + "labeldrop", + "labelkeep", + "unknown_default_open_api", +} + +func (v *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction(value) + for _, existing := range AllowedPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATESCRAPECONFIGSREQUESTINNERMETRICSRELABELCONFIGSINNERACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionFromValue returns a pointer to a valid PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionFromValue(v string) (*PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction, error) { + ev := PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction: valid values are %v", v, AllowedPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) IsValid() bool { + for _, existing := range AllowedPartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateScrapeConfigs_request_inner_metricsRelabelConfigs_inner_action value +func (v PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) Ptr() *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction { + return &v +} + +type NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction struct { + value *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) Get() *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) Set(val *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction(val *PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction { + return &NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInnerAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_partial_update_scrape_configs_request_inner_scheme.go b/services/observability/v1api/model_partial_update_scrape_configs_request_inner_scheme.go new file mode 100644 index 000000000..565dd2605 --- /dev/null +++ b/services/observability/v1api/model_partial_update_scrape_configs_request_inner_scheme.go @@ -0,0 +1,114 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// PartialUpdateScrapeConfigsRequestInnerScheme Configures the protocol scheme used for requests. https or http +type PartialUpdateScrapeConfigsRequestInnerScheme string + +// List of PartialUpdateScrapeConfigs_request_inner_scheme +const ( + PARTIALUPDATESCRAPECONFIGSREQUESTINNERSCHEME_HTTP PartialUpdateScrapeConfigsRequestInnerScheme = "http" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERSCHEME_HTTPS PartialUpdateScrapeConfigsRequestInnerScheme = "https" + PARTIALUPDATESCRAPECONFIGSREQUESTINNERSCHEME_UNKNOWN_DEFAULT_OPEN_API PartialUpdateScrapeConfigsRequestInnerScheme = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateScrapeConfigsRequestInnerScheme enum +var AllowedPartialUpdateScrapeConfigsRequestInnerSchemeEnumValues = []PartialUpdateScrapeConfigsRequestInnerScheme{ + "http", + "https", + "unknown_default_open_api", +} + +func (v *PartialUpdateScrapeConfigsRequestInnerScheme) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateScrapeConfigsRequestInnerScheme(value) + for _, existing := range AllowedPartialUpdateScrapeConfigsRequestInnerSchemeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATESCRAPECONFIGSREQUESTINNERSCHEME_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateScrapeConfigsRequestInnerSchemeFromValue returns a pointer to a valid PartialUpdateScrapeConfigsRequestInnerScheme +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateScrapeConfigsRequestInnerSchemeFromValue(v string) (*PartialUpdateScrapeConfigsRequestInnerScheme, error) { + ev := PartialUpdateScrapeConfigsRequestInnerScheme(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateScrapeConfigsRequestInnerScheme: valid values are %v", v, AllowedPartialUpdateScrapeConfigsRequestInnerSchemeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateScrapeConfigsRequestInnerScheme) IsValid() bool { + for _, existing := range AllowedPartialUpdateScrapeConfigsRequestInnerSchemeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateScrapeConfigs_request_inner_scheme value +func (v PartialUpdateScrapeConfigsRequestInnerScheme) Ptr() *PartialUpdateScrapeConfigsRequestInnerScheme { + return &v +} + +type NullablePartialUpdateScrapeConfigsRequestInnerScheme struct { + value *PartialUpdateScrapeConfigsRequestInnerScheme + isSet bool +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerScheme) Get() *PartialUpdateScrapeConfigsRequestInnerScheme { + return v.value +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerScheme) Set(val *PartialUpdateScrapeConfigsRequestInnerScheme) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerScheme) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerScheme) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateScrapeConfigsRequestInnerScheme(val *PartialUpdateScrapeConfigsRequestInnerScheme) *NullablePartialUpdateScrapeConfigsRequestInnerScheme { + return &NullablePartialUpdateScrapeConfigsRequestInnerScheme{value: val, isSet: true} +} + +func (v NullablePartialUpdateScrapeConfigsRequestInnerScheme) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateScrapeConfigsRequestInnerScheme) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_project_instance_full.go b/services/observability/v1api/model_project_instance_full.go index fec547a3c..952178e58 100644 --- a/services/observability/v1api/model_project_instance_full.go +++ b/services/observability/v1api/model_project_instance_full.go @@ -27,7 +27,7 @@ type ProjectInstanceFull struct { Name *string `json:"name,omitempty"` PlanName string `json:"planName"` ServiceName string `json:"serviceName"` - Status string `json:"status"` + Status Status1 `json:"status"` AdditionalProperties map[string]interface{} } @@ -37,7 +37,7 @@ type _ProjectInstanceFull ProjectInstanceFull // 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 NewProjectInstanceFull(id string, instance string, planName string, serviceName string, status string) *ProjectInstanceFull { +func NewProjectInstanceFull(id string, instance string, planName string, serviceName string, status Status1) *ProjectInstanceFull { this := ProjectInstanceFull{} this.Id = id this.Instance = instance @@ -227,9 +227,9 @@ func (o *ProjectInstanceFull) SetServiceName(v string) { } // GetStatus returns the Status field value -func (o *ProjectInstanceFull) GetStatus() string { +func (o *ProjectInstanceFull) GetStatus() Status1 { if o == nil { - var ret string + var ret Status1 return ret } @@ -238,7 +238,7 @@ func (o *ProjectInstanceFull) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *ProjectInstanceFull) GetStatusOk() (*string, bool) { +func (o *ProjectInstanceFull) GetStatusOk() (*Status1, bool) { if o == nil { return nil, false } @@ -246,7 +246,7 @@ func (o *ProjectInstanceFull) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *ProjectInstanceFull) SetStatus(v string) { +func (o *ProjectInstanceFull) SetStatus(v Status1) { o.Status = v } diff --git a/services/observability/v1api/model_restore_backup_restore_target_parameter.go b/services/observability/v1api/model_restore_backup_restore_target_parameter.go new file mode 100644 index 000000000..246a6d952 --- /dev/null +++ b/services/observability/v1api/model_restore_backup_restore_target_parameter.go @@ -0,0 +1,118 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// RestoreBackupRestoreTargetParameter the model 'RestoreBackupRestoreTargetParameter' +type RestoreBackupRestoreTargetParameter string + +// List of RestoreBackup_restoreTarget_parameter +const ( + RESTOREBACKUPRESTORETARGETPARAMETER_ALERT_CONFIG RestoreBackupRestoreTargetParameter = "alertConfig" + RESTOREBACKUPRESTORETARGETPARAMETER_ALERT_RULES RestoreBackupRestoreTargetParameter = "alertRules" + RESTOREBACKUPRESTORETARGETPARAMETER_SCRAPE_CONFIG RestoreBackupRestoreTargetParameter = "scrapeConfig" + RESTOREBACKUPRESTORETARGETPARAMETER_GRAFANA RestoreBackupRestoreTargetParameter = "grafana" + RESTOREBACKUPRESTORETARGETPARAMETER_UNKNOWN_DEFAULT_OPEN_API RestoreBackupRestoreTargetParameter = "unknown_default_open_api" +) + +// All allowed values of RestoreBackupRestoreTargetParameter enum +var AllowedRestoreBackupRestoreTargetParameterEnumValues = []RestoreBackupRestoreTargetParameter{ + "alertConfig", + "alertRules", + "scrapeConfig", + "grafana", + "unknown_default_open_api", +} + +func (v *RestoreBackupRestoreTargetParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RestoreBackupRestoreTargetParameter(value) + for _, existing := range AllowedRestoreBackupRestoreTargetParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = RESTOREBACKUPRESTORETARGETPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewRestoreBackupRestoreTargetParameterFromValue returns a pointer to a valid RestoreBackupRestoreTargetParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRestoreBackupRestoreTargetParameterFromValue(v string) (*RestoreBackupRestoreTargetParameter, error) { + ev := RestoreBackupRestoreTargetParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RestoreBackupRestoreTargetParameter: valid values are %v", v, AllowedRestoreBackupRestoreTargetParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RestoreBackupRestoreTargetParameter) IsValid() bool { + for _, existing := range AllowedRestoreBackupRestoreTargetParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RestoreBackup_restoreTarget_parameter value +func (v RestoreBackupRestoreTargetParameter) Ptr() *RestoreBackupRestoreTargetParameter { + return &v +} + +type NullableRestoreBackupRestoreTargetParameter struct { + value *RestoreBackupRestoreTargetParameter + isSet bool +} + +func (v NullableRestoreBackupRestoreTargetParameter) Get() *RestoreBackupRestoreTargetParameter { + return v.value +} + +func (v *NullableRestoreBackupRestoreTargetParameter) Set(val *RestoreBackupRestoreTargetParameter) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreBackupRestoreTargetParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreBackupRestoreTargetParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreBackupRestoreTargetParameter(val *RestoreBackupRestoreTargetParameter) *NullableRestoreBackupRestoreTargetParameter { + return &NullableRestoreBackupRestoreTargetParameter{value: val, isSet: true} +} + +func (v NullableRestoreBackupRestoreTargetParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreBackupRestoreTargetParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_scheme.go b/services/observability/v1api/model_scheme.go new file mode 100644 index 000000000..41767f27b --- /dev/null +++ b/services/observability/v1api/model_scheme.go @@ -0,0 +1,114 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// Scheme the model 'Scheme' +type Scheme string + +// List of Scheme +const ( + SCHEME_HTTP Scheme = "http" + SCHEME_HTTPS Scheme = "https" + SCHEME_UNKNOWN_DEFAULT_OPEN_API Scheme = "unknown_default_open_api" +) + +// All allowed values of Scheme enum +var AllowedSchemeEnumValues = []Scheme{ + "http", + "https", + "unknown_default_open_api", +} + +func (v *Scheme) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Scheme(value) + for _, existing := range AllowedSchemeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SCHEME_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewSchemeFromValue returns a pointer to a valid Scheme +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSchemeFromValue(v string) (*Scheme, error) { + ev := Scheme(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Scheme: valid values are %v", v, AllowedSchemeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Scheme) IsValid() bool { + for _, existing := range AllowedSchemeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Scheme value +func (v Scheme) Ptr() *Scheme { + return &v +} + +type NullableScheme struct { + value *Scheme + isSet bool +} + +func (v NullableScheme) Get() *Scheme { + return v.value +} + +func (v *NullableScheme) Set(val *Scheme) { + v.value = val + v.isSet = true +} + +func (v NullableScheme) IsSet() bool { + return v.isSet +} + +func (v *NullableScheme) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheme(val *Scheme) *NullableScheme { + return &NullableScheme{value: val, isSet: true} +} + +func (v NullableScheme) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheme) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_state.go b/services/observability/v1api/model_state.go new file mode 100644 index 000000000..5234508ba --- /dev/null +++ b/services/observability/v1api/model_state.go @@ -0,0 +1,136 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// State the model 'State' +type State string + +// List of State +const ( + STATE_COMPONENT_CREATION_STARTED State = "Component creation started" + STATE_COMPONENT_CREATION_FAILED State = "Component creation failed" + STATE_COMPONENT_CREATION_SUCCEEDED__NOW_NEED_TO_CHECK_READINESS State = "Component creation succeeded. Now need to check readiness" + STATE_COMPONENT_CREATION_SUCCEEDED State = "Component creation succeeded" + STATE_COMPONENT_DELETION_STARTED State = "Component deletion started" + STATE_COMPONENT_DELETION_FAILED State = "Component deletion failed" + STATE_COMPONENT_DELETION_SUCCEEDED State = "Component deletion succeeded" + STATE_COMPONENT_DELETION_OF_ROUTINE_SUCCEEDED__NOW_NEED_TO_CHECK_IF_RESOURCES_GONE State = "Component deletion of routine succeeded. Now need to check if resources gone" + STATE_COMPONENT_DELETION_BUCKETS_SUCCEEDED State = "Component deletion buckets succeeded" + STATE_COMPONENT_UPDATE_FAILED State = "Component update failed" + STATE_COMPONENT_UPDATE_STARTED State = "Component update started" + STATE_COMPONENT_UPDATE_CREATION_SUCCEEDED State = "Component update creation succeeded" + STATE_COMPONENT_UPDATE_DOWNGRADE_DELETION_RESOURCES_SUCCEEDED State = "Component update downgrade deletion resources succeeded" + STATE_UNKNOWN_DEFAULT_OPEN_API State = "unknown_default_open_api" +) + +// All allowed values of State enum +var AllowedStateEnumValues = []State{ + "Component creation started", + "Component creation failed", + "Component creation succeeded. Now need to check readiness", + "Component creation succeeded", + "Component deletion started", + "Component deletion failed", + "Component deletion succeeded", + "Component deletion of routine succeeded. Now need to check if resources gone", + "Component deletion buckets succeeded", + "Component update failed", + "Component update started", + "Component update creation succeeded", + "Component update downgrade deletion resources succeeded", + "unknown_default_open_api", +} + +func (v *State) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := State(value) + for _, existing := range AllowedStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = STATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewStateFromValue returns a pointer to a valid State +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStateFromValue(v string) (*State, error) { + ev := State(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for State: valid values are %v", v, AllowedStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v State) IsValid() bool { + for _, existing := range AllowedStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to State value +func (v State) Ptr() *State { + return &v +} + +type NullableState struct { + value *State + isSet bool +} + +func (v NullableState) Get() *State { + return v.value +} + +func (v *NullableState) Set(val *State) { + v.value = val + v.isSet = true +} + +func (v NullableState) IsSet() bool { + return v.isSet +} + +func (v *NullableState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableState(val *State) *NullableState { + return &NullableState{value: val, isSet: true} +} + +func (v NullableState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_status.go b/services/observability/v1api/model_status.go new file mode 100644 index 000000000..729a90758 --- /dev/null +++ b/services/observability/v1api/model_status.go @@ -0,0 +1,128 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// Status the model 'Status' +type Status string + +// List of Status +const ( + STATUS_CREATING Status = "CREATING" + STATUS_CREATE_SUCCEEDED Status = "CREATE_SUCCEEDED" + STATUS_CREATE_FAILED Status = "CREATE_FAILED" + STATUS_DELETING Status = "DELETING" + STATUS_DELETE_SUCCEEDED Status = "DELETE_SUCCEEDED" + STATUS_DELETE_FAILED Status = "DELETE_FAILED" + STATUS_UPDATING Status = "UPDATING" + STATUS_UPDATE_SUCCEEDED Status = "UPDATE_SUCCEEDED" + STATUS_UPDATE_FAILED Status = "UPDATE_FAILED" + STATUS_UNKNOWN_DEFAULT_OPEN_API Status = "unknown_default_open_api" +) + +// All allowed values of Status enum +var AllowedStatusEnumValues = []Status{ + "CREATING", + "CREATE_SUCCEEDED", + "CREATE_FAILED", + "DELETING", + "DELETE_SUCCEEDED", + "DELETE_FAILED", + "UPDATING", + "UPDATE_SUCCEEDED", + "UPDATE_FAILED", + "unknown_default_open_api", +} + +func (v *Status) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Status(value) + for _, existing := range AllowedStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = STATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewStatusFromValue returns a pointer to a valid Status +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStatusFromValue(v string) (*Status, error) { + ev := Status(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Status: valid values are %v", v, AllowedStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Status) IsValid() bool { + for _, existing := range AllowedStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Status value +func (v Status) Ptr() *Status { + return &v +} + +type NullableStatus struct { + value *Status + isSet bool +} + +func (v NullableStatus) Get() *Status { + return v.value +} + +func (v *NullableStatus) Set(val *Status) { + v.value = val + v.isSet = true +} + +func (v NullableStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatus(val *Status) *NullableStatus { + return &NullableStatus{value: val, isSet: true} +} + +func (v NullableStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_status_1.go b/services/observability/v1api/model_status_1.go new file mode 100644 index 000000000..b65488cfc --- /dev/null +++ b/services/observability/v1api/model_status_1.go @@ -0,0 +1,128 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// Status1 the model 'Status1' +type Status1 string + +// List of Status_1 +const ( + STATUS1_CREATING Status1 = "CREATING" + STATUS1_CREATE_SUCCEEDED Status1 = "CREATE_SUCCEEDED" + STATUS1_CREATE_FAILED Status1 = "CREATE_FAILED" + STATUS1_DELETING Status1 = "DELETING" + STATUS1_DELETE_SUCCEEDED Status1 = "DELETE_SUCCEEDED" + STATUS1_DELETE_FAILED Status1 = "DELETE_FAILED" + STATUS1_UPDATING Status1 = "UPDATING" + STATUS1_UPDATE_SUCCEEDED Status1 = "UPDATE_SUCCEEDED" + STATUS1_UPDATE_FAILED Status1 = "UPDATE_FAILED" + STATUS1_UNKNOWN_DEFAULT_OPEN_API Status1 = "unknown_default_open_api" +) + +// All allowed values of Status1 enum +var AllowedStatus1EnumValues = []Status1{ + "CREATING", + "CREATE_SUCCEEDED", + "CREATE_FAILED", + "DELETING", + "DELETE_SUCCEEDED", + "DELETE_FAILED", + "UPDATING", + "UPDATE_SUCCEEDED", + "UPDATE_FAILED", + "unknown_default_open_api", +} + +func (v *Status1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Status1(value) + for _, existing := range AllowedStatus1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = STATUS1_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewStatus1FromValue returns a pointer to a valid Status1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStatus1FromValue(v string) (*Status1, error) { + ev := Status1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Status1: valid values are %v", v, AllowedStatus1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Status1) IsValid() bool { + for _, existing := range AllowedStatus1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Status_1 value +func (v Status1) Ptr() *Status1 { + return &v +} + +type NullableStatus1 struct { + value *Status1 + isSet bool +} + +func (v NullableStatus1) Get() *Status1 { + return v.value +} + +func (v *NullableStatus1) Set(val *Status1) { + v.value = val + v.isSet = true +} + +func (v NullableStatus1) IsSet() bool { + return v.isSet +} + +func (v *NullableStatus1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatus1(val *Status1) *NullableStatus1 { + return &NullableStatus1{value: val, isSet: true} +} + +func (v NullableStatus1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatus1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_update_scrape_config_payload.go b/services/observability/v1api/model_update_scrape_config_payload.go index 359bdfe83..9e3fef766 100644 --- a/services/observability/v1api/model_update_scrape_config_payload.go +++ b/services/observability/v1api/model_update_scrape_config_payload.go @@ -35,9 +35,8 @@ type UpdateScrapeConfigPayload struct { // Optional http params `Additional Validators:` * should not contain more than 5 keys * each key and value should not have more than 200 characters Params map[string]interface{} `json:"params,omitempty"` // Per-scrape limit on number of scraped samples that will be accepted. If more than this number of samples are present after metric relabeling the entire scrape will be treated as failed. The total limit depends on the service plan target limits * samples - SampleLimit *float32 `json:"sampleLimit,omitempty"` - // Configures the protocol scheme used for requests. https or http - Scheme string `json:"scheme"` + SampleLimit *float32 `json:"sampleLimit,omitempty"` + Scheme UpdateScrapeConfigPayloadScheme `json:"scheme"` // How frequently to scrape targets from this job. E.g. 5m `Additional Validators:` * must be a valid time format* must be >= 60s ScrapeInterval string `json:"scrapeInterval"` // Per-scrape timeout when scraping this job. `Additional Validators:` * must be a valid time format* must be smaller than scrapeInterval @@ -54,7 +53,7 @@ type _UpdateScrapeConfigPayload UpdateScrapeConfigPayload // 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 NewUpdateScrapeConfigPayload(metricsPath string, scheme string, scrapeInterval string, scrapeTimeout string, staticConfigs []UpdateScrapeConfigPayloadStaticConfigsInner) *UpdateScrapeConfigPayload { +func NewUpdateScrapeConfigPayload(metricsPath string, scheme UpdateScrapeConfigPayloadScheme, scrapeInterval string, scrapeTimeout string, staticConfigs []UpdateScrapeConfigPayloadStaticConfigsInner) *UpdateScrapeConfigPayload { this := UpdateScrapeConfigPayload{} var honorLabels bool = false this.HonorLabels = &honorLabels @@ -331,9 +330,9 @@ func (o *UpdateScrapeConfigPayload) SetSampleLimit(v float32) { } // GetScheme returns the Scheme field value -func (o *UpdateScrapeConfigPayload) GetScheme() string { +func (o *UpdateScrapeConfigPayload) GetScheme() UpdateScrapeConfigPayloadScheme { if o == nil { - var ret string + var ret UpdateScrapeConfigPayloadScheme return ret } @@ -342,7 +341,7 @@ func (o *UpdateScrapeConfigPayload) GetScheme() string { // GetSchemeOk returns a tuple with the Scheme field value // and a boolean to check if the value has been set. -func (o *UpdateScrapeConfigPayload) GetSchemeOk() (*string, bool) { +func (o *UpdateScrapeConfigPayload) GetSchemeOk() (*UpdateScrapeConfigPayloadScheme, bool) { if o == nil { return nil, false } @@ -350,7 +349,7 @@ func (o *UpdateScrapeConfigPayload) GetSchemeOk() (*string, bool) { } // SetScheme sets field value -func (o *UpdateScrapeConfigPayload) SetScheme(v string) { +func (o *UpdateScrapeConfigPayload) SetScheme(v UpdateScrapeConfigPayloadScheme) { o.Scheme = v } diff --git a/services/observability/v1api/model_update_scrape_config_payload_metrics_relabel_configs_inner.go b/services/observability/v1api/model_update_scrape_config_payload_metrics_relabel_configs_inner.go index 751b7d71c..a61d1b0a1 100644 --- a/services/observability/v1api/model_update_scrape_config_payload_metrics_relabel_configs_inner.go +++ b/services/observability/v1api/model_update_scrape_config_payload_metrics_relabel_configs_inner.go @@ -20,8 +20,7 @@ var _ MappedNullable = &UpdateScrapeConfigPayloadMetricsRelabelConfigsInner{} // UpdateScrapeConfigPayloadMetricsRelabelConfigsInner struct for UpdateScrapeConfigPayloadMetricsRelabelConfigsInner type UpdateScrapeConfigPayloadMetricsRelabelConfigsInner struct { - // Action to perform based on regex matching. `Additional Validators:` * if action is replace, targetLabel needs to be in body - Action *string `json:"action,omitempty"` + Action *UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction `json:"action,omitempty"` // Modulus to take of the hash of the source label values. Modulus *float32 `json:"modulus,omitempty"` // Regular expression against which the extracted value is matched. @@ -45,7 +44,7 @@ type _UpdateScrapeConfigPayloadMetricsRelabelConfigsInner UpdateScrapeConfigPayl // will change when the set of required properties is changed func NewUpdateScrapeConfigPayloadMetricsRelabelConfigsInner() *UpdateScrapeConfigPayloadMetricsRelabelConfigsInner { this := UpdateScrapeConfigPayloadMetricsRelabelConfigsInner{} - var action string = "replace" + var action UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_REPLACE this.Action = &action var regex string = ".*" this.Regex = ®ex @@ -61,7 +60,7 @@ func NewUpdateScrapeConfigPayloadMetricsRelabelConfigsInner() *UpdateScrapeConfi // but it doesn't guarantee that properties required by API are set func NewUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerWithDefaults() *UpdateScrapeConfigPayloadMetricsRelabelConfigsInner { this := UpdateScrapeConfigPayloadMetricsRelabelConfigsInner{} - var action string = "replace" + var action UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_REPLACE this.Action = &action var regex string = ".*" this.Regex = ®ex @@ -73,9 +72,9 @@ func NewUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerWithDefaults() *Updat } // GetAction returns the Action field value if set, zero value otherwise. -func (o *UpdateScrapeConfigPayloadMetricsRelabelConfigsInner) GetAction() string { +func (o *UpdateScrapeConfigPayloadMetricsRelabelConfigsInner) GetAction() UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { if o == nil || IsNil(o.Action) { - var ret string + var ret UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction return ret } return *o.Action @@ -83,7 +82,7 @@ func (o *UpdateScrapeConfigPayloadMetricsRelabelConfigsInner) GetAction() string // GetActionOk returns a tuple with the Action field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateScrapeConfigPayloadMetricsRelabelConfigsInner) GetActionOk() (*string, bool) { +func (o *UpdateScrapeConfigPayloadMetricsRelabelConfigsInner) GetActionOk() (*UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction, bool) { if o == nil || IsNil(o.Action) { return nil, false } @@ -99,8 +98,8 @@ func (o *UpdateScrapeConfigPayloadMetricsRelabelConfigsInner) HasAction() bool { return false } -// SetAction gets a reference to the given string and assigns it to the Action field. -func (o *UpdateScrapeConfigPayloadMetricsRelabelConfigsInner) SetAction(v string) { +// SetAction gets a reference to the given UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction and assigns it to the Action field. +func (o *UpdateScrapeConfigPayloadMetricsRelabelConfigsInner) SetAction(v UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) { o.Action = &v } diff --git a/services/observability/v1api/model_update_scrape_config_payload_metrics_relabel_configs_inner_action.go b/services/observability/v1api/model_update_scrape_config_payload_metrics_relabel_configs_inner_action.go new file mode 100644 index 000000000..c8e1360b1 --- /dev/null +++ b/services/observability/v1api/model_update_scrape_config_payload_metrics_relabel_configs_inner_action.go @@ -0,0 +1,124 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction Action to perform based on regex matching. `Additional Validators:` * if action is replace, targetLabel needs to be in body +type UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction string + +// List of UpdateScrapeConfigPayload_metricsRelabelConfigs_inner_action +const ( + UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_REPLACE UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "replace" + UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_KEEP UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "keep" + UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_DROP UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "drop" + UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_HASHMOD UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "hashmod" + UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_LABELMAP UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "labelmap" + UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_LABELDROP UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "labeldrop" + UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_LABELKEEP UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "labelkeep" + UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_UNKNOWN_DEFAULT_OPEN_API UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction = "unknown_default_open_api" +) + +// All allowed values of UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction enum +var AllowedUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues = []UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction{ + "replace", + "keep", + "drop", + "hashmod", + "labelmap", + "labeldrop", + "labelkeep", + "unknown_default_open_api", +} + +func (v *UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction(value) + for _, existing := range AllowedUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATESCRAPECONFIGPAYLOADMETRICSRELABELCONFIGSINNERACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerActionFromValue returns a pointer to a valid UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerActionFromValue(v string) (*UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction, error) { + ev := UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction: valid values are %v", v, AllowedUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) IsValid() bool { + for _, existing := range AllowedUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateScrapeConfigPayload_metricsRelabelConfigs_inner_action value +func (v UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Ptr() *UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { + return &v +} + +type NullableUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction struct { + value *UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction + isSet bool +} + +func (v NullableUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Get() *UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { + return v.value +} + +func (v *NullableUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Set(val *UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction(val *UpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) *NullableUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction { + return &NullableUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction{value: val, isSet: true} +} + +func (v NullableUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateScrapeConfigPayloadMetricsRelabelConfigsInnerAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/v1api/model_update_scrape_config_payload_scheme.go b/services/observability/v1api/model_update_scrape_config_payload_scheme.go new file mode 100644 index 000000000..3c54f1ece --- /dev/null +++ b/services/observability/v1api/model_update_scrape_config_payload_scheme.go @@ -0,0 +1,114 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +Contact: stackit-argus@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// UpdateScrapeConfigPayloadScheme Configures the protocol scheme used for requests. https or http +type UpdateScrapeConfigPayloadScheme string + +// List of UpdateScrapeConfigPayload_scheme +const ( + UPDATESCRAPECONFIGPAYLOADSCHEME_HTTP UpdateScrapeConfigPayloadScheme = "http" + UPDATESCRAPECONFIGPAYLOADSCHEME_HTTPS UpdateScrapeConfigPayloadScheme = "https" + UPDATESCRAPECONFIGPAYLOADSCHEME_UNKNOWN_DEFAULT_OPEN_API UpdateScrapeConfigPayloadScheme = "unknown_default_open_api" +) + +// All allowed values of UpdateScrapeConfigPayloadScheme enum +var AllowedUpdateScrapeConfigPayloadSchemeEnumValues = []UpdateScrapeConfigPayloadScheme{ + "http", + "https", + "unknown_default_open_api", +} + +func (v *UpdateScrapeConfigPayloadScheme) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateScrapeConfigPayloadScheme(value) + for _, existing := range AllowedUpdateScrapeConfigPayloadSchemeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATESCRAPECONFIGPAYLOADSCHEME_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateScrapeConfigPayloadSchemeFromValue returns a pointer to a valid UpdateScrapeConfigPayloadScheme +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateScrapeConfigPayloadSchemeFromValue(v string) (*UpdateScrapeConfigPayloadScheme, error) { + ev := UpdateScrapeConfigPayloadScheme(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateScrapeConfigPayloadScheme: valid values are %v", v, AllowedUpdateScrapeConfigPayloadSchemeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateScrapeConfigPayloadScheme) IsValid() bool { + for _, existing := range AllowedUpdateScrapeConfigPayloadSchemeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateScrapeConfigPayload_scheme value +func (v UpdateScrapeConfigPayloadScheme) Ptr() *UpdateScrapeConfigPayloadScheme { + return &v +} + +type NullableUpdateScrapeConfigPayloadScheme struct { + value *UpdateScrapeConfigPayloadScheme + isSet bool +} + +func (v NullableUpdateScrapeConfigPayloadScheme) Get() *UpdateScrapeConfigPayloadScheme { + return v.value +} + +func (v *NullableUpdateScrapeConfigPayloadScheme) Set(val *UpdateScrapeConfigPayloadScheme) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateScrapeConfigPayloadScheme) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateScrapeConfigPayloadScheme) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateScrapeConfigPayloadScheme(val *UpdateScrapeConfigPayloadScheme) *NullableUpdateScrapeConfigPayloadScheme { + return &NullableUpdateScrapeConfigPayloadScheme{value: val, isSet: true} +} + +func (v NullableUpdateScrapeConfigPayloadScheme) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateScrapeConfigPayloadScheme) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From a5cb0d210741472c9baaa9873474717c951468bd Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:01:30 +0200 Subject: [PATCH 30/66] chore(observability): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/observability/CHANGELOG.md | 3 +++ services/observability/VERSION | 2 +- services/observability/v1api/wait/wait.go | 12 +++++------ .../observability/v1api/wait/wait_test.go | 21 +++++++++---------- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2169f76e5..8e4ed3f9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -289,6 +289,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v0.21.2](services/observability/CHANGELOG.md#v0212) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` + - [v0.22.0](services/observability/CHANGELOG.md#v0220) + - **Feature:** Introduce enums for various attributes - `opensearch`: - [v0.26.3](services/opensearch/CHANGELOG.md#v0263) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/observability/CHANGELOG.md b/services/observability/CHANGELOG.md index da91b46c4..58f349944 100644 --- a/services/observability/CHANGELOG.md +++ b/services/observability/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.22.0 +- **Feature:** Introduce enums for various attributes + ## v0.21.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` diff --git a/services/observability/VERSION b/services/observability/VERSION index 172c2f8b5..4f2794371 100644 --- a/services/observability/VERSION +++ b/services/observability/VERSION @@ -1 +1 @@ -v0.21.2 \ No newline at end of file +v0.22.0 diff --git a/services/observability/v1api/wait/wait.go b/services/observability/v1api/wait/wait.go index 707beb566..2885ad5c5 100644 --- a/services/observability/v1api/wait/wait.go +++ b/services/observability/v1api/wait/wait.go @@ -31,10 +31,10 @@ func CreateInstanceWaitHandler(ctx context.Context, a observability.DefaultAPI, if s == nil { return false, nil, nil } - if s.Id == instanceId && s.Status == GETINSTANCERESPONSESTATUS_CREATE_SUCCEEDED { + if s.Id == instanceId && s.Status == observability.STATUS_CREATE_SUCCEEDED { return true, s, nil } - if s.Id == instanceId && s.Status == GETINSTANCERESPONSESTATUS_CREATE_FAILED { + if s.Id == instanceId && s.Status == observability.STATUS_CREATE_FAILED { return true, s, fmt.Errorf("create failed for instance with id %s", instanceId) } return false, nil, nil @@ -54,10 +54,10 @@ func UpdateInstanceWaitHandler(ctx context.Context, a observability.DefaultAPI, return false, nil, nil } // The observability instance API currently replies with create success in case the update was successful. - if s.Id == instanceId && (s.Status == GETINSTANCERESPONSESTATUS_UPDATE_SUCCEEDED || s.Status == GETINSTANCERESPONSESTATUS_CREATE_FAILED) { + if s.Id == instanceId && (s.Status == observability.STATUS_UPDATE_SUCCEEDED || s.Status == observability.STATUS_CREATE_SUCCEEDED) { return true, s, nil } - if s.Id == instanceId && (s.Status == GETINSTANCERESPONSESTATUS_UPDATE_FAILED || s.Status == GETINSTANCERESPONSESTATUS_CREATE_FAILED) { + if s.Id == instanceId && (s.Status == observability.STATUS_UPDATE_FAILED || s.Status == observability.STATUS_CREATE_FAILED) { return true, s, fmt.Errorf("update failed for instance with id %s", instanceId) } return false, nil, nil @@ -76,10 +76,10 @@ func DeleteInstanceWaitHandler(ctx context.Context, a observability.DefaultAPI, if s == nil { return false, nil, nil } - if s.Id == instanceId && s.Status == GETINSTANCERESPONSESTATUS_DELETE_SUCCEEDED { + if s.Id == instanceId && s.Status == observability.STATUS_DELETE_SUCCEEDED { return true, s, nil } - if s.Id == instanceId && s.Status == GETINSTANCERESPONSESTATUS_DELETE_FAILED { + if s.Id == instanceId && s.Status == observability.STATUS_DELETE_FAILED { return true, s, fmt.Errorf("delete failed for instance with id %s", instanceId) } return false, nil, nil diff --git a/services/observability/v1api/wait/wait_test.go b/services/observability/v1api/wait/wait_test.go index 8eef39fff..f3500225e 100644 --- a/services/observability/v1api/wait/wait_test.go +++ b/services/observability/v1api/wait/wait_test.go @@ -16,7 +16,7 @@ import ( type mockSettings struct { getFails bool - resourceState string + resourceState observability.Status jobs []observability.Job } @@ -52,21 +52,21 @@ func TestCreateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState observability.Status wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: GETINSTANCERESPONSESTATUS_CREATE_SUCCEEDED, + resourceState: observability.STATUS_CREATE_SUCCEEDED, wantErr: false, wantResp: true, }, { desc: "create_failed", getFails: false, - resourceState: GETINSTANCERESPONSESTATUS_CREATE_FAILED, + resourceState: observability.STATUS_CREATE_FAILED, wantErr: true, wantResp: true, }, @@ -127,21 +127,21 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState observability.Status wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: GETINSTANCERESPONSESTATUS_UPDATE_SUCCEEDED, + resourceState: observability.STATUS_UPDATE_SUCCEEDED, wantErr: false, wantResp: true, }, { desc: "update_failed", getFails: false, - resourceState: GETINSTANCERESPONSESTATUS_UPDATE_FAILED, + resourceState: observability.STATUS_UPDATE_FAILED, wantErr: true, wantResp: true, }, @@ -195,21 +195,21 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState observability.Status wantErr bool wantResp bool }{ { desc: "delete_succeeded", getFails: false, - resourceState: GETINSTANCERESPONSESTATUS_DELETE_SUCCEEDED, + resourceState: observability.STATUS_DELETE_SUCCEEDED, wantErr: false, wantResp: true, }, { desc: "delete_failed", getFails: false, - resourceState: GETINSTANCERESPONSESTATUS_DELETE_FAILED, + resourceState: observability.STATUS_DELETE_FAILED, wantErr: true, wantResp: true, }, @@ -258,7 +258,6 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { }) } } - func TestCreateScrapeConfigWaitHandler(t *testing.T) { tests := []struct { desc string From ad042d5e58048e36e72a09c31c29c52defccbf51 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:02:37 +0200 Subject: [PATCH 31/66] refac(opensearch): introduce inline enums --- services/opensearch/v1api/model_instance.go | 12 +- .../v1api/model_instance_last_operation.go | 24 ++-- .../model_instance_last_operation_state.go | 115 +++++++++++++++++ .../model_instance_last_operation_type.go | 115 +++++++++++++++++ .../v1api/model_instance_parameters.go | 44 +++---- ...tance_parameters_java_garbage_collector.go | 117 +++++++++++++++++ ...model_instance_parameters_plugins_inner.go | 115 +++++++++++++++++ ...instance_parameters_tls_protocols_inner.go | 113 ++++++++++++++++ .../opensearch/v1api/model_instance_status.go | 121 ++++++++++++++++++ 9 files changed, 736 insertions(+), 40 deletions(-) create mode 100644 services/opensearch/v1api/model_instance_last_operation_state.go create mode 100644 services/opensearch/v1api/model_instance_last_operation_type.go create mode 100644 services/opensearch/v1api/model_instance_parameters_java_garbage_collector.go create mode 100644 services/opensearch/v1api/model_instance_parameters_plugins_inner.go create mode 100644 services/opensearch/v1api/model_instance_parameters_tls_protocols_inner.go create mode 100644 services/opensearch/v1api/model_instance_status.go diff --git a/services/opensearch/v1api/model_instance.go b/services/opensearch/v1api/model_instance.go index 794725ec5..9cd832665 100644 --- a/services/opensearch/v1api/model_instance.go +++ b/services/opensearch/v1api/model_instance.go @@ -34,7 +34,7 @@ type Instance struct { Parameters map[string]interface{} `json:"parameters"` PlanId string `json:"planId"` PlanName string `json:"planName"` - Status *string `json:"status,omitempty"` + Status *InstanceStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -393,9 +393,9 @@ func (o *Instance) SetPlanName(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Instance) GetStatus() string { +func (o *Instance) GetStatus() InstanceStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret InstanceStatus return ret } return *o.Status @@ -403,7 +403,7 @@ func (o *Instance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetStatusOk() (*string, bool) { +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -419,8 +419,8 @@ func (o *Instance) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Instance) SetStatus(v string) { +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { o.Status = &v } diff --git a/services/opensearch/v1api/model_instance_last_operation.go b/services/opensearch/v1api/model_instance_last_operation.go index b5aef2ff5..800e71e73 100644 --- a/services/opensearch/v1api/model_instance_last_operation.go +++ b/services/opensearch/v1api/model_instance_last_operation.go @@ -20,9 +20,9 @@ var _ MappedNullable = &InstanceLastOperation{} // InstanceLastOperation struct for InstanceLastOperation type InstanceLastOperation struct { - Description string `json:"description"` - State string `json:"state"` - Type string `json:"type"` + Description string `json:"description"` + State InstanceLastOperationState `json:"state"` + Type InstanceLastOperationType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +32,7 @@ type _InstanceLastOperation InstanceLastOperation // 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 NewInstanceLastOperation(description string, state string, types string) *InstanceLastOperation { +func NewInstanceLastOperation(description string, state InstanceLastOperationState, types InstanceLastOperationType) *InstanceLastOperation { this := InstanceLastOperation{} this.Description = description this.State = state @@ -73,9 +73,9 @@ func (o *InstanceLastOperation) SetDescription(v string) { } // GetState returns the State field value -func (o *InstanceLastOperation) GetState() string { +func (o *InstanceLastOperation) GetState() InstanceLastOperationState { if o == nil { - var ret string + var ret InstanceLastOperationState return ret } @@ -84,7 +84,7 @@ func (o *InstanceLastOperation) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *InstanceLastOperation) GetStateOk() (*string, bool) { +func (o *InstanceLastOperation) GetStateOk() (*InstanceLastOperationState, bool) { if o == nil { return nil, false } @@ -92,14 +92,14 @@ func (o *InstanceLastOperation) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *InstanceLastOperation) SetState(v string) { +func (o *InstanceLastOperation) SetState(v InstanceLastOperationState) { o.State = v } // GetType returns the Type field value -func (o *InstanceLastOperation) GetType() string { +func (o *InstanceLastOperation) GetType() InstanceLastOperationType { if o == nil { - var ret string + var ret InstanceLastOperationType return ret } @@ -108,7 +108,7 @@ func (o *InstanceLastOperation) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *InstanceLastOperation) GetTypeOk() (*string, bool) { +func (o *InstanceLastOperation) GetTypeOk() (*InstanceLastOperationType, bool) { if o == nil { return nil, false } @@ -116,7 +116,7 @@ func (o *InstanceLastOperation) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *InstanceLastOperation) SetType(v string) { +func (o *InstanceLastOperation) SetType(v InstanceLastOperationType) { o.Type = v } diff --git a/services/opensearch/v1api/model_instance_last_operation_state.go b/services/opensearch/v1api/model_instance_last_operation_state.go new file mode 100644 index 000000000..29ef473e9 --- /dev/null +++ b/services/opensearch/v1api/model_instance_last_operation_state.go @@ -0,0 +1,115 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationState the model 'InstanceLastOperationState' +type InstanceLastOperationState string + +// List of InstanceLastOperation_state +const ( + INSTANCELASTOPERATIONSTATE_IN_PROGRESS InstanceLastOperationState = "in progress" + INSTANCELASTOPERATIONSTATE_SUCCEEDED InstanceLastOperationState = "succeeded" + INSTANCELASTOPERATIONSTATE_FAILED InstanceLastOperationState = "failed" + INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationState = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationState enum +var AllowedInstanceLastOperationStateEnumValues = []InstanceLastOperationState{ + "in progress", + "succeeded", + "failed", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationState(value) + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationStateFromValue returns a pointer to a valid InstanceLastOperationState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationStateFromValue(v string) (*InstanceLastOperationState, error) { + ev := InstanceLastOperationState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationState: valid values are %v", v, AllowedInstanceLastOperationStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationState) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_state value +func (v InstanceLastOperationState) Ptr() *InstanceLastOperationState { + return &v +} + +type NullableInstanceLastOperationState struct { + value *InstanceLastOperationState + isSet bool +} + +func (v NullableInstanceLastOperationState) Get() *InstanceLastOperationState { + return v.value +} + +func (v *NullableInstanceLastOperationState) Set(val *InstanceLastOperationState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationState(val *InstanceLastOperationState) *NullableInstanceLastOperationState { + return &NullableInstanceLastOperationState{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v1api/model_instance_last_operation_type.go b/services/opensearch/v1api/model_instance_last_operation_type.go new file mode 100644 index 000000000..b020a0d66 --- /dev/null +++ b/services/opensearch/v1api/model_instance_last_operation_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationType the model 'InstanceLastOperationType' +type InstanceLastOperationType string + +// List of InstanceLastOperation_type +const ( + INSTANCELASTOPERATIONTYPE_CREATE InstanceLastOperationType = "create" + INSTANCELASTOPERATIONTYPE_UPDATE InstanceLastOperationType = "update" + INSTANCELASTOPERATIONTYPE_DELETE InstanceLastOperationType = "delete" + INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationType = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationType enum +var AllowedInstanceLastOperationTypeEnumValues = []InstanceLastOperationType{ + "create", + "update", + "delete", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationType(value) + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationTypeFromValue returns a pointer to a valid InstanceLastOperationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationTypeFromValue(v string) (*InstanceLastOperationType, error) { + ev := InstanceLastOperationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationType: valid values are %v", v, AllowedInstanceLastOperationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationType) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_type value +func (v InstanceLastOperationType) Ptr() *InstanceLastOperationType { + return &v +} + +type NullableInstanceLastOperationType struct { + value *InstanceLastOperationType + isSet bool +} + +func (v NullableInstanceLastOperationType) Get() *InstanceLastOperationType { + return v.value +} + +func (v *NullableInstanceLastOperationType) Set(val *InstanceLastOperationType) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationType) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationType(val *InstanceLastOperationType) *NullableInstanceLastOperationType { + return &NullableInstanceLastOperationType{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v1api/model_instance_parameters.go b/services/opensearch/v1api/model_instance_parameters.go index 38bb2e56d..b8d972fdf 100644 --- a/services/opensearch/v1api/model_instance_parameters.go +++ b/services/opensearch/v1api/model_instance_parameters.go @@ -21,8 +21,8 @@ var _ MappedNullable = &InstanceParameters{} type InstanceParameters struct { EnableMonitoring *bool `json:"enable_monitoring,omitempty"` // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. - Graphite *string `json:"graphite,omitempty"` - JavaGarbageCollector *string `json:"java_garbage_collector,omitempty"` + Graphite *string `json:"graphite,omitempty"` + JavaGarbageCollector *InstanceParametersJavaGarbageCollector `json:"java_garbage_collector,omitempty"` // Default: not set, 46% of available memory will be used. The amount of memory (in MB) allocated as heap by the JVM for OpenSearch. JavaHeapspace *int32 `json:"java_heapspace,omitempty"` // The amount of memory (in MB) used by the JVM to store metadata for OpenSearch. @@ -35,13 +35,13 @@ type InstanceParameters struct { MetricsPrefix *string `json:"metrics_prefix,omitempty"` MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` // The plugins repository-s3 and repository-azure are enabled by default and cannot be disabled. - Plugins []string `json:"plugins,omitempty"` + Plugins []InstanceParametersPluginsInner `json:"plugins,omitempty"` // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl *string `json:"sgw_acl,omitempty"` Syslog []string `json:"syslog,omitempty"` // Only Java format is supported. - TlsCiphers []string `json:"tls-ciphers,omitempty"` - TlsProtocols []string `json:"tls-protocols,omitempty"` + TlsCiphers []string `json:"tls-ciphers,omitempty"` + TlsProtocols []InstanceParametersTlsProtocolsInner `json:"tls-protocols,omitempty"` AdditionalProperties map[string]interface{} } @@ -55,7 +55,7 @@ func NewInstanceParameters() *InstanceParameters { this := InstanceParameters{} var enableMonitoring bool = false this.EnableMonitoring = &enableMonitoring - var javaGarbageCollector string = "UseG1GC" + var javaGarbageCollector InstanceParametersJavaGarbageCollector = INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_G1_GC this.JavaGarbageCollector = &javaGarbageCollector var javaMaxmetaspace int32 = 512 this.JavaMaxmetaspace = &javaMaxmetaspace @@ -73,7 +73,7 @@ func NewInstanceParametersWithDefaults() *InstanceParameters { this := InstanceParameters{} var enableMonitoring bool = false this.EnableMonitoring = &enableMonitoring - var javaGarbageCollector string = "UseG1GC" + var javaGarbageCollector InstanceParametersJavaGarbageCollector = INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_G1_GC this.JavaGarbageCollector = &javaGarbageCollector var javaMaxmetaspace int32 = 512 this.JavaMaxmetaspace = &javaMaxmetaspace @@ -149,9 +149,9 @@ func (o *InstanceParameters) SetGraphite(v string) { } // GetJavaGarbageCollector returns the JavaGarbageCollector field value if set, zero value otherwise. -func (o *InstanceParameters) GetJavaGarbageCollector() string { +func (o *InstanceParameters) GetJavaGarbageCollector() InstanceParametersJavaGarbageCollector { if o == nil || IsNil(o.JavaGarbageCollector) { - var ret string + var ret InstanceParametersJavaGarbageCollector return ret } return *o.JavaGarbageCollector @@ -159,7 +159,7 @@ func (o *InstanceParameters) GetJavaGarbageCollector() string { // GetJavaGarbageCollectorOk returns a tuple with the JavaGarbageCollector field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceParameters) GetJavaGarbageCollectorOk() (*string, bool) { +func (o *InstanceParameters) GetJavaGarbageCollectorOk() (*InstanceParametersJavaGarbageCollector, bool) { if o == nil || IsNil(o.JavaGarbageCollector) { return nil, false } @@ -175,8 +175,8 @@ func (o *InstanceParameters) HasJavaGarbageCollector() bool { return false } -// SetJavaGarbageCollector gets a reference to the given string and assigns it to the JavaGarbageCollector field. -func (o *InstanceParameters) SetJavaGarbageCollector(v string) { +// SetJavaGarbageCollector gets a reference to the given InstanceParametersJavaGarbageCollector and assigns it to the JavaGarbageCollector field. +func (o *InstanceParameters) SetJavaGarbageCollector(v InstanceParametersJavaGarbageCollector) { o.JavaGarbageCollector = &v } @@ -373,9 +373,9 @@ func (o *InstanceParameters) SetMonitoringInstanceId(v string) { } // GetPlugins returns the Plugins field value if set, zero value otherwise. -func (o *InstanceParameters) GetPlugins() []string { +func (o *InstanceParameters) GetPlugins() []InstanceParametersPluginsInner { if o == nil || IsNil(o.Plugins) { - var ret []string + var ret []InstanceParametersPluginsInner return ret } return o.Plugins @@ -383,7 +383,7 @@ func (o *InstanceParameters) GetPlugins() []string { // GetPluginsOk returns a tuple with the Plugins field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceParameters) GetPluginsOk() ([]string, bool) { +func (o *InstanceParameters) GetPluginsOk() ([]InstanceParametersPluginsInner, bool) { if o == nil || IsNil(o.Plugins) { return nil, false } @@ -399,8 +399,8 @@ func (o *InstanceParameters) HasPlugins() bool { return false } -// SetPlugins gets a reference to the given []string and assigns it to the Plugins field. -func (o *InstanceParameters) SetPlugins(v []string) { +// SetPlugins gets a reference to the given []InstanceParametersPluginsInner and assigns it to the Plugins field. +func (o *InstanceParameters) SetPlugins(v []InstanceParametersPluginsInner) { o.Plugins = v } @@ -501,9 +501,9 @@ func (o *InstanceParameters) SetTlsCiphers(v []string) { } // GetTlsProtocols returns the TlsProtocols field value if set, zero value otherwise. -func (o *InstanceParameters) GetTlsProtocols() []string { +func (o *InstanceParameters) GetTlsProtocols() []InstanceParametersTlsProtocolsInner { if o == nil || IsNil(o.TlsProtocols) { - var ret []string + var ret []InstanceParametersTlsProtocolsInner return ret } return o.TlsProtocols @@ -511,7 +511,7 @@ func (o *InstanceParameters) GetTlsProtocols() []string { // GetTlsProtocolsOk returns a tuple with the TlsProtocols field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceParameters) GetTlsProtocolsOk() ([]string, bool) { +func (o *InstanceParameters) GetTlsProtocolsOk() ([]InstanceParametersTlsProtocolsInner, bool) { if o == nil || IsNil(o.TlsProtocols) { return nil, false } @@ -527,8 +527,8 @@ func (o *InstanceParameters) HasTlsProtocols() bool { return false } -// SetTlsProtocols gets a reference to the given []string and assigns it to the TlsProtocols field. -func (o *InstanceParameters) SetTlsProtocols(v []string) { +// SetTlsProtocols gets a reference to the given []InstanceParametersTlsProtocolsInner and assigns it to the TlsProtocols field. +func (o *InstanceParameters) SetTlsProtocols(v []InstanceParametersTlsProtocolsInner) { o.TlsProtocols = v } diff --git a/services/opensearch/v1api/model_instance_parameters_java_garbage_collector.go b/services/opensearch/v1api/model_instance_parameters_java_garbage_collector.go new file mode 100644 index 000000000..c6040f718 --- /dev/null +++ b/services/opensearch/v1api/model_instance_parameters_java_garbage_collector.go @@ -0,0 +1,117 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersJavaGarbageCollector the model 'InstanceParametersJavaGarbageCollector' +type InstanceParametersJavaGarbageCollector string + +// List of InstanceParameters_java_garbage_collector +const ( + INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_SERIAL_GC InstanceParametersJavaGarbageCollector = "UseSerialGC" + INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_PARALLEL_GC InstanceParametersJavaGarbageCollector = "UseParallelGC" + INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_PARALLEL_OLD_GC InstanceParametersJavaGarbageCollector = "UseParallelOldGC" + INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_USE_G1_GC InstanceParametersJavaGarbageCollector = "UseG1GC" + INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_UNKNOWN_DEFAULT_OPEN_API InstanceParametersJavaGarbageCollector = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersJavaGarbageCollector enum +var AllowedInstanceParametersJavaGarbageCollectorEnumValues = []InstanceParametersJavaGarbageCollector{ + "UseSerialGC", + "UseParallelGC", + "UseParallelOldGC", + "UseG1GC", + "unknown_default_open_api", +} + +func (v *InstanceParametersJavaGarbageCollector) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersJavaGarbageCollector(value) + for _, existing := range AllowedInstanceParametersJavaGarbageCollectorEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSJAVAGARBAGECOLLECTOR_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersJavaGarbageCollectorFromValue returns a pointer to a valid InstanceParametersJavaGarbageCollector +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersJavaGarbageCollectorFromValue(v string) (*InstanceParametersJavaGarbageCollector, error) { + ev := InstanceParametersJavaGarbageCollector(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersJavaGarbageCollector: valid values are %v", v, AllowedInstanceParametersJavaGarbageCollectorEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersJavaGarbageCollector) IsValid() bool { + for _, existing := range AllowedInstanceParametersJavaGarbageCollectorEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_java_garbage_collector value +func (v InstanceParametersJavaGarbageCollector) Ptr() *InstanceParametersJavaGarbageCollector { + return &v +} + +type NullableInstanceParametersJavaGarbageCollector struct { + value *InstanceParametersJavaGarbageCollector + isSet bool +} + +func (v NullableInstanceParametersJavaGarbageCollector) Get() *InstanceParametersJavaGarbageCollector { + return v.value +} + +func (v *NullableInstanceParametersJavaGarbageCollector) Set(val *InstanceParametersJavaGarbageCollector) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersJavaGarbageCollector) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersJavaGarbageCollector) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersJavaGarbageCollector(val *InstanceParametersJavaGarbageCollector) *NullableInstanceParametersJavaGarbageCollector { + return &NullableInstanceParametersJavaGarbageCollector{value: val, isSet: true} +} + +func (v NullableInstanceParametersJavaGarbageCollector) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersJavaGarbageCollector) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v1api/model_instance_parameters_plugins_inner.go b/services/opensearch/v1api/model_instance_parameters_plugins_inner.go new file mode 100644 index 000000000..5819003a9 --- /dev/null +++ b/services/opensearch/v1api/model_instance_parameters_plugins_inner.go @@ -0,0 +1,115 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersPluginsInner the model 'InstanceParametersPluginsInner' +type InstanceParametersPluginsInner string + +// List of InstanceParameters_plugins_inner +const ( + INSTANCEPARAMETERSPLUGINSINNER_REPOSITORY_S3 InstanceParametersPluginsInner = "repository-s3" + INSTANCEPARAMETERSPLUGINSINNER_REPOSITORY_AZURE InstanceParametersPluginsInner = "repository-azure" + INSTANCEPARAMETERSPLUGINSINNER_ANALYSIS_PHONETIC InstanceParametersPluginsInner = "analysis-phonetic" + INSTANCEPARAMETERSPLUGINSINNER_UNKNOWN_DEFAULT_OPEN_API InstanceParametersPluginsInner = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersPluginsInner enum +var AllowedInstanceParametersPluginsInnerEnumValues = []InstanceParametersPluginsInner{ + "repository-s3", + "repository-azure", + "analysis-phonetic", + "unknown_default_open_api", +} + +func (v *InstanceParametersPluginsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersPluginsInner(value) + for _, existing := range AllowedInstanceParametersPluginsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSPLUGINSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersPluginsInnerFromValue returns a pointer to a valid InstanceParametersPluginsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersPluginsInnerFromValue(v string) (*InstanceParametersPluginsInner, error) { + ev := InstanceParametersPluginsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersPluginsInner: valid values are %v", v, AllowedInstanceParametersPluginsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersPluginsInner) IsValid() bool { + for _, existing := range AllowedInstanceParametersPluginsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_plugins_inner value +func (v InstanceParametersPluginsInner) Ptr() *InstanceParametersPluginsInner { + return &v +} + +type NullableInstanceParametersPluginsInner struct { + value *InstanceParametersPluginsInner + isSet bool +} + +func (v NullableInstanceParametersPluginsInner) Get() *InstanceParametersPluginsInner { + return v.value +} + +func (v *NullableInstanceParametersPluginsInner) Set(val *InstanceParametersPluginsInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersPluginsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersPluginsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersPluginsInner(val *InstanceParametersPluginsInner) *NullableInstanceParametersPluginsInner { + return &NullableInstanceParametersPluginsInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersPluginsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersPluginsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v1api/model_instance_parameters_tls_protocols_inner.go b/services/opensearch/v1api/model_instance_parameters_tls_protocols_inner.go new file mode 100644 index 000000000..24784725e --- /dev/null +++ b/services/opensearch/v1api/model_instance_parameters_tls_protocols_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersTlsProtocolsInner the model 'InstanceParametersTlsProtocolsInner' +type InstanceParametersTlsProtocolsInner string + +// List of InstanceParameters_tls_protocols_inner +const ( + INSTANCEPARAMETERSTLSPROTOCOLSINNER_TLSV1_2 InstanceParametersTlsProtocolsInner = "TLSv1.2" + INSTANCEPARAMETERSTLSPROTOCOLSINNER_TLSV1_3 InstanceParametersTlsProtocolsInner = "TLSv1.3" + INSTANCEPARAMETERSTLSPROTOCOLSINNER_UNKNOWN_DEFAULT_OPEN_API InstanceParametersTlsProtocolsInner = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersTlsProtocolsInner enum +var AllowedInstanceParametersTlsProtocolsInnerEnumValues = []InstanceParametersTlsProtocolsInner{ + "TLSv1.2", + "TLSv1.3", + "unknown_default_open_api", +} + +func (v *InstanceParametersTlsProtocolsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersTlsProtocolsInner(value) + for _, existing := range AllowedInstanceParametersTlsProtocolsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSTLSPROTOCOLSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersTlsProtocolsInnerFromValue returns a pointer to a valid InstanceParametersTlsProtocolsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersTlsProtocolsInnerFromValue(v string) (*InstanceParametersTlsProtocolsInner, error) { + ev := InstanceParametersTlsProtocolsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersTlsProtocolsInner: valid values are %v", v, AllowedInstanceParametersTlsProtocolsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersTlsProtocolsInner) IsValid() bool { + for _, existing := range AllowedInstanceParametersTlsProtocolsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_tls_protocols_inner value +func (v InstanceParametersTlsProtocolsInner) Ptr() *InstanceParametersTlsProtocolsInner { + return &v +} + +type NullableInstanceParametersTlsProtocolsInner struct { + value *InstanceParametersTlsProtocolsInner + isSet bool +} + +func (v NullableInstanceParametersTlsProtocolsInner) Get() *InstanceParametersTlsProtocolsInner { + return v.value +} + +func (v *NullableInstanceParametersTlsProtocolsInner) Set(val *InstanceParametersTlsProtocolsInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersTlsProtocolsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersTlsProtocolsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersTlsProtocolsInner(val *InstanceParametersTlsProtocolsInner) *NullableInstanceParametersTlsProtocolsInner { + return &NullableInstanceParametersTlsProtocolsInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersTlsProtocolsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersTlsProtocolsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/opensearch/v1api/model_instance_status.go b/services/opensearch/v1api/model_instance_status.go new file mode 100644 index 000000000..ee66b6ba6 --- /dev/null +++ b/services/opensearch/v1api/model_instance_status.go @@ -0,0 +1,121 @@ +/* +STACKIT Opensearch API + +The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus the model 'InstanceStatus' +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_FAILED InstanceStatus = "failed" + INSTANCESTATUS_STOPPED InstanceStatus = "stopped" + INSTANCESTATUS_CREATING InstanceStatus = "creating" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UPDATING InstanceStatus = "updating" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "active", + "failed", + "stopped", + "creating", + "deleting", + "updating", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 8b8e948df6375bb6f9bc03bc5539ce78b38fd7b6 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:09:16 +0200 Subject: [PATCH 32/66] chore(opensearch): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/opensearch/CHANGELOG.md | 3 ++ services/opensearch/VERSION | 2 +- services/opensearch/v1api/wait/wait.go | 12 ++++---- services/opensearch/v1api/wait/wait_test.go | 32 ++++++++++----------- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e4ed3f9d..2c252710c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -300,6 +300,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v0.27.2](services/opensearch/CHANGELOG.md#v0272) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` + - [v0.28.0](services/opensearch/CHANGELOG.md#v0280) + - **Feature:** Introduce enums for various attributes - `postgresflex`: - [v1.6.3](services/postgresflex/CHANGELOG.md#v163) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/opensearch/CHANGELOG.md b/services/opensearch/CHANGELOG.md index b78f283bb..3c31f17af 100644 --- a/services/opensearch/CHANGELOG.md +++ b/services/opensearch/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.28.0 +- **Feature:** Introduce enums for various attributes + ## v0.27.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` diff --git a/services/opensearch/VERSION b/services/opensearch/VERSION index 95be22acf..31950daca 100644 --- a/services/opensearch/VERSION +++ b/services/opensearch/VERSION @@ -1 +1 @@ -v0.27.2 \ No newline at end of file +v0.28.0 diff --git a/services/opensearch/v1api/wait/wait.go b/services/opensearch/v1api/wait/wait.go index b3fd9318c..793b276be 100644 --- a/services/opensearch/v1api/wait/wait.go +++ b/services/opensearch/v1api/wait/wait.go @@ -36,9 +36,9 @@ func CreateInstanceWaitHandler(ctx context.Context, a opensearch.DefaultAPI, pro return false, nil, fmt.Errorf("create failed for instance with id %s. The response is not valid: the status are missing", instanceId) } switch *s.Status { - case INSTANCESTATUS_ACTIVE: + case opensearch.INSTANCESTATUS_ACTIVE: return true, s, nil - case INSTANCESTATUS_FAILED: + case opensearch.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("create failed for instance with id %s: %s", instanceId, s.LastOperation.Description) } return false, nil, nil @@ -58,9 +58,9 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, a opensearch.DefaultA return false, nil, fmt.Errorf("update failed for instance with id %s. The response is not valid: the instance id or the status are missing", instanceId) } switch *s.Status { - case INSTANCESTATUS_ACTIVE: + case opensearch.INSTANCESTATUS_ACTIVE: return true, s, nil - case INSTANCESTATUS_FAILED: + case opensearch.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("update failed for instance with id %s: %s", instanceId, s.LastOperation.Description) } return false, nil, nil @@ -77,10 +77,10 @@ func DeleteInstanceWaitHandler(ctx context.Context, a opensearch.DefaultAPI, pro if s.Status == nil { return false, nil, fmt.Errorf("delete failed for instance with id %s. The response is not valid: The status is missing", instanceId) } - if *s.Status != INSTANCESTATUS_DELETING { + if *s.Status != opensearch.INSTANCESTATUS_DELETING { return false, nil, nil } - if *s.Status == INSTANCESTATUS_ACTIVE { + if *s.Status == opensearch.INSTANCESTATUS_ACTIVE { if strings.Contains(s.LastOperation.Description, "DeleteFailed") || strings.Contains(s.LastOperation.Description, "failed") { return true, nil, fmt.Errorf("instance was deleted successfully but has errors: %s", s.LastOperation.Description) } diff --git a/services/opensearch/v1api/wait/wait_test.go b/services/opensearch/v1api/wait/wait_test.go index b2c675830..be347b641 100644 --- a/services/opensearch/v1api/wait/wait_test.go +++ b/services/opensearch/v1api/wait/wait_test.go @@ -17,8 +17,8 @@ type mockSettings struct { instanceGetFails bool instanceDeletionSucceedsWithErrors bool instanceResourceId string - instanceResourceOperation string - instanceResourceState *string + instanceResourceOperation opensearch.InstanceLastOperationType + instanceResourceState *opensearch.InstanceStatus instanceResourceDescription string credentialGetFails bool @@ -36,7 +36,7 @@ func newAPIMock(settings *mockSettings) opensearch.DefaultAPI { } } - if settings.instanceResourceOperation == INSTANCELASTOPERATIONTYPE_DELETE && settings.instanceResourceState != nil && *settings.instanceResourceState == INSTANCESTATUS_ACTIVE { + if settings.instanceResourceOperation == opensearch.INSTANCELASTOPERATIONTYPE_DELETE && settings.instanceResourceState != nil && *settings.instanceResourceState == opensearch.INSTANCESTATUS_ACTIVE { if settings.instanceDeletionSucceedsWithErrors { return &opensearch.Instance{ InstanceId: &settings.instanceResourceId, @@ -81,21 +81,21 @@ func TestCreateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState *string + resourceState *opensearch.InstanceStatus wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: opensearch.INSTANCESTATUS_ACTIVE.Ptr(), wantErr: false, wantResp: true, }, { desc: "create_failed", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: opensearch.INSTANCESTATUS_FAILED.Ptr(), wantErr: true, wantResp: true, }, @@ -108,7 +108,7 @@ func TestCreateInstanceWaitHandler(t *testing.T) { { desc: "timeout", getFails: false, - resourceState: utils.Ptr("ANOTHER STATE"), + resourceState: opensearch.InstanceStatus("ANOTHER STATE").Ptr(), wantErr: true, wantResp: false, }, @@ -152,21 +152,21 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState *string + resourceState *opensearch.InstanceStatus wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: opensearch.INSTANCESTATUS_ACTIVE.Ptr(), wantErr: false, wantResp: true, }, { desc: "update_failed", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: opensearch.INSTANCESTATUS_FAILED.Ptr(), wantErr: true, wantResp: true, }, @@ -179,7 +179,7 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { { desc: "timeout", getFails: false, - resourceState: utils.Ptr("ANOTHER STATE"), + resourceState: opensearch.InstanceStatus("ANOTHER STATE").Ptr(), wantErr: true, wantResp: false, }, @@ -223,7 +223,7 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc string getFails bool deleteSucceeedsWithErrors bool - resourceState *string + resourceState *opensearch.InstanceStatus resourceDescription string wantErr bool }{ @@ -231,20 +231,20 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc: "delete_succeeded", getFails: false, deleteSucceeedsWithErrors: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: opensearch.INSTANCESTATUS_ACTIVE.Ptr(), wantErr: false, }, { desc: "delete_failed", getFails: false, deleteSucceeedsWithErrors: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: opensearch.INSTANCESTATUS_FAILED.Ptr(), wantErr: true, }, { desc: "delete_succeeds_with_errors", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: opensearch.INSTANCESTATUS_ACTIVE.Ptr(), deleteSucceeedsWithErrors: true, resourceDescription: "Deleting resource: cf failed with error: DeleteFailed", wantErr: true, @@ -265,7 +265,7 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { instanceGetFails: tt.getFails, instanceDeletionSucceedsWithErrors: tt.deleteSucceeedsWithErrors, instanceResourceId: instanceId, - instanceResourceOperation: INSTANCELASTOPERATIONTYPE_DELETE, + instanceResourceOperation: opensearch.INSTANCELASTOPERATIONTYPE_DELETE, instanceResourceDescription: tt.resourceDescription, instanceResourceState: tt.resourceState, }) From 7fde917d406246640bbe760c78eb10397248ece9 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:10:24 +0200 Subject: [PATCH 33/66] refac(postgresflex): introduce inline enums --- services/postgresflex/v2api/api_default.go | 156 ++++++++--------- .../postgresflex/v2api/api_default_mock.go | 52 +++--- .../model_clone_instance_region_parameter.go | 112 ++++++++++++ .../model_create_database_region_parameter.go | 112 ++++++++++++ .../model_create_instance_region_parameter.go | 112 ++++++++++++ .../model_create_user_region_parameter.go | 112 ++++++++++++ .../model_delete_database_region_parameter.go | 112 ++++++++++++ .../model_delete_instance_region_parameter.go | 112 ++++++++++++ .../model_delete_user_region_parameter.go | 112 ++++++++++++ ..._force_delete_instance_region_parameter.go | 112 ++++++++++++ .../model_get_backup_region_parameter.go | 112 ++++++++++++ .../model_get_instance_region_parameter.go | 112 ++++++++++++ .../v2api/model_get_user_region_parameter.go | 112 ++++++++++++ .../model_list_backups_region_parameter.go | 112 ++++++++++++ ...st_database_parameters_region_parameter.go | 112 ++++++++++++ .../model_list_databases_region_parameter.go | 112 ++++++++++++ .../model_list_flavors_region_parameter.go | 112 ++++++++++++ .../model_list_instances_region_parameter.go | 112 ++++++++++++ .../model_list_metrics_region_parameter.go | 112 ++++++++++++ .../model_list_storages_region_parameter.go | 112 ++++++++++++ .../model_list_users_region_parameter.go | 112 ++++++++++++ .../model_list_versions_region_parameter.go | 112 ++++++++++++ ...artial_update_instance_region_parameter.go | 112 ++++++++++++ ...el_partial_update_user_region_parameter.go | 112 ++++++++++++ .../model_reset_user_region_parameter.go | 112 ++++++++++++ ...update_backup_schedule_region_parameter.go | 112 ++++++++++++ .../model_update_instance_region_parameter.go | 112 ++++++++++++ .../model_update_user_region_parameter.go | 112 ++++++++++++ .../postgresflex/v3alpha1api/api_default.go | 162 +++++++++--------- .../v3alpha1api/api_default_mock.go | 54 +++--- ...el_get_flavors_request_region_parameter.go | 112 ++++++++++++ 31 files changed, 3236 insertions(+), 212 deletions(-) create mode 100644 services/postgresflex/v2api/model_clone_instance_region_parameter.go create mode 100644 services/postgresflex/v2api/model_create_database_region_parameter.go create mode 100644 services/postgresflex/v2api/model_create_instance_region_parameter.go create mode 100644 services/postgresflex/v2api/model_create_user_region_parameter.go create mode 100644 services/postgresflex/v2api/model_delete_database_region_parameter.go create mode 100644 services/postgresflex/v2api/model_delete_instance_region_parameter.go create mode 100644 services/postgresflex/v2api/model_delete_user_region_parameter.go create mode 100644 services/postgresflex/v2api/model_force_delete_instance_region_parameter.go create mode 100644 services/postgresflex/v2api/model_get_backup_region_parameter.go create mode 100644 services/postgresflex/v2api/model_get_instance_region_parameter.go create mode 100644 services/postgresflex/v2api/model_get_user_region_parameter.go create mode 100644 services/postgresflex/v2api/model_list_backups_region_parameter.go create mode 100644 services/postgresflex/v2api/model_list_database_parameters_region_parameter.go create mode 100644 services/postgresflex/v2api/model_list_databases_region_parameter.go create mode 100644 services/postgresflex/v2api/model_list_flavors_region_parameter.go create mode 100644 services/postgresflex/v2api/model_list_instances_region_parameter.go create mode 100644 services/postgresflex/v2api/model_list_metrics_region_parameter.go create mode 100644 services/postgresflex/v2api/model_list_storages_region_parameter.go create mode 100644 services/postgresflex/v2api/model_list_users_region_parameter.go create mode 100644 services/postgresflex/v2api/model_list_versions_region_parameter.go create mode 100644 services/postgresflex/v2api/model_partial_update_instance_region_parameter.go create mode 100644 services/postgresflex/v2api/model_partial_update_user_region_parameter.go create mode 100644 services/postgresflex/v2api/model_reset_user_region_parameter.go create mode 100644 services/postgresflex/v2api/model_update_backup_schedule_region_parameter.go create mode 100644 services/postgresflex/v2api/model_update_instance_region_parameter.go create mode 100644 services/postgresflex/v2api/model_update_user_region_parameter.go create mode 100644 services/postgresflex/v3alpha1api/model_get_flavors_request_region_parameter.go diff --git a/services/postgresflex/v2api/api_default.go b/services/postgresflex/v2api/api_default.go index 5d9f7ac83..799bf5b7a 100644 --- a/services/postgresflex/v2api/api_default.go +++ b/services/postgresflex/v2api/api_default.go @@ -35,7 +35,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiCloneInstanceRequest */ - CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest + CloneInstance(ctx context.Context, projectId string, region CloneInstanceRegionParameter, instanceId string) ApiCloneInstanceRequest // CloneInstanceExecute executes the request // @return CloneInstanceResponse @@ -53,7 +53,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiCreateDatabaseRequest */ - CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest + CreateDatabase(ctx context.Context, projectId string, region CreateDatabaseRegionParameter, instanceId string) ApiCreateDatabaseRequest // CreateDatabaseExecute executes the request // @return InstanceCreateDatabaseResponse @@ -69,7 +69,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateInstanceRequest */ - CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest // CreateInstanceExecute executes the request // @return CreateInstanceResponse @@ -86,7 +86,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiCreateUserRequest */ - CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest + CreateUser(ctx context.Context, projectId string, region CreateUserRegionParameter, instanceId string) ApiCreateUserRequest // CreateUserExecute executes the request // @return CreateUserResponse @@ -104,7 +104,7 @@ type DefaultAPI interface { @param databaseId Database ID @return ApiDeleteDatabaseRequest */ - DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest + DeleteDatabase(ctx context.Context, projectId string, region DeleteDatabaseRegionParameter, instanceId string, databaseId string) ApiDeleteDatabaseRequest // DeleteDatabaseExecute executes the request DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error @@ -120,7 +120,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiDeleteInstanceRequest */ - DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, region DeleteInstanceRegionParameter, instanceId string) ApiDeleteInstanceRequest // DeleteInstanceExecute executes the request DeleteInstanceExecute(r ApiDeleteInstanceRequest) error @@ -137,7 +137,7 @@ type DefaultAPI interface { @param userId User ID @return ApiDeleteUserRequest */ - DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest + DeleteUser(ctx context.Context, projectId string, region DeleteUserRegionParameter, instanceId string, userId string) ApiDeleteUserRequest // DeleteUserExecute executes the request DeleteUserExecute(r ApiDeleteUserRequest) error @@ -153,7 +153,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiForceDeleteInstanceRequest */ - ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest + ForceDeleteInstance(ctx context.Context, projectId string, region ForceDeleteInstanceRegionParameter, instanceId string) ApiForceDeleteInstanceRequest // ForceDeleteInstanceExecute executes the request ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error @@ -170,7 +170,7 @@ type DefaultAPI interface { @param backupId Backup ID @return ApiGetBackupRequest */ - GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest + GetBackup(ctx context.Context, projectId string, region GetBackupRegionParameter, instanceId string, backupId string) ApiGetBackupRequest // GetBackupExecute executes the request // @return GetBackupResponse @@ -187,7 +187,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiGetInstanceRequest */ - GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, region GetInstanceRegionParameter, instanceId string) ApiGetInstanceRequest // GetInstanceExecute executes the request // @return InstanceResponse @@ -205,7 +205,7 @@ type DefaultAPI interface { @param userId User ID @return ApiGetUserRequest */ - GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest + GetUser(ctx context.Context, projectId string, region GetUserRegionParameter, instanceId string, userId string) ApiGetUserRequest // GetUserExecute executes the request // @return GetUserResponse @@ -222,7 +222,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiListBackupsRequest */ - ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, region ListBackupsRegionParameter, instanceId string) ApiListBackupsRequest // ListBackupsExecute executes the request // @return ListBackupsResponse @@ -239,7 +239,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiListDatabaseParametersRequest */ - ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest + ListDatabaseParameters(ctx context.Context, projectId string, region ListDatabaseParametersRegionParameter, instanceId string) ApiListDatabaseParametersRequest // ListDatabaseParametersExecute executes the request // @return PostgresDatabaseParameterResponse @@ -256,7 +256,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiListDatabasesRequest */ - ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest + ListDatabases(ctx context.Context, projectId string, region ListDatabasesRegionParameter, instanceId string) ApiListDatabasesRequest // ListDatabasesExecute executes the request // @return InstanceListDatabasesResponse @@ -272,7 +272,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListFlavorsRequest */ - ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest + ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest // ListFlavorsExecute executes the request // @return ListFlavorsResponse @@ -288,7 +288,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListInstancesRequest */ - ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest // ListInstancesExecute executes the request // @return ListInstancesResponse @@ -306,7 +306,7 @@ type DefaultAPI interface { @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. @return ApiListMetricsRequest */ - ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest + ListMetrics(ctx context.Context, projectId string, region ListMetricsRegionParameter, instanceId string, metric string) ApiListMetricsRequest // ListMetricsExecute executes the request // @return InstanceMetricsResponse @@ -323,7 +323,7 @@ type DefaultAPI interface { @param flavorId Flavor ID @return ApiListStoragesRequest */ - ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest + ListStorages(ctx context.Context, projectId string, region ListStoragesRegionParameter, flavorId string) ApiListStoragesRequest // ListStoragesExecute executes the request // @return ListStoragesResponse @@ -340,7 +340,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiListUsersRequest */ - ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest + ListUsers(ctx context.Context, projectId string, region ListUsersRegionParameter, instanceId string) ApiListUsersRequest // ListUsersExecute executes the request // @return ListUsersResponse @@ -356,7 +356,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListVersionsRequest */ - ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest + ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest // ListVersionsExecute executes the request // @return ListVersionsResponse @@ -373,7 +373,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiPartialUpdateInstanceRequest */ - PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, region PartialUpdateInstanceRegionParameter, instanceId string) ApiPartialUpdateInstanceRequest // PartialUpdateInstanceExecute executes the request // @return PartialUpdateInstanceResponse @@ -391,7 +391,7 @@ type DefaultAPI interface { @param userId The ID of the user in the database @return ApiPartialUpdateUserRequest */ - PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest + PartialUpdateUser(ctx context.Context, projectId string, region PartialUpdateUserRegionParameter, instanceId string, userId string) ApiPartialUpdateUserRequest // PartialUpdateUserExecute executes the request PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error @@ -408,7 +408,7 @@ type DefaultAPI interface { @param userId user ID @return ApiResetUserRequest */ - ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest + ResetUser(ctx context.Context, projectId string, region ResetUserRegionParameter, instanceId string, userId string) ApiResetUserRequest // ResetUserExecute executes the request // @return ResetUserResponse @@ -425,7 +425,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiUpdateBackupScheduleRequest */ - UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest + UpdateBackupSchedule(ctx context.Context, projectId string, region UpdateBackupScheduleRegionParameter, instanceId string) ApiUpdateBackupScheduleRequest // UpdateBackupScheduleExecute executes the request UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error @@ -441,7 +441,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiUpdateInstanceRequest */ - UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest + UpdateInstance(ctx context.Context, projectId string, region UpdateInstanceRegionParameter, instanceId string) ApiUpdateInstanceRequest // UpdateInstanceExecute executes the request // @return PartialUpdateInstanceResponse @@ -459,7 +459,7 @@ type DefaultAPI interface { @param userId The ID of the user in the database @return ApiUpdateUserRequest */ - UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest + UpdateUser(ctx context.Context, projectId string, region UpdateUserRegionParameter, instanceId string, userId string) ApiUpdateUserRequest // UpdateUserExecute executes the request UpdateUserExecute(r ApiUpdateUserRequest) error @@ -472,7 +472,7 @@ type ApiCloneInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region CloneInstanceRegionParameter instanceId string cloneInstancePayload *CloneInstancePayload } @@ -498,7 +498,7 @@ Clone an existing instance of a postgres database to a new destination instance @param instanceId Instance ID @return ApiCloneInstanceRequest */ -func (a *DefaultAPIService) CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest { +func (a *DefaultAPIService) CloneInstance(ctx context.Context, projectId string, region CloneInstanceRegionParameter, instanceId string) ApiCloneInstanceRequest { return ApiCloneInstanceRequest{ ApiService: a, ctx: ctx, @@ -629,7 +629,7 @@ type ApiCreateDatabaseRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region CreateDatabaseRegionParameter instanceId string createDatabasePayload *CreateDatabasePayload } @@ -656,7 +656,7 @@ Note: The name of a valid user must be provided in the "options" map field using @param instanceId Instance ID @return ApiCreateDatabaseRequest */ -func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { +func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, region CreateDatabaseRegionParameter, instanceId string) ApiCreateDatabaseRequest { return ApiCreateDatabaseRequest{ ApiService: a, ctx: ctx, @@ -787,7 +787,7 @@ type ApiCreateInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region CreateInstanceRegionParameter createInstancePayload *CreateInstancePayload } @@ -811,7 +811,7 @@ Create a new instance of a postgres database @param region The region which should be addressed @return ApiCreateInstanceRequest */ -func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ ApiService: a, ctx: ctx, @@ -940,7 +940,7 @@ type ApiCreateUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region CreateUserRegionParameter instanceId string createUserPayload *CreateUserPayload } @@ -966,7 +966,7 @@ Create user for an instance @param instanceId Instance ID @return ApiCreateUserRequest */ -func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest { +func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, region CreateUserRegionParameter, instanceId string) ApiCreateUserRequest { return ApiCreateUserRequest{ ApiService: a, ctx: ctx, @@ -1097,7 +1097,7 @@ type ApiDeleteDatabaseRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region DeleteDatabaseRegionParameter instanceId string databaseId string } @@ -1118,7 +1118,7 @@ Delete database for an instance @param databaseId Database ID @return ApiDeleteDatabaseRequest */ -func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { +func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, region DeleteDatabaseRegionParameter, instanceId string, databaseId string) ApiDeleteDatabaseRequest { return ApiDeleteDatabaseRequest{ ApiService: a, ctx: ctx, @@ -1233,7 +1233,7 @@ type ApiDeleteInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region DeleteInstanceRegionParameter instanceId string } @@ -1252,7 +1252,7 @@ Delete available instance @param instanceId Instance ID @return ApiDeleteInstanceRequest */ -func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest { +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, region DeleteInstanceRegionParameter, instanceId string) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -1386,7 +1386,7 @@ type ApiDeleteUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region DeleteUserRegionParameter instanceId string userId string } @@ -1407,7 +1407,7 @@ Delete user for an instance @param userId User ID @return ApiDeleteUserRequest */ -func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest { +func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, region DeleteUserRegionParameter, instanceId string, userId string) ApiDeleteUserRequest { return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, @@ -1522,7 +1522,7 @@ type ApiForceDeleteInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ForceDeleteInstanceRegionParameter instanceId string } @@ -1541,7 +1541,7 @@ Forces the deletion of an delayed deleted instance @param instanceId Instance ID @return ApiForceDeleteInstanceRequest */ -func (a *DefaultAPIService) ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest { +func (a *DefaultAPIService) ForceDeleteInstance(ctx context.Context, projectId string, region ForceDeleteInstanceRegionParameter, instanceId string) ApiForceDeleteInstanceRequest { return ApiForceDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -1675,7 +1675,7 @@ type ApiGetBackupRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetBackupRegionParameter instanceId string backupId string } @@ -1696,7 +1696,7 @@ Get specific available backup @param backupId Backup ID @return ApiGetBackupRequest */ -func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest { +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, region GetBackupRegionParameter, instanceId string, backupId string) ApiGetBackupRequest { return ApiGetBackupRequest{ ApiService: a, ctx: ctx, @@ -1824,7 +1824,7 @@ type ApiGetInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetInstanceRegionParameter instanceId string } @@ -1843,7 +1843,7 @@ Get specific available instances @param instanceId Instance ID @return ApiGetInstanceRequest */ -func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, region GetInstanceRegionParameter, instanceId string) ApiGetInstanceRequest { return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, @@ -1969,7 +1969,7 @@ type ApiGetUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetUserRegionParameter instanceId string userId string } @@ -1990,7 +1990,7 @@ Get specific available user for an instance @param userId User ID @return ApiGetUserRequest */ -func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest { +func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, region GetUserRegionParameter, instanceId string, userId string) ApiGetUserRequest { return ApiGetUserRequest{ ApiService: a, ctx: ctx, @@ -2118,7 +2118,7 @@ type ApiListBackupsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListBackupsRegionParameter instanceId string } @@ -2137,7 +2137,7 @@ List all backups which are available for a specific instance @param instanceId Instance ID @return ApiListBackupsRequest */ -func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, region ListBackupsRegionParameter, instanceId string) ApiListBackupsRequest { return ApiListBackupsRequest{ ApiService: a, ctx: ctx, @@ -2263,7 +2263,7 @@ type ApiListDatabaseParametersRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListDatabaseParametersRegionParameter instanceId string } @@ -2282,7 +2282,7 @@ List available databases parameter @param instanceId Instance ID @return ApiListDatabaseParametersRequest */ -func (a *DefaultAPIService) ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest { +func (a *DefaultAPIService) ListDatabaseParameters(ctx context.Context, projectId string, region ListDatabaseParametersRegionParameter, instanceId string) ApiListDatabaseParametersRequest { return ApiListDatabaseParametersRequest{ ApiService: a, ctx: ctx, @@ -2408,7 +2408,7 @@ type ApiListDatabasesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListDatabasesRegionParameter instanceId string } @@ -2427,7 +2427,7 @@ List available databases for an instance @param instanceId Instance ID @return ApiListDatabasesRequest */ -func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { +func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, region ListDatabasesRegionParameter, instanceId string) ApiListDatabasesRequest { return ApiListDatabasesRequest{ ApiService: a, ctx: ctx, @@ -2553,7 +2553,7 @@ type ApiListFlavorsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListFlavorsRegionParameter } func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { @@ -2570,7 +2570,7 @@ Get available flavors for a specific projectID @param region The region which should be addressed @return ApiListFlavorsRequest */ -func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { +func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest { return ApiListFlavorsRequest{ ApiService: a, ctx: ctx, @@ -2694,7 +2694,7 @@ type ApiListInstancesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListInstancesRegionParameter } func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { @@ -2711,7 +2711,7 @@ List available instances @param region The region which should be addressed @return ApiListInstancesRequest */ -func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest { return ApiListInstancesRequest{ ApiService: a, ctx: ctx, @@ -2835,7 +2835,7 @@ type ApiListMetricsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListMetricsRegionParameter instanceId string metric string granularity *string @@ -2884,7 +2884,7 @@ Returns a metric for an instance. The metric will only be for the master pod if @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. @return ApiListMetricsRequest */ -func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest { +func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, region ListMetricsRegionParameter, instanceId string, metric string) ApiListMetricsRequest { return ApiListMetricsRequest{ ApiService: a, ctx: ctx, @@ -3046,7 +3046,7 @@ type ApiListStoragesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListStoragesRegionParameter flavorId string } @@ -3065,7 +3065,7 @@ Get available storages for a specific flavor @param flavorId Flavor ID @return ApiListStoragesRequest */ -func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest { +func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, region ListStoragesRegionParameter, flavorId string) ApiListStoragesRequest { return ApiListStoragesRequest{ ApiService: a, ctx: ctx, @@ -3191,7 +3191,7 @@ type ApiListUsersRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListUsersRegionParameter instanceId string } @@ -3210,7 +3210,7 @@ List available users for an instance @param instanceId Instance ID @return ApiListUsersRequest */ -func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { +func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, region ListUsersRegionParameter, instanceId string) ApiListUsersRequest { return ApiListUsersRequest{ ApiService: a, ctx: ctx, @@ -3336,7 +3336,7 @@ type ApiListVersionsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListVersionsRegionParameter instanceId *string } @@ -3360,7 +3360,7 @@ Get available versions for postgres database @param region The region which should be addressed @return ApiListVersionsRequest */ -func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { +func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest { return ApiListVersionsRequest{ ApiService: a, ctx: ctx, @@ -3487,7 +3487,7 @@ type ApiPartialUpdateInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region PartialUpdateInstanceRegionParameter instanceId string partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -3513,7 +3513,7 @@ Update available instance of a postgres database. Supported Versions are 12, 13, @param instanceId Instance ID @return ApiPartialUpdateInstanceRequest */ -func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, region PartialUpdateInstanceRegionParameter, instanceId string) ApiPartialUpdateInstanceRequest { return ApiPartialUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -3644,7 +3644,7 @@ type ApiPartialUpdateUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region PartialUpdateUserRegionParameter instanceId string userId string partialUpdateUserPayload *PartialUpdateUserPayload @@ -3672,7 +3672,7 @@ Update user for an instance. Only the roles are updatable. @param userId The ID of the user in the database @return ApiPartialUpdateUserRequest */ -func (a *DefaultAPIService) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest { +func (a *DefaultAPIService) PartialUpdateUser(ctx context.Context, projectId string, region PartialUpdateUserRegionParameter, instanceId string, userId string) ApiPartialUpdateUserRequest { return ApiPartialUpdateUserRequest{ ApiService: a, ctx: ctx, @@ -3799,7 +3799,7 @@ type ApiResetUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ResetUserRegionParameter instanceId string userId string } @@ -3820,7 +3820,7 @@ Reset user password for a postgres instance @param userId user ID @return ApiResetUserRequest */ -func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest { +func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, region ResetUserRegionParameter, instanceId string, userId string) ApiResetUserRequest { return ApiResetUserRequest{ ApiService: a, ctx: ctx, @@ -3969,7 +3969,7 @@ type ApiUpdateBackupScheduleRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region UpdateBackupScheduleRegionParameter instanceId string updateBackupSchedulePayload *UpdateBackupSchedulePayload } @@ -3995,7 +3995,7 @@ Update backup schedule @param instanceId Instance ID @return ApiUpdateBackupScheduleRequest */ -func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest { +func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, region UpdateBackupScheduleRegionParameter, instanceId string) ApiUpdateBackupScheduleRequest { return ApiUpdateBackupScheduleRequest{ ApiService: a, ctx: ctx, @@ -4113,7 +4113,7 @@ type ApiUpdateInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region UpdateInstanceRegionParameter instanceId string updateInstancePayload *UpdateInstancePayload } @@ -4139,7 +4139,7 @@ Update available instance of a postgres database. Supported Versions are 12, 13, @param instanceId Instance ID @return ApiUpdateInstanceRequest */ -func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { +func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, region UpdateInstanceRegionParameter, instanceId string) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -4270,7 +4270,7 @@ type ApiUpdateUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region UpdateUserRegionParameter instanceId string userId string updateUserPayload *UpdateUserPayload @@ -4298,7 +4298,7 @@ Update user for an instance. Only the roles are updatable. @param userId The ID of the user in the database @return ApiUpdateUserRequest */ -func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest { +func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, region UpdateUserRegionParameter, instanceId string, userId string) ApiUpdateUserRequest { return ApiUpdateUserRequest{ ApiService: a, ctx: ctx, diff --git a/services/postgresflex/v2api/api_default_mock.go b/services/postgresflex/v2api/api_default_mock.go index 97b993ec6..e953c5990 100644 --- a/services/postgresflex/v2api/api_default_mock.go +++ b/services/postgresflex/v2api/api_default_mock.go @@ -75,7 +75,7 @@ type DefaultAPIServiceMock struct { UpdateUserExecuteMock *func(r ApiUpdateUserRequest) error } -func (a DefaultAPIServiceMock) CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest { +func (a DefaultAPIServiceMock) CloneInstance(ctx context.Context, projectId string, region CloneInstanceRegionParameter, instanceId string) ApiCloneInstanceRequest { return ApiCloneInstanceRequest{ ApiService: a, ctx: ctx, @@ -95,7 +95,7 @@ func (a DefaultAPIServiceMock) CloneInstanceExecute(r ApiCloneInstanceRequest) ( return (*a.CloneInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { +func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, region CreateDatabaseRegionParameter, instanceId string) ApiCreateDatabaseRequest { return ApiCreateDatabaseRequest{ ApiService: a, ctx: ctx, @@ -115,7 +115,7 @@ func (a DefaultAPIServiceMock) CreateDatabaseExecute(r ApiCreateDatabaseRequest) return (*a.CreateDatabaseExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ ApiService: a, ctx: ctx, @@ -134,7 +134,7 @@ func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) return (*a.CreateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest { +func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, region CreateUserRegionParameter, instanceId string) ApiCreateUserRequest { return ApiCreateUserRequest{ ApiService: a, ctx: ctx, @@ -154,7 +154,7 @@ func (a DefaultAPIServiceMock) CreateUserExecute(r ApiCreateUserRequest) (*Creat return (*a.CreateUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { +func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, region DeleteDatabaseRegionParameter, instanceId string, databaseId string) ApiDeleteDatabaseRequest { return ApiDeleteDatabaseRequest{ ApiService: a, ctx: ctx, @@ -174,7 +174,7 @@ func (a DefaultAPIServiceMock) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) return (*a.DeleteDatabaseExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest { +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, region DeleteInstanceRegionParameter, instanceId string) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -193,7 +193,7 @@ func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) return (*a.DeleteInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest { +func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, region DeleteUserRegionParameter, instanceId string, userId string) ApiDeleteUserRequest { return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, @@ -213,7 +213,7 @@ func (a DefaultAPIServiceMock) DeleteUserExecute(r ApiDeleteUserRequest) error { return (*a.DeleteUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest { +func (a DefaultAPIServiceMock) ForceDeleteInstance(ctx context.Context, projectId string, region ForceDeleteInstanceRegionParameter, instanceId string) ApiForceDeleteInstanceRequest { return ApiForceDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -232,7 +232,7 @@ func (a DefaultAPIServiceMock) ForceDeleteInstanceExecute(r ApiForceDeleteInstan return (*a.ForceDeleteInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest { +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, region GetBackupRegionParameter, instanceId string, backupId string) ApiGetBackupRequest { return ApiGetBackupRequest{ ApiService: a, ctx: ctx, @@ -253,7 +253,7 @@ func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*GetBack return (*a.GetBackupExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, region GetInstanceRegionParameter, instanceId string) ApiGetInstanceRequest { return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, @@ -273,7 +273,7 @@ func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Ins return (*a.GetInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest { +func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, region GetUserRegionParameter, instanceId string, userId string) ApiGetUserRequest { return ApiGetUserRequest{ ApiService: a, ctx: ctx, @@ -294,7 +294,7 @@ func (a DefaultAPIServiceMock) GetUserExecute(r ApiGetUserRequest) (*GetUserResp return (*a.GetUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, region ListBackupsRegionParameter, instanceId string) ApiListBackupsRequest { return ApiListBackupsRequest{ ApiService: a, ctx: ctx, @@ -314,7 +314,7 @@ func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*Lis return (*a.ListBackupsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest { +func (a DefaultAPIServiceMock) ListDatabaseParameters(ctx context.Context, projectId string, region ListDatabaseParametersRegionParameter, instanceId string) ApiListDatabaseParametersRequest { return ApiListDatabaseParametersRequest{ ApiService: a, ctx: ctx, @@ -334,7 +334,7 @@ func (a DefaultAPIServiceMock) ListDatabaseParametersExecute(r ApiListDatabasePa return (*a.ListDatabaseParametersExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { +func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, region ListDatabasesRegionParameter, instanceId string) ApiListDatabasesRequest { return ApiListDatabasesRequest{ ApiService: a, ctx: ctx, @@ -354,7 +354,7 @@ func (a DefaultAPIServiceMock) ListDatabasesExecute(r ApiListDatabasesRequest) ( return (*a.ListDatabasesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { +func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest { return ApiListFlavorsRequest{ ApiService: a, ctx: ctx, @@ -373,7 +373,7 @@ func (a DefaultAPIServiceMock) ListFlavorsExecute(r ApiListFlavorsRequest) (*Lis return (*a.ListFlavorsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest { return ApiListInstancesRequest{ ApiService: a, ctx: ctx, @@ -392,7 +392,7 @@ func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) ( return (*a.ListInstancesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest { +func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, region ListMetricsRegionParameter, instanceId string, metric string) ApiListMetricsRequest { return ApiListMetricsRequest{ ApiService: a, ctx: ctx, @@ -413,7 +413,7 @@ func (a DefaultAPIServiceMock) ListMetricsExecute(r ApiListMetricsRequest) (*Ins return (*a.ListMetricsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest { +func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, region ListStoragesRegionParameter, flavorId string) ApiListStoragesRequest { return ApiListStoragesRequest{ ApiService: a, ctx: ctx, @@ -433,7 +433,7 @@ func (a DefaultAPIServiceMock) ListStoragesExecute(r ApiListStoragesRequest) (*L return (*a.ListStoragesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { +func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, region ListUsersRegionParameter, instanceId string) ApiListUsersRequest { return ApiListUsersRequest{ ApiService: a, ctx: ctx, @@ -453,7 +453,7 @@ func (a DefaultAPIServiceMock) ListUsersExecute(r ApiListUsersRequest) (*ListUse return (*a.ListUsersExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { +func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest { return ApiListVersionsRequest{ ApiService: a, ctx: ctx, @@ -472,7 +472,7 @@ func (a DefaultAPIServiceMock) ListVersionsExecute(r ApiListVersionsRequest) (*L return (*a.ListVersionsExecuteMock)(r) } -func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, region PartialUpdateInstanceRegionParameter, instanceId string) ApiPartialUpdateInstanceRequest { return ApiPartialUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -492,7 +492,7 @@ func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateIn return (*a.PartialUpdateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest { +func (a DefaultAPIServiceMock) PartialUpdateUser(ctx context.Context, projectId string, region PartialUpdateUserRegionParameter, instanceId string, userId string) ApiPartialUpdateUserRequest { return ApiPartialUpdateUserRequest{ ApiService: a, ctx: ctx, @@ -512,7 +512,7 @@ func (a DefaultAPIServiceMock) PartialUpdateUserExecute(r ApiPartialUpdateUserRe return (*a.PartialUpdateUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest { +func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, region ResetUserRegionParameter, instanceId string, userId string) ApiResetUserRequest { return ApiResetUserRequest{ ApiService: a, ctx: ctx, @@ -533,7 +533,7 @@ func (a DefaultAPIServiceMock) ResetUserExecute(r ApiResetUserRequest) (*ResetUs return (*a.ResetUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest { +func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, region UpdateBackupScheduleRegionParameter, instanceId string) ApiUpdateBackupScheduleRequest { return ApiUpdateBackupScheduleRequest{ ApiService: a, ctx: ctx, @@ -552,7 +552,7 @@ func (a DefaultAPIServiceMock) UpdateBackupScheduleExecute(r ApiUpdateBackupSche return (*a.UpdateBackupScheduleExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { +func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, region UpdateInstanceRegionParameter, instanceId string) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -572,7 +572,7 @@ func (a DefaultAPIServiceMock) UpdateInstanceExecute(r ApiUpdateInstanceRequest) return (*a.UpdateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest { +func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, region UpdateUserRegionParameter, instanceId string, userId string) ApiUpdateUserRequest { return ApiUpdateUserRequest{ ApiService: a, ctx: ctx, diff --git a/services/postgresflex/v2api/model_clone_instance_region_parameter.go b/services/postgresflex/v2api/model_clone_instance_region_parameter.go new file mode 100644 index 000000000..d91075a93 --- /dev/null +++ b/services/postgresflex/v2api/model_clone_instance_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CloneInstanceRegionParameter the model 'CloneInstanceRegionParameter' +type CloneInstanceRegionParameter string + +// List of CloneInstance_region_parameter +const ( + CLONEINSTANCEREGIONPARAMETER_EU01 CloneInstanceRegionParameter = "eu01" + CLONEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CloneInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of CloneInstanceRegionParameter enum +var AllowedCloneInstanceRegionParameterEnumValues = []CloneInstanceRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *CloneInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CloneInstanceRegionParameter(value) + for _, existing := range AllowedCloneInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CLONEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCloneInstanceRegionParameterFromValue returns a pointer to a valid CloneInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCloneInstanceRegionParameterFromValue(v string) (*CloneInstanceRegionParameter, error) { + ev := CloneInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CloneInstanceRegionParameter: valid values are %v", v, AllowedCloneInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CloneInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedCloneInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CloneInstance_region_parameter value +func (v CloneInstanceRegionParameter) Ptr() *CloneInstanceRegionParameter { + return &v +} + +type NullableCloneInstanceRegionParameter struct { + value *CloneInstanceRegionParameter + isSet bool +} + +func (v NullableCloneInstanceRegionParameter) Get() *CloneInstanceRegionParameter { + return v.value +} + +func (v *NullableCloneInstanceRegionParameter) Set(val *CloneInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableCloneInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneInstanceRegionParameter(val *CloneInstanceRegionParameter) *NullableCloneInstanceRegionParameter { + return &NullableCloneInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableCloneInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_create_database_region_parameter.go b/services/postgresflex/v2api/model_create_database_region_parameter.go new file mode 100644 index 000000000..e850ebb70 --- /dev/null +++ b/services/postgresflex/v2api/model_create_database_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateDatabaseRegionParameter the model 'CreateDatabaseRegionParameter' +type CreateDatabaseRegionParameter string + +// List of CreateDatabase_region_parameter +const ( + CREATEDATABASEREGIONPARAMETER_EU01 CreateDatabaseRegionParameter = "eu01" + CREATEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateDatabaseRegionParameter = "unknown_default_open_api" +) + +// All allowed values of CreateDatabaseRegionParameter enum +var AllowedCreateDatabaseRegionParameterEnumValues = []CreateDatabaseRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *CreateDatabaseRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateDatabaseRegionParameter(value) + for _, existing := range AllowedCreateDatabaseRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateDatabaseRegionParameterFromValue returns a pointer to a valid CreateDatabaseRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateDatabaseRegionParameterFromValue(v string) (*CreateDatabaseRegionParameter, error) { + ev := CreateDatabaseRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateDatabaseRegionParameter: valid values are %v", v, AllowedCreateDatabaseRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateDatabaseRegionParameter) IsValid() bool { + for _, existing := range AllowedCreateDatabaseRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateDatabase_region_parameter value +func (v CreateDatabaseRegionParameter) Ptr() *CreateDatabaseRegionParameter { + return &v +} + +type NullableCreateDatabaseRegionParameter struct { + value *CreateDatabaseRegionParameter + isSet bool +} + +func (v NullableCreateDatabaseRegionParameter) Get() *CreateDatabaseRegionParameter { + return v.value +} + +func (v *NullableCreateDatabaseRegionParameter) Set(val *CreateDatabaseRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDatabaseRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDatabaseRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDatabaseRegionParameter(val *CreateDatabaseRegionParameter) *NullableCreateDatabaseRegionParameter { + return &NullableCreateDatabaseRegionParameter{value: val, isSet: true} +} + +func (v NullableCreateDatabaseRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDatabaseRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_create_instance_region_parameter.go b/services/postgresflex/v2api/model_create_instance_region_parameter.go new file mode 100644 index 000000000..4787d0172 --- /dev/null +++ b/services/postgresflex/v2api/model_create_instance_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateInstanceRegionParameter the model 'CreateInstanceRegionParameter' +type CreateInstanceRegionParameter string + +// List of CreateInstance_region_parameter +const ( + CREATEINSTANCEREGIONPARAMETER_EU01 CreateInstanceRegionParameter = "eu01" + CREATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of CreateInstanceRegionParameter enum +var AllowedCreateInstanceRegionParameterEnumValues = []CreateInstanceRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *CreateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateInstanceRegionParameter(value) + for _, existing := range AllowedCreateInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateInstanceRegionParameterFromValue returns a pointer to a valid CreateInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateInstanceRegionParameterFromValue(v string) (*CreateInstanceRegionParameter, error) { + ev := CreateInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateInstanceRegionParameter: valid values are %v", v, AllowedCreateInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedCreateInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateInstance_region_parameter value +func (v CreateInstanceRegionParameter) Ptr() *CreateInstanceRegionParameter { + return &v +} + +type NullableCreateInstanceRegionParameter struct { + value *CreateInstanceRegionParameter + isSet bool +} + +func (v NullableCreateInstanceRegionParameter) Get() *CreateInstanceRegionParameter { + return v.value +} + +func (v *NullableCreateInstanceRegionParameter) Set(val *CreateInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceRegionParameter(val *CreateInstanceRegionParameter) *NullableCreateInstanceRegionParameter { + return &NullableCreateInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableCreateInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_create_user_region_parameter.go b/services/postgresflex/v2api/model_create_user_region_parameter.go new file mode 100644 index 000000000..87543421a --- /dev/null +++ b/services/postgresflex/v2api/model_create_user_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateUserRegionParameter the model 'CreateUserRegionParameter' +type CreateUserRegionParameter string + +// List of CreateUser_region_parameter +const ( + CREATEUSERREGIONPARAMETER_EU01 CreateUserRegionParameter = "eu01" + CREATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of CreateUserRegionParameter enum +var AllowedCreateUserRegionParameterEnumValues = []CreateUserRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *CreateUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateUserRegionParameter(value) + for _, existing := range AllowedCreateUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateUserRegionParameterFromValue returns a pointer to a valid CreateUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateUserRegionParameterFromValue(v string) (*CreateUserRegionParameter, error) { + ev := CreateUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateUserRegionParameter: valid values are %v", v, AllowedCreateUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateUserRegionParameter) IsValid() bool { + for _, existing := range AllowedCreateUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateUser_region_parameter value +func (v CreateUserRegionParameter) Ptr() *CreateUserRegionParameter { + return &v +} + +type NullableCreateUserRegionParameter struct { + value *CreateUserRegionParameter + isSet bool +} + +func (v NullableCreateUserRegionParameter) Get() *CreateUserRegionParameter { + return v.value +} + +func (v *NullableCreateUserRegionParameter) Set(val *CreateUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserRegionParameter(val *CreateUserRegionParameter) *NullableCreateUserRegionParameter { + return &NullableCreateUserRegionParameter{value: val, isSet: true} +} + +func (v NullableCreateUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_delete_database_region_parameter.go b/services/postgresflex/v2api/model_delete_database_region_parameter.go new file mode 100644 index 000000000..70ca47c71 --- /dev/null +++ b/services/postgresflex/v2api/model_delete_database_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// DeleteDatabaseRegionParameter the model 'DeleteDatabaseRegionParameter' +type DeleteDatabaseRegionParameter string + +// List of DeleteDatabase_region_parameter +const ( + DELETEDATABASEREGIONPARAMETER_EU01 DeleteDatabaseRegionParameter = "eu01" + DELETEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteDatabaseRegionParameter = "unknown_default_open_api" +) + +// All allowed values of DeleteDatabaseRegionParameter enum +var AllowedDeleteDatabaseRegionParameterEnumValues = []DeleteDatabaseRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *DeleteDatabaseRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeleteDatabaseRegionParameter(value) + for _, existing := range AllowedDeleteDatabaseRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DELETEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDeleteDatabaseRegionParameterFromValue returns a pointer to a valid DeleteDatabaseRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeleteDatabaseRegionParameterFromValue(v string) (*DeleteDatabaseRegionParameter, error) { + ev := DeleteDatabaseRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeleteDatabaseRegionParameter: valid values are %v", v, AllowedDeleteDatabaseRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeleteDatabaseRegionParameter) IsValid() bool { + for _, existing := range AllowedDeleteDatabaseRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteDatabase_region_parameter value +func (v DeleteDatabaseRegionParameter) Ptr() *DeleteDatabaseRegionParameter { + return &v +} + +type NullableDeleteDatabaseRegionParameter struct { + value *DeleteDatabaseRegionParameter + isSet bool +} + +func (v NullableDeleteDatabaseRegionParameter) Get() *DeleteDatabaseRegionParameter { + return v.value +} + +func (v *NullableDeleteDatabaseRegionParameter) Set(val *DeleteDatabaseRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteDatabaseRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteDatabaseRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteDatabaseRegionParameter(val *DeleteDatabaseRegionParameter) *NullableDeleteDatabaseRegionParameter { + return &NullableDeleteDatabaseRegionParameter{value: val, isSet: true} +} + +func (v NullableDeleteDatabaseRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteDatabaseRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_delete_instance_region_parameter.go b/services/postgresflex/v2api/model_delete_instance_region_parameter.go new file mode 100644 index 000000000..e02482e6b --- /dev/null +++ b/services/postgresflex/v2api/model_delete_instance_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// DeleteInstanceRegionParameter the model 'DeleteInstanceRegionParameter' +type DeleteInstanceRegionParameter string + +// List of DeleteInstance_region_parameter +const ( + DELETEINSTANCEREGIONPARAMETER_EU01 DeleteInstanceRegionParameter = "eu01" + DELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of DeleteInstanceRegionParameter enum +var AllowedDeleteInstanceRegionParameterEnumValues = []DeleteInstanceRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *DeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeleteInstanceRegionParameter(value) + for _, existing := range AllowedDeleteInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDeleteInstanceRegionParameterFromValue returns a pointer to a valid DeleteInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeleteInstanceRegionParameterFromValue(v string) (*DeleteInstanceRegionParameter, error) { + ev := DeleteInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeleteInstanceRegionParameter: valid values are %v", v, AllowedDeleteInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeleteInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedDeleteInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteInstance_region_parameter value +func (v DeleteInstanceRegionParameter) Ptr() *DeleteInstanceRegionParameter { + return &v +} + +type NullableDeleteInstanceRegionParameter struct { + value *DeleteInstanceRegionParameter + isSet bool +} + +func (v NullableDeleteInstanceRegionParameter) Get() *DeleteInstanceRegionParameter { + return v.value +} + +func (v *NullableDeleteInstanceRegionParameter) Set(val *DeleteInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteInstanceRegionParameter(val *DeleteInstanceRegionParameter) *NullableDeleteInstanceRegionParameter { + return &NullableDeleteInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableDeleteInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_delete_user_region_parameter.go b/services/postgresflex/v2api/model_delete_user_region_parameter.go new file mode 100644 index 000000000..eed98ae8f --- /dev/null +++ b/services/postgresflex/v2api/model_delete_user_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// DeleteUserRegionParameter the model 'DeleteUserRegionParameter' +type DeleteUserRegionParameter string + +// List of DeleteUser_region_parameter +const ( + DELETEUSERREGIONPARAMETER_EU01 DeleteUserRegionParameter = "eu01" + DELETEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of DeleteUserRegionParameter enum +var AllowedDeleteUserRegionParameterEnumValues = []DeleteUserRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *DeleteUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeleteUserRegionParameter(value) + for _, existing := range AllowedDeleteUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DELETEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDeleteUserRegionParameterFromValue returns a pointer to a valid DeleteUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeleteUserRegionParameterFromValue(v string) (*DeleteUserRegionParameter, error) { + ev := DeleteUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeleteUserRegionParameter: valid values are %v", v, AllowedDeleteUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeleteUserRegionParameter) IsValid() bool { + for _, existing := range AllowedDeleteUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteUser_region_parameter value +func (v DeleteUserRegionParameter) Ptr() *DeleteUserRegionParameter { + return &v +} + +type NullableDeleteUserRegionParameter struct { + value *DeleteUserRegionParameter + isSet bool +} + +func (v NullableDeleteUserRegionParameter) Get() *DeleteUserRegionParameter { + return v.value +} + +func (v *NullableDeleteUserRegionParameter) Set(val *DeleteUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteUserRegionParameter(val *DeleteUserRegionParameter) *NullableDeleteUserRegionParameter { + return &NullableDeleteUserRegionParameter{value: val, isSet: true} +} + +func (v NullableDeleteUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_force_delete_instance_region_parameter.go b/services/postgresflex/v2api/model_force_delete_instance_region_parameter.go new file mode 100644 index 000000000..251459b4c --- /dev/null +++ b/services/postgresflex/v2api/model_force_delete_instance_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ForceDeleteInstanceRegionParameter the model 'ForceDeleteInstanceRegionParameter' +type ForceDeleteInstanceRegionParameter string + +// List of ForceDeleteInstance_region_parameter +const ( + FORCEDELETEINSTANCEREGIONPARAMETER_EU01 ForceDeleteInstanceRegionParameter = "eu01" + FORCEDELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ForceDeleteInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ForceDeleteInstanceRegionParameter enum +var AllowedForceDeleteInstanceRegionParameterEnumValues = []ForceDeleteInstanceRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ForceDeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ForceDeleteInstanceRegionParameter(value) + for _, existing := range AllowedForceDeleteInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = FORCEDELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewForceDeleteInstanceRegionParameterFromValue returns a pointer to a valid ForceDeleteInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewForceDeleteInstanceRegionParameterFromValue(v string) (*ForceDeleteInstanceRegionParameter, error) { + ev := ForceDeleteInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ForceDeleteInstanceRegionParameter: valid values are %v", v, AllowedForceDeleteInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ForceDeleteInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedForceDeleteInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ForceDeleteInstance_region_parameter value +func (v ForceDeleteInstanceRegionParameter) Ptr() *ForceDeleteInstanceRegionParameter { + return &v +} + +type NullableForceDeleteInstanceRegionParameter struct { + value *ForceDeleteInstanceRegionParameter + isSet bool +} + +func (v NullableForceDeleteInstanceRegionParameter) Get() *ForceDeleteInstanceRegionParameter { + return v.value +} + +func (v *NullableForceDeleteInstanceRegionParameter) Set(val *ForceDeleteInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableForceDeleteInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableForceDeleteInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableForceDeleteInstanceRegionParameter(val *ForceDeleteInstanceRegionParameter) *NullableForceDeleteInstanceRegionParameter { + return &NullableForceDeleteInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableForceDeleteInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableForceDeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_get_backup_region_parameter.go b/services/postgresflex/v2api/model_get_backup_region_parameter.go new file mode 100644 index 000000000..d80ffd66c --- /dev/null +++ b/services/postgresflex/v2api/model_get_backup_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetBackupRegionParameter the model 'GetBackupRegionParameter' +type GetBackupRegionParameter string + +// List of GetBackup_region_parameter +const ( + GETBACKUPREGIONPARAMETER_EU01 GetBackupRegionParameter = "eu01" + GETBACKUPREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetBackupRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetBackupRegionParameter enum +var AllowedGetBackupRegionParameterEnumValues = []GetBackupRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *GetBackupRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetBackupRegionParameter(value) + for _, existing := range AllowedGetBackupRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETBACKUPREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetBackupRegionParameterFromValue returns a pointer to a valid GetBackupRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetBackupRegionParameterFromValue(v string) (*GetBackupRegionParameter, error) { + ev := GetBackupRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetBackupRegionParameter: valid values are %v", v, AllowedGetBackupRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetBackupRegionParameter) IsValid() bool { + for _, existing := range AllowedGetBackupRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetBackup_region_parameter value +func (v GetBackupRegionParameter) Ptr() *GetBackupRegionParameter { + return &v +} + +type NullableGetBackupRegionParameter struct { + value *GetBackupRegionParameter + isSet bool +} + +func (v NullableGetBackupRegionParameter) Get() *GetBackupRegionParameter { + return v.value +} + +func (v *NullableGetBackupRegionParameter) Set(val *GetBackupRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupRegionParameter(val *GetBackupRegionParameter) *NullableGetBackupRegionParameter { + return &NullableGetBackupRegionParameter{value: val, isSet: true} +} + +func (v NullableGetBackupRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_get_instance_region_parameter.go b/services/postgresflex/v2api/model_get_instance_region_parameter.go new file mode 100644 index 000000000..26acc1d8f --- /dev/null +++ b/services/postgresflex/v2api/model_get_instance_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetInstanceRegionParameter the model 'GetInstanceRegionParameter' +type GetInstanceRegionParameter string + +// List of GetInstance_region_parameter +const ( + GETINSTANCEREGIONPARAMETER_EU01 GetInstanceRegionParameter = "eu01" + GETINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetInstanceRegionParameter enum +var AllowedGetInstanceRegionParameterEnumValues = []GetInstanceRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *GetInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetInstanceRegionParameter(value) + for _, existing := range AllowedGetInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetInstanceRegionParameterFromValue returns a pointer to a valid GetInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetInstanceRegionParameterFromValue(v string) (*GetInstanceRegionParameter, error) { + ev := GetInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetInstanceRegionParameter: valid values are %v", v, AllowedGetInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedGetInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetInstance_region_parameter value +func (v GetInstanceRegionParameter) Ptr() *GetInstanceRegionParameter { + return &v +} + +type NullableGetInstanceRegionParameter struct { + value *GetInstanceRegionParameter + isSet bool +} + +func (v NullableGetInstanceRegionParameter) Get() *GetInstanceRegionParameter { + return v.value +} + +func (v *NullableGetInstanceRegionParameter) Set(val *GetInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetInstanceRegionParameter(val *GetInstanceRegionParameter) *NullableGetInstanceRegionParameter { + return &NullableGetInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableGetInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_get_user_region_parameter.go b/services/postgresflex/v2api/model_get_user_region_parameter.go new file mode 100644 index 000000000..4ad1fdd6b --- /dev/null +++ b/services/postgresflex/v2api/model_get_user_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetUserRegionParameter the model 'GetUserRegionParameter' +type GetUserRegionParameter string + +// List of GetUser_region_parameter +const ( + GETUSERREGIONPARAMETER_EU01 GetUserRegionParameter = "eu01" + GETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetUserRegionParameter enum +var AllowedGetUserRegionParameterEnumValues = []GetUserRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *GetUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetUserRegionParameter(value) + for _, existing := range AllowedGetUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetUserRegionParameterFromValue returns a pointer to a valid GetUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetUserRegionParameterFromValue(v string) (*GetUserRegionParameter, error) { + ev := GetUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetUserRegionParameter: valid values are %v", v, AllowedGetUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetUserRegionParameter) IsValid() bool { + for _, existing := range AllowedGetUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetUser_region_parameter value +func (v GetUserRegionParameter) Ptr() *GetUserRegionParameter { + return &v +} + +type NullableGetUserRegionParameter struct { + value *GetUserRegionParameter + isSet bool +} + +func (v NullableGetUserRegionParameter) Get() *GetUserRegionParameter { + return v.value +} + +func (v *NullableGetUserRegionParameter) Set(val *GetUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetUserRegionParameter(val *GetUserRegionParameter) *NullableGetUserRegionParameter { + return &NullableGetUserRegionParameter{value: val, isSet: true} +} + +func (v NullableGetUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_backups_region_parameter.go b/services/postgresflex/v2api/model_list_backups_region_parameter.go new file mode 100644 index 000000000..0e0b3e174 --- /dev/null +++ b/services/postgresflex/v2api/model_list_backups_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListBackupsRegionParameter the model 'ListBackupsRegionParameter' +type ListBackupsRegionParameter string + +// List of ListBackups_region_parameter +const ( + LISTBACKUPSREGIONPARAMETER_EU01 ListBackupsRegionParameter = "eu01" + LISTBACKUPSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListBackupsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListBackupsRegionParameter enum +var AllowedListBackupsRegionParameterEnumValues = []ListBackupsRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ListBackupsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListBackupsRegionParameter(value) + for _, existing := range AllowedListBackupsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTBACKUPSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListBackupsRegionParameterFromValue returns a pointer to a valid ListBackupsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListBackupsRegionParameterFromValue(v string) (*ListBackupsRegionParameter, error) { + ev := ListBackupsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListBackupsRegionParameter: valid values are %v", v, AllowedListBackupsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListBackupsRegionParameter) IsValid() bool { + for _, existing := range AllowedListBackupsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListBackups_region_parameter value +func (v ListBackupsRegionParameter) Ptr() *ListBackupsRegionParameter { + return &v +} + +type NullableListBackupsRegionParameter struct { + value *ListBackupsRegionParameter + isSet bool +} + +func (v NullableListBackupsRegionParameter) Get() *ListBackupsRegionParameter { + return v.value +} + +func (v *NullableListBackupsRegionParameter) Set(val *ListBackupsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsRegionParameter(val *ListBackupsRegionParameter) *NullableListBackupsRegionParameter { + return &NullableListBackupsRegionParameter{value: val, isSet: true} +} + +func (v NullableListBackupsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_database_parameters_region_parameter.go b/services/postgresflex/v2api/model_list_database_parameters_region_parameter.go new file mode 100644 index 000000000..c11298e10 --- /dev/null +++ b/services/postgresflex/v2api/model_list_database_parameters_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListDatabaseParametersRegionParameter the model 'ListDatabaseParametersRegionParameter' +type ListDatabaseParametersRegionParameter string + +// List of ListDatabaseParameters_region_parameter +const ( + LISTDATABASEPARAMETERSREGIONPARAMETER_EU01 ListDatabaseParametersRegionParameter = "eu01" + LISTDATABASEPARAMETERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDatabaseParametersRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListDatabaseParametersRegionParameter enum +var AllowedListDatabaseParametersRegionParameterEnumValues = []ListDatabaseParametersRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ListDatabaseParametersRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListDatabaseParametersRegionParameter(value) + for _, existing := range AllowedListDatabaseParametersRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTDATABASEPARAMETERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListDatabaseParametersRegionParameterFromValue returns a pointer to a valid ListDatabaseParametersRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListDatabaseParametersRegionParameterFromValue(v string) (*ListDatabaseParametersRegionParameter, error) { + ev := ListDatabaseParametersRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListDatabaseParametersRegionParameter: valid values are %v", v, AllowedListDatabaseParametersRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListDatabaseParametersRegionParameter) IsValid() bool { + for _, existing := range AllowedListDatabaseParametersRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListDatabaseParameters_region_parameter value +func (v ListDatabaseParametersRegionParameter) Ptr() *ListDatabaseParametersRegionParameter { + return &v +} + +type NullableListDatabaseParametersRegionParameter struct { + value *ListDatabaseParametersRegionParameter + isSet bool +} + +func (v NullableListDatabaseParametersRegionParameter) Get() *ListDatabaseParametersRegionParameter { + return v.value +} + +func (v *NullableListDatabaseParametersRegionParameter) Set(val *ListDatabaseParametersRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListDatabaseParametersRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListDatabaseParametersRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDatabaseParametersRegionParameter(val *ListDatabaseParametersRegionParameter) *NullableListDatabaseParametersRegionParameter { + return &NullableListDatabaseParametersRegionParameter{value: val, isSet: true} +} + +func (v NullableListDatabaseParametersRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDatabaseParametersRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_databases_region_parameter.go b/services/postgresflex/v2api/model_list_databases_region_parameter.go new file mode 100644 index 000000000..8d15d1d0b --- /dev/null +++ b/services/postgresflex/v2api/model_list_databases_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListDatabasesRegionParameter the model 'ListDatabasesRegionParameter' +type ListDatabasesRegionParameter string + +// List of ListDatabases_region_parameter +const ( + LISTDATABASESREGIONPARAMETER_EU01 ListDatabasesRegionParameter = "eu01" + LISTDATABASESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDatabasesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListDatabasesRegionParameter enum +var AllowedListDatabasesRegionParameterEnumValues = []ListDatabasesRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ListDatabasesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListDatabasesRegionParameter(value) + for _, existing := range AllowedListDatabasesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTDATABASESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListDatabasesRegionParameterFromValue returns a pointer to a valid ListDatabasesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListDatabasesRegionParameterFromValue(v string) (*ListDatabasesRegionParameter, error) { + ev := ListDatabasesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListDatabasesRegionParameter: valid values are %v", v, AllowedListDatabasesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListDatabasesRegionParameter) IsValid() bool { + for _, existing := range AllowedListDatabasesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListDatabases_region_parameter value +func (v ListDatabasesRegionParameter) Ptr() *ListDatabasesRegionParameter { + return &v +} + +type NullableListDatabasesRegionParameter struct { + value *ListDatabasesRegionParameter + isSet bool +} + +func (v NullableListDatabasesRegionParameter) Get() *ListDatabasesRegionParameter { + return v.value +} + +func (v *NullableListDatabasesRegionParameter) Set(val *ListDatabasesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListDatabasesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListDatabasesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDatabasesRegionParameter(val *ListDatabasesRegionParameter) *NullableListDatabasesRegionParameter { + return &NullableListDatabasesRegionParameter{value: val, isSet: true} +} + +func (v NullableListDatabasesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDatabasesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_flavors_region_parameter.go b/services/postgresflex/v2api/model_list_flavors_region_parameter.go new file mode 100644 index 000000000..91bff656f --- /dev/null +++ b/services/postgresflex/v2api/model_list_flavors_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListFlavorsRegionParameter the model 'ListFlavorsRegionParameter' +type ListFlavorsRegionParameter string + +// List of ListFlavors_region_parameter +const ( + LISTFLAVORSREGIONPARAMETER_EU01 ListFlavorsRegionParameter = "eu01" + LISTFLAVORSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListFlavorsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListFlavorsRegionParameter enum +var AllowedListFlavorsRegionParameterEnumValues = []ListFlavorsRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ListFlavorsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListFlavorsRegionParameter(value) + for _, existing := range AllowedListFlavorsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTFLAVORSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListFlavorsRegionParameterFromValue returns a pointer to a valid ListFlavorsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListFlavorsRegionParameterFromValue(v string) (*ListFlavorsRegionParameter, error) { + ev := ListFlavorsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListFlavorsRegionParameter: valid values are %v", v, AllowedListFlavorsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListFlavorsRegionParameter) IsValid() bool { + for _, existing := range AllowedListFlavorsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListFlavors_region_parameter value +func (v ListFlavorsRegionParameter) Ptr() *ListFlavorsRegionParameter { + return &v +} + +type NullableListFlavorsRegionParameter struct { + value *ListFlavorsRegionParameter + isSet bool +} + +func (v NullableListFlavorsRegionParameter) Get() *ListFlavorsRegionParameter { + return v.value +} + +func (v *NullableListFlavorsRegionParameter) Set(val *ListFlavorsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListFlavorsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlavorsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlavorsRegionParameter(val *ListFlavorsRegionParameter) *NullableListFlavorsRegionParameter { + return &NullableListFlavorsRegionParameter{value: val, isSet: true} +} + +func (v NullableListFlavorsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlavorsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_instances_region_parameter.go b/services/postgresflex/v2api/model_list_instances_region_parameter.go new file mode 100644 index 000000000..ee02be93e --- /dev/null +++ b/services/postgresflex/v2api/model_list_instances_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListInstancesRegionParameter the model 'ListInstancesRegionParameter' +type ListInstancesRegionParameter string + +// List of ListInstances_region_parameter +const ( + LISTINSTANCESREGIONPARAMETER_EU01 ListInstancesRegionParameter = "eu01" + LISTINSTANCESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListInstancesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListInstancesRegionParameter enum +var AllowedListInstancesRegionParameterEnumValues = []ListInstancesRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ListInstancesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListInstancesRegionParameter(value) + for _, existing := range AllowedListInstancesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTINSTANCESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListInstancesRegionParameterFromValue returns a pointer to a valid ListInstancesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListInstancesRegionParameterFromValue(v string) (*ListInstancesRegionParameter, error) { + ev := ListInstancesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListInstancesRegionParameter: valid values are %v", v, AllowedListInstancesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListInstancesRegionParameter) IsValid() bool { + for _, existing := range AllowedListInstancesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListInstances_region_parameter value +func (v ListInstancesRegionParameter) Ptr() *ListInstancesRegionParameter { + return &v +} + +type NullableListInstancesRegionParameter struct { + value *ListInstancesRegionParameter + isSet bool +} + +func (v NullableListInstancesRegionParameter) Get() *ListInstancesRegionParameter { + return v.value +} + +func (v *NullableListInstancesRegionParameter) Set(val *ListInstancesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesRegionParameter(val *ListInstancesRegionParameter) *NullableListInstancesRegionParameter { + return &NullableListInstancesRegionParameter{value: val, isSet: true} +} + +func (v NullableListInstancesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_metrics_region_parameter.go b/services/postgresflex/v2api/model_list_metrics_region_parameter.go new file mode 100644 index 000000000..68289f811 --- /dev/null +++ b/services/postgresflex/v2api/model_list_metrics_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListMetricsRegionParameter the model 'ListMetricsRegionParameter' +type ListMetricsRegionParameter string + +// List of ListMetrics_region_parameter +const ( + LISTMETRICSREGIONPARAMETER_EU01 ListMetricsRegionParameter = "eu01" + LISTMETRICSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListMetricsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListMetricsRegionParameter enum +var AllowedListMetricsRegionParameterEnumValues = []ListMetricsRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ListMetricsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListMetricsRegionParameter(value) + for _, existing := range AllowedListMetricsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTMETRICSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListMetricsRegionParameterFromValue returns a pointer to a valid ListMetricsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListMetricsRegionParameterFromValue(v string) (*ListMetricsRegionParameter, error) { + ev := ListMetricsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListMetricsRegionParameter: valid values are %v", v, AllowedListMetricsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListMetricsRegionParameter) IsValid() bool { + for _, existing := range AllowedListMetricsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListMetrics_region_parameter value +func (v ListMetricsRegionParameter) Ptr() *ListMetricsRegionParameter { + return &v +} + +type NullableListMetricsRegionParameter struct { + value *ListMetricsRegionParameter + isSet bool +} + +func (v NullableListMetricsRegionParameter) Get() *ListMetricsRegionParameter { + return v.value +} + +func (v *NullableListMetricsRegionParameter) Set(val *ListMetricsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListMetricsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListMetricsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListMetricsRegionParameter(val *ListMetricsRegionParameter) *NullableListMetricsRegionParameter { + return &NullableListMetricsRegionParameter{value: val, isSet: true} +} + +func (v NullableListMetricsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListMetricsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_storages_region_parameter.go b/services/postgresflex/v2api/model_list_storages_region_parameter.go new file mode 100644 index 000000000..04642b698 --- /dev/null +++ b/services/postgresflex/v2api/model_list_storages_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListStoragesRegionParameter the model 'ListStoragesRegionParameter' +type ListStoragesRegionParameter string + +// List of ListStorages_region_parameter +const ( + LISTSTORAGESREGIONPARAMETER_EU01 ListStoragesRegionParameter = "eu01" + LISTSTORAGESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListStoragesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListStoragesRegionParameter enum +var AllowedListStoragesRegionParameterEnumValues = []ListStoragesRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ListStoragesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListStoragesRegionParameter(value) + for _, existing := range AllowedListStoragesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTSTORAGESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListStoragesRegionParameterFromValue returns a pointer to a valid ListStoragesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListStoragesRegionParameterFromValue(v string) (*ListStoragesRegionParameter, error) { + ev := ListStoragesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListStoragesRegionParameter: valid values are %v", v, AllowedListStoragesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListStoragesRegionParameter) IsValid() bool { + for _, existing := range AllowedListStoragesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListStorages_region_parameter value +func (v ListStoragesRegionParameter) Ptr() *ListStoragesRegionParameter { + return &v +} + +type NullableListStoragesRegionParameter struct { + value *ListStoragesRegionParameter + isSet bool +} + +func (v NullableListStoragesRegionParameter) Get() *ListStoragesRegionParameter { + return v.value +} + +func (v *NullableListStoragesRegionParameter) Set(val *ListStoragesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListStoragesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListStoragesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListStoragesRegionParameter(val *ListStoragesRegionParameter) *NullableListStoragesRegionParameter { + return &NullableListStoragesRegionParameter{value: val, isSet: true} +} + +func (v NullableListStoragesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListStoragesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_users_region_parameter.go b/services/postgresflex/v2api/model_list_users_region_parameter.go new file mode 100644 index 000000000..63c298f53 --- /dev/null +++ b/services/postgresflex/v2api/model_list_users_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListUsersRegionParameter the model 'ListUsersRegionParameter' +type ListUsersRegionParameter string + +// List of ListUsers_region_parameter +const ( + LISTUSERSREGIONPARAMETER_EU01 ListUsersRegionParameter = "eu01" + LISTUSERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListUsersRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListUsersRegionParameter enum +var AllowedListUsersRegionParameterEnumValues = []ListUsersRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ListUsersRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListUsersRegionParameter(value) + for _, existing := range AllowedListUsersRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTUSERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListUsersRegionParameterFromValue returns a pointer to a valid ListUsersRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListUsersRegionParameterFromValue(v string) (*ListUsersRegionParameter, error) { + ev := ListUsersRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListUsersRegionParameter: valid values are %v", v, AllowedListUsersRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListUsersRegionParameter) IsValid() bool { + for _, existing := range AllowedListUsersRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListUsers_region_parameter value +func (v ListUsersRegionParameter) Ptr() *ListUsersRegionParameter { + return &v +} + +type NullableListUsersRegionParameter struct { + value *ListUsersRegionParameter + isSet bool +} + +func (v NullableListUsersRegionParameter) Get() *ListUsersRegionParameter { + return v.value +} + +func (v *NullableListUsersRegionParameter) Set(val *ListUsersRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListUsersRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListUsersRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUsersRegionParameter(val *ListUsersRegionParameter) *NullableListUsersRegionParameter { + return &NullableListUsersRegionParameter{value: val, isSet: true} +} + +func (v NullableListUsersRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUsersRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_list_versions_region_parameter.go b/services/postgresflex/v2api/model_list_versions_region_parameter.go new file mode 100644 index 000000000..70fe2d15a --- /dev/null +++ b/services/postgresflex/v2api/model_list_versions_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListVersionsRegionParameter the model 'ListVersionsRegionParameter' +type ListVersionsRegionParameter string + +// List of ListVersions_region_parameter +const ( + LISTVERSIONSREGIONPARAMETER_EU01 ListVersionsRegionParameter = "eu01" + LISTVERSIONSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListVersionsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListVersionsRegionParameter enum +var AllowedListVersionsRegionParameterEnumValues = []ListVersionsRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ListVersionsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListVersionsRegionParameter(value) + for _, existing := range AllowedListVersionsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTVERSIONSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListVersionsRegionParameterFromValue returns a pointer to a valid ListVersionsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListVersionsRegionParameterFromValue(v string) (*ListVersionsRegionParameter, error) { + ev := ListVersionsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListVersionsRegionParameter: valid values are %v", v, AllowedListVersionsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListVersionsRegionParameter) IsValid() bool { + for _, existing := range AllowedListVersionsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListVersions_region_parameter value +func (v ListVersionsRegionParameter) Ptr() *ListVersionsRegionParameter { + return &v +} + +type NullableListVersionsRegionParameter struct { + value *ListVersionsRegionParameter + isSet bool +} + +func (v NullableListVersionsRegionParameter) Get() *ListVersionsRegionParameter { + return v.value +} + +func (v *NullableListVersionsRegionParameter) Set(val *ListVersionsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListVersionsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListVersionsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListVersionsRegionParameter(val *ListVersionsRegionParameter) *NullableListVersionsRegionParameter { + return &NullableListVersionsRegionParameter{value: val, isSet: true} +} + +func (v NullableListVersionsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListVersionsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_partial_update_instance_region_parameter.go b/services/postgresflex/v2api/model_partial_update_instance_region_parameter.go new file mode 100644 index 000000000..2e332486e --- /dev/null +++ b/services/postgresflex/v2api/model_partial_update_instance_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// PartialUpdateInstanceRegionParameter the model 'PartialUpdateInstanceRegionParameter' +type PartialUpdateInstanceRegionParameter string + +// List of PartialUpdateInstance_region_parameter +const ( + PARTIALUPDATEINSTANCEREGIONPARAMETER_EU01 PartialUpdateInstanceRegionParameter = "eu01" + PARTIALUPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API PartialUpdateInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateInstanceRegionParameter enum +var AllowedPartialUpdateInstanceRegionParameterEnumValues = []PartialUpdateInstanceRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *PartialUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateInstanceRegionParameter(value) + for _, existing := range AllowedPartialUpdateInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateInstanceRegionParameterFromValue returns a pointer to a valid PartialUpdateInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateInstanceRegionParameterFromValue(v string) (*PartialUpdateInstanceRegionParameter, error) { + ev := PartialUpdateInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateInstanceRegionParameter: valid values are %v", v, AllowedPartialUpdateInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedPartialUpdateInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateInstance_region_parameter value +func (v PartialUpdateInstanceRegionParameter) Ptr() *PartialUpdateInstanceRegionParameter { + return &v +} + +type NullablePartialUpdateInstanceRegionParameter struct { + value *PartialUpdateInstanceRegionParameter + isSet bool +} + +func (v NullablePartialUpdateInstanceRegionParameter) Get() *PartialUpdateInstanceRegionParameter { + return v.value +} + +func (v *NullablePartialUpdateInstanceRegionParameter) Set(val *PartialUpdateInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstanceRegionParameter(val *PartialUpdateInstanceRegionParameter) *NullablePartialUpdateInstanceRegionParameter { + return &NullablePartialUpdateInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_partial_update_user_region_parameter.go b/services/postgresflex/v2api/model_partial_update_user_region_parameter.go new file mode 100644 index 000000000..bc506e83d --- /dev/null +++ b/services/postgresflex/v2api/model_partial_update_user_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// PartialUpdateUserRegionParameter the model 'PartialUpdateUserRegionParameter' +type PartialUpdateUserRegionParameter string + +// List of PartialUpdateUser_region_parameter +const ( + PARTIALUPDATEUSERREGIONPARAMETER_EU01 PartialUpdateUserRegionParameter = "eu01" + PARTIALUPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API PartialUpdateUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateUserRegionParameter enum +var AllowedPartialUpdateUserRegionParameterEnumValues = []PartialUpdateUserRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *PartialUpdateUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateUserRegionParameter(value) + for _, existing := range AllowedPartialUpdateUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateUserRegionParameterFromValue returns a pointer to a valid PartialUpdateUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateUserRegionParameterFromValue(v string) (*PartialUpdateUserRegionParameter, error) { + ev := PartialUpdateUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateUserRegionParameter: valid values are %v", v, AllowedPartialUpdateUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateUserRegionParameter) IsValid() bool { + for _, existing := range AllowedPartialUpdateUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateUser_region_parameter value +func (v PartialUpdateUserRegionParameter) Ptr() *PartialUpdateUserRegionParameter { + return &v +} + +type NullablePartialUpdateUserRegionParameter struct { + value *PartialUpdateUserRegionParameter + isSet bool +} + +func (v NullablePartialUpdateUserRegionParameter) Get() *PartialUpdateUserRegionParameter { + return v.value +} + +func (v *NullablePartialUpdateUserRegionParameter) Set(val *PartialUpdateUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateUserRegionParameter(val *PartialUpdateUserRegionParameter) *NullablePartialUpdateUserRegionParameter { + return &NullablePartialUpdateUserRegionParameter{value: val, isSet: true} +} + +func (v NullablePartialUpdateUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_reset_user_region_parameter.go b/services/postgresflex/v2api/model_reset_user_region_parameter.go new file mode 100644 index 000000000..a3d16b5e3 --- /dev/null +++ b/services/postgresflex/v2api/model_reset_user_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ResetUserRegionParameter the model 'ResetUserRegionParameter' +type ResetUserRegionParameter string + +// List of ResetUser_region_parameter +const ( + RESETUSERREGIONPARAMETER_EU01 ResetUserRegionParameter = "eu01" + RESETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ResetUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ResetUserRegionParameter enum +var AllowedResetUserRegionParameterEnumValues = []ResetUserRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *ResetUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ResetUserRegionParameter(value) + for _, existing := range AllowedResetUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = RESETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewResetUserRegionParameterFromValue returns a pointer to a valid ResetUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewResetUserRegionParameterFromValue(v string) (*ResetUserRegionParameter, error) { + ev := ResetUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ResetUserRegionParameter: valid values are %v", v, AllowedResetUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ResetUserRegionParameter) IsValid() bool { + for _, existing := range AllowedResetUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ResetUser_region_parameter value +func (v ResetUserRegionParameter) Ptr() *ResetUserRegionParameter { + return &v +} + +type NullableResetUserRegionParameter struct { + value *ResetUserRegionParameter + isSet bool +} + +func (v NullableResetUserRegionParameter) Get() *ResetUserRegionParameter { + return v.value +} + +func (v *NullableResetUserRegionParameter) Set(val *ResetUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableResetUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableResetUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResetUserRegionParameter(val *ResetUserRegionParameter) *NullableResetUserRegionParameter { + return &NullableResetUserRegionParameter{value: val, isSet: true} +} + +func (v NullableResetUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResetUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_update_backup_schedule_region_parameter.go b/services/postgresflex/v2api/model_update_backup_schedule_region_parameter.go new file mode 100644 index 000000000..39e2939a0 --- /dev/null +++ b/services/postgresflex/v2api/model_update_backup_schedule_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// UpdateBackupScheduleRegionParameter the model 'UpdateBackupScheduleRegionParameter' +type UpdateBackupScheduleRegionParameter string + +// List of UpdateBackupSchedule_region_parameter +const ( + UPDATEBACKUPSCHEDULEREGIONPARAMETER_EU01 UpdateBackupScheduleRegionParameter = "eu01" + UPDATEBACKUPSCHEDULEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API UpdateBackupScheduleRegionParameter = "unknown_default_open_api" +) + +// All allowed values of UpdateBackupScheduleRegionParameter enum +var AllowedUpdateBackupScheduleRegionParameterEnumValues = []UpdateBackupScheduleRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *UpdateBackupScheduleRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateBackupScheduleRegionParameter(value) + for _, existing := range AllowedUpdateBackupScheduleRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATEBACKUPSCHEDULEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateBackupScheduleRegionParameterFromValue returns a pointer to a valid UpdateBackupScheduleRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateBackupScheduleRegionParameterFromValue(v string) (*UpdateBackupScheduleRegionParameter, error) { + ev := UpdateBackupScheduleRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateBackupScheduleRegionParameter: valid values are %v", v, AllowedUpdateBackupScheduleRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateBackupScheduleRegionParameter) IsValid() bool { + for _, existing := range AllowedUpdateBackupScheduleRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateBackupSchedule_region_parameter value +func (v UpdateBackupScheduleRegionParameter) Ptr() *UpdateBackupScheduleRegionParameter { + return &v +} + +type NullableUpdateBackupScheduleRegionParameter struct { + value *UpdateBackupScheduleRegionParameter + isSet bool +} + +func (v NullableUpdateBackupScheduleRegionParameter) Get() *UpdateBackupScheduleRegionParameter { + return v.value +} + +func (v *NullableUpdateBackupScheduleRegionParameter) Set(val *UpdateBackupScheduleRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupScheduleRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupScheduleRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupScheduleRegionParameter(val *UpdateBackupScheduleRegionParameter) *NullableUpdateBackupScheduleRegionParameter { + return &NullableUpdateBackupScheduleRegionParameter{value: val, isSet: true} +} + +func (v NullableUpdateBackupScheduleRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupScheduleRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_update_instance_region_parameter.go b/services/postgresflex/v2api/model_update_instance_region_parameter.go new file mode 100644 index 000000000..678bd6f0e --- /dev/null +++ b/services/postgresflex/v2api/model_update_instance_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// UpdateInstanceRegionParameter the model 'UpdateInstanceRegionParameter' +type UpdateInstanceRegionParameter string + +// List of UpdateInstance_region_parameter +const ( + UPDATEINSTANCEREGIONPARAMETER_EU01 UpdateInstanceRegionParameter = "eu01" + UPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API UpdateInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of UpdateInstanceRegionParameter enum +var AllowedUpdateInstanceRegionParameterEnumValues = []UpdateInstanceRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *UpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateInstanceRegionParameter(value) + for _, existing := range AllowedUpdateInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateInstanceRegionParameterFromValue returns a pointer to a valid UpdateInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateInstanceRegionParameterFromValue(v string) (*UpdateInstanceRegionParameter, error) { + ev := UpdateInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateInstanceRegionParameter: valid values are %v", v, AllowedUpdateInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedUpdateInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateInstance_region_parameter value +func (v UpdateInstanceRegionParameter) Ptr() *UpdateInstanceRegionParameter { + return &v +} + +type NullableUpdateInstanceRegionParameter struct { + value *UpdateInstanceRegionParameter + isSet bool +} + +func (v NullableUpdateInstanceRegionParameter) Get() *UpdateInstanceRegionParameter { + return v.value +} + +func (v *NullableUpdateInstanceRegionParameter) Set(val *UpdateInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstanceRegionParameter(val *UpdateInstanceRegionParameter) *NullableUpdateInstanceRegionParameter { + return &NullableUpdateInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableUpdateInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v2api/model_update_user_region_parameter.go b/services/postgresflex/v2api/model_update_user_region_parameter.go new file mode 100644 index 000000000..862b36896 --- /dev/null +++ b/services/postgresflex/v2api/model_update_user_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT postgres service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// UpdateUserRegionParameter the model 'UpdateUserRegionParameter' +type UpdateUserRegionParameter string + +// List of UpdateUser_region_parameter +const ( + UPDATEUSERREGIONPARAMETER_EU01 UpdateUserRegionParameter = "eu01" + UPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API UpdateUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of UpdateUserRegionParameter enum +var AllowedUpdateUserRegionParameterEnumValues = []UpdateUserRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *UpdateUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateUserRegionParameter(value) + for _, existing := range AllowedUpdateUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateUserRegionParameterFromValue returns a pointer to a valid UpdateUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateUserRegionParameterFromValue(v string) (*UpdateUserRegionParameter, error) { + ev := UpdateUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateUserRegionParameter: valid values are %v", v, AllowedUpdateUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateUserRegionParameter) IsValid() bool { + for _, existing := range AllowedUpdateUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateUser_region_parameter value +func (v UpdateUserRegionParameter) Ptr() *UpdateUserRegionParameter { + return &v +} + +type NullableUpdateUserRegionParameter struct { + value *UpdateUserRegionParameter + isSet bool +} + +func (v NullableUpdateUserRegionParameter) Get() *UpdateUserRegionParameter { + return v.value +} + +func (v *NullableUpdateUserRegionParameter) Set(val *UpdateUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserRegionParameter(val *UpdateUserRegionParameter) *NullableUpdateUserRegionParameter { + return &NullableUpdateUserRegionParameter{value: val, isSet: true} +} + +func (v NullableUpdateUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3alpha1api/api_default.go b/services/postgresflex/v3alpha1api/api_default.go index 378953bd5..18ed8662d 100644 --- a/services/postgresflex/v3alpha1api/api_default.go +++ b/services/postgresflex/v3alpha1api/api_default.go @@ -35,7 +35,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiCloneRequestRequest */ - CloneRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCloneRequestRequest + CloneRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCloneRequestRequest // CloneRequestExecute executes the request // @return CloneResponse @@ -52,7 +52,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiCreateDatabaseRequestRequest */ - CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest + CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest // CreateDatabaseRequestExecute executes the request // @return CreateDatabaseResponse @@ -68,7 +68,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateInstanceRequestRequest */ - CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest + CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest // CreateInstanceRequestExecute executes the request // @return CreateInstanceResponse @@ -85,7 +85,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiCreateUserRequestRequest */ - CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest + CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest // CreateUserRequestExecute executes the request // @return CreateUserResponse @@ -103,7 +103,7 @@ type DefaultAPI interface { @param databaseId The ID of the database. @return ApiDeleteDatabaseRequestRequest */ - DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest + DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest // DeleteDatabaseRequestExecute executes the request DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) error @@ -119,7 +119,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiDeleteInstanceRequestRequest */ - DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest + DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest // DeleteInstanceRequestExecute executes the request DeleteInstanceRequestExecute(r ApiDeleteInstanceRequestRequest) error @@ -136,7 +136,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiDeleteUserRequestRequest */ - DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiDeleteUserRequestRequest + DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiDeleteUserRequestRequest // DeleteUserRequestExecute executes the request DeleteUserRequestExecute(r ApiDeleteUserRequestRequest) error @@ -153,7 +153,7 @@ type DefaultAPI interface { @param backupId The ID of the backup. @return ApiGetBackupRequestRequest */ - GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest + GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int32) ApiGetBackupRequestRequest // GetBackupRequestExecute executes the request // @return GetBackupResponse @@ -170,7 +170,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiGetCollationsRequestRequest */ - GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest + GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest // GetCollationsRequestExecute executes the request // @return GetCollationsResponse @@ -188,7 +188,7 @@ type DefaultAPI interface { @param databaseId The ID of the database. @return ApiGetDatabaseRequestRequest */ - GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest + GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest // GetDatabaseRequestExecute executes the request // @return GetDatabaseResponse @@ -204,7 +204,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetFlavorsRequestRequest */ - GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest + GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest // GetFlavorsRequestExecute executes the request // @return GetFlavorsResponse @@ -221,7 +221,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiGetInstanceRequestRequest */ - GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest + GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest // GetInstanceRequestExecute executes the request // @return GetInstanceResponse @@ -239,7 +239,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiGetUserRequestRequest */ - GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiGetUserRequestRequest + GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiGetUserRequestRequest // GetUserRequestExecute executes the request // @return GetUserResponse @@ -255,7 +255,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetVersionsRequestRequest */ - GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest + GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest // GetVersionsRequestExecute executes the request // @return GetVersionsResponse @@ -272,7 +272,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListBackupsRequestRequest */ - ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest + ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest // ListBackupsRequestExecute executes the request // @return ListBackupResponse @@ -289,7 +289,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListDatabasesRequestRequest */ - ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest + ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest // ListDatabasesRequestExecute executes the request // @return ListDatabasesResponse @@ -305,7 +305,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListInstancesRequestRequest */ - ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest + ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest // ListInstancesRequestExecute executes the request // @return ListInstancesResponse @@ -322,7 +322,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListRolesRequestRequest */ - ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest + ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest // ListRolesRequestExecute executes the request // @return ListRolesResponse @@ -339,7 +339,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListUsersRequestRequest */ - ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest + ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest // ListUsersRequestExecute executes the request // @return ListUserResponse @@ -356,7 +356,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiProtectInstanceRequestRequest */ - ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest + ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest // ProtectInstanceRequestExecute executes the request // @return ProtectInstanceResponse @@ -374,7 +374,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiResetUserRequestRequest */ - ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiResetUserRequestRequest + ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiResetUserRequestRequest // ResetUserRequestExecute executes the request // @return ResetUserResponse @@ -392,7 +392,7 @@ type DefaultAPI interface { @param databaseId The ID of the database. @return ApiUpdateDatabasePartiallyRequestRequest */ - UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest + UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest // UpdateDatabasePartiallyRequestExecute executes the request UpdateDatabasePartiallyRequestExecute(r ApiUpdateDatabasePartiallyRequestRequest) error @@ -409,7 +409,7 @@ type DefaultAPI interface { @param databaseId The ID of the database. @return ApiUpdateDatabaseRequestRequest */ - UpdateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest + UpdateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest // UpdateDatabaseRequestExecute executes the request UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequestRequest) error @@ -425,7 +425,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiUpdateInstancePartiallyRequestRequest */ - UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest + UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest // UpdateInstancePartiallyRequestExecute executes the request UpdateInstancePartiallyRequestExecute(r ApiUpdateInstancePartiallyRequestRequest) error @@ -441,7 +441,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiUpdateInstanceRequestRequest */ - UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest + UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest // UpdateInstanceRequestExecute executes the request UpdateInstanceRequestExecute(r ApiUpdateInstanceRequestRequest) error @@ -458,7 +458,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiUpdateUserPartiallyRequestRequest */ - UpdateUserPartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest + UpdateUserPartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest // UpdateUserPartiallyRequestExecute executes the request UpdateUserPartiallyRequestExecute(r ApiUpdateUserPartiallyRequestRequest) error @@ -475,7 +475,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiUpdateUserRequestRequest */ - UpdateUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserRequestRequest + UpdateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserRequestRequest // UpdateUserRequestExecute executes the request UpdateUserRequestExecute(r ApiUpdateUserRequestRequest) error @@ -488,7 +488,7 @@ type ApiCloneRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string cloneRequestPayload *CloneRequestPayload } @@ -514,7 +514,7 @@ Clone Instance @param instanceId The ID of the instance. @return ApiCloneRequestRequest */ -func (a *DefaultAPIService) CloneRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCloneRequestRequest { +func (a *DefaultAPIService) CloneRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCloneRequestRequest { return ApiCloneRequestRequest{ ApiService: a, ctx: ctx, @@ -696,7 +696,7 @@ type ApiCreateDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string createDatabaseRequestPayload *CreateDatabaseRequestPayload } @@ -722,7 +722,7 @@ Create database for a user. Note: The name of a valid user must be provided in t @param instanceId The ID of the instance. @return ApiCreateDatabaseRequestRequest */ -func (a *DefaultAPIService) CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest { +func (a *DefaultAPIService) CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest { return ApiCreateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -918,7 +918,7 @@ type ApiCreateInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter createInstanceRequestPayload *CreateInstanceRequestPayload } @@ -942,7 +942,7 @@ Create a new instance of a postgres database instance. @param region The region which should be addressed @return ApiCreateInstanceRequestRequest */ -func (a *DefaultAPIService) CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest { +func (a *DefaultAPIService) CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest { return ApiCreateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -1114,7 +1114,7 @@ type ApiCreateUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string createUserRequestPayload *CreateUserRequestPayload } @@ -1140,7 +1140,7 @@ Create user for an instance. @param instanceId The ID of the instance. @return ApiCreateUserRequestRequest */ -func (a *DefaultAPIService) CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest { +func (a *DefaultAPIService) CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest { return ApiCreateUserRequestRequest{ ApiService: a, ctx: ctx, @@ -1325,7 +1325,7 @@ type ApiDeleteDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseId int32 } @@ -1346,7 +1346,7 @@ Delete database for an instance. @param databaseId The ID of the database. @return ApiDeleteDatabaseRequestRequest */ -func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest { +func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest { return ApiDeleteDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -1504,7 +1504,7 @@ type ApiDeleteInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -1523,7 +1523,7 @@ Delete an available postgres instance. @param instanceId The ID of the instance. @return ApiDeleteInstanceRequestRequest */ -func (a *DefaultAPIService) DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest { +func (a *DefaultAPIService) DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest { return ApiDeleteInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -1679,7 +1679,7 @@ type ApiDeleteUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int32 } @@ -1700,7 +1700,7 @@ Delete an user from a specific instance. @param userId The ID of the user. @return ApiDeleteUserRequestRequest */ -func (a *DefaultAPIService) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiDeleteUserRequestRequest { +func (a *DefaultAPIService) DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiDeleteUserRequestRequest { return ApiDeleteUserRequestRequest{ ApiService: a, ctx: ctx, @@ -1858,7 +1858,7 @@ type ApiGetBackupRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string backupId int32 } @@ -1879,7 +1879,7 @@ Get information about a specific backup for an instance. @param backupId The ID of the backup. @return ApiGetBackupRequestRequest */ -func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest { +func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int32) ApiGetBackupRequestRequest { return ApiGetBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -2050,7 +2050,7 @@ type ApiGetCollationsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -2069,7 +2069,7 @@ Get available collations for an instance @param instanceId The ID of the instance. @return ApiGetCollationsRequestRequest */ -func (a *DefaultAPIService) GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest { +func (a *DefaultAPIService) GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest { return ApiGetCollationsRequestRequest{ ApiService: a, ctx: ctx, @@ -2238,7 +2238,7 @@ type ApiGetDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseId int32 } @@ -2259,7 +2259,7 @@ Get information about a specific database in an instance. @param databaseId The ID of the database. @return ApiGetDatabaseRequestRequest */ -func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest { +func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest { return ApiGetDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -2419,7 +2419,7 @@ type ApiGetFlavorsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter page *int32 size *int32 sort *FlavorSort @@ -2457,7 +2457,7 @@ Get all available flavors for a project. @param region The region which should be addressed @return ApiGetFlavorsRequestRequest */ -func (a *DefaultAPIService) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest { +func (a *DefaultAPIService) GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest { return ApiGetFlavorsRequestRequest{ ApiService: a, ctx: ctx, @@ -2641,7 +2641,7 @@ type ApiGetInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -2660,7 +2660,7 @@ Get information about a specific available instance @param instanceId The ID of the instance. @return ApiGetInstanceRequestRequest */ -func (a *DefaultAPIService) GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest { +func (a *DefaultAPIService) GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest { return ApiGetInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -2818,7 +2818,7 @@ type ApiGetUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int32 } @@ -2839,7 +2839,7 @@ Get a specific available user for an instance. @param userId The ID of the user. @return ApiGetUserRequestRequest */ -func (a *DefaultAPIService) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiGetUserRequestRequest { +func (a *DefaultAPIService) GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiGetUserRequestRequest { return ApiGetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -2999,7 +2999,7 @@ type ApiGetVersionsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter } func (r ApiGetVersionsRequestRequest) Execute() (*GetVersionsResponse, error) { @@ -3016,7 +3016,7 @@ Get available postgres versions for the project. @param region The region which should be addressed @return ApiGetVersionsRequestRequest */ -func (a *DefaultAPIService) GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest { +func (a *DefaultAPIService) GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest { return ApiGetVersionsRequestRequest{ ApiService: a, ctx: ctx, @@ -3183,7 +3183,7 @@ type ApiListBackupsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string page *int32 size *int32 @@ -3223,7 +3223,7 @@ List all backups which are available for a specific instance. @param instanceId The ID of the instance. @return ApiListBackupsRequestRequest */ -func (a *DefaultAPIService) ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest { +func (a *DefaultAPIService) ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest { return ApiListBackupsRequestRequest{ ApiService: a, ctx: ctx, @@ -3409,7 +3409,7 @@ type ApiListDatabasesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string page *int32 size *int32 @@ -3449,7 +3449,7 @@ List available databases for an instance. @param instanceId The ID of the instance. @return ApiListDatabasesRequestRequest */ -func (a *DefaultAPIService) ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest { +func (a *DefaultAPIService) ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest { return ApiListDatabasesRequestRequest{ ApiService: a, ctx: ctx, @@ -3624,7 +3624,7 @@ type ApiListInstancesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter page *int32 size *int32 sort *InstanceSort @@ -3662,7 +3662,7 @@ List all available instances for your project. @param region The region which should be addressed @return ApiListInstancesRequestRequest */ -func (a *DefaultAPIService) ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest { +func (a *DefaultAPIService) ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest { return ApiListInstancesRequestRequest{ ApiService: a, ctx: ctx, @@ -3835,7 +3835,7 @@ type ApiListRolesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -3854,7 +3854,7 @@ List available roles for an instance. @param instanceId The ID of the instance. @return ApiListRolesRequestRequest */ -func (a *DefaultAPIService) ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest { +func (a *DefaultAPIService) ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest { return ApiListRolesRequestRequest{ ApiService: a, ctx: ctx, @@ -4012,7 +4012,7 @@ type ApiListUsersRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string page *int32 size *int32 @@ -4052,7 +4052,7 @@ List available users for an instance. @param instanceId The ID of the instance. @return ApiListUsersRequestRequest */ -func (a *DefaultAPIService) ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest { +func (a *DefaultAPIService) ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest { return ApiListUsersRequestRequest{ ApiService: a, ctx: ctx, @@ -4227,7 +4227,7 @@ type ApiProtectInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string protectInstanceRequestPayload *ProtectInstanceRequestPayload } @@ -4253,7 +4253,7 @@ Toggle the deletion protection for an instance. @param instanceId The ID of the instance. @return ApiProtectInstanceRequestRequest */ -func (a *DefaultAPIService) ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest { +func (a *DefaultAPIService) ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest { return ApiProtectInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -4438,7 +4438,7 @@ type ApiResetUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int32 } @@ -4459,7 +4459,7 @@ Reset an user from an specific instance. @param userId The ID of the user. @return ApiResetUserRequestRequest */ -func (a *DefaultAPIService) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiResetUserRequestRequest { +func (a *DefaultAPIService) ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiResetUserRequestRequest { return ApiResetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -4641,7 +4641,7 @@ type ApiUpdateDatabasePartiallyRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseId int32 updateDatabasePartiallyRequestPayload *UpdateDatabasePartiallyRequestPayload @@ -4669,7 +4669,7 @@ Update a database partially in an instance. @param databaseId The ID of the database. @return ApiUpdateDatabasePartiallyRequestRequest */ -func (a *DefaultAPIService) UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest { +func (a *DefaultAPIService) UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest { return ApiUpdateDatabasePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -4843,7 +4843,7 @@ type ApiUpdateDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseId int32 updateDatabaseRequestPayload *UpdateDatabaseRequestPayload @@ -4871,7 +4871,7 @@ Update a database in an instance. @param databaseId The ID of the database. @return ApiUpdateDatabaseRequestRequest */ -func (a *DefaultAPIService) UpdateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest { +func (a *DefaultAPIService) UpdateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest { return ApiUpdateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -5045,7 +5045,7 @@ type ApiUpdateInstancePartiallyRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string updateInstancePartiallyRequestPayload *UpdateInstancePartiallyRequestPayload } @@ -5071,7 +5071,7 @@ Update an available instance of a postgres database. No fields are required. @param instanceId The ID of the instance. @return ApiUpdateInstancePartiallyRequestRequest */ -func (a *DefaultAPIService) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest { +func (a *DefaultAPIService) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest { return ApiUpdateInstancePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -5243,7 +5243,7 @@ type ApiUpdateInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string updateInstanceRequestPayload *UpdateInstanceRequestPayload } @@ -5269,7 +5269,7 @@ Updates an available instance of a postgres database @param instanceId The ID of the instance. @return ApiUpdateInstanceRequestRequest */ -func (a *DefaultAPIService) UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest { +func (a *DefaultAPIService) UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest { return ApiUpdateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -5441,7 +5441,7 @@ type ApiUpdateUserPartiallyRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int32 updateUserPartiallyRequestPayload *UpdateUserPartiallyRequestPayload @@ -5469,7 +5469,7 @@ Update an user partially for an instance. @param userId The ID of the user. @return ApiUpdateUserPartiallyRequestRequest */ -func (a *DefaultAPIService) UpdateUserPartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest { +func (a *DefaultAPIService) UpdateUserPartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest { return ApiUpdateUserPartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -5640,7 +5640,7 @@ type ApiUpdateUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int32 updateUserRequestPayload *UpdateUserRequestPayload @@ -5668,7 +5668,7 @@ Update user for an instance. @param userId The ID of the user. @return ApiUpdateUserRequestRequest */ -func (a *DefaultAPIService) UpdateUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserRequestRequest { +func (a *DefaultAPIService) UpdateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserRequestRequest { return ApiUpdateUserRequestRequest{ ApiService: a, ctx: ctx, diff --git a/services/postgresflex/v3alpha1api/api_default_mock.go b/services/postgresflex/v3alpha1api/api_default_mock.go index 8a2fefee0..4fd557b2e 100644 --- a/services/postgresflex/v3alpha1api/api_default_mock.go +++ b/services/postgresflex/v3alpha1api/api_default_mock.go @@ -77,7 +77,7 @@ type DefaultAPIServiceMock struct { UpdateUserRequestExecuteMock *func(r ApiUpdateUserRequestRequest) error } -func (a DefaultAPIServiceMock) CloneRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCloneRequestRequest { +func (a DefaultAPIServiceMock) CloneRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCloneRequestRequest { return ApiCloneRequestRequest{ ApiService: a, ctx: ctx, @@ -97,7 +97,7 @@ func (a DefaultAPIServiceMock) CloneRequestExecute(r ApiCloneRequestRequest) (*C return (*a.CloneRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest { +func (a DefaultAPIServiceMock) CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest { return ApiCreateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -117,7 +117,7 @@ func (a DefaultAPIServiceMock) CreateDatabaseRequestExecute(r ApiCreateDatabaseR return (*a.CreateDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest { +func (a DefaultAPIServiceMock) CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest { return ApiCreateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -136,7 +136,7 @@ func (a DefaultAPIServiceMock) CreateInstanceRequestExecute(r ApiCreateInstanceR return (*a.CreateInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest { +func (a DefaultAPIServiceMock) CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest { return ApiCreateUserRequestRequest{ ApiService: a, ctx: ctx, @@ -156,7 +156,7 @@ func (a DefaultAPIServiceMock) CreateUserRequestExecute(r ApiCreateUserRequestRe return (*a.CreateUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest { +func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest { return ApiDeleteDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -176,7 +176,7 @@ func (a DefaultAPIServiceMock) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseR return (*a.DeleteDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest { +func (a DefaultAPIServiceMock) DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest { return ApiDeleteInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -195,7 +195,7 @@ func (a DefaultAPIServiceMock) DeleteInstanceRequestExecute(r ApiDeleteInstanceR return (*a.DeleteInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiDeleteUserRequestRequest { +func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiDeleteUserRequestRequest { return ApiDeleteUserRequestRequest{ ApiService: a, ctx: ctx, @@ -215,7 +215,7 @@ func (a DefaultAPIServiceMock) DeleteUserRequestExecute(r ApiDeleteUserRequestRe return (*a.DeleteUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest { +func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int32) ApiGetBackupRequestRequest { return ApiGetBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -236,7 +236,7 @@ func (a DefaultAPIServiceMock) GetBackupRequestExecute(r ApiGetBackupRequestRequ return (*a.GetBackupRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest { +func (a DefaultAPIServiceMock) GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest { return ApiGetCollationsRequestRequest{ ApiService: a, ctx: ctx, @@ -256,7 +256,7 @@ func (a DefaultAPIServiceMock) GetCollationsRequestExecute(r ApiGetCollationsReq return (*a.GetCollationsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest { +func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest { return ApiGetDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -277,7 +277,7 @@ func (a DefaultAPIServiceMock) GetDatabaseRequestExecute(r ApiGetDatabaseRequest return (*a.GetDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest { +func (a DefaultAPIServiceMock) GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest { return ApiGetFlavorsRequestRequest{ ApiService: a, ctx: ctx, @@ -296,7 +296,7 @@ func (a DefaultAPIServiceMock) GetFlavorsRequestExecute(r ApiGetFlavorsRequestRe return (*a.GetFlavorsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest { +func (a DefaultAPIServiceMock) GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest { return ApiGetInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -316,7 +316,7 @@ func (a DefaultAPIServiceMock) GetInstanceRequestExecute(r ApiGetInstanceRequest return (*a.GetInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiGetUserRequestRequest { +func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiGetUserRequestRequest { return ApiGetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -337,7 +337,7 @@ func (a DefaultAPIServiceMock) GetUserRequestExecute(r ApiGetUserRequestRequest) return (*a.GetUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest { +func (a DefaultAPIServiceMock) GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest { return ApiGetVersionsRequestRequest{ ApiService: a, ctx: ctx, @@ -356,7 +356,7 @@ func (a DefaultAPIServiceMock) GetVersionsRequestExecute(r ApiGetVersionsRequest return (*a.GetVersionsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest { +func (a DefaultAPIServiceMock) ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest { return ApiListBackupsRequestRequest{ ApiService: a, ctx: ctx, @@ -376,7 +376,7 @@ func (a DefaultAPIServiceMock) ListBackupsRequestExecute(r ApiListBackupsRequest return (*a.ListBackupsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest { +func (a DefaultAPIServiceMock) ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest { return ApiListDatabasesRequestRequest{ ApiService: a, ctx: ctx, @@ -396,7 +396,7 @@ func (a DefaultAPIServiceMock) ListDatabasesRequestExecute(r ApiListDatabasesReq return (*a.ListDatabasesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest { +func (a DefaultAPIServiceMock) ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest { return ApiListInstancesRequestRequest{ ApiService: a, ctx: ctx, @@ -415,7 +415,7 @@ func (a DefaultAPIServiceMock) ListInstancesRequestExecute(r ApiListInstancesReq return (*a.ListInstancesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest { +func (a DefaultAPIServiceMock) ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest { return ApiListRolesRequestRequest{ ApiService: a, ctx: ctx, @@ -435,7 +435,7 @@ func (a DefaultAPIServiceMock) ListRolesRequestExecute(r ApiListRolesRequestRequ return (*a.ListRolesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest { +func (a DefaultAPIServiceMock) ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest { return ApiListUsersRequestRequest{ ApiService: a, ctx: ctx, @@ -455,7 +455,7 @@ func (a DefaultAPIServiceMock) ListUsersRequestExecute(r ApiListUsersRequestRequ return (*a.ListUsersRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest { +func (a DefaultAPIServiceMock) ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest { return ApiProtectInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -475,7 +475,7 @@ func (a DefaultAPIServiceMock) ProtectInstanceRequestExecute(r ApiProtectInstanc return (*a.ProtectInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiResetUserRequestRequest { +func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiResetUserRequestRequest { return ApiResetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -496,7 +496,7 @@ func (a DefaultAPIServiceMock) ResetUserRequestExecute(r ApiResetUserRequestRequ return (*a.ResetUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest { +func (a DefaultAPIServiceMock) UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest { return ApiUpdateDatabasePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -516,7 +516,7 @@ func (a DefaultAPIServiceMock) UpdateDatabasePartiallyRequestExecute(r ApiUpdate return (*a.UpdateDatabasePartiallyRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest { +func (a DefaultAPIServiceMock) UpdateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest { return ApiUpdateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -536,7 +536,7 @@ func (a DefaultAPIServiceMock) UpdateDatabaseRequestExecute(r ApiUpdateDatabaseR return (*a.UpdateDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest { +func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest { return ApiUpdateInstancePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -555,7 +555,7 @@ func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequestExecute(r ApiUpdate return (*a.UpdateInstancePartiallyRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest { +func (a DefaultAPIServiceMock) UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest { return ApiUpdateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -574,7 +574,7 @@ func (a DefaultAPIServiceMock) UpdateInstanceRequestExecute(r ApiUpdateInstanceR return (*a.UpdateInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateUserPartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest { +func (a DefaultAPIServiceMock) UpdateUserPartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest { return ApiUpdateUserPartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -594,7 +594,7 @@ func (a DefaultAPIServiceMock) UpdateUserPartiallyRequestExecute(r ApiUpdateUser return (*a.UpdateUserPartiallyRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserRequestRequest { +func (a DefaultAPIServiceMock) UpdateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserRequestRequest { return ApiUpdateUserRequestRequest{ ApiService: a, ctx: ctx, diff --git a/services/postgresflex/v3alpha1api/model_get_flavors_request_region_parameter.go b/services/postgresflex/v3alpha1api/model_get_flavors_request_region_parameter.go new file mode 100644 index 000000000..90ed1f94f --- /dev/null +++ b/services/postgresflex/v3alpha1api/model_get_flavors_request_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// GetFlavorsRequestRegionParameter the model 'GetFlavorsRequestRegionParameter' +type GetFlavorsRequestRegionParameter string + +// List of getFlavorsRequest_region_parameter +const ( + GETFLAVORSREQUESTREGIONPARAMETER_EU01 GetFlavorsRequestRegionParameter = "eu01" + GETFLAVORSREQUESTREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetFlavorsRequestRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetFlavorsRequestRegionParameter enum +var AllowedGetFlavorsRequestRegionParameterEnumValues = []GetFlavorsRequestRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *GetFlavorsRequestRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetFlavorsRequestRegionParameter(value) + for _, existing := range AllowedGetFlavorsRequestRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETFLAVORSREQUESTREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetFlavorsRequestRegionParameterFromValue returns a pointer to a valid GetFlavorsRequestRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetFlavorsRequestRegionParameterFromValue(v string) (*GetFlavorsRequestRegionParameter, error) { + ev := GetFlavorsRequestRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetFlavorsRequestRegionParameter: valid values are %v", v, AllowedGetFlavorsRequestRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetFlavorsRequestRegionParameter) IsValid() bool { + for _, existing := range AllowedGetFlavorsRequestRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to getFlavorsRequest_region_parameter value +func (v GetFlavorsRequestRegionParameter) Ptr() *GetFlavorsRequestRegionParameter { + return &v +} + +type NullableGetFlavorsRequestRegionParameter struct { + value *GetFlavorsRequestRegionParameter + isSet bool +} + +func (v NullableGetFlavorsRequestRegionParameter) Get() *GetFlavorsRequestRegionParameter { + return v.value +} + +func (v *NullableGetFlavorsRequestRegionParameter) Set(val *GetFlavorsRequestRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetFlavorsRequestRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetFlavorsRequestRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetFlavorsRequestRegionParameter(val *GetFlavorsRequestRegionParameter) *NullableGetFlavorsRequestRegionParameter { + return &NullableGetFlavorsRequestRegionParameter{value: val, isSet: true} +} + +func (v NullableGetFlavorsRequestRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetFlavorsRequestRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From dcc4d2ea4082356b19b12dedeb06ca4aa0e3f3c8 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:19:09 +0200 Subject: [PATCH 34/66] Revert "refac(postgresflex): introduce inline enums" This reverts commit 7fde917d406246640bbe760c78eb10397248ece9. --- services/postgresflex/v2api/api_default.go | 156 ++++++++--------- .../postgresflex/v2api/api_default_mock.go | 52 +++--- .../model_clone_instance_region_parameter.go | 112 ------------ .../model_create_database_region_parameter.go | 112 ------------ .../model_create_instance_region_parameter.go | 112 ------------ .../model_create_user_region_parameter.go | 112 ------------ .../model_delete_database_region_parameter.go | 112 ------------ .../model_delete_instance_region_parameter.go | 112 ------------ .../model_delete_user_region_parameter.go | 112 ------------ ..._force_delete_instance_region_parameter.go | 112 ------------ .../model_get_backup_region_parameter.go | 112 ------------ .../model_get_instance_region_parameter.go | 112 ------------ .../v2api/model_get_user_region_parameter.go | 112 ------------ .../model_list_backups_region_parameter.go | 112 ------------ ...st_database_parameters_region_parameter.go | 112 ------------ .../model_list_databases_region_parameter.go | 112 ------------ .../model_list_flavors_region_parameter.go | 112 ------------ .../model_list_instances_region_parameter.go | 112 ------------ .../model_list_metrics_region_parameter.go | 112 ------------ .../model_list_storages_region_parameter.go | 112 ------------ .../model_list_users_region_parameter.go | 112 ------------ .../model_list_versions_region_parameter.go | 112 ------------ ...artial_update_instance_region_parameter.go | 112 ------------ ...el_partial_update_user_region_parameter.go | 112 ------------ .../model_reset_user_region_parameter.go | 112 ------------ ...update_backup_schedule_region_parameter.go | 112 ------------ .../model_update_instance_region_parameter.go | 112 ------------ .../model_update_user_region_parameter.go | 112 ------------ .../postgresflex/v3alpha1api/api_default.go | 162 +++++++++--------- .../v3alpha1api/api_default_mock.go | 54 +++--- ...el_get_flavors_request_region_parameter.go | 112 ------------ 31 files changed, 212 insertions(+), 3236 deletions(-) delete mode 100644 services/postgresflex/v2api/model_clone_instance_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_create_database_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_create_instance_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_create_user_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_delete_database_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_delete_instance_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_delete_user_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_force_delete_instance_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_get_backup_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_get_instance_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_get_user_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_list_backups_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_list_database_parameters_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_list_databases_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_list_flavors_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_list_instances_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_list_metrics_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_list_storages_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_list_users_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_list_versions_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_partial_update_instance_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_partial_update_user_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_reset_user_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_update_backup_schedule_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_update_instance_region_parameter.go delete mode 100644 services/postgresflex/v2api/model_update_user_region_parameter.go delete mode 100644 services/postgresflex/v3alpha1api/model_get_flavors_request_region_parameter.go diff --git a/services/postgresflex/v2api/api_default.go b/services/postgresflex/v2api/api_default.go index 799bf5b7a..5d9f7ac83 100644 --- a/services/postgresflex/v2api/api_default.go +++ b/services/postgresflex/v2api/api_default.go @@ -35,7 +35,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiCloneInstanceRequest */ - CloneInstance(ctx context.Context, projectId string, region CloneInstanceRegionParameter, instanceId string) ApiCloneInstanceRequest + CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest // CloneInstanceExecute executes the request // @return CloneInstanceResponse @@ -53,7 +53,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiCreateDatabaseRequest */ - CreateDatabase(ctx context.Context, projectId string, region CreateDatabaseRegionParameter, instanceId string) ApiCreateDatabaseRequest + CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest // CreateDatabaseExecute executes the request // @return InstanceCreateDatabaseResponse @@ -69,7 +69,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateInstanceRequest */ - CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest // CreateInstanceExecute executes the request // @return CreateInstanceResponse @@ -86,7 +86,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiCreateUserRequest */ - CreateUser(ctx context.Context, projectId string, region CreateUserRegionParameter, instanceId string) ApiCreateUserRequest + CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest // CreateUserExecute executes the request // @return CreateUserResponse @@ -104,7 +104,7 @@ type DefaultAPI interface { @param databaseId Database ID @return ApiDeleteDatabaseRequest */ - DeleteDatabase(ctx context.Context, projectId string, region DeleteDatabaseRegionParameter, instanceId string, databaseId string) ApiDeleteDatabaseRequest + DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest // DeleteDatabaseExecute executes the request DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error @@ -120,7 +120,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiDeleteInstanceRequest */ - DeleteInstance(ctx context.Context, projectId string, region DeleteInstanceRegionParameter, instanceId string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest // DeleteInstanceExecute executes the request DeleteInstanceExecute(r ApiDeleteInstanceRequest) error @@ -137,7 +137,7 @@ type DefaultAPI interface { @param userId User ID @return ApiDeleteUserRequest */ - DeleteUser(ctx context.Context, projectId string, region DeleteUserRegionParameter, instanceId string, userId string) ApiDeleteUserRequest + DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest // DeleteUserExecute executes the request DeleteUserExecute(r ApiDeleteUserRequest) error @@ -153,7 +153,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiForceDeleteInstanceRequest */ - ForceDeleteInstance(ctx context.Context, projectId string, region ForceDeleteInstanceRegionParameter, instanceId string) ApiForceDeleteInstanceRequest + ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest // ForceDeleteInstanceExecute executes the request ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error @@ -170,7 +170,7 @@ type DefaultAPI interface { @param backupId Backup ID @return ApiGetBackupRequest */ - GetBackup(ctx context.Context, projectId string, region GetBackupRegionParameter, instanceId string, backupId string) ApiGetBackupRequest + GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest // GetBackupExecute executes the request // @return GetBackupResponse @@ -187,7 +187,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiGetInstanceRequest */ - GetInstance(ctx context.Context, projectId string, region GetInstanceRegionParameter, instanceId string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest // GetInstanceExecute executes the request // @return InstanceResponse @@ -205,7 +205,7 @@ type DefaultAPI interface { @param userId User ID @return ApiGetUserRequest */ - GetUser(ctx context.Context, projectId string, region GetUserRegionParameter, instanceId string, userId string) ApiGetUserRequest + GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest // GetUserExecute executes the request // @return GetUserResponse @@ -222,7 +222,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiListBackupsRequest */ - ListBackups(ctx context.Context, projectId string, region ListBackupsRegionParameter, instanceId string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest // ListBackupsExecute executes the request // @return ListBackupsResponse @@ -239,7 +239,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiListDatabaseParametersRequest */ - ListDatabaseParameters(ctx context.Context, projectId string, region ListDatabaseParametersRegionParameter, instanceId string) ApiListDatabaseParametersRequest + ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest // ListDatabaseParametersExecute executes the request // @return PostgresDatabaseParameterResponse @@ -256,7 +256,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiListDatabasesRequest */ - ListDatabases(ctx context.Context, projectId string, region ListDatabasesRegionParameter, instanceId string) ApiListDatabasesRequest + ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest // ListDatabasesExecute executes the request // @return InstanceListDatabasesResponse @@ -272,7 +272,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListFlavorsRequest */ - ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest + ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest // ListFlavorsExecute executes the request // @return ListFlavorsResponse @@ -288,7 +288,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListInstancesRequest */ - ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest // ListInstancesExecute executes the request // @return ListInstancesResponse @@ -306,7 +306,7 @@ type DefaultAPI interface { @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. @return ApiListMetricsRequest */ - ListMetrics(ctx context.Context, projectId string, region ListMetricsRegionParameter, instanceId string, metric string) ApiListMetricsRequest + ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest // ListMetricsExecute executes the request // @return InstanceMetricsResponse @@ -323,7 +323,7 @@ type DefaultAPI interface { @param flavorId Flavor ID @return ApiListStoragesRequest */ - ListStorages(ctx context.Context, projectId string, region ListStoragesRegionParameter, flavorId string) ApiListStoragesRequest + ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest // ListStoragesExecute executes the request // @return ListStoragesResponse @@ -340,7 +340,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiListUsersRequest */ - ListUsers(ctx context.Context, projectId string, region ListUsersRegionParameter, instanceId string) ApiListUsersRequest + ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest // ListUsersExecute executes the request // @return ListUsersResponse @@ -356,7 +356,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListVersionsRequest */ - ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest + ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest // ListVersionsExecute executes the request // @return ListVersionsResponse @@ -373,7 +373,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiPartialUpdateInstanceRequest */ - PartialUpdateInstance(ctx context.Context, projectId string, region PartialUpdateInstanceRegionParameter, instanceId string) ApiPartialUpdateInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest // PartialUpdateInstanceExecute executes the request // @return PartialUpdateInstanceResponse @@ -391,7 +391,7 @@ type DefaultAPI interface { @param userId The ID of the user in the database @return ApiPartialUpdateUserRequest */ - PartialUpdateUser(ctx context.Context, projectId string, region PartialUpdateUserRegionParameter, instanceId string, userId string) ApiPartialUpdateUserRequest + PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest // PartialUpdateUserExecute executes the request PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error @@ -408,7 +408,7 @@ type DefaultAPI interface { @param userId user ID @return ApiResetUserRequest */ - ResetUser(ctx context.Context, projectId string, region ResetUserRegionParameter, instanceId string, userId string) ApiResetUserRequest + ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest // ResetUserExecute executes the request // @return ResetUserResponse @@ -425,7 +425,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiUpdateBackupScheduleRequest */ - UpdateBackupSchedule(ctx context.Context, projectId string, region UpdateBackupScheduleRegionParameter, instanceId string) ApiUpdateBackupScheduleRequest + UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest // UpdateBackupScheduleExecute executes the request UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error @@ -441,7 +441,7 @@ type DefaultAPI interface { @param instanceId Instance ID @return ApiUpdateInstanceRequest */ - UpdateInstance(ctx context.Context, projectId string, region UpdateInstanceRegionParameter, instanceId string) ApiUpdateInstanceRequest + UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest // UpdateInstanceExecute executes the request // @return PartialUpdateInstanceResponse @@ -459,7 +459,7 @@ type DefaultAPI interface { @param userId The ID of the user in the database @return ApiUpdateUserRequest */ - UpdateUser(ctx context.Context, projectId string, region UpdateUserRegionParameter, instanceId string, userId string) ApiUpdateUserRequest + UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest // UpdateUserExecute executes the request UpdateUserExecute(r ApiUpdateUserRequest) error @@ -472,7 +472,7 @@ type ApiCloneInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region CloneInstanceRegionParameter + region string instanceId string cloneInstancePayload *CloneInstancePayload } @@ -498,7 +498,7 @@ Clone an existing instance of a postgres database to a new destination instance @param instanceId Instance ID @return ApiCloneInstanceRequest */ -func (a *DefaultAPIService) CloneInstance(ctx context.Context, projectId string, region CloneInstanceRegionParameter, instanceId string) ApiCloneInstanceRequest { +func (a *DefaultAPIService) CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest { return ApiCloneInstanceRequest{ ApiService: a, ctx: ctx, @@ -629,7 +629,7 @@ type ApiCreateDatabaseRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region CreateDatabaseRegionParameter + region string instanceId string createDatabasePayload *CreateDatabasePayload } @@ -656,7 +656,7 @@ Note: The name of a valid user must be provided in the "options" map field using @param instanceId Instance ID @return ApiCreateDatabaseRequest */ -func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, region CreateDatabaseRegionParameter, instanceId string) ApiCreateDatabaseRequest { +func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { return ApiCreateDatabaseRequest{ ApiService: a, ctx: ctx, @@ -787,7 +787,7 @@ type ApiCreateInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region CreateInstanceRegionParameter + region string createInstancePayload *CreateInstancePayload } @@ -811,7 +811,7 @@ Create a new instance of a postgres database @param region The region which should be addressed @return ApiCreateInstanceRequest */ -func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest { +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ ApiService: a, ctx: ctx, @@ -940,7 +940,7 @@ type ApiCreateUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region CreateUserRegionParameter + region string instanceId string createUserPayload *CreateUserPayload } @@ -966,7 +966,7 @@ Create user for an instance @param instanceId Instance ID @return ApiCreateUserRequest */ -func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, region CreateUserRegionParameter, instanceId string) ApiCreateUserRequest { +func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest { return ApiCreateUserRequest{ ApiService: a, ctx: ctx, @@ -1097,7 +1097,7 @@ type ApiDeleteDatabaseRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region DeleteDatabaseRegionParameter + region string instanceId string databaseId string } @@ -1118,7 +1118,7 @@ Delete database for an instance @param databaseId Database ID @return ApiDeleteDatabaseRequest */ -func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, region DeleteDatabaseRegionParameter, instanceId string, databaseId string) ApiDeleteDatabaseRequest { +func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { return ApiDeleteDatabaseRequest{ ApiService: a, ctx: ctx, @@ -1233,7 +1233,7 @@ type ApiDeleteInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region DeleteInstanceRegionParameter + region string instanceId string } @@ -1252,7 +1252,7 @@ Delete available instance @param instanceId Instance ID @return ApiDeleteInstanceRequest */ -func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, region DeleteInstanceRegionParameter, instanceId string) ApiDeleteInstanceRequest { +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -1386,7 +1386,7 @@ type ApiDeleteUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region DeleteUserRegionParameter + region string instanceId string userId string } @@ -1407,7 +1407,7 @@ Delete user for an instance @param userId User ID @return ApiDeleteUserRequest */ -func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, region DeleteUserRegionParameter, instanceId string, userId string) ApiDeleteUserRequest { +func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest { return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, @@ -1522,7 +1522,7 @@ type ApiForceDeleteInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ForceDeleteInstanceRegionParameter + region string instanceId string } @@ -1541,7 +1541,7 @@ Forces the deletion of an delayed deleted instance @param instanceId Instance ID @return ApiForceDeleteInstanceRequest */ -func (a *DefaultAPIService) ForceDeleteInstance(ctx context.Context, projectId string, region ForceDeleteInstanceRegionParameter, instanceId string) ApiForceDeleteInstanceRequest { +func (a *DefaultAPIService) ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest { return ApiForceDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -1675,7 +1675,7 @@ type ApiGetBackupRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetBackupRegionParameter + region string instanceId string backupId string } @@ -1696,7 +1696,7 @@ Get specific available backup @param backupId Backup ID @return ApiGetBackupRequest */ -func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, region GetBackupRegionParameter, instanceId string, backupId string) ApiGetBackupRequest { +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest { return ApiGetBackupRequest{ ApiService: a, ctx: ctx, @@ -1824,7 +1824,7 @@ type ApiGetInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetInstanceRegionParameter + region string instanceId string } @@ -1843,7 +1843,7 @@ Get specific available instances @param instanceId Instance ID @return ApiGetInstanceRequest */ -func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, region GetInstanceRegionParameter, instanceId string) ApiGetInstanceRequest { +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, @@ -1969,7 +1969,7 @@ type ApiGetUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetUserRegionParameter + region string instanceId string userId string } @@ -1990,7 +1990,7 @@ Get specific available user for an instance @param userId User ID @return ApiGetUserRequest */ -func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, region GetUserRegionParameter, instanceId string, userId string) ApiGetUserRequest { +func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest { return ApiGetUserRequest{ ApiService: a, ctx: ctx, @@ -2118,7 +2118,7 @@ type ApiListBackupsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ListBackupsRegionParameter + region string instanceId string } @@ -2137,7 +2137,7 @@ List all backups which are available for a specific instance @param instanceId Instance ID @return ApiListBackupsRequest */ -func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, region ListBackupsRegionParameter, instanceId string) ApiListBackupsRequest { +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { return ApiListBackupsRequest{ ApiService: a, ctx: ctx, @@ -2263,7 +2263,7 @@ type ApiListDatabaseParametersRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ListDatabaseParametersRegionParameter + region string instanceId string } @@ -2282,7 +2282,7 @@ List available databases parameter @param instanceId Instance ID @return ApiListDatabaseParametersRequest */ -func (a *DefaultAPIService) ListDatabaseParameters(ctx context.Context, projectId string, region ListDatabaseParametersRegionParameter, instanceId string) ApiListDatabaseParametersRequest { +func (a *DefaultAPIService) ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest { return ApiListDatabaseParametersRequest{ ApiService: a, ctx: ctx, @@ -2408,7 +2408,7 @@ type ApiListDatabasesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ListDatabasesRegionParameter + region string instanceId string } @@ -2427,7 +2427,7 @@ List available databases for an instance @param instanceId Instance ID @return ApiListDatabasesRequest */ -func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, region ListDatabasesRegionParameter, instanceId string) ApiListDatabasesRequest { +func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { return ApiListDatabasesRequest{ ApiService: a, ctx: ctx, @@ -2553,7 +2553,7 @@ type ApiListFlavorsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ListFlavorsRegionParameter + region string } func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { @@ -2570,7 +2570,7 @@ Get available flavors for a specific projectID @param region The region which should be addressed @return ApiListFlavorsRequest */ -func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest { +func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { return ApiListFlavorsRequest{ ApiService: a, ctx: ctx, @@ -2694,7 +2694,7 @@ type ApiListInstancesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ListInstancesRegionParameter + region string } func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { @@ -2711,7 +2711,7 @@ List available instances @param region The region which should be addressed @return ApiListInstancesRequest */ -func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest { +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { return ApiListInstancesRequest{ ApiService: a, ctx: ctx, @@ -2835,7 +2835,7 @@ type ApiListMetricsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ListMetricsRegionParameter + region string instanceId string metric string granularity *string @@ -2884,7 +2884,7 @@ Returns a metric for an instance. The metric will only be for the master pod if @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. @return ApiListMetricsRequest */ -func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, region ListMetricsRegionParameter, instanceId string, metric string) ApiListMetricsRequest { +func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest { return ApiListMetricsRequest{ ApiService: a, ctx: ctx, @@ -3046,7 +3046,7 @@ type ApiListStoragesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ListStoragesRegionParameter + region string flavorId string } @@ -3065,7 +3065,7 @@ Get available storages for a specific flavor @param flavorId Flavor ID @return ApiListStoragesRequest */ -func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, region ListStoragesRegionParameter, flavorId string) ApiListStoragesRequest { +func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest { return ApiListStoragesRequest{ ApiService: a, ctx: ctx, @@ -3191,7 +3191,7 @@ type ApiListUsersRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ListUsersRegionParameter + region string instanceId string } @@ -3210,7 +3210,7 @@ List available users for an instance @param instanceId Instance ID @return ApiListUsersRequest */ -func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, region ListUsersRegionParameter, instanceId string) ApiListUsersRequest { +func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { return ApiListUsersRequest{ ApiService: a, ctx: ctx, @@ -3336,7 +3336,7 @@ type ApiListVersionsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ListVersionsRegionParameter + region string instanceId *string } @@ -3360,7 +3360,7 @@ Get available versions for postgres database @param region The region which should be addressed @return ApiListVersionsRequest */ -func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest { +func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { return ApiListVersionsRequest{ ApiService: a, ctx: ctx, @@ -3487,7 +3487,7 @@ type ApiPartialUpdateInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region PartialUpdateInstanceRegionParameter + region string instanceId string partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -3513,7 +3513,7 @@ Update available instance of a postgres database. Supported Versions are 12, 13, @param instanceId Instance ID @return ApiPartialUpdateInstanceRequest */ -func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, region PartialUpdateInstanceRegionParameter, instanceId string) ApiPartialUpdateInstanceRequest { +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { return ApiPartialUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -3644,7 +3644,7 @@ type ApiPartialUpdateUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region PartialUpdateUserRegionParameter + region string instanceId string userId string partialUpdateUserPayload *PartialUpdateUserPayload @@ -3672,7 +3672,7 @@ Update user for an instance. Only the roles are updatable. @param userId The ID of the user in the database @return ApiPartialUpdateUserRequest */ -func (a *DefaultAPIService) PartialUpdateUser(ctx context.Context, projectId string, region PartialUpdateUserRegionParameter, instanceId string, userId string) ApiPartialUpdateUserRequest { +func (a *DefaultAPIService) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest { return ApiPartialUpdateUserRequest{ ApiService: a, ctx: ctx, @@ -3799,7 +3799,7 @@ type ApiResetUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region ResetUserRegionParameter + region string instanceId string userId string } @@ -3820,7 +3820,7 @@ Reset user password for a postgres instance @param userId user ID @return ApiResetUserRequest */ -func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, region ResetUserRegionParameter, instanceId string, userId string) ApiResetUserRequest { +func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest { return ApiResetUserRequest{ ApiService: a, ctx: ctx, @@ -3969,7 +3969,7 @@ type ApiUpdateBackupScheduleRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region UpdateBackupScheduleRegionParameter + region string instanceId string updateBackupSchedulePayload *UpdateBackupSchedulePayload } @@ -3995,7 +3995,7 @@ Update backup schedule @param instanceId Instance ID @return ApiUpdateBackupScheduleRequest */ -func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, region UpdateBackupScheduleRegionParameter, instanceId string) ApiUpdateBackupScheduleRequest { +func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest { return ApiUpdateBackupScheduleRequest{ ApiService: a, ctx: ctx, @@ -4113,7 +4113,7 @@ type ApiUpdateInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region UpdateInstanceRegionParameter + region string instanceId string updateInstancePayload *UpdateInstancePayload } @@ -4139,7 +4139,7 @@ Update available instance of a postgres database. Supported Versions are 12, 13, @param instanceId Instance ID @return ApiUpdateInstanceRequest */ -func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, region UpdateInstanceRegionParameter, instanceId string) ApiUpdateInstanceRequest { +func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -4270,7 +4270,7 @@ type ApiUpdateUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region UpdateUserRegionParameter + region string instanceId string userId string updateUserPayload *UpdateUserPayload @@ -4298,7 +4298,7 @@ Update user for an instance. Only the roles are updatable. @param userId The ID of the user in the database @return ApiUpdateUserRequest */ -func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, region UpdateUserRegionParameter, instanceId string, userId string) ApiUpdateUserRequest { +func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest { return ApiUpdateUserRequest{ ApiService: a, ctx: ctx, diff --git a/services/postgresflex/v2api/api_default_mock.go b/services/postgresflex/v2api/api_default_mock.go index e953c5990..97b993ec6 100644 --- a/services/postgresflex/v2api/api_default_mock.go +++ b/services/postgresflex/v2api/api_default_mock.go @@ -75,7 +75,7 @@ type DefaultAPIServiceMock struct { UpdateUserExecuteMock *func(r ApiUpdateUserRequest) error } -func (a DefaultAPIServiceMock) CloneInstance(ctx context.Context, projectId string, region CloneInstanceRegionParameter, instanceId string) ApiCloneInstanceRequest { +func (a DefaultAPIServiceMock) CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest { return ApiCloneInstanceRequest{ ApiService: a, ctx: ctx, @@ -95,7 +95,7 @@ func (a DefaultAPIServiceMock) CloneInstanceExecute(r ApiCloneInstanceRequest) ( return (*a.CloneInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, region CreateDatabaseRegionParameter, instanceId string) ApiCreateDatabaseRequest { +func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { return ApiCreateDatabaseRequest{ ApiService: a, ctx: ctx, @@ -115,7 +115,7 @@ func (a DefaultAPIServiceMock) CreateDatabaseExecute(r ApiCreateDatabaseRequest) return (*a.CreateDatabaseExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest { +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ ApiService: a, ctx: ctx, @@ -134,7 +134,7 @@ func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) return (*a.CreateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, region CreateUserRegionParameter, instanceId string) ApiCreateUserRequest { +func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest { return ApiCreateUserRequest{ ApiService: a, ctx: ctx, @@ -154,7 +154,7 @@ func (a DefaultAPIServiceMock) CreateUserExecute(r ApiCreateUserRequest) (*Creat return (*a.CreateUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, region DeleteDatabaseRegionParameter, instanceId string, databaseId string) ApiDeleteDatabaseRequest { +func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { return ApiDeleteDatabaseRequest{ ApiService: a, ctx: ctx, @@ -174,7 +174,7 @@ func (a DefaultAPIServiceMock) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) return (*a.DeleteDatabaseExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, region DeleteInstanceRegionParameter, instanceId string) ApiDeleteInstanceRequest { +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -193,7 +193,7 @@ func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) return (*a.DeleteInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, region DeleteUserRegionParameter, instanceId string, userId string) ApiDeleteUserRequest { +func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest { return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, @@ -213,7 +213,7 @@ func (a DefaultAPIServiceMock) DeleteUserExecute(r ApiDeleteUserRequest) error { return (*a.DeleteUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ForceDeleteInstance(ctx context.Context, projectId string, region ForceDeleteInstanceRegionParameter, instanceId string) ApiForceDeleteInstanceRequest { +func (a DefaultAPIServiceMock) ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest { return ApiForceDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -232,7 +232,7 @@ func (a DefaultAPIServiceMock) ForceDeleteInstanceExecute(r ApiForceDeleteInstan return (*a.ForceDeleteInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, region GetBackupRegionParameter, instanceId string, backupId string) ApiGetBackupRequest { +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest { return ApiGetBackupRequest{ ApiService: a, ctx: ctx, @@ -253,7 +253,7 @@ func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*GetBack return (*a.GetBackupExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, region GetInstanceRegionParameter, instanceId string) ApiGetInstanceRequest { +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, @@ -273,7 +273,7 @@ func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Ins return (*a.GetInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, region GetUserRegionParameter, instanceId string, userId string) ApiGetUserRequest { +func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest { return ApiGetUserRequest{ ApiService: a, ctx: ctx, @@ -294,7 +294,7 @@ func (a DefaultAPIServiceMock) GetUserExecute(r ApiGetUserRequest) (*GetUserResp return (*a.GetUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, region ListBackupsRegionParameter, instanceId string) ApiListBackupsRequest { +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { return ApiListBackupsRequest{ ApiService: a, ctx: ctx, @@ -314,7 +314,7 @@ func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*Lis return (*a.ListBackupsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDatabaseParameters(ctx context.Context, projectId string, region ListDatabaseParametersRegionParameter, instanceId string) ApiListDatabaseParametersRequest { +func (a DefaultAPIServiceMock) ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest { return ApiListDatabaseParametersRequest{ ApiService: a, ctx: ctx, @@ -334,7 +334,7 @@ func (a DefaultAPIServiceMock) ListDatabaseParametersExecute(r ApiListDatabasePa return (*a.ListDatabaseParametersExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, region ListDatabasesRegionParameter, instanceId string) ApiListDatabasesRequest { +func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { return ApiListDatabasesRequest{ ApiService: a, ctx: ctx, @@ -354,7 +354,7 @@ func (a DefaultAPIServiceMock) ListDatabasesExecute(r ApiListDatabasesRequest) ( return (*a.ListDatabasesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest { +func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { return ApiListFlavorsRequest{ ApiService: a, ctx: ctx, @@ -373,7 +373,7 @@ func (a DefaultAPIServiceMock) ListFlavorsExecute(r ApiListFlavorsRequest) (*Lis return (*a.ListFlavorsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest { +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { return ApiListInstancesRequest{ ApiService: a, ctx: ctx, @@ -392,7 +392,7 @@ func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) ( return (*a.ListInstancesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, region ListMetricsRegionParameter, instanceId string, metric string) ApiListMetricsRequest { +func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest { return ApiListMetricsRequest{ ApiService: a, ctx: ctx, @@ -413,7 +413,7 @@ func (a DefaultAPIServiceMock) ListMetricsExecute(r ApiListMetricsRequest) (*Ins return (*a.ListMetricsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, region ListStoragesRegionParameter, flavorId string) ApiListStoragesRequest { +func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest { return ApiListStoragesRequest{ ApiService: a, ctx: ctx, @@ -433,7 +433,7 @@ func (a DefaultAPIServiceMock) ListStoragesExecute(r ApiListStoragesRequest) (*L return (*a.ListStoragesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, region ListUsersRegionParameter, instanceId string) ApiListUsersRequest { +func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { return ApiListUsersRequest{ ApiService: a, ctx: ctx, @@ -453,7 +453,7 @@ func (a DefaultAPIServiceMock) ListUsersExecute(r ApiListUsersRequest) (*ListUse return (*a.ListUsersExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest { +func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { return ApiListVersionsRequest{ ApiService: a, ctx: ctx, @@ -472,7 +472,7 @@ func (a DefaultAPIServiceMock) ListVersionsExecute(r ApiListVersionsRequest) (*L return (*a.ListVersionsExecuteMock)(r) } -func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, region PartialUpdateInstanceRegionParameter, instanceId string) ApiPartialUpdateInstanceRequest { +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { return ApiPartialUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -492,7 +492,7 @@ func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateIn return (*a.PartialUpdateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) PartialUpdateUser(ctx context.Context, projectId string, region PartialUpdateUserRegionParameter, instanceId string, userId string) ApiPartialUpdateUserRequest { +func (a DefaultAPIServiceMock) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest { return ApiPartialUpdateUserRequest{ ApiService: a, ctx: ctx, @@ -512,7 +512,7 @@ func (a DefaultAPIServiceMock) PartialUpdateUserExecute(r ApiPartialUpdateUserRe return (*a.PartialUpdateUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, region ResetUserRegionParameter, instanceId string, userId string) ApiResetUserRequest { +func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest { return ApiResetUserRequest{ ApiService: a, ctx: ctx, @@ -533,7 +533,7 @@ func (a DefaultAPIServiceMock) ResetUserExecute(r ApiResetUserRequest) (*ResetUs return (*a.ResetUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, region UpdateBackupScheduleRegionParameter, instanceId string) ApiUpdateBackupScheduleRequest { +func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest { return ApiUpdateBackupScheduleRequest{ ApiService: a, ctx: ctx, @@ -552,7 +552,7 @@ func (a DefaultAPIServiceMock) UpdateBackupScheduleExecute(r ApiUpdateBackupSche return (*a.UpdateBackupScheduleExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, region UpdateInstanceRegionParameter, instanceId string) ApiUpdateInstanceRequest { +func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -572,7 +572,7 @@ func (a DefaultAPIServiceMock) UpdateInstanceExecute(r ApiUpdateInstanceRequest) return (*a.UpdateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, region UpdateUserRegionParameter, instanceId string, userId string) ApiUpdateUserRequest { +func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest { return ApiUpdateUserRequest{ ApiService: a, ctx: ctx, diff --git a/services/postgresflex/v2api/model_clone_instance_region_parameter.go b/services/postgresflex/v2api/model_clone_instance_region_parameter.go deleted file mode 100644 index d91075a93..000000000 --- a/services/postgresflex/v2api/model_clone_instance_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// CloneInstanceRegionParameter the model 'CloneInstanceRegionParameter' -type CloneInstanceRegionParameter string - -// List of CloneInstance_region_parameter -const ( - CLONEINSTANCEREGIONPARAMETER_EU01 CloneInstanceRegionParameter = "eu01" - CLONEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CloneInstanceRegionParameter = "unknown_default_open_api" -) - -// All allowed values of CloneInstanceRegionParameter enum -var AllowedCloneInstanceRegionParameterEnumValues = []CloneInstanceRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *CloneInstanceRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := CloneInstanceRegionParameter(value) - for _, existing := range AllowedCloneInstanceRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = CLONEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewCloneInstanceRegionParameterFromValue returns a pointer to a valid CloneInstanceRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewCloneInstanceRegionParameterFromValue(v string) (*CloneInstanceRegionParameter, error) { - ev := CloneInstanceRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for CloneInstanceRegionParameter: valid values are %v", v, AllowedCloneInstanceRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v CloneInstanceRegionParameter) IsValid() bool { - for _, existing := range AllowedCloneInstanceRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to CloneInstance_region_parameter value -func (v CloneInstanceRegionParameter) Ptr() *CloneInstanceRegionParameter { - return &v -} - -type NullableCloneInstanceRegionParameter struct { - value *CloneInstanceRegionParameter - isSet bool -} - -func (v NullableCloneInstanceRegionParameter) Get() *CloneInstanceRegionParameter { - return v.value -} - -func (v *NullableCloneInstanceRegionParameter) Set(val *CloneInstanceRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableCloneInstanceRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableCloneInstanceRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCloneInstanceRegionParameter(val *CloneInstanceRegionParameter) *NullableCloneInstanceRegionParameter { - return &NullableCloneInstanceRegionParameter{value: val, isSet: true} -} - -func (v NullableCloneInstanceRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCloneInstanceRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_create_database_region_parameter.go b/services/postgresflex/v2api/model_create_database_region_parameter.go deleted file mode 100644 index e850ebb70..000000000 --- a/services/postgresflex/v2api/model_create_database_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// CreateDatabaseRegionParameter the model 'CreateDatabaseRegionParameter' -type CreateDatabaseRegionParameter string - -// List of CreateDatabase_region_parameter -const ( - CREATEDATABASEREGIONPARAMETER_EU01 CreateDatabaseRegionParameter = "eu01" - CREATEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateDatabaseRegionParameter = "unknown_default_open_api" -) - -// All allowed values of CreateDatabaseRegionParameter enum -var AllowedCreateDatabaseRegionParameterEnumValues = []CreateDatabaseRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *CreateDatabaseRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := CreateDatabaseRegionParameter(value) - for _, existing := range AllowedCreateDatabaseRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = CREATEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewCreateDatabaseRegionParameterFromValue returns a pointer to a valid CreateDatabaseRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewCreateDatabaseRegionParameterFromValue(v string) (*CreateDatabaseRegionParameter, error) { - ev := CreateDatabaseRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for CreateDatabaseRegionParameter: valid values are %v", v, AllowedCreateDatabaseRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v CreateDatabaseRegionParameter) IsValid() bool { - for _, existing := range AllowedCreateDatabaseRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to CreateDatabase_region_parameter value -func (v CreateDatabaseRegionParameter) Ptr() *CreateDatabaseRegionParameter { - return &v -} - -type NullableCreateDatabaseRegionParameter struct { - value *CreateDatabaseRegionParameter - isSet bool -} - -func (v NullableCreateDatabaseRegionParameter) Get() *CreateDatabaseRegionParameter { - return v.value -} - -func (v *NullableCreateDatabaseRegionParameter) Set(val *CreateDatabaseRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableCreateDatabaseRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateDatabaseRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateDatabaseRegionParameter(val *CreateDatabaseRegionParameter) *NullableCreateDatabaseRegionParameter { - return &NullableCreateDatabaseRegionParameter{value: val, isSet: true} -} - -func (v NullableCreateDatabaseRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateDatabaseRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_create_instance_region_parameter.go b/services/postgresflex/v2api/model_create_instance_region_parameter.go deleted file mode 100644 index 4787d0172..000000000 --- a/services/postgresflex/v2api/model_create_instance_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// CreateInstanceRegionParameter the model 'CreateInstanceRegionParameter' -type CreateInstanceRegionParameter string - -// List of CreateInstance_region_parameter -const ( - CREATEINSTANCEREGIONPARAMETER_EU01 CreateInstanceRegionParameter = "eu01" - CREATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateInstanceRegionParameter = "unknown_default_open_api" -) - -// All allowed values of CreateInstanceRegionParameter enum -var AllowedCreateInstanceRegionParameterEnumValues = []CreateInstanceRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *CreateInstanceRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := CreateInstanceRegionParameter(value) - for _, existing := range AllowedCreateInstanceRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = CREATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewCreateInstanceRegionParameterFromValue returns a pointer to a valid CreateInstanceRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewCreateInstanceRegionParameterFromValue(v string) (*CreateInstanceRegionParameter, error) { - ev := CreateInstanceRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for CreateInstanceRegionParameter: valid values are %v", v, AllowedCreateInstanceRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v CreateInstanceRegionParameter) IsValid() bool { - for _, existing := range AllowedCreateInstanceRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to CreateInstance_region_parameter value -func (v CreateInstanceRegionParameter) Ptr() *CreateInstanceRegionParameter { - return &v -} - -type NullableCreateInstanceRegionParameter struct { - value *CreateInstanceRegionParameter - isSet bool -} - -func (v NullableCreateInstanceRegionParameter) Get() *CreateInstanceRegionParameter { - return v.value -} - -func (v *NullableCreateInstanceRegionParameter) Set(val *CreateInstanceRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableCreateInstanceRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateInstanceRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateInstanceRegionParameter(val *CreateInstanceRegionParameter) *NullableCreateInstanceRegionParameter { - return &NullableCreateInstanceRegionParameter{value: val, isSet: true} -} - -func (v NullableCreateInstanceRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateInstanceRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_create_user_region_parameter.go b/services/postgresflex/v2api/model_create_user_region_parameter.go deleted file mode 100644 index 87543421a..000000000 --- a/services/postgresflex/v2api/model_create_user_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// CreateUserRegionParameter the model 'CreateUserRegionParameter' -type CreateUserRegionParameter string - -// List of CreateUser_region_parameter -const ( - CREATEUSERREGIONPARAMETER_EU01 CreateUserRegionParameter = "eu01" - CREATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateUserRegionParameter = "unknown_default_open_api" -) - -// All allowed values of CreateUserRegionParameter enum -var AllowedCreateUserRegionParameterEnumValues = []CreateUserRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *CreateUserRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := CreateUserRegionParameter(value) - for _, existing := range AllowedCreateUserRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = CREATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewCreateUserRegionParameterFromValue returns a pointer to a valid CreateUserRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewCreateUserRegionParameterFromValue(v string) (*CreateUserRegionParameter, error) { - ev := CreateUserRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for CreateUserRegionParameter: valid values are %v", v, AllowedCreateUserRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v CreateUserRegionParameter) IsValid() bool { - for _, existing := range AllowedCreateUserRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to CreateUser_region_parameter value -func (v CreateUserRegionParameter) Ptr() *CreateUserRegionParameter { - return &v -} - -type NullableCreateUserRegionParameter struct { - value *CreateUserRegionParameter - isSet bool -} - -func (v NullableCreateUserRegionParameter) Get() *CreateUserRegionParameter { - return v.value -} - -func (v *NullableCreateUserRegionParameter) Set(val *CreateUserRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableCreateUserRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateUserRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateUserRegionParameter(val *CreateUserRegionParameter) *NullableCreateUserRegionParameter { - return &NullableCreateUserRegionParameter{value: val, isSet: true} -} - -func (v NullableCreateUserRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateUserRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_delete_database_region_parameter.go b/services/postgresflex/v2api/model_delete_database_region_parameter.go deleted file mode 100644 index 70ca47c71..000000000 --- a/services/postgresflex/v2api/model_delete_database_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// DeleteDatabaseRegionParameter the model 'DeleteDatabaseRegionParameter' -type DeleteDatabaseRegionParameter string - -// List of DeleteDatabase_region_parameter -const ( - DELETEDATABASEREGIONPARAMETER_EU01 DeleteDatabaseRegionParameter = "eu01" - DELETEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteDatabaseRegionParameter = "unknown_default_open_api" -) - -// All allowed values of DeleteDatabaseRegionParameter enum -var AllowedDeleteDatabaseRegionParameterEnumValues = []DeleteDatabaseRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *DeleteDatabaseRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := DeleteDatabaseRegionParameter(value) - for _, existing := range AllowedDeleteDatabaseRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = DELETEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewDeleteDatabaseRegionParameterFromValue returns a pointer to a valid DeleteDatabaseRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewDeleteDatabaseRegionParameterFromValue(v string) (*DeleteDatabaseRegionParameter, error) { - ev := DeleteDatabaseRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for DeleteDatabaseRegionParameter: valid values are %v", v, AllowedDeleteDatabaseRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v DeleteDatabaseRegionParameter) IsValid() bool { - for _, existing := range AllowedDeleteDatabaseRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DeleteDatabase_region_parameter value -func (v DeleteDatabaseRegionParameter) Ptr() *DeleteDatabaseRegionParameter { - return &v -} - -type NullableDeleteDatabaseRegionParameter struct { - value *DeleteDatabaseRegionParameter - isSet bool -} - -func (v NullableDeleteDatabaseRegionParameter) Get() *DeleteDatabaseRegionParameter { - return v.value -} - -func (v *NullableDeleteDatabaseRegionParameter) Set(val *DeleteDatabaseRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableDeleteDatabaseRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableDeleteDatabaseRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeleteDatabaseRegionParameter(val *DeleteDatabaseRegionParameter) *NullableDeleteDatabaseRegionParameter { - return &NullableDeleteDatabaseRegionParameter{value: val, isSet: true} -} - -func (v NullableDeleteDatabaseRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeleteDatabaseRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_delete_instance_region_parameter.go b/services/postgresflex/v2api/model_delete_instance_region_parameter.go deleted file mode 100644 index e02482e6b..000000000 --- a/services/postgresflex/v2api/model_delete_instance_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// DeleteInstanceRegionParameter the model 'DeleteInstanceRegionParameter' -type DeleteInstanceRegionParameter string - -// List of DeleteInstance_region_parameter -const ( - DELETEINSTANCEREGIONPARAMETER_EU01 DeleteInstanceRegionParameter = "eu01" - DELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteInstanceRegionParameter = "unknown_default_open_api" -) - -// All allowed values of DeleteInstanceRegionParameter enum -var AllowedDeleteInstanceRegionParameterEnumValues = []DeleteInstanceRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *DeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := DeleteInstanceRegionParameter(value) - for _, existing := range AllowedDeleteInstanceRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = DELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewDeleteInstanceRegionParameterFromValue returns a pointer to a valid DeleteInstanceRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewDeleteInstanceRegionParameterFromValue(v string) (*DeleteInstanceRegionParameter, error) { - ev := DeleteInstanceRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for DeleteInstanceRegionParameter: valid values are %v", v, AllowedDeleteInstanceRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v DeleteInstanceRegionParameter) IsValid() bool { - for _, existing := range AllowedDeleteInstanceRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DeleteInstance_region_parameter value -func (v DeleteInstanceRegionParameter) Ptr() *DeleteInstanceRegionParameter { - return &v -} - -type NullableDeleteInstanceRegionParameter struct { - value *DeleteInstanceRegionParameter - isSet bool -} - -func (v NullableDeleteInstanceRegionParameter) Get() *DeleteInstanceRegionParameter { - return v.value -} - -func (v *NullableDeleteInstanceRegionParameter) Set(val *DeleteInstanceRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableDeleteInstanceRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableDeleteInstanceRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeleteInstanceRegionParameter(val *DeleteInstanceRegionParameter) *NullableDeleteInstanceRegionParameter { - return &NullableDeleteInstanceRegionParameter{value: val, isSet: true} -} - -func (v NullableDeleteInstanceRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_delete_user_region_parameter.go b/services/postgresflex/v2api/model_delete_user_region_parameter.go deleted file mode 100644 index eed98ae8f..000000000 --- a/services/postgresflex/v2api/model_delete_user_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// DeleteUserRegionParameter the model 'DeleteUserRegionParameter' -type DeleteUserRegionParameter string - -// List of DeleteUser_region_parameter -const ( - DELETEUSERREGIONPARAMETER_EU01 DeleteUserRegionParameter = "eu01" - DELETEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteUserRegionParameter = "unknown_default_open_api" -) - -// All allowed values of DeleteUserRegionParameter enum -var AllowedDeleteUserRegionParameterEnumValues = []DeleteUserRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *DeleteUserRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := DeleteUserRegionParameter(value) - for _, existing := range AllowedDeleteUserRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = DELETEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewDeleteUserRegionParameterFromValue returns a pointer to a valid DeleteUserRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewDeleteUserRegionParameterFromValue(v string) (*DeleteUserRegionParameter, error) { - ev := DeleteUserRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for DeleteUserRegionParameter: valid values are %v", v, AllowedDeleteUserRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v DeleteUserRegionParameter) IsValid() bool { - for _, existing := range AllowedDeleteUserRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DeleteUser_region_parameter value -func (v DeleteUserRegionParameter) Ptr() *DeleteUserRegionParameter { - return &v -} - -type NullableDeleteUserRegionParameter struct { - value *DeleteUserRegionParameter - isSet bool -} - -func (v NullableDeleteUserRegionParameter) Get() *DeleteUserRegionParameter { - return v.value -} - -func (v *NullableDeleteUserRegionParameter) Set(val *DeleteUserRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableDeleteUserRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableDeleteUserRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeleteUserRegionParameter(val *DeleteUserRegionParameter) *NullableDeleteUserRegionParameter { - return &NullableDeleteUserRegionParameter{value: val, isSet: true} -} - -func (v NullableDeleteUserRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeleteUserRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_force_delete_instance_region_parameter.go b/services/postgresflex/v2api/model_force_delete_instance_region_parameter.go deleted file mode 100644 index 251459b4c..000000000 --- a/services/postgresflex/v2api/model_force_delete_instance_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ForceDeleteInstanceRegionParameter the model 'ForceDeleteInstanceRegionParameter' -type ForceDeleteInstanceRegionParameter string - -// List of ForceDeleteInstance_region_parameter -const ( - FORCEDELETEINSTANCEREGIONPARAMETER_EU01 ForceDeleteInstanceRegionParameter = "eu01" - FORCEDELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ForceDeleteInstanceRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ForceDeleteInstanceRegionParameter enum -var AllowedForceDeleteInstanceRegionParameterEnumValues = []ForceDeleteInstanceRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ForceDeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ForceDeleteInstanceRegionParameter(value) - for _, existing := range AllowedForceDeleteInstanceRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = FORCEDELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewForceDeleteInstanceRegionParameterFromValue returns a pointer to a valid ForceDeleteInstanceRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewForceDeleteInstanceRegionParameterFromValue(v string) (*ForceDeleteInstanceRegionParameter, error) { - ev := ForceDeleteInstanceRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ForceDeleteInstanceRegionParameter: valid values are %v", v, AllowedForceDeleteInstanceRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ForceDeleteInstanceRegionParameter) IsValid() bool { - for _, existing := range AllowedForceDeleteInstanceRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ForceDeleteInstance_region_parameter value -func (v ForceDeleteInstanceRegionParameter) Ptr() *ForceDeleteInstanceRegionParameter { - return &v -} - -type NullableForceDeleteInstanceRegionParameter struct { - value *ForceDeleteInstanceRegionParameter - isSet bool -} - -func (v NullableForceDeleteInstanceRegionParameter) Get() *ForceDeleteInstanceRegionParameter { - return v.value -} - -func (v *NullableForceDeleteInstanceRegionParameter) Set(val *ForceDeleteInstanceRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableForceDeleteInstanceRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableForceDeleteInstanceRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableForceDeleteInstanceRegionParameter(val *ForceDeleteInstanceRegionParameter) *NullableForceDeleteInstanceRegionParameter { - return &NullableForceDeleteInstanceRegionParameter{value: val, isSet: true} -} - -func (v NullableForceDeleteInstanceRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableForceDeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_get_backup_region_parameter.go b/services/postgresflex/v2api/model_get_backup_region_parameter.go deleted file mode 100644 index d80ffd66c..000000000 --- a/services/postgresflex/v2api/model_get_backup_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// GetBackupRegionParameter the model 'GetBackupRegionParameter' -type GetBackupRegionParameter string - -// List of GetBackup_region_parameter -const ( - GETBACKUPREGIONPARAMETER_EU01 GetBackupRegionParameter = "eu01" - GETBACKUPREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetBackupRegionParameter = "unknown_default_open_api" -) - -// All allowed values of GetBackupRegionParameter enum -var AllowedGetBackupRegionParameterEnumValues = []GetBackupRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *GetBackupRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetBackupRegionParameter(value) - for _, existing := range AllowedGetBackupRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETBACKUPREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetBackupRegionParameterFromValue returns a pointer to a valid GetBackupRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetBackupRegionParameterFromValue(v string) (*GetBackupRegionParameter, error) { - ev := GetBackupRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetBackupRegionParameter: valid values are %v", v, AllowedGetBackupRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetBackupRegionParameter) IsValid() bool { - for _, existing := range AllowedGetBackupRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetBackup_region_parameter value -func (v GetBackupRegionParameter) Ptr() *GetBackupRegionParameter { - return &v -} - -type NullableGetBackupRegionParameter struct { - value *GetBackupRegionParameter - isSet bool -} - -func (v NullableGetBackupRegionParameter) Get() *GetBackupRegionParameter { - return v.value -} - -func (v *NullableGetBackupRegionParameter) Set(val *GetBackupRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableGetBackupRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableGetBackupRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetBackupRegionParameter(val *GetBackupRegionParameter) *NullableGetBackupRegionParameter { - return &NullableGetBackupRegionParameter{value: val, isSet: true} -} - -func (v NullableGetBackupRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetBackupRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_get_instance_region_parameter.go b/services/postgresflex/v2api/model_get_instance_region_parameter.go deleted file mode 100644 index 26acc1d8f..000000000 --- a/services/postgresflex/v2api/model_get_instance_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// GetInstanceRegionParameter the model 'GetInstanceRegionParameter' -type GetInstanceRegionParameter string - -// List of GetInstance_region_parameter -const ( - GETINSTANCEREGIONPARAMETER_EU01 GetInstanceRegionParameter = "eu01" - GETINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetInstanceRegionParameter = "unknown_default_open_api" -) - -// All allowed values of GetInstanceRegionParameter enum -var AllowedGetInstanceRegionParameterEnumValues = []GetInstanceRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *GetInstanceRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetInstanceRegionParameter(value) - for _, existing := range AllowedGetInstanceRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetInstanceRegionParameterFromValue returns a pointer to a valid GetInstanceRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetInstanceRegionParameterFromValue(v string) (*GetInstanceRegionParameter, error) { - ev := GetInstanceRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetInstanceRegionParameter: valid values are %v", v, AllowedGetInstanceRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetInstanceRegionParameter) IsValid() bool { - for _, existing := range AllowedGetInstanceRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetInstance_region_parameter value -func (v GetInstanceRegionParameter) Ptr() *GetInstanceRegionParameter { - return &v -} - -type NullableGetInstanceRegionParameter struct { - value *GetInstanceRegionParameter - isSet bool -} - -func (v NullableGetInstanceRegionParameter) Get() *GetInstanceRegionParameter { - return v.value -} - -func (v *NullableGetInstanceRegionParameter) Set(val *GetInstanceRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableGetInstanceRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableGetInstanceRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetInstanceRegionParameter(val *GetInstanceRegionParameter) *NullableGetInstanceRegionParameter { - return &NullableGetInstanceRegionParameter{value: val, isSet: true} -} - -func (v NullableGetInstanceRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetInstanceRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_get_user_region_parameter.go b/services/postgresflex/v2api/model_get_user_region_parameter.go deleted file mode 100644 index 4ad1fdd6b..000000000 --- a/services/postgresflex/v2api/model_get_user_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// GetUserRegionParameter the model 'GetUserRegionParameter' -type GetUserRegionParameter string - -// List of GetUser_region_parameter -const ( - GETUSERREGIONPARAMETER_EU01 GetUserRegionParameter = "eu01" - GETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetUserRegionParameter = "unknown_default_open_api" -) - -// All allowed values of GetUserRegionParameter enum -var AllowedGetUserRegionParameterEnumValues = []GetUserRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *GetUserRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetUserRegionParameter(value) - for _, existing := range AllowedGetUserRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetUserRegionParameterFromValue returns a pointer to a valid GetUserRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetUserRegionParameterFromValue(v string) (*GetUserRegionParameter, error) { - ev := GetUserRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetUserRegionParameter: valid values are %v", v, AllowedGetUserRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetUserRegionParameter) IsValid() bool { - for _, existing := range AllowedGetUserRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetUser_region_parameter value -func (v GetUserRegionParameter) Ptr() *GetUserRegionParameter { - return &v -} - -type NullableGetUserRegionParameter struct { - value *GetUserRegionParameter - isSet bool -} - -func (v NullableGetUserRegionParameter) Get() *GetUserRegionParameter { - return v.value -} - -func (v *NullableGetUserRegionParameter) Set(val *GetUserRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableGetUserRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableGetUserRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetUserRegionParameter(val *GetUserRegionParameter) *NullableGetUserRegionParameter { - return &NullableGetUserRegionParameter{value: val, isSet: true} -} - -func (v NullableGetUserRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetUserRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_list_backups_region_parameter.go b/services/postgresflex/v2api/model_list_backups_region_parameter.go deleted file mode 100644 index 0e0b3e174..000000000 --- a/services/postgresflex/v2api/model_list_backups_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ListBackupsRegionParameter the model 'ListBackupsRegionParameter' -type ListBackupsRegionParameter string - -// List of ListBackups_region_parameter -const ( - LISTBACKUPSREGIONPARAMETER_EU01 ListBackupsRegionParameter = "eu01" - LISTBACKUPSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListBackupsRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ListBackupsRegionParameter enum -var AllowedListBackupsRegionParameterEnumValues = []ListBackupsRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ListBackupsRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListBackupsRegionParameter(value) - for _, existing := range AllowedListBackupsRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTBACKUPSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListBackupsRegionParameterFromValue returns a pointer to a valid ListBackupsRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListBackupsRegionParameterFromValue(v string) (*ListBackupsRegionParameter, error) { - ev := ListBackupsRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListBackupsRegionParameter: valid values are %v", v, AllowedListBackupsRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListBackupsRegionParameter) IsValid() bool { - for _, existing := range AllowedListBackupsRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListBackups_region_parameter value -func (v ListBackupsRegionParameter) Ptr() *ListBackupsRegionParameter { - return &v -} - -type NullableListBackupsRegionParameter struct { - value *ListBackupsRegionParameter - isSet bool -} - -func (v NullableListBackupsRegionParameter) Get() *ListBackupsRegionParameter { - return v.value -} - -func (v *NullableListBackupsRegionParameter) Set(val *ListBackupsRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListBackupsRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListBackupsRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListBackupsRegionParameter(val *ListBackupsRegionParameter) *NullableListBackupsRegionParameter { - return &NullableListBackupsRegionParameter{value: val, isSet: true} -} - -func (v NullableListBackupsRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListBackupsRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_list_database_parameters_region_parameter.go b/services/postgresflex/v2api/model_list_database_parameters_region_parameter.go deleted file mode 100644 index c11298e10..000000000 --- a/services/postgresflex/v2api/model_list_database_parameters_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ListDatabaseParametersRegionParameter the model 'ListDatabaseParametersRegionParameter' -type ListDatabaseParametersRegionParameter string - -// List of ListDatabaseParameters_region_parameter -const ( - LISTDATABASEPARAMETERSREGIONPARAMETER_EU01 ListDatabaseParametersRegionParameter = "eu01" - LISTDATABASEPARAMETERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDatabaseParametersRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ListDatabaseParametersRegionParameter enum -var AllowedListDatabaseParametersRegionParameterEnumValues = []ListDatabaseParametersRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ListDatabaseParametersRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListDatabaseParametersRegionParameter(value) - for _, existing := range AllowedListDatabaseParametersRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTDATABASEPARAMETERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListDatabaseParametersRegionParameterFromValue returns a pointer to a valid ListDatabaseParametersRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListDatabaseParametersRegionParameterFromValue(v string) (*ListDatabaseParametersRegionParameter, error) { - ev := ListDatabaseParametersRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListDatabaseParametersRegionParameter: valid values are %v", v, AllowedListDatabaseParametersRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListDatabaseParametersRegionParameter) IsValid() bool { - for _, existing := range AllowedListDatabaseParametersRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListDatabaseParameters_region_parameter value -func (v ListDatabaseParametersRegionParameter) Ptr() *ListDatabaseParametersRegionParameter { - return &v -} - -type NullableListDatabaseParametersRegionParameter struct { - value *ListDatabaseParametersRegionParameter - isSet bool -} - -func (v NullableListDatabaseParametersRegionParameter) Get() *ListDatabaseParametersRegionParameter { - return v.value -} - -func (v *NullableListDatabaseParametersRegionParameter) Set(val *ListDatabaseParametersRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListDatabaseParametersRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListDatabaseParametersRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListDatabaseParametersRegionParameter(val *ListDatabaseParametersRegionParameter) *NullableListDatabaseParametersRegionParameter { - return &NullableListDatabaseParametersRegionParameter{value: val, isSet: true} -} - -func (v NullableListDatabaseParametersRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListDatabaseParametersRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_list_databases_region_parameter.go b/services/postgresflex/v2api/model_list_databases_region_parameter.go deleted file mode 100644 index 8d15d1d0b..000000000 --- a/services/postgresflex/v2api/model_list_databases_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ListDatabasesRegionParameter the model 'ListDatabasesRegionParameter' -type ListDatabasesRegionParameter string - -// List of ListDatabases_region_parameter -const ( - LISTDATABASESREGIONPARAMETER_EU01 ListDatabasesRegionParameter = "eu01" - LISTDATABASESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDatabasesRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ListDatabasesRegionParameter enum -var AllowedListDatabasesRegionParameterEnumValues = []ListDatabasesRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ListDatabasesRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListDatabasesRegionParameter(value) - for _, existing := range AllowedListDatabasesRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTDATABASESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListDatabasesRegionParameterFromValue returns a pointer to a valid ListDatabasesRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListDatabasesRegionParameterFromValue(v string) (*ListDatabasesRegionParameter, error) { - ev := ListDatabasesRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListDatabasesRegionParameter: valid values are %v", v, AllowedListDatabasesRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListDatabasesRegionParameter) IsValid() bool { - for _, existing := range AllowedListDatabasesRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListDatabases_region_parameter value -func (v ListDatabasesRegionParameter) Ptr() *ListDatabasesRegionParameter { - return &v -} - -type NullableListDatabasesRegionParameter struct { - value *ListDatabasesRegionParameter - isSet bool -} - -func (v NullableListDatabasesRegionParameter) Get() *ListDatabasesRegionParameter { - return v.value -} - -func (v *NullableListDatabasesRegionParameter) Set(val *ListDatabasesRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListDatabasesRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListDatabasesRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListDatabasesRegionParameter(val *ListDatabasesRegionParameter) *NullableListDatabasesRegionParameter { - return &NullableListDatabasesRegionParameter{value: val, isSet: true} -} - -func (v NullableListDatabasesRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListDatabasesRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_list_flavors_region_parameter.go b/services/postgresflex/v2api/model_list_flavors_region_parameter.go deleted file mode 100644 index 91bff656f..000000000 --- a/services/postgresflex/v2api/model_list_flavors_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ListFlavorsRegionParameter the model 'ListFlavorsRegionParameter' -type ListFlavorsRegionParameter string - -// List of ListFlavors_region_parameter -const ( - LISTFLAVORSREGIONPARAMETER_EU01 ListFlavorsRegionParameter = "eu01" - LISTFLAVORSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListFlavorsRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ListFlavorsRegionParameter enum -var AllowedListFlavorsRegionParameterEnumValues = []ListFlavorsRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ListFlavorsRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListFlavorsRegionParameter(value) - for _, existing := range AllowedListFlavorsRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTFLAVORSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListFlavorsRegionParameterFromValue returns a pointer to a valid ListFlavorsRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListFlavorsRegionParameterFromValue(v string) (*ListFlavorsRegionParameter, error) { - ev := ListFlavorsRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListFlavorsRegionParameter: valid values are %v", v, AllowedListFlavorsRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListFlavorsRegionParameter) IsValid() bool { - for _, existing := range AllowedListFlavorsRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListFlavors_region_parameter value -func (v ListFlavorsRegionParameter) Ptr() *ListFlavorsRegionParameter { - return &v -} - -type NullableListFlavorsRegionParameter struct { - value *ListFlavorsRegionParameter - isSet bool -} - -func (v NullableListFlavorsRegionParameter) Get() *ListFlavorsRegionParameter { - return v.value -} - -func (v *NullableListFlavorsRegionParameter) Set(val *ListFlavorsRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListFlavorsRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListFlavorsRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListFlavorsRegionParameter(val *ListFlavorsRegionParameter) *NullableListFlavorsRegionParameter { - return &NullableListFlavorsRegionParameter{value: val, isSet: true} -} - -func (v NullableListFlavorsRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListFlavorsRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_list_instances_region_parameter.go b/services/postgresflex/v2api/model_list_instances_region_parameter.go deleted file mode 100644 index ee02be93e..000000000 --- a/services/postgresflex/v2api/model_list_instances_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ListInstancesRegionParameter the model 'ListInstancesRegionParameter' -type ListInstancesRegionParameter string - -// List of ListInstances_region_parameter -const ( - LISTINSTANCESREGIONPARAMETER_EU01 ListInstancesRegionParameter = "eu01" - LISTINSTANCESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListInstancesRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ListInstancesRegionParameter enum -var AllowedListInstancesRegionParameterEnumValues = []ListInstancesRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ListInstancesRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListInstancesRegionParameter(value) - for _, existing := range AllowedListInstancesRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTINSTANCESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListInstancesRegionParameterFromValue returns a pointer to a valid ListInstancesRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListInstancesRegionParameterFromValue(v string) (*ListInstancesRegionParameter, error) { - ev := ListInstancesRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListInstancesRegionParameter: valid values are %v", v, AllowedListInstancesRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListInstancesRegionParameter) IsValid() bool { - for _, existing := range AllowedListInstancesRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListInstances_region_parameter value -func (v ListInstancesRegionParameter) Ptr() *ListInstancesRegionParameter { - return &v -} - -type NullableListInstancesRegionParameter struct { - value *ListInstancesRegionParameter - isSet bool -} - -func (v NullableListInstancesRegionParameter) Get() *ListInstancesRegionParameter { - return v.value -} - -func (v *NullableListInstancesRegionParameter) Set(val *ListInstancesRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListInstancesRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListInstancesRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListInstancesRegionParameter(val *ListInstancesRegionParameter) *NullableListInstancesRegionParameter { - return &NullableListInstancesRegionParameter{value: val, isSet: true} -} - -func (v NullableListInstancesRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListInstancesRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_list_metrics_region_parameter.go b/services/postgresflex/v2api/model_list_metrics_region_parameter.go deleted file mode 100644 index 68289f811..000000000 --- a/services/postgresflex/v2api/model_list_metrics_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ListMetricsRegionParameter the model 'ListMetricsRegionParameter' -type ListMetricsRegionParameter string - -// List of ListMetrics_region_parameter -const ( - LISTMETRICSREGIONPARAMETER_EU01 ListMetricsRegionParameter = "eu01" - LISTMETRICSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListMetricsRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ListMetricsRegionParameter enum -var AllowedListMetricsRegionParameterEnumValues = []ListMetricsRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ListMetricsRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListMetricsRegionParameter(value) - for _, existing := range AllowedListMetricsRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTMETRICSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListMetricsRegionParameterFromValue returns a pointer to a valid ListMetricsRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListMetricsRegionParameterFromValue(v string) (*ListMetricsRegionParameter, error) { - ev := ListMetricsRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListMetricsRegionParameter: valid values are %v", v, AllowedListMetricsRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListMetricsRegionParameter) IsValid() bool { - for _, existing := range AllowedListMetricsRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListMetrics_region_parameter value -func (v ListMetricsRegionParameter) Ptr() *ListMetricsRegionParameter { - return &v -} - -type NullableListMetricsRegionParameter struct { - value *ListMetricsRegionParameter - isSet bool -} - -func (v NullableListMetricsRegionParameter) Get() *ListMetricsRegionParameter { - return v.value -} - -func (v *NullableListMetricsRegionParameter) Set(val *ListMetricsRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListMetricsRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListMetricsRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListMetricsRegionParameter(val *ListMetricsRegionParameter) *NullableListMetricsRegionParameter { - return &NullableListMetricsRegionParameter{value: val, isSet: true} -} - -func (v NullableListMetricsRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListMetricsRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_list_storages_region_parameter.go b/services/postgresflex/v2api/model_list_storages_region_parameter.go deleted file mode 100644 index 04642b698..000000000 --- a/services/postgresflex/v2api/model_list_storages_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ListStoragesRegionParameter the model 'ListStoragesRegionParameter' -type ListStoragesRegionParameter string - -// List of ListStorages_region_parameter -const ( - LISTSTORAGESREGIONPARAMETER_EU01 ListStoragesRegionParameter = "eu01" - LISTSTORAGESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListStoragesRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ListStoragesRegionParameter enum -var AllowedListStoragesRegionParameterEnumValues = []ListStoragesRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ListStoragesRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListStoragesRegionParameter(value) - for _, existing := range AllowedListStoragesRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTSTORAGESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListStoragesRegionParameterFromValue returns a pointer to a valid ListStoragesRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListStoragesRegionParameterFromValue(v string) (*ListStoragesRegionParameter, error) { - ev := ListStoragesRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListStoragesRegionParameter: valid values are %v", v, AllowedListStoragesRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListStoragesRegionParameter) IsValid() bool { - for _, existing := range AllowedListStoragesRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListStorages_region_parameter value -func (v ListStoragesRegionParameter) Ptr() *ListStoragesRegionParameter { - return &v -} - -type NullableListStoragesRegionParameter struct { - value *ListStoragesRegionParameter - isSet bool -} - -func (v NullableListStoragesRegionParameter) Get() *ListStoragesRegionParameter { - return v.value -} - -func (v *NullableListStoragesRegionParameter) Set(val *ListStoragesRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListStoragesRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListStoragesRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListStoragesRegionParameter(val *ListStoragesRegionParameter) *NullableListStoragesRegionParameter { - return &NullableListStoragesRegionParameter{value: val, isSet: true} -} - -func (v NullableListStoragesRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListStoragesRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_list_users_region_parameter.go b/services/postgresflex/v2api/model_list_users_region_parameter.go deleted file mode 100644 index 63c298f53..000000000 --- a/services/postgresflex/v2api/model_list_users_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ListUsersRegionParameter the model 'ListUsersRegionParameter' -type ListUsersRegionParameter string - -// List of ListUsers_region_parameter -const ( - LISTUSERSREGIONPARAMETER_EU01 ListUsersRegionParameter = "eu01" - LISTUSERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListUsersRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ListUsersRegionParameter enum -var AllowedListUsersRegionParameterEnumValues = []ListUsersRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ListUsersRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListUsersRegionParameter(value) - for _, existing := range AllowedListUsersRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTUSERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListUsersRegionParameterFromValue returns a pointer to a valid ListUsersRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListUsersRegionParameterFromValue(v string) (*ListUsersRegionParameter, error) { - ev := ListUsersRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListUsersRegionParameter: valid values are %v", v, AllowedListUsersRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListUsersRegionParameter) IsValid() bool { - for _, existing := range AllowedListUsersRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListUsers_region_parameter value -func (v ListUsersRegionParameter) Ptr() *ListUsersRegionParameter { - return &v -} - -type NullableListUsersRegionParameter struct { - value *ListUsersRegionParameter - isSet bool -} - -func (v NullableListUsersRegionParameter) Get() *ListUsersRegionParameter { - return v.value -} - -func (v *NullableListUsersRegionParameter) Set(val *ListUsersRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListUsersRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListUsersRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListUsersRegionParameter(val *ListUsersRegionParameter) *NullableListUsersRegionParameter { - return &NullableListUsersRegionParameter{value: val, isSet: true} -} - -func (v NullableListUsersRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListUsersRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_list_versions_region_parameter.go b/services/postgresflex/v2api/model_list_versions_region_parameter.go deleted file mode 100644 index 70fe2d15a..000000000 --- a/services/postgresflex/v2api/model_list_versions_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ListVersionsRegionParameter the model 'ListVersionsRegionParameter' -type ListVersionsRegionParameter string - -// List of ListVersions_region_parameter -const ( - LISTVERSIONSREGIONPARAMETER_EU01 ListVersionsRegionParameter = "eu01" - LISTVERSIONSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListVersionsRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ListVersionsRegionParameter enum -var AllowedListVersionsRegionParameterEnumValues = []ListVersionsRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ListVersionsRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListVersionsRegionParameter(value) - for _, existing := range AllowedListVersionsRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTVERSIONSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListVersionsRegionParameterFromValue returns a pointer to a valid ListVersionsRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListVersionsRegionParameterFromValue(v string) (*ListVersionsRegionParameter, error) { - ev := ListVersionsRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListVersionsRegionParameter: valid values are %v", v, AllowedListVersionsRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListVersionsRegionParameter) IsValid() bool { - for _, existing := range AllowedListVersionsRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListVersions_region_parameter value -func (v ListVersionsRegionParameter) Ptr() *ListVersionsRegionParameter { - return &v -} - -type NullableListVersionsRegionParameter struct { - value *ListVersionsRegionParameter - isSet bool -} - -func (v NullableListVersionsRegionParameter) Get() *ListVersionsRegionParameter { - return v.value -} - -func (v *NullableListVersionsRegionParameter) Set(val *ListVersionsRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListVersionsRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListVersionsRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListVersionsRegionParameter(val *ListVersionsRegionParameter) *NullableListVersionsRegionParameter { - return &NullableListVersionsRegionParameter{value: val, isSet: true} -} - -func (v NullableListVersionsRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListVersionsRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_partial_update_instance_region_parameter.go b/services/postgresflex/v2api/model_partial_update_instance_region_parameter.go deleted file mode 100644 index 2e332486e..000000000 --- a/services/postgresflex/v2api/model_partial_update_instance_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// PartialUpdateInstanceRegionParameter the model 'PartialUpdateInstanceRegionParameter' -type PartialUpdateInstanceRegionParameter string - -// List of PartialUpdateInstance_region_parameter -const ( - PARTIALUPDATEINSTANCEREGIONPARAMETER_EU01 PartialUpdateInstanceRegionParameter = "eu01" - PARTIALUPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API PartialUpdateInstanceRegionParameter = "unknown_default_open_api" -) - -// All allowed values of PartialUpdateInstanceRegionParameter enum -var AllowedPartialUpdateInstanceRegionParameterEnumValues = []PartialUpdateInstanceRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *PartialUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := PartialUpdateInstanceRegionParameter(value) - for _, existing := range AllowedPartialUpdateInstanceRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = PARTIALUPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewPartialUpdateInstanceRegionParameterFromValue returns a pointer to a valid PartialUpdateInstanceRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewPartialUpdateInstanceRegionParameterFromValue(v string) (*PartialUpdateInstanceRegionParameter, error) { - ev := PartialUpdateInstanceRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for PartialUpdateInstanceRegionParameter: valid values are %v", v, AllowedPartialUpdateInstanceRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v PartialUpdateInstanceRegionParameter) IsValid() bool { - for _, existing := range AllowedPartialUpdateInstanceRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to PartialUpdateInstance_region_parameter value -func (v PartialUpdateInstanceRegionParameter) Ptr() *PartialUpdateInstanceRegionParameter { - return &v -} - -type NullablePartialUpdateInstanceRegionParameter struct { - value *PartialUpdateInstanceRegionParameter - isSet bool -} - -func (v NullablePartialUpdateInstanceRegionParameter) Get() *PartialUpdateInstanceRegionParameter { - return v.value -} - -func (v *NullablePartialUpdateInstanceRegionParameter) Set(val *PartialUpdateInstanceRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullablePartialUpdateInstanceRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullablePartialUpdateInstanceRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePartialUpdateInstanceRegionParameter(val *PartialUpdateInstanceRegionParameter) *NullablePartialUpdateInstanceRegionParameter { - return &NullablePartialUpdateInstanceRegionParameter{value: val, isSet: true} -} - -func (v NullablePartialUpdateInstanceRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePartialUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_partial_update_user_region_parameter.go b/services/postgresflex/v2api/model_partial_update_user_region_parameter.go deleted file mode 100644 index bc506e83d..000000000 --- a/services/postgresflex/v2api/model_partial_update_user_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// PartialUpdateUserRegionParameter the model 'PartialUpdateUserRegionParameter' -type PartialUpdateUserRegionParameter string - -// List of PartialUpdateUser_region_parameter -const ( - PARTIALUPDATEUSERREGIONPARAMETER_EU01 PartialUpdateUserRegionParameter = "eu01" - PARTIALUPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API PartialUpdateUserRegionParameter = "unknown_default_open_api" -) - -// All allowed values of PartialUpdateUserRegionParameter enum -var AllowedPartialUpdateUserRegionParameterEnumValues = []PartialUpdateUserRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *PartialUpdateUserRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := PartialUpdateUserRegionParameter(value) - for _, existing := range AllowedPartialUpdateUserRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = PARTIALUPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewPartialUpdateUserRegionParameterFromValue returns a pointer to a valid PartialUpdateUserRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewPartialUpdateUserRegionParameterFromValue(v string) (*PartialUpdateUserRegionParameter, error) { - ev := PartialUpdateUserRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for PartialUpdateUserRegionParameter: valid values are %v", v, AllowedPartialUpdateUserRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v PartialUpdateUserRegionParameter) IsValid() bool { - for _, existing := range AllowedPartialUpdateUserRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to PartialUpdateUser_region_parameter value -func (v PartialUpdateUserRegionParameter) Ptr() *PartialUpdateUserRegionParameter { - return &v -} - -type NullablePartialUpdateUserRegionParameter struct { - value *PartialUpdateUserRegionParameter - isSet bool -} - -func (v NullablePartialUpdateUserRegionParameter) Get() *PartialUpdateUserRegionParameter { - return v.value -} - -func (v *NullablePartialUpdateUserRegionParameter) Set(val *PartialUpdateUserRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullablePartialUpdateUserRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullablePartialUpdateUserRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePartialUpdateUserRegionParameter(val *PartialUpdateUserRegionParameter) *NullablePartialUpdateUserRegionParameter { - return &NullablePartialUpdateUserRegionParameter{value: val, isSet: true} -} - -func (v NullablePartialUpdateUserRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePartialUpdateUserRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_reset_user_region_parameter.go b/services/postgresflex/v2api/model_reset_user_region_parameter.go deleted file mode 100644 index a3d16b5e3..000000000 --- a/services/postgresflex/v2api/model_reset_user_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// ResetUserRegionParameter the model 'ResetUserRegionParameter' -type ResetUserRegionParameter string - -// List of ResetUser_region_parameter -const ( - RESETUSERREGIONPARAMETER_EU01 ResetUserRegionParameter = "eu01" - RESETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ResetUserRegionParameter = "unknown_default_open_api" -) - -// All allowed values of ResetUserRegionParameter enum -var AllowedResetUserRegionParameterEnumValues = []ResetUserRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *ResetUserRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ResetUserRegionParameter(value) - for _, existing := range AllowedResetUserRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = RESETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewResetUserRegionParameterFromValue returns a pointer to a valid ResetUserRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewResetUserRegionParameterFromValue(v string) (*ResetUserRegionParameter, error) { - ev := ResetUserRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ResetUserRegionParameter: valid values are %v", v, AllowedResetUserRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ResetUserRegionParameter) IsValid() bool { - for _, existing := range AllowedResetUserRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ResetUser_region_parameter value -func (v ResetUserRegionParameter) Ptr() *ResetUserRegionParameter { - return &v -} - -type NullableResetUserRegionParameter struct { - value *ResetUserRegionParameter - isSet bool -} - -func (v NullableResetUserRegionParameter) Get() *ResetUserRegionParameter { - return v.value -} - -func (v *NullableResetUserRegionParameter) Set(val *ResetUserRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableResetUserRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableResetUserRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableResetUserRegionParameter(val *ResetUserRegionParameter) *NullableResetUserRegionParameter { - return &NullableResetUserRegionParameter{value: val, isSet: true} -} - -func (v NullableResetUserRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableResetUserRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_update_backup_schedule_region_parameter.go b/services/postgresflex/v2api/model_update_backup_schedule_region_parameter.go deleted file mode 100644 index 39e2939a0..000000000 --- a/services/postgresflex/v2api/model_update_backup_schedule_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// UpdateBackupScheduleRegionParameter the model 'UpdateBackupScheduleRegionParameter' -type UpdateBackupScheduleRegionParameter string - -// List of UpdateBackupSchedule_region_parameter -const ( - UPDATEBACKUPSCHEDULEREGIONPARAMETER_EU01 UpdateBackupScheduleRegionParameter = "eu01" - UPDATEBACKUPSCHEDULEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API UpdateBackupScheduleRegionParameter = "unknown_default_open_api" -) - -// All allowed values of UpdateBackupScheduleRegionParameter enum -var AllowedUpdateBackupScheduleRegionParameterEnumValues = []UpdateBackupScheduleRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *UpdateBackupScheduleRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := UpdateBackupScheduleRegionParameter(value) - for _, existing := range AllowedUpdateBackupScheduleRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = UPDATEBACKUPSCHEDULEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewUpdateBackupScheduleRegionParameterFromValue returns a pointer to a valid UpdateBackupScheduleRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewUpdateBackupScheduleRegionParameterFromValue(v string) (*UpdateBackupScheduleRegionParameter, error) { - ev := UpdateBackupScheduleRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for UpdateBackupScheduleRegionParameter: valid values are %v", v, AllowedUpdateBackupScheduleRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v UpdateBackupScheduleRegionParameter) IsValid() bool { - for _, existing := range AllowedUpdateBackupScheduleRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to UpdateBackupSchedule_region_parameter value -func (v UpdateBackupScheduleRegionParameter) Ptr() *UpdateBackupScheduleRegionParameter { - return &v -} - -type NullableUpdateBackupScheduleRegionParameter struct { - value *UpdateBackupScheduleRegionParameter - isSet bool -} - -func (v NullableUpdateBackupScheduleRegionParameter) Get() *UpdateBackupScheduleRegionParameter { - return v.value -} - -func (v *NullableUpdateBackupScheduleRegionParameter) Set(val *UpdateBackupScheduleRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateBackupScheduleRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateBackupScheduleRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateBackupScheduleRegionParameter(val *UpdateBackupScheduleRegionParameter) *NullableUpdateBackupScheduleRegionParameter { - return &NullableUpdateBackupScheduleRegionParameter{value: val, isSet: true} -} - -func (v NullableUpdateBackupScheduleRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateBackupScheduleRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_update_instance_region_parameter.go b/services/postgresflex/v2api/model_update_instance_region_parameter.go deleted file mode 100644 index 678bd6f0e..000000000 --- a/services/postgresflex/v2api/model_update_instance_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// UpdateInstanceRegionParameter the model 'UpdateInstanceRegionParameter' -type UpdateInstanceRegionParameter string - -// List of UpdateInstance_region_parameter -const ( - UPDATEINSTANCEREGIONPARAMETER_EU01 UpdateInstanceRegionParameter = "eu01" - UPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API UpdateInstanceRegionParameter = "unknown_default_open_api" -) - -// All allowed values of UpdateInstanceRegionParameter enum -var AllowedUpdateInstanceRegionParameterEnumValues = []UpdateInstanceRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *UpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := UpdateInstanceRegionParameter(value) - for _, existing := range AllowedUpdateInstanceRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = UPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewUpdateInstanceRegionParameterFromValue returns a pointer to a valid UpdateInstanceRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewUpdateInstanceRegionParameterFromValue(v string) (*UpdateInstanceRegionParameter, error) { - ev := UpdateInstanceRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for UpdateInstanceRegionParameter: valid values are %v", v, AllowedUpdateInstanceRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v UpdateInstanceRegionParameter) IsValid() bool { - for _, existing := range AllowedUpdateInstanceRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to UpdateInstance_region_parameter value -func (v UpdateInstanceRegionParameter) Ptr() *UpdateInstanceRegionParameter { - return &v -} - -type NullableUpdateInstanceRegionParameter struct { - value *UpdateInstanceRegionParameter - isSet bool -} - -func (v NullableUpdateInstanceRegionParameter) Get() *UpdateInstanceRegionParameter { - return v.value -} - -func (v *NullableUpdateInstanceRegionParameter) Set(val *UpdateInstanceRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateInstanceRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateInstanceRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateInstanceRegionParameter(val *UpdateInstanceRegionParameter) *NullableUpdateInstanceRegionParameter { - return &NullableUpdateInstanceRegionParameter{value: val, isSet: true} -} - -func (v NullableUpdateInstanceRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v2api/model_update_user_region_parameter.go b/services/postgresflex/v2api/model_update_user_region_parameter.go deleted file mode 100644 index 862b36896..000000000 --- a/services/postgresflex/v2api/model_update_user_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// UpdateUserRegionParameter the model 'UpdateUserRegionParameter' -type UpdateUserRegionParameter string - -// List of UpdateUser_region_parameter -const ( - UPDATEUSERREGIONPARAMETER_EU01 UpdateUserRegionParameter = "eu01" - UPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API UpdateUserRegionParameter = "unknown_default_open_api" -) - -// All allowed values of UpdateUserRegionParameter enum -var AllowedUpdateUserRegionParameterEnumValues = []UpdateUserRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *UpdateUserRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := UpdateUserRegionParameter(value) - for _, existing := range AllowedUpdateUserRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = UPDATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewUpdateUserRegionParameterFromValue returns a pointer to a valid UpdateUserRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewUpdateUserRegionParameterFromValue(v string) (*UpdateUserRegionParameter, error) { - ev := UpdateUserRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for UpdateUserRegionParameter: valid values are %v", v, AllowedUpdateUserRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v UpdateUserRegionParameter) IsValid() bool { - for _, existing := range AllowedUpdateUserRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to UpdateUser_region_parameter value -func (v UpdateUserRegionParameter) Ptr() *UpdateUserRegionParameter { - return &v -} - -type NullableUpdateUserRegionParameter struct { - value *UpdateUserRegionParameter - isSet bool -} - -func (v NullableUpdateUserRegionParameter) Get() *UpdateUserRegionParameter { - return v.value -} - -func (v *NullableUpdateUserRegionParameter) Set(val *UpdateUserRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateUserRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateUserRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateUserRegionParameter(val *UpdateUserRegionParameter) *NullableUpdateUserRegionParameter { - return &NullableUpdateUserRegionParameter{value: val, isSet: true} -} - -func (v NullableUpdateUserRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateUserRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v3alpha1api/api_default.go b/services/postgresflex/v3alpha1api/api_default.go index 18ed8662d..378953bd5 100644 --- a/services/postgresflex/v3alpha1api/api_default.go +++ b/services/postgresflex/v3alpha1api/api_default.go @@ -35,7 +35,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiCloneRequestRequest */ - CloneRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCloneRequestRequest + CloneRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCloneRequestRequest // CloneRequestExecute executes the request // @return CloneResponse @@ -52,7 +52,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiCreateDatabaseRequestRequest */ - CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest + CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest // CreateDatabaseRequestExecute executes the request // @return CreateDatabaseResponse @@ -68,7 +68,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateInstanceRequestRequest */ - CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest + CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest // CreateInstanceRequestExecute executes the request // @return CreateInstanceResponse @@ -85,7 +85,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiCreateUserRequestRequest */ - CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest + CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest // CreateUserRequestExecute executes the request // @return CreateUserResponse @@ -103,7 +103,7 @@ type DefaultAPI interface { @param databaseId The ID of the database. @return ApiDeleteDatabaseRequestRequest */ - DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest + DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest // DeleteDatabaseRequestExecute executes the request DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) error @@ -119,7 +119,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiDeleteInstanceRequestRequest */ - DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest + DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest // DeleteInstanceRequestExecute executes the request DeleteInstanceRequestExecute(r ApiDeleteInstanceRequestRequest) error @@ -136,7 +136,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiDeleteUserRequestRequest */ - DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiDeleteUserRequestRequest + DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiDeleteUserRequestRequest // DeleteUserRequestExecute executes the request DeleteUserRequestExecute(r ApiDeleteUserRequestRequest) error @@ -153,7 +153,7 @@ type DefaultAPI interface { @param backupId The ID of the backup. @return ApiGetBackupRequestRequest */ - GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int32) ApiGetBackupRequestRequest + GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest // GetBackupRequestExecute executes the request // @return GetBackupResponse @@ -170,7 +170,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiGetCollationsRequestRequest */ - GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest + GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest // GetCollationsRequestExecute executes the request // @return GetCollationsResponse @@ -188,7 +188,7 @@ type DefaultAPI interface { @param databaseId The ID of the database. @return ApiGetDatabaseRequestRequest */ - GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest + GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest // GetDatabaseRequestExecute executes the request // @return GetDatabaseResponse @@ -204,7 +204,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetFlavorsRequestRequest */ - GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest + GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest // GetFlavorsRequestExecute executes the request // @return GetFlavorsResponse @@ -221,7 +221,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiGetInstanceRequestRequest */ - GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest + GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest // GetInstanceRequestExecute executes the request // @return GetInstanceResponse @@ -239,7 +239,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiGetUserRequestRequest */ - GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiGetUserRequestRequest + GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiGetUserRequestRequest // GetUserRequestExecute executes the request // @return GetUserResponse @@ -255,7 +255,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetVersionsRequestRequest */ - GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest + GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest // GetVersionsRequestExecute executes the request // @return GetVersionsResponse @@ -272,7 +272,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListBackupsRequestRequest */ - ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest + ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest // ListBackupsRequestExecute executes the request // @return ListBackupResponse @@ -289,7 +289,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListDatabasesRequestRequest */ - ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest + ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest // ListDatabasesRequestExecute executes the request // @return ListDatabasesResponse @@ -305,7 +305,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListInstancesRequestRequest */ - ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest + ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest // ListInstancesRequestExecute executes the request // @return ListInstancesResponse @@ -322,7 +322,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListRolesRequestRequest */ - ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest + ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest // ListRolesRequestExecute executes the request // @return ListRolesResponse @@ -339,7 +339,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListUsersRequestRequest */ - ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest + ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest // ListUsersRequestExecute executes the request // @return ListUserResponse @@ -356,7 +356,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiProtectInstanceRequestRequest */ - ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest + ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest // ProtectInstanceRequestExecute executes the request // @return ProtectInstanceResponse @@ -374,7 +374,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiResetUserRequestRequest */ - ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiResetUserRequestRequest + ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiResetUserRequestRequest // ResetUserRequestExecute executes the request // @return ResetUserResponse @@ -392,7 +392,7 @@ type DefaultAPI interface { @param databaseId The ID of the database. @return ApiUpdateDatabasePartiallyRequestRequest */ - UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest + UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest // UpdateDatabasePartiallyRequestExecute executes the request UpdateDatabasePartiallyRequestExecute(r ApiUpdateDatabasePartiallyRequestRequest) error @@ -409,7 +409,7 @@ type DefaultAPI interface { @param databaseId The ID of the database. @return ApiUpdateDatabaseRequestRequest */ - UpdateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest + UpdateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest // UpdateDatabaseRequestExecute executes the request UpdateDatabaseRequestExecute(r ApiUpdateDatabaseRequestRequest) error @@ -425,7 +425,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiUpdateInstancePartiallyRequestRequest */ - UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest + UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest // UpdateInstancePartiallyRequestExecute executes the request UpdateInstancePartiallyRequestExecute(r ApiUpdateInstancePartiallyRequestRequest) error @@ -441,7 +441,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiUpdateInstanceRequestRequest */ - UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest + UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest // UpdateInstanceRequestExecute executes the request UpdateInstanceRequestExecute(r ApiUpdateInstanceRequestRequest) error @@ -458,7 +458,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiUpdateUserPartiallyRequestRequest */ - UpdateUserPartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest + UpdateUserPartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest // UpdateUserPartiallyRequestExecute executes the request UpdateUserPartiallyRequestExecute(r ApiUpdateUserPartiallyRequestRequest) error @@ -475,7 +475,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiUpdateUserRequestRequest */ - UpdateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserRequestRequest + UpdateUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserRequestRequest // UpdateUserRequestExecute executes the request UpdateUserRequestExecute(r ApiUpdateUserRequestRequest) error @@ -488,7 +488,7 @@ type ApiCloneRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string cloneRequestPayload *CloneRequestPayload } @@ -514,7 +514,7 @@ Clone Instance @param instanceId The ID of the instance. @return ApiCloneRequestRequest */ -func (a *DefaultAPIService) CloneRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCloneRequestRequest { +func (a *DefaultAPIService) CloneRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCloneRequestRequest { return ApiCloneRequestRequest{ ApiService: a, ctx: ctx, @@ -696,7 +696,7 @@ type ApiCreateDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string createDatabaseRequestPayload *CreateDatabaseRequestPayload } @@ -722,7 +722,7 @@ Create database for a user. Note: The name of a valid user must be provided in t @param instanceId The ID of the instance. @return ApiCreateDatabaseRequestRequest */ -func (a *DefaultAPIService) CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest { +func (a *DefaultAPIService) CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest { return ApiCreateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -918,7 +918,7 @@ type ApiCreateInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string createInstanceRequestPayload *CreateInstanceRequestPayload } @@ -942,7 +942,7 @@ Create a new instance of a postgres database instance. @param region The region which should be addressed @return ApiCreateInstanceRequestRequest */ -func (a *DefaultAPIService) CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest { +func (a *DefaultAPIService) CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest { return ApiCreateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -1114,7 +1114,7 @@ type ApiCreateUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string createUserRequestPayload *CreateUserRequestPayload } @@ -1140,7 +1140,7 @@ Create user for an instance. @param instanceId The ID of the instance. @return ApiCreateUserRequestRequest */ -func (a *DefaultAPIService) CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest { +func (a *DefaultAPIService) CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest { return ApiCreateUserRequestRequest{ ApiService: a, ctx: ctx, @@ -1325,7 +1325,7 @@ type ApiDeleteDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string databaseId int32 } @@ -1346,7 +1346,7 @@ Delete database for an instance. @param databaseId The ID of the database. @return ApiDeleteDatabaseRequestRequest */ -func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest { +func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest { return ApiDeleteDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -1504,7 +1504,7 @@ type ApiDeleteInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string } @@ -1523,7 +1523,7 @@ Delete an available postgres instance. @param instanceId The ID of the instance. @return ApiDeleteInstanceRequestRequest */ -func (a *DefaultAPIService) DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest { +func (a *DefaultAPIService) DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest { return ApiDeleteInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -1679,7 +1679,7 @@ type ApiDeleteUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string userId int32 } @@ -1700,7 +1700,7 @@ Delete an user from a specific instance. @param userId The ID of the user. @return ApiDeleteUserRequestRequest */ -func (a *DefaultAPIService) DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiDeleteUserRequestRequest { +func (a *DefaultAPIService) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiDeleteUserRequestRequest { return ApiDeleteUserRequestRequest{ ApiService: a, ctx: ctx, @@ -1858,7 +1858,7 @@ type ApiGetBackupRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string backupId int32 } @@ -1879,7 +1879,7 @@ Get information about a specific backup for an instance. @param backupId The ID of the backup. @return ApiGetBackupRequestRequest */ -func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int32) ApiGetBackupRequestRequest { +func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest { return ApiGetBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -2050,7 +2050,7 @@ type ApiGetCollationsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string } @@ -2069,7 +2069,7 @@ Get available collations for an instance @param instanceId The ID of the instance. @return ApiGetCollationsRequestRequest */ -func (a *DefaultAPIService) GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest { +func (a *DefaultAPIService) GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest { return ApiGetCollationsRequestRequest{ ApiService: a, ctx: ctx, @@ -2238,7 +2238,7 @@ type ApiGetDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string databaseId int32 } @@ -2259,7 +2259,7 @@ Get information about a specific database in an instance. @param databaseId The ID of the database. @return ApiGetDatabaseRequestRequest */ -func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest { +func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest { return ApiGetDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -2419,7 +2419,7 @@ type ApiGetFlavorsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string page *int32 size *int32 sort *FlavorSort @@ -2457,7 +2457,7 @@ Get all available flavors for a project. @param region The region which should be addressed @return ApiGetFlavorsRequestRequest */ -func (a *DefaultAPIService) GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest { +func (a *DefaultAPIService) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest { return ApiGetFlavorsRequestRequest{ ApiService: a, ctx: ctx, @@ -2641,7 +2641,7 @@ type ApiGetInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string } @@ -2660,7 +2660,7 @@ Get information about a specific available instance @param instanceId The ID of the instance. @return ApiGetInstanceRequestRequest */ -func (a *DefaultAPIService) GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest { +func (a *DefaultAPIService) GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest { return ApiGetInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -2818,7 +2818,7 @@ type ApiGetUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string userId int32 } @@ -2839,7 +2839,7 @@ Get a specific available user for an instance. @param userId The ID of the user. @return ApiGetUserRequestRequest */ -func (a *DefaultAPIService) GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiGetUserRequestRequest { +func (a *DefaultAPIService) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiGetUserRequestRequest { return ApiGetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -2999,7 +2999,7 @@ type ApiGetVersionsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string } func (r ApiGetVersionsRequestRequest) Execute() (*GetVersionsResponse, error) { @@ -3016,7 +3016,7 @@ Get available postgres versions for the project. @param region The region which should be addressed @return ApiGetVersionsRequestRequest */ -func (a *DefaultAPIService) GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest { +func (a *DefaultAPIService) GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest { return ApiGetVersionsRequestRequest{ ApiService: a, ctx: ctx, @@ -3183,7 +3183,7 @@ type ApiListBackupsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string page *int32 size *int32 @@ -3223,7 +3223,7 @@ List all backups which are available for a specific instance. @param instanceId The ID of the instance. @return ApiListBackupsRequestRequest */ -func (a *DefaultAPIService) ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest { +func (a *DefaultAPIService) ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest { return ApiListBackupsRequestRequest{ ApiService: a, ctx: ctx, @@ -3409,7 +3409,7 @@ type ApiListDatabasesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string page *int32 size *int32 @@ -3449,7 +3449,7 @@ List available databases for an instance. @param instanceId The ID of the instance. @return ApiListDatabasesRequestRequest */ -func (a *DefaultAPIService) ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest { +func (a *DefaultAPIService) ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest { return ApiListDatabasesRequestRequest{ ApiService: a, ctx: ctx, @@ -3624,7 +3624,7 @@ type ApiListInstancesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string page *int32 size *int32 sort *InstanceSort @@ -3662,7 +3662,7 @@ List all available instances for your project. @param region The region which should be addressed @return ApiListInstancesRequestRequest */ -func (a *DefaultAPIService) ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest { +func (a *DefaultAPIService) ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest { return ApiListInstancesRequestRequest{ ApiService: a, ctx: ctx, @@ -3835,7 +3835,7 @@ type ApiListRolesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string } @@ -3854,7 +3854,7 @@ List available roles for an instance. @param instanceId The ID of the instance. @return ApiListRolesRequestRequest */ -func (a *DefaultAPIService) ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest { +func (a *DefaultAPIService) ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest { return ApiListRolesRequestRequest{ ApiService: a, ctx: ctx, @@ -4012,7 +4012,7 @@ type ApiListUsersRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string page *int32 size *int32 @@ -4052,7 +4052,7 @@ List available users for an instance. @param instanceId The ID of the instance. @return ApiListUsersRequestRequest */ -func (a *DefaultAPIService) ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest { +func (a *DefaultAPIService) ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest { return ApiListUsersRequestRequest{ ApiService: a, ctx: ctx, @@ -4227,7 +4227,7 @@ type ApiProtectInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string protectInstanceRequestPayload *ProtectInstanceRequestPayload } @@ -4253,7 +4253,7 @@ Toggle the deletion protection for an instance. @param instanceId The ID of the instance. @return ApiProtectInstanceRequestRequest */ -func (a *DefaultAPIService) ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest { +func (a *DefaultAPIService) ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest { return ApiProtectInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -4438,7 +4438,7 @@ type ApiResetUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string userId int32 } @@ -4459,7 +4459,7 @@ Reset an user from an specific instance. @param userId The ID of the user. @return ApiResetUserRequestRequest */ -func (a *DefaultAPIService) ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiResetUserRequestRequest { +func (a *DefaultAPIService) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiResetUserRequestRequest { return ApiResetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -4641,7 +4641,7 @@ type ApiUpdateDatabasePartiallyRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string databaseId int32 updateDatabasePartiallyRequestPayload *UpdateDatabasePartiallyRequestPayload @@ -4669,7 +4669,7 @@ Update a database partially in an instance. @param databaseId The ID of the database. @return ApiUpdateDatabasePartiallyRequestRequest */ -func (a *DefaultAPIService) UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest { +func (a *DefaultAPIService) UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest { return ApiUpdateDatabasePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -4843,7 +4843,7 @@ type ApiUpdateDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string databaseId int32 updateDatabaseRequestPayload *UpdateDatabaseRequestPayload @@ -4871,7 +4871,7 @@ Update a database in an instance. @param databaseId The ID of the database. @return ApiUpdateDatabaseRequestRequest */ -func (a *DefaultAPIService) UpdateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest { +func (a *DefaultAPIService) UpdateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest { return ApiUpdateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -5045,7 +5045,7 @@ type ApiUpdateInstancePartiallyRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string updateInstancePartiallyRequestPayload *UpdateInstancePartiallyRequestPayload } @@ -5071,7 +5071,7 @@ Update an available instance of a postgres database. No fields are required. @param instanceId The ID of the instance. @return ApiUpdateInstancePartiallyRequestRequest */ -func (a *DefaultAPIService) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest { +func (a *DefaultAPIService) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest { return ApiUpdateInstancePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -5243,7 +5243,7 @@ type ApiUpdateInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string updateInstanceRequestPayload *UpdateInstanceRequestPayload } @@ -5269,7 +5269,7 @@ Updates an available instance of a postgres database @param instanceId The ID of the instance. @return ApiUpdateInstanceRequestRequest */ -func (a *DefaultAPIService) UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest { +func (a *DefaultAPIService) UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest { return ApiUpdateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -5441,7 +5441,7 @@ type ApiUpdateUserPartiallyRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string userId int32 updateUserPartiallyRequestPayload *UpdateUserPartiallyRequestPayload @@ -5469,7 +5469,7 @@ Update an user partially for an instance. @param userId The ID of the user. @return ApiUpdateUserPartiallyRequestRequest */ -func (a *DefaultAPIService) UpdateUserPartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest { +func (a *DefaultAPIService) UpdateUserPartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest { return ApiUpdateUserPartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -5640,7 +5640,7 @@ type ApiUpdateUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region GetFlavorsRequestRegionParameter + region string instanceId string userId int32 updateUserRequestPayload *UpdateUserRequestPayload @@ -5668,7 +5668,7 @@ Update user for an instance. @param userId The ID of the user. @return ApiUpdateUserRequestRequest */ -func (a *DefaultAPIService) UpdateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserRequestRequest { +func (a *DefaultAPIService) UpdateUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserRequestRequest { return ApiUpdateUserRequestRequest{ ApiService: a, ctx: ctx, diff --git a/services/postgresflex/v3alpha1api/api_default_mock.go b/services/postgresflex/v3alpha1api/api_default_mock.go index 4fd557b2e..8a2fefee0 100644 --- a/services/postgresflex/v3alpha1api/api_default_mock.go +++ b/services/postgresflex/v3alpha1api/api_default_mock.go @@ -77,7 +77,7 @@ type DefaultAPIServiceMock struct { UpdateUserRequestExecuteMock *func(r ApiUpdateUserRequestRequest) error } -func (a DefaultAPIServiceMock) CloneRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCloneRequestRequest { +func (a DefaultAPIServiceMock) CloneRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCloneRequestRequest { return ApiCloneRequestRequest{ ApiService: a, ctx: ctx, @@ -97,7 +97,7 @@ func (a DefaultAPIServiceMock) CloneRequestExecute(r ApiCloneRequestRequest) (*C return (*a.CloneRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest { +func (a DefaultAPIServiceMock) CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest { return ApiCreateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -117,7 +117,7 @@ func (a DefaultAPIServiceMock) CreateDatabaseRequestExecute(r ApiCreateDatabaseR return (*a.CreateDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest { +func (a DefaultAPIServiceMock) CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest { return ApiCreateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -136,7 +136,7 @@ func (a DefaultAPIServiceMock) CreateInstanceRequestExecute(r ApiCreateInstanceR return (*a.CreateInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest { +func (a DefaultAPIServiceMock) CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest { return ApiCreateUserRequestRequest{ ApiService: a, ctx: ctx, @@ -156,7 +156,7 @@ func (a DefaultAPIServiceMock) CreateUserRequestExecute(r ApiCreateUserRequestRe return (*a.CreateUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest { +func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiDeleteDatabaseRequestRequest { return ApiDeleteDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -176,7 +176,7 @@ func (a DefaultAPIServiceMock) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseR return (*a.DeleteDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest { +func (a DefaultAPIServiceMock) DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest { return ApiDeleteInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -195,7 +195,7 @@ func (a DefaultAPIServiceMock) DeleteInstanceRequestExecute(r ApiDeleteInstanceR return (*a.DeleteInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiDeleteUserRequestRequest { +func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiDeleteUserRequestRequest { return ApiDeleteUserRequestRequest{ ApiService: a, ctx: ctx, @@ -215,7 +215,7 @@ func (a DefaultAPIServiceMock) DeleteUserRequestExecute(r ApiDeleteUserRequestRe return (*a.DeleteUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int32) ApiGetBackupRequestRequest { +func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int32) ApiGetBackupRequestRequest { return ApiGetBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -236,7 +236,7 @@ func (a DefaultAPIServiceMock) GetBackupRequestExecute(r ApiGetBackupRequestRequ return (*a.GetBackupRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest { +func (a DefaultAPIServiceMock) GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest { return ApiGetCollationsRequestRequest{ ApiService: a, ctx: ctx, @@ -256,7 +256,7 @@ func (a DefaultAPIServiceMock) GetCollationsRequestExecute(r ApiGetCollationsReq return (*a.GetCollationsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest { +func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiGetDatabaseRequestRequest { return ApiGetDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -277,7 +277,7 @@ func (a DefaultAPIServiceMock) GetDatabaseRequestExecute(r ApiGetDatabaseRequest return (*a.GetDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest { +func (a DefaultAPIServiceMock) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest { return ApiGetFlavorsRequestRequest{ ApiService: a, ctx: ctx, @@ -296,7 +296,7 @@ func (a DefaultAPIServiceMock) GetFlavorsRequestExecute(r ApiGetFlavorsRequestRe return (*a.GetFlavorsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest { +func (a DefaultAPIServiceMock) GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest { return ApiGetInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -316,7 +316,7 @@ func (a DefaultAPIServiceMock) GetInstanceRequestExecute(r ApiGetInstanceRequest return (*a.GetInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiGetUserRequestRequest { +func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiGetUserRequestRequest { return ApiGetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -337,7 +337,7 @@ func (a DefaultAPIServiceMock) GetUserRequestExecute(r ApiGetUserRequestRequest) return (*a.GetUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest { +func (a DefaultAPIServiceMock) GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest { return ApiGetVersionsRequestRequest{ ApiService: a, ctx: ctx, @@ -356,7 +356,7 @@ func (a DefaultAPIServiceMock) GetVersionsRequestExecute(r ApiGetVersionsRequest return (*a.GetVersionsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest { +func (a DefaultAPIServiceMock) ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest { return ApiListBackupsRequestRequest{ ApiService: a, ctx: ctx, @@ -376,7 +376,7 @@ func (a DefaultAPIServiceMock) ListBackupsRequestExecute(r ApiListBackupsRequest return (*a.ListBackupsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest { +func (a DefaultAPIServiceMock) ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest { return ApiListDatabasesRequestRequest{ ApiService: a, ctx: ctx, @@ -396,7 +396,7 @@ func (a DefaultAPIServiceMock) ListDatabasesRequestExecute(r ApiListDatabasesReq return (*a.ListDatabasesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest { +func (a DefaultAPIServiceMock) ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest { return ApiListInstancesRequestRequest{ ApiService: a, ctx: ctx, @@ -415,7 +415,7 @@ func (a DefaultAPIServiceMock) ListInstancesRequestExecute(r ApiListInstancesReq return (*a.ListInstancesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest { +func (a DefaultAPIServiceMock) ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest { return ApiListRolesRequestRequest{ ApiService: a, ctx: ctx, @@ -435,7 +435,7 @@ func (a DefaultAPIServiceMock) ListRolesRequestExecute(r ApiListRolesRequestRequ return (*a.ListRolesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest { +func (a DefaultAPIServiceMock) ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest { return ApiListUsersRequestRequest{ ApiService: a, ctx: ctx, @@ -455,7 +455,7 @@ func (a DefaultAPIServiceMock) ListUsersRequestExecute(r ApiListUsersRequestRequ return (*a.ListUsersRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest { +func (a DefaultAPIServiceMock) ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest { return ApiProtectInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -475,7 +475,7 @@ func (a DefaultAPIServiceMock) ProtectInstanceRequestExecute(r ApiProtectInstanc return (*a.ProtectInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiResetUserRequestRequest { +func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiResetUserRequestRequest { return ApiResetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -496,7 +496,7 @@ func (a DefaultAPIServiceMock) ResetUserRequestExecute(r ApiResetUserRequestRequ return (*a.ResetUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest { +func (a DefaultAPIServiceMock) UpdateDatabasePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabasePartiallyRequestRequest { return ApiUpdateDatabasePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -516,7 +516,7 @@ func (a DefaultAPIServiceMock) UpdateDatabasePartiallyRequestExecute(r ApiUpdate return (*a.UpdateDatabasePartiallyRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest { +func (a DefaultAPIServiceMock) UpdateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseId int32) ApiUpdateDatabaseRequestRequest { return ApiUpdateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -536,7 +536,7 @@ func (a DefaultAPIServiceMock) UpdateDatabaseRequestExecute(r ApiUpdateDatabaseR return (*a.UpdateDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest { +func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest { return ApiUpdateInstancePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -555,7 +555,7 @@ func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequestExecute(r ApiUpdate return (*a.UpdateInstancePartiallyRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest { +func (a DefaultAPIServiceMock) UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest { return ApiUpdateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -574,7 +574,7 @@ func (a DefaultAPIServiceMock) UpdateInstanceRequestExecute(r ApiUpdateInstanceR return (*a.UpdateInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateUserPartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest { +func (a DefaultAPIServiceMock) UpdateUserPartiallyRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserPartiallyRequestRequest { return ApiUpdateUserPartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -594,7 +594,7 @@ func (a DefaultAPIServiceMock) UpdateUserPartiallyRequestExecute(r ApiUpdateUser return (*a.UpdateUserPartiallyRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int32) ApiUpdateUserRequestRequest { +func (a DefaultAPIServiceMock) UpdateUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int32) ApiUpdateUserRequestRequest { return ApiUpdateUserRequestRequest{ ApiService: a, ctx: ctx, diff --git a/services/postgresflex/v3alpha1api/model_get_flavors_request_region_parameter.go b/services/postgresflex/v3alpha1api/model_get_flavors_request_region_parameter.go deleted file mode 100644 index 90ed1f94f..000000000 --- a/services/postgresflex/v3alpha1api/model_get_flavors_request_region_parameter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT Postgres Flex service - -API version: 3alpha1 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v3alpha1api - -import ( - "encoding/json" - "fmt" -) - -// GetFlavorsRequestRegionParameter the model 'GetFlavorsRequestRegionParameter' -type GetFlavorsRequestRegionParameter string - -// List of getFlavorsRequest_region_parameter -const ( - GETFLAVORSREQUESTREGIONPARAMETER_EU01 GetFlavorsRequestRegionParameter = "eu01" - GETFLAVORSREQUESTREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetFlavorsRequestRegionParameter = "unknown_default_open_api" -) - -// All allowed values of GetFlavorsRequestRegionParameter enum -var AllowedGetFlavorsRequestRegionParameterEnumValues = []GetFlavorsRequestRegionParameter{ - "eu01", - "unknown_default_open_api", -} - -func (v *GetFlavorsRequestRegionParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetFlavorsRequestRegionParameter(value) - for _, existing := range AllowedGetFlavorsRequestRegionParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETFLAVORSREQUESTREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetFlavorsRequestRegionParameterFromValue returns a pointer to a valid GetFlavorsRequestRegionParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetFlavorsRequestRegionParameterFromValue(v string) (*GetFlavorsRequestRegionParameter, error) { - ev := GetFlavorsRequestRegionParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetFlavorsRequestRegionParameter: valid values are %v", v, AllowedGetFlavorsRequestRegionParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetFlavorsRequestRegionParameter) IsValid() bool { - for _, existing := range AllowedGetFlavorsRequestRegionParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to getFlavorsRequest_region_parameter value -func (v GetFlavorsRequestRegionParameter) Ptr() *GetFlavorsRequestRegionParameter { - return &v -} - -type NullableGetFlavorsRequestRegionParameter struct { - value *GetFlavorsRequestRegionParameter - isSet bool -} - -func (v NullableGetFlavorsRequestRegionParameter) Get() *GetFlavorsRequestRegionParameter { - return v.value -} - -func (v *NullableGetFlavorsRequestRegionParameter) Set(val *GetFlavorsRequestRegionParameter) { - v.value = val - v.isSet = true -} - -func (v NullableGetFlavorsRequestRegionParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableGetFlavorsRequestRegionParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetFlavorsRequestRegionParameter(val *GetFlavorsRequestRegionParameter) *NullableGetFlavorsRequestRegionParameter { - return &NullableGetFlavorsRequestRegionParameter{value: val, isSet: true} -} - -func (v NullableGetFlavorsRequestRegionParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetFlavorsRequestRegionParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} From 4a099be90f978fb747681c03c3994afa3ff4e250 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:20:01 +0200 Subject: [PATCH 35/66] refac(rabbitmq): introduce inline enums --- services/rabbitmq/v1api/model_instance.go | 12 +- .../v1api/model_instance_last_operation.go | 24 ++-- .../model_instance_last_operation_state.go | 115 ++++++++++++++++ .../model_instance_last_operation_type.go | 115 ++++++++++++++++ .../v1api/model_instance_parameters.go | 36 ++--- ...model_instance_parameters_plugins_inner.go | 129 ++++++++++++++++++ ...instance_parameters_tls_protocols_inner.go | 113 +++++++++++++++ .../rabbitmq/v1api/model_instance_status.go | 121 ++++++++++++++++ 8 files changed, 629 insertions(+), 36 deletions(-) create mode 100644 services/rabbitmq/v1api/model_instance_last_operation_state.go create mode 100644 services/rabbitmq/v1api/model_instance_last_operation_type.go create mode 100644 services/rabbitmq/v1api/model_instance_parameters_plugins_inner.go create mode 100644 services/rabbitmq/v1api/model_instance_parameters_tls_protocols_inner.go create mode 100644 services/rabbitmq/v1api/model_instance_status.go diff --git a/services/rabbitmq/v1api/model_instance.go b/services/rabbitmq/v1api/model_instance.go index 3442b57b9..d1605e40b 100644 --- a/services/rabbitmq/v1api/model_instance.go +++ b/services/rabbitmq/v1api/model_instance.go @@ -34,7 +34,7 @@ type Instance struct { Parameters map[string]interface{} `json:"parameters"` PlanId string `json:"planId"` PlanName string `json:"planName"` - Status *string `json:"status,omitempty"` + Status *InstanceStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -393,9 +393,9 @@ func (o *Instance) SetPlanName(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Instance) GetStatus() string { +func (o *Instance) GetStatus() InstanceStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret InstanceStatus return ret } return *o.Status @@ -403,7 +403,7 @@ func (o *Instance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetStatusOk() (*string, bool) { +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -419,8 +419,8 @@ func (o *Instance) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Instance) SetStatus(v string) { +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { o.Status = &v } diff --git a/services/rabbitmq/v1api/model_instance_last_operation.go b/services/rabbitmq/v1api/model_instance_last_operation.go index 41099fe74..a8d46dfc1 100644 --- a/services/rabbitmq/v1api/model_instance_last_operation.go +++ b/services/rabbitmq/v1api/model_instance_last_operation.go @@ -20,9 +20,9 @@ var _ MappedNullable = &InstanceLastOperation{} // InstanceLastOperation struct for InstanceLastOperation type InstanceLastOperation struct { - Description string `json:"description"` - State string `json:"state"` - Type string `json:"type"` + Description string `json:"description"` + State InstanceLastOperationState `json:"state"` + Type InstanceLastOperationType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +32,7 @@ type _InstanceLastOperation InstanceLastOperation // 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 NewInstanceLastOperation(description string, state string, types string) *InstanceLastOperation { +func NewInstanceLastOperation(description string, state InstanceLastOperationState, types InstanceLastOperationType) *InstanceLastOperation { this := InstanceLastOperation{} this.Description = description this.State = state @@ -73,9 +73,9 @@ func (o *InstanceLastOperation) SetDescription(v string) { } // GetState returns the State field value -func (o *InstanceLastOperation) GetState() string { +func (o *InstanceLastOperation) GetState() InstanceLastOperationState { if o == nil { - var ret string + var ret InstanceLastOperationState return ret } @@ -84,7 +84,7 @@ func (o *InstanceLastOperation) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *InstanceLastOperation) GetStateOk() (*string, bool) { +func (o *InstanceLastOperation) GetStateOk() (*InstanceLastOperationState, bool) { if o == nil { return nil, false } @@ -92,14 +92,14 @@ func (o *InstanceLastOperation) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *InstanceLastOperation) SetState(v string) { +func (o *InstanceLastOperation) SetState(v InstanceLastOperationState) { o.State = v } // GetType returns the Type field value -func (o *InstanceLastOperation) GetType() string { +func (o *InstanceLastOperation) GetType() InstanceLastOperationType { if o == nil { - var ret string + var ret InstanceLastOperationType return ret } @@ -108,7 +108,7 @@ func (o *InstanceLastOperation) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *InstanceLastOperation) GetTypeOk() (*string, bool) { +func (o *InstanceLastOperation) GetTypeOk() (*InstanceLastOperationType, bool) { if o == nil { return nil, false } @@ -116,7 +116,7 @@ func (o *InstanceLastOperation) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *InstanceLastOperation) SetType(v string) { +func (o *InstanceLastOperation) SetType(v InstanceLastOperationType) { o.Type = v } diff --git a/services/rabbitmq/v1api/model_instance_last_operation_state.go b/services/rabbitmq/v1api/model_instance_last_operation_state.go new file mode 100644 index 000000000..c7c0d336b --- /dev/null +++ b/services/rabbitmq/v1api/model_instance_last_operation_state.go @@ -0,0 +1,115 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationState the model 'InstanceLastOperationState' +type InstanceLastOperationState string + +// List of InstanceLastOperation_state +const ( + INSTANCELASTOPERATIONSTATE_IN_PROGRESS InstanceLastOperationState = "in progress" + INSTANCELASTOPERATIONSTATE_SUCCEEDED InstanceLastOperationState = "succeeded" + INSTANCELASTOPERATIONSTATE_FAILED InstanceLastOperationState = "failed" + INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationState = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationState enum +var AllowedInstanceLastOperationStateEnumValues = []InstanceLastOperationState{ + "in progress", + "succeeded", + "failed", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationState(value) + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationStateFromValue returns a pointer to a valid InstanceLastOperationState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationStateFromValue(v string) (*InstanceLastOperationState, error) { + ev := InstanceLastOperationState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationState: valid values are %v", v, AllowedInstanceLastOperationStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationState) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_state value +func (v InstanceLastOperationState) Ptr() *InstanceLastOperationState { + return &v +} + +type NullableInstanceLastOperationState struct { + value *InstanceLastOperationState + isSet bool +} + +func (v NullableInstanceLastOperationState) Get() *InstanceLastOperationState { + return v.value +} + +func (v *NullableInstanceLastOperationState) Set(val *InstanceLastOperationState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationState(val *InstanceLastOperationState) *NullableInstanceLastOperationState { + return &NullableInstanceLastOperationState{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v1api/model_instance_last_operation_type.go b/services/rabbitmq/v1api/model_instance_last_operation_type.go new file mode 100644 index 000000000..6ac33814c --- /dev/null +++ b/services/rabbitmq/v1api/model_instance_last_operation_type.go @@ -0,0 +1,115 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationType the model 'InstanceLastOperationType' +type InstanceLastOperationType string + +// List of InstanceLastOperation_type +const ( + INSTANCELASTOPERATIONTYPE_CREATE InstanceLastOperationType = "create" + INSTANCELASTOPERATIONTYPE_UPDATE InstanceLastOperationType = "update" + INSTANCELASTOPERATIONTYPE_DELETE InstanceLastOperationType = "delete" + INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationType = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationType enum +var AllowedInstanceLastOperationTypeEnumValues = []InstanceLastOperationType{ + "create", + "update", + "delete", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationType(value) + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationTypeFromValue returns a pointer to a valid InstanceLastOperationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationTypeFromValue(v string) (*InstanceLastOperationType, error) { + ev := InstanceLastOperationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationType: valid values are %v", v, AllowedInstanceLastOperationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationType) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_type value +func (v InstanceLastOperationType) Ptr() *InstanceLastOperationType { + return &v +} + +type NullableInstanceLastOperationType struct { + value *InstanceLastOperationType + isSet bool +} + +func (v NullableInstanceLastOperationType) Get() *InstanceLastOperationType { + return v.value +} + +func (v *NullableInstanceLastOperationType) Set(val *InstanceLastOperationType) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationType) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationType(val *InstanceLastOperationType) *NullableInstanceLastOperationType { + return &NullableInstanceLastOperationType{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v1api/model_instance_parameters.go b/services/rabbitmq/v1api/model_instance_parameters.go index cde525565..f0b339ae2 100644 --- a/services/rabbitmq/v1api/model_instance_parameters.go +++ b/services/rabbitmq/v1api/model_instance_parameters.go @@ -29,15 +29,15 @@ type InstanceParameters struct { // Frequency of metrics being emitted in seconds MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix *string `json:"metrics_prefix,omitempty"` - MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` - Plugins []string `json:"plugins,omitempty"` - Roles []string `json:"roles,omitempty"` + MetricsPrefix *string `json:"metrics_prefix,omitempty"` + MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` + Plugins []InstanceParametersPluginsInner `json:"plugins,omitempty"` + Roles []string `json:"roles,omitempty"` // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - SgwAcl *string `json:"sgw_acl,omitempty"` - Syslog []string `json:"syslog,omitempty"` - TlsCiphers []string `json:"tls-ciphers,omitempty"` - TlsProtocols []string `json:"tls-protocols,omitempty"` + SgwAcl *string `json:"sgw_acl,omitempty"` + Syslog []string `json:"syslog,omitempty"` + TlsCiphers []string `json:"tls-ciphers,omitempty"` + TlsProtocols []InstanceParametersTlsProtocolsInner `json:"tls-protocols,omitempty"` AdditionalProperties map[string]interface{} } @@ -301,9 +301,9 @@ func (o *InstanceParameters) SetMonitoringInstanceId(v string) { } // GetPlugins returns the Plugins field value if set, zero value otherwise. -func (o *InstanceParameters) GetPlugins() []string { +func (o *InstanceParameters) GetPlugins() []InstanceParametersPluginsInner { if o == nil || IsNil(o.Plugins) { - var ret []string + var ret []InstanceParametersPluginsInner return ret } return o.Plugins @@ -311,7 +311,7 @@ func (o *InstanceParameters) GetPlugins() []string { // GetPluginsOk returns a tuple with the Plugins field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceParameters) GetPluginsOk() ([]string, bool) { +func (o *InstanceParameters) GetPluginsOk() ([]InstanceParametersPluginsInner, bool) { if o == nil || IsNil(o.Plugins) { return nil, false } @@ -327,8 +327,8 @@ func (o *InstanceParameters) HasPlugins() bool { return false } -// SetPlugins gets a reference to the given []string and assigns it to the Plugins field. -func (o *InstanceParameters) SetPlugins(v []string) { +// SetPlugins gets a reference to the given []InstanceParametersPluginsInner and assigns it to the Plugins field. +func (o *InstanceParameters) SetPlugins(v []InstanceParametersPluginsInner) { o.Plugins = v } @@ -461,9 +461,9 @@ func (o *InstanceParameters) SetTlsCiphers(v []string) { } // GetTlsProtocols returns the TlsProtocols field value if set, zero value otherwise. -func (o *InstanceParameters) GetTlsProtocols() []string { +func (o *InstanceParameters) GetTlsProtocols() []InstanceParametersTlsProtocolsInner { if o == nil || IsNil(o.TlsProtocols) { - var ret []string + var ret []InstanceParametersTlsProtocolsInner return ret } return o.TlsProtocols @@ -471,7 +471,7 @@ func (o *InstanceParameters) GetTlsProtocols() []string { // GetTlsProtocolsOk returns a tuple with the TlsProtocols field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceParameters) GetTlsProtocolsOk() ([]string, bool) { +func (o *InstanceParameters) GetTlsProtocolsOk() ([]InstanceParametersTlsProtocolsInner, bool) { if o == nil || IsNil(o.TlsProtocols) { return nil, false } @@ -487,8 +487,8 @@ func (o *InstanceParameters) HasTlsProtocols() bool { return false } -// SetTlsProtocols gets a reference to the given []string and assigns it to the TlsProtocols field. -func (o *InstanceParameters) SetTlsProtocols(v []string) { +// SetTlsProtocols gets a reference to the given []InstanceParametersTlsProtocolsInner and assigns it to the TlsProtocols field. +func (o *InstanceParameters) SetTlsProtocols(v []InstanceParametersTlsProtocolsInner) { o.TlsProtocols = v } diff --git a/services/rabbitmq/v1api/model_instance_parameters_plugins_inner.go b/services/rabbitmq/v1api/model_instance_parameters_plugins_inner.go new file mode 100644 index 000000000..46777c791 --- /dev/null +++ b/services/rabbitmq/v1api/model_instance_parameters_plugins_inner.go @@ -0,0 +1,129 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersPluginsInner the model 'InstanceParametersPluginsInner' +type InstanceParametersPluginsInner string + +// List of InstanceParameters_plugins_inner +const ( + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_CONSISTENT_HASH_EXCHANGE InstanceParametersPluginsInner = "rabbitmq_consistent_hash_exchange" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_FEDERATION InstanceParametersPluginsInner = "rabbitmq_federation" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_FEDERATION_MANAGEMENT InstanceParametersPluginsInner = "rabbitmq_federation_management" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_MQTT InstanceParametersPluginsInner = "rabbitmq_mqtt" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_SHARDING InstanceParametersPluginsInner = "rabbitmq_sharding" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_SHOVEL InstanceParametersPluginsInner = "rabbitmq_shovel" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_SHOVEL_MANAGEMENT InstanceParametersPluginsInner = "rabbitmq_shovel_management" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_STOMP InstanceParametersPluginsInner = "rabbitmq_stomp" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_TRACING InstanceParametersPluginsInner = "rabbitmq_tracing" + INSTANCEPARAMETERSPLUGINSINNER_RABBITMQ_EVENT_EXCHANGE InstanceParametersPluginsInner = "rabbitmq_event_exchange" + INSTANCEPARAMETERSPLUGINSINNER_UNKNOWN_DEFAULT_OPEN_API InstanceParametersPluginsInner = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersPluginsInner enum +var AllowedInstanceParametersPluginsInnerEnumValues = []InstanceParametersPluginsInner{ + "rabbitmq_consistent_hash_exchange", + "rabbitmq_federation", + "rabbitmq_federation_management", + "rabbitmq_mqtt", + "rabbitmq_sharding", + "rabbitmq_shovel", + "rabbitmq_shovel_management", + "rabbitmq_stomp", + "rabbitmq_tracing", + "rabbitmq_event_exchange", + "unknown_default_open_api", +} + +func (v *InstanceParametersPluginsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersPluginsInner(value) + for _, existing := range AllowedInstanceParametersPluginsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSPLUGINSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersPluginsInnerFromValue returns a pointer to a valid InstanceParametersPluginsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersPluginsInnerFromValue(v string) (*InstanceParametersPluginsInner, error) { + ev := InstanceParametersPluginsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersPluginsInner: valid values are %v", v, AllowedInstanceParametersPluginsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersPluginsInner) IsValid() bool { + for _, existing := range AllowedInstanceParametersPluginsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_plugins_inner value +func (v InstanceParametersPluginsInner) Ptr() *InstanceParametersPluginsInner { + return &v +} + +type NullableInstanceParametersPluginsInner struct { + value *InstanceParametersPluginsInner + isSet bool +} + +func (v NullableInstanceParametersPluginsInner) Get() *InstanceParametersPluginsInner { + return v.value +} + +func (v *NullableInstanceParametersPluginsInner) Set(val *InstanceParametersPluginsInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersPluginsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersPluginsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersPluginsInner(val *InstanceParametersPluginsInner) *NullableInstanceParametersPluginsInner { + return &NullableInstanceParametersPluginsInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersPluginsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersPluginsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v1api/model_instance_parameters_tls_protocols_inner.go b/services/rabbitmq/v1api/model_instance_parameters_tls_protocols_inner.go new file mode 100644 index 000000000..7ee2c0538 --- /dev/null +++ b/services/rabbitmq/v1api/model_instance_parameters_tls_protocols_inner.go @@ -0,0 +1,113 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersTlsProtocolsInner the model 'InstanceParametersTlsProtocolsInner' +type InstanceParametersTlsProtocolsInner string + +// List of InstanceParameters_tls_protocols_inner +const ( + INSTANCEPARAMETERSTLSPROTOCOLSINNER_TLSV1_2 InstanceParametersTlsProtocolsInner = "tlsv1.2" + INSTANCEPARAMETERSTLSPROTOCOLSINNER_TLSV1_3 InstanceParametersTlsProtocolsInner = "tlsv1.3" + INSTANCEPARAMETERSTLSPROTOCOLSINNER_UNKNOWN_DEFAULT_OPEN_API InstanceParametersTlsProtocolsInner = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersTlsProtocolsInner enum +var AllowedInstanceParametersTlsProtocolsInnerEnumValues = []InstanceParametersTlsProtocolsInner{ + "tlsv1.2", + "tlsv1.3", + "unknown_default_open_api", +} + +func (v *InstanceParametersTlsProtocolsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersTlsProtocolsInner(value) + for _, existing := range AllowedInstanceParametersTlsProtocolsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSTLSPROTOCOLSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersTlsProtocolsInnerFromValue returns a pointer to a valid InstanceParametersTlsProtocolsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersTlsProtocolsInnerFromValue(v string) (*InstanceParametersTlsProtocolsInner, error) { + ev := InstanceParametersTlsProtocolsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersTlsProtocolsInner: valid values are %v", v, AllowedInstanceParametersTlsProtocolsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersTlsProtocolsInner) IsValid() bool { + for _, existing := range AllowedInstanceParametersTlsProtocolsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_tls_protocols_inner value +func (v InstanceParametersTlsProtocolsInner) Ptr() *InstanceParametersTlsProtocolsInner { + return &v +} + +type NullableInstanceParametersTlsProtocolsInner struct { + value *InstanceParametersTlsProtocolsInner + isSet bool +} + +func (v NullableInstanceParametersTlsProtocolsInner) Get() *InstanceParametersTlsProtocolsInner { + return v.value +} + +func (v *NullableInstanceParametersTlsProtocolsInner) Set(val *InstanceParametersTlsProtocolsInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersTlsProtocolsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersTlsProtocolsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersTlsProtocolsInner(val *InstanceParametersTlsProtocolsInner) *NullableInstanceParametersTlsProtocolsInner { + return &NullableInstanceParametersTlsProtocolsInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersTlsProtocolsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersTlsProtocolsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/rabbitmq/v1api/model_instance_status.go b/services/rabbitmq/v1api/model_instance_status.go new file mode 100644 index 000000000..70fb1fa69 --- /dev/null +++ b/services/rabbitmq/v1api/model_instance_status.go @@ -0,0 +1,121 @@ +/* +STACKIT RabbitMQ API + +The STACKIT RabbitMQ API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus the model 'InstanceStatus' +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_FAILED InstanceStatus = "failed" + INSTANCESTATUS_STOPPED InstanceStatus = "stopped" + INSTANCESTATUS_CREATING InstanceStatus = "creating" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UPDATING InstanceStatus = "updating" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "active", + "failed", + "stopped", + "creating", + "deleting", + "updating", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 514d1e61e326500abf7c8b47b1a059e78cb2845e Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:26:12 +0200 Subject: [PATCH 36/66] chore(rabbitmq): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/rabbitmq/CHANGELOG.md | 3 +++ services/rabbitmq/VERSION | 2 +- services/rabbitmq/v1api/wait/wait.go | 12 ++++----- services/rabbitmq/v1api/wait/wait_test.go | 32 +++++++++++------------ 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c252710c..f56052dfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -322,6 +322,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v0.29.2](services/rabbitmq/CHANGELOG.md#v0292) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` + - [v0.30.0](services/rabbitmq/CHANGELOG.md#v0300) + - **Feature:** Introduce enums for various attributes - `redis`: - [v0.27.3](services/redis/CHANGELOG.md#v0273) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/rabbitmq/CHANGELOG.md b/services/rabbitmq/CHANGELOG.md index d1a15cff3..e2ccc871d 100644 --- a/services/rabbitmq/CHANGELOG.md +++ b/services/rabbitmq/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.30.0 +- **Feature:** Introduce enums for various attributes + ## v0.29.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` diff --git a/services/rabbitmq/VERSION b/services/rabbitmq/VERSION index 9f27816d8..29e939cda 100644 --- a/services/rabbitmq/VERSION +++ b/services/rabbitmq/VERSION @@ -1 +1 @@ -v0.29.2 \ No newline at end of file +v0.30.0 \ No newline at end of file diff --git a/services/rabbitmq/v1api/wait/wait.go b/services/rabbitmq/v1api/wait/wait.go index f0ef6c443..ddeebce92 100644 --- a/services/rabbitmq/v1api/wait/wait.go +++ b/services/rabbitmq/v1api/wait/wait.go @@ -36,9 +36,9 @@ func CreateInstanceWaitHandler(ctx context.Context, a rabbitmq.DefaultAPI, proje return false, nil, fmt.Errorf("create failed for instance with id %s. The response is not valid: the status is missing", instanceId) } switch *s.Status { - case INSTANCESTATUS_ACTIVE: + case rabbitmq.INSTANCESTATUS_ACTIVE: return true, s, nil - case INSTANCESTATUS_FAILED: + case rabbitmq.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("create failed for instance with id %s: %s", instanceId, s.LastOperation.Description) } return false, nil, nil @@ -58,9 +58,9 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, a rabbitmq.DefaultAPI return false, nil, fmt.Errorf("update failed for instance with id %s. The response is not valid: the instance id or the status are missing", instanceId) } switch *s.Status { - case INSTANCESTATUS_ACTIVE: + case rabbitmq.INSTANCESTATUS_ACTIVE: return true, s, nil - case INSTANCESTATUS_FAILED: + case rabbitmq.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("update failed for instance with id %s: %s", instanceId, s.LastOperation.Description) } return false, nil, nil @@ -77,10 +77,10 @@ func DeleteInstanceWaitHandler(ctx context.Context, a rabbitmq.DefaultAPI, proje if s.Status == nil { return false, nil, fmt.Errorf("delete failed for instance with id %s. The response is not valid: The status is missing", instanceId) } - if *s.Status != INSTANCESTATUS_DELETING { + if *s.Status != rabbitmq.INSTANCESTATUS_DELETING { return false, nil, nil } - if *s.Status == INSTANCESTATUS_ACTIVE { + if *s.Status == rabbitmq.INSTANCESTATUS_ACTIVE { if strings.Contains(s.LastOperation.Description, "DeleteFailed") || strings.Contains(s.LastOperation.Description, "failed") { return true, nil, fmt.Errorf("instance was deleted successfully but has errors: %s", s.LastOperation.Description) } diff --git a/services/rabbitmq/v1api/wait/wait_test.go b/services/rabbitmq/v1api/wait/wait_test.go index 7cd9a28bd..d5f18cbd6 100644 --- a/services/rabbitmq/v1api/wait/wait_test.go +++ b/services/rabbitmq/v1api/wait/wait_test.go @@ -17,8 +17,8 @@ type mockSettings struct { instanceGetFails bool instanceDeletionSucceedsWithErrors bool instanceResourceId string - instanceResourceOperation string - instanceResourceState *string + instanceResourceOperation rabbitmq.InstanceLastOperationType + instanceResourceState *rabbitmq.InstanceStatus instanceResourceDescription string credentialGetFails bool @@ -35,7 +35,7 @@ func newAPIMock(settings *mockSettings) rabbitmq.DefaultAPI { StatusCode: 500, } } - if settings.instanceResourceOperation == INSTANCELASTOPERATIONTYPE_DELETE && settings.instanceResourceState != nil && *settings.instanceResourceState == INSTANCESTATUS_ACTIVE { + if settings.instanceResourceOperation == rabbitmq.INSTANCELASTOPERATIONTYPE_DELETE && settings.instanceResourceState != nil && *settings.instanceResourceState == rabbitmq.INSTANCESTATUS_ACTIVE { if settings.instanceDeletionSucceedsWithErrors { return &rabbitmq.Instance{ InstanceId: &settings.instanceResourceId, @@ -80,21 +80,21 @@ func TestCreateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState *string + resourceState *rabbitmq.InstanceStatus wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(rabbitmq.INSTANCESTATUS_ACTIVE), wantErr: false, wantResp: true, }, { desc: "create_failed", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: utils.Ptr(rabbitmq.INSTANCESTATUS_FAILED), wantErr: true, wantResp: true, }, @@ -107,7 +107,7 @@ func TestCreateInstanceWaitHandler(t *testing.T) { { desc: "timeout", getFails: false, - resourceState: utils.Ptr("ANOTHER STATE"), + resourceState: utils.Ptr(rabbitmq.InstanceStatus("ANOTHER STATE")), wantErr: true, wantResp: false, }, @@ -151,21 +151,21 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState *string + resourceState *rabbitmq.InstanceStatus wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(rabbitmq.INSTANCESTATUS_ACTIVE), wantErr: false, wantResp: true, }, { desc: "update_failed", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: utils.Ptr(rabbitmq.INSTANCESTATUS_FAILED), wantErr: true, wantResp: true, }, @@ -178,7 +178,7 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { { desc: "timeout", getFails: false, - resourceState: utils.Ptr("ANOTHER STATE"), + resourceState: utils.Ptr(rabbitmq.InstanceStatus("ANOTHER STATE")), wantErr: true, wantResp: false, }, @@ -222,7 +222,7 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc string getFails bool deleteSucceeedsWithErrors bool - resourceState *string + resourceState *rabbitmq.InstanceStatus resourceDescription string wantErr bool }{ @@ -230,20 +230,20 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc: "delete_succeeded", getFails: false, deleteSucceeedsWithErrors: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(rabbitmq.INSTANCESTATUS_ACTIVE), wantErr: false, }, { desc: "delete_failed", getFails: false, deleteSucceeedsWithErrors: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: utils.Ptr(rabbitmq.INSTANCESTATUS_FAILED), wantErr: true, }, { desc: "delete_succeeds_with_errors", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(rabbitmq.INSTANCESTATUS_ACTIVE), deleteSucceeedsWithErrors: true, resourceDescription: "Deleting resource: cf failed with error: DeleteFailed", wantErr: true, @@ -264,7 +264,7 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { instanceGetFails: tt.getFails, instanceDeletionSucceedsWithErrors: tt.deleteSucceeedsWithErrors, instanceResourceId: instanceId, - instanceResourceOperation: INSTANCELASTOPERATIONTYPE_DELETE, + instanceResourceOperation: rabbitmq.INSTANCELASTOPERATIONTYPE_DELETE, instanceResourceDescription: tt.resourceDescription, instanceResourceState: tt.resourceState, }) From e8f7c71ff4ccd0ca500be123626ad4215e73ac47 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:27:06 +0200 Subject: [PATCH 37/66] refac(redis): introduce inline enums --- services/redis/v1api/model_instance.go | 12 +- .../v1api/model_instance_last_operation.go | 24 ++-- .../model_instance_last_operation_state.go | 115 +++++++++++++++++ .../model_instance_last_operation_type.go | 115 +++++++++++++++++ .../redis/v1api/model_instance_parameters.go | 78 +++++------ ...tance_parameters_lazyfree_lazy_eviction.go | 113 ++++++++++++++++ ...nstance_parameters_lazyfree_lazy_expire.go | 113 ++++++++++++++++ ...el_instance_parameters_maxmemory_policy.go | 121 ++++++++++++++++++ ...model_instance_parameters_tls_protocols.go | 113 ++++++++++++++++ services/redis/v1api/model_instance_status.go | 121 ++++++++++++++++++ 10 files changed, 868 insertions(+), 57 deletions(-) create mode 100644 services/redis/v1api/model_instance_last_operation_state.go create mode 100644 services/redis/v1api/model_instance_last_operation_type.go create mode 100644 services/redis/v1api/model_instance_parameters_lazyfree_lazy_eviction.go create mode 100644 services/redis/v1api/model_instance_parameters_lazyfree_lazy_expire.go create mode 100644 services/redis/v1api/model_instance_parameters_maxmemory_policy.go create mode 100644 services/redis/v1api/model_instance_parameters_tls_protocols.go create mode 100644 services/redis/v1api/model_instance_status.go diff --git a/services/redis/v1api/model_instance.go b/services/redis/v1api/model_instance.go index 3c72e535d..ab5970791 100644 --- a/services/redis/v1api/model_instance.go +++ b/services/redis/v1api/model_instance.go @@ -34,7 +34,7 @@ type Instance struct { Parameters map[string]interface{} `json:"parameters"` PlanId string `json:"planId"` PlanName string `json:"planName"` - Status *string `json:"status,omitempty"` + Status *InstanceStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -393,9 +393,9 @@ func (o *Instance) SetPlanName(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Instance) GetStatus() string { +func (o *Instance) GetStatus() InstanceStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret InstanceStatus return ret } return *o.Status @@ -403,7 +403,7 @@ func (o *Instance) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Instance) GetStatusOk() (*string, bool) { +func (o *Instance) GetStatusOk() (*InstanceStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -419,8 +419,8 @@ func (o *Instance) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Instance) SetStatus(v string) { +// SetStatus gets a reference to the given InstanceStatus and assigns it to the Status field. +func (o *Instance) SetStatus(v InstanceStatus) { o.Status = &v } diff --git a/services/redis/v1api/model_instance_last_operation.go b/services/redis/v1api/model_instance_last_operation.go index 029120deb..7c83e8c6b 100644 --- a/services/redis/v1api/model_instance_last_operation.go +++ b/services/redis/v1api/model_instance_last_operation.go @@ -20,9 +20,9 @@ var _ MappedNullable = &InstanceLastOperation{} // InstanceLastOperation struct for InstanceLastOperation type InstanceLastOperation struct { - Description string `json:"description"` - State string `json:"state"` - Type string `json:"type"` + Description string `json:"description"` + State InstanceLastOperationState `json:"state"` + Type InstanceLastOperationType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +32,7 @@ type _InstanceLastOperation InstanceLastOperation // 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 NewInstanceLastOperation(description string, state string, types string) *InstanceLastOperation { +func NewInstanceLastOperation(description string, state InstanceLastOperationState, types InstanceLastOperationType) *InstanceLastOperation { this := InstanceLastOperation{} this.Description = description this.State = state @@ -73,9 +73,9 @@ func (o *InstanceLastOperation) SetDescription(v string) { } // GetState returns the State field value -func (o *InstanceLastOperation) GetState() string { +func (o *InstanceLastOperation) GetState() InstanceLastOperationState { if o == nil { - var ret string + var ret InstanceLastOperationState return ret } @@ -84,7 +84,7 @@ func (o *InstanceLastOperation) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *InstanceLastOperation) GetStateOk() (*string, bool) { +func (o *InstanceLastOperation) GetStateOk() (*InstanceLastOperationState, bool) { if o == nil { return nil, false } @@ -92,14 +92,14 @@ func (o *InstanceLastOperation) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *InstanceLastOperation) SetState(v string) { +func (o *InstanceLastOperation) SetState(v InstanceLastOperationState) { o.State = v } // GetType returns the Type field value -func (o *InstanceLastOperation) GetType() string { +func (o *InstanceLastOperation) GetType() InstanceLastOperationType { if o == nil { - var ret string + var ret InstanceLastOperationType return ret } @@ -108,7 +108,7 @@ func (o *InstanceLastOperation) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *InstanceLastOperation) GetTypeOk() (*string, bool) { +func (o *InstanceLastOperation) GetTypeOk() (*InstanceLastOperationType, bool) { if o == nil { return nil, false } @@ -116,7 +116,7 @@ func (o *InstanceLastOperation) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *InstanceLastOperation) SetType(v string) { +func (o *InstanceLastOperation) SetType(v InstanceLastOperationType) { o.Type = v } diff --git a/services/redis/v1api/model_instance_last_operation_state.go b/services/redis/v1api/model_instance_last_operation_state.go new file mode 100644 index 000000000..db8383a8f --- /dev/null +++ b/services/redis/v1api/model_instance_last_operation_state.go @@ -0,0 +1,115 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationState the model 'InstanceLastOperationState' +type InstanceLastOperationState string + +// List of InstanceLastOperation_state +const ( + INSTANCELASTOPERATIONSTATE_IN_PROGRESS InstanceLastOperationState = "in progress" + INSTANCELASTOPERATIONSTATE_SUCCEEDED InstanceLastOperationState = "succeeded" + INSTANCELASTOPERATIONSTATE_FAILED InstanceLastOperationState = "failed" + INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationState = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationState enum +var AllowedInstanceLastOperationStateEnumValues = []InstanceLastOperationState{ + "in progress", + "succeeded", + "failed", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationState(value) + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationStateFromValue returns a pointer to a valid InstanceLastOperationState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationStateFromValue(v string) (*InstanceLastOperationState, error) { + ev := InstanceLastOperationState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationState: valid values are %v", v, AllowedInstanceLastOperationStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationState) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_state value +func (v InstanceLastOperationState) Ptr() *InstanceLastOperationState { + return &v +} + +type NullableInstanceLastOperationState struct { + value *InstanceLastOperationState + isSet bool +} + +func (v NullableInstanceLastOperationState) Get() *InstanceLastOperationState { + return v.value +} + +func (v *NullableInstanceLastOperationState) Set(val *InstanceLastOperationState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationState(val *InstanceLastOperationState) *NullableInstanceLastOperationState { + return &NullableInstanceLastOperationState{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v1api/model_instance_last_operation_type.go b/services/redis/v1api/model_instance_last_operation_type.go new file mode 100644 index 000000000..161492422 --- /dev/null +++ b/services/redis/v1api/model_instance_last_operation_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceLastOperationType the model 'InstanceLastOperationType' +type InstanceLastOperationType string + +// List of InstanceLastOperation_type +const ( + INSTANCELASTOPERATIONTYPE_CREATE InstanceLastOperationType = "create" + INSTANCELASTOPERATIONTYPE_UPDATE InstanceLastOperationType = "update" + INSTANCELASTOPERATIONTYPE_DELETE InstanceLastOperationType = "delete" + INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API InstanceLastOperationType = "unknown_default_open_api" +) + +// All allowed values of InstanceLastOperationType enum +var AllowedInstanceLastOperationTypeEnumValues = []InstanceLastOperationType{ + "create", + "update", + "delete", + "unknown_default_open_api", +} + +func (v *InstanceLastOperationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceLastOperationType(value) + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCELASTOPERATIONTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceLastOperationTypeFromValue returns a pointer to a valid InstanceLastOperationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceLastOperationTypeFromValue(v string) (*InstanceLastOperationType, error) { + ev := InstanceLastOperationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceLastOperationType: valid values are %v", v, AllowedInstanceLastOperationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceLastOperationType) IsValid() bool { + for _, existing := range AllowedInstanceLastOperationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceLastOperation_type value +func (v InstanceLastOperationType) Ptr() *InstanceLastOperationType { + return &v +} + +type NullableInstanceLastOperationType struct { + value *InstanceLastOperationType + isSet bool +} + +func (v NullableInstanceLastOperationType) Get() *InstanceLastOperationType { + return v.value +} + +func (v *NullableInstanceLastOperationType) Set(val *InstanceLastOperationType) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperationType) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperationType(val *InstanceLastOperationType) *NullableInstanceLastOperationType { + return &NullableInstanceLastOperationType{value: val, isSet: true} +} + +func (v NullableInstanceLastOperationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v1api/model_instance_parameters.go b/services/redis/v1api/model_instance_parameters.go index 9e2520d25..01423d4e4 100644 --- a/services/redis/v1api/model_instance_parameters.go +++ b/services/redis/v1api/model_instance_parameters.go @@ -25,15 +25,15 @@ type InstanceParameters struct { // The unit is milliseconds. FailoverTimeout *int32 `json:"failover-timeout,omitempty"` // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. - Graphite *string `json:"graphite,omitempty"` - LazyfreeLazyEviction *string `json:"lazyfree-lazy-eviction,omitempty"` - LazyfreeLazyExpire *string `json:"lazyfree-lazy-expire,omitempty"` - LuaTimeLimit *int32 `json:"lua-time-limit,omitempty"` + Graphite *string `json:"graphite,omitempty"` + LazyfreeLazyEviction *InstanceParametersLazyfreeLazyEviction `json:"lazyfree-lazy-eviction,omitempty"` + LazyfreeLazyExpire *InstanceParametersLazyfreeLazyExpire `json:"lazyfree-lazy-expire,omitempty"` + LuaTimeLimit *int32 `json:"lua-time-limit,omitempty"` // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. - MaxDiskThreshold *int32 `json:"max_disk_threshold,omitempty"` - Maxclients *int32 `json:"maxclients,omitempty"` - MaxmemoryPolicy *string `json:"maxmemory-policy,omitempty"` - MaxmemorySamples *int32 `json:"maxmemory-samples,omitempty"` + MaxDiskThreshold *int32 `json:"max_disk_threshold,omitempty"` + Maxclients *int32 `json:"maxclients,omitempty"` + MaxmemoryPolicy *InstanceParametersMaxmemoryPolicy `json:"maxmemory-policy,omitempty"` + MaxmemorySamples *int32 `json:"maxmemory-samples,omitempty"` // Frequency of metrics being emitted in seconds MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. @@ -46,11 +46,11 @@ type InstanceParameters struct { // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl *string `json:"sgw_acl,omitempty"` // This setting must follow the original Redis configuration for RDB. - Snapshot *string `json:"snapshot,omitempty"` - Syslog []string `json:"syslog,omitempty"` - TlsCiphers []string `json:"tls-ciphers,omitempty"` - TlsCiphersuites *string `json:"tls-ciphersuites,omitempty"` - TlsProtocols *string `json:"tls-protocols,omitempty"` + Snapshot *string `json:"snapshot,omitempty"` + Syslog []string `json:"syslog,omitempty"` + TlsCiphers []string `json:"tls-ciphers,omitempty"` + TlsCiphersuites *string `json:"tls-ciphersuites,omitempty"` + TlsProtocols *InstanceParametersTlsProtocols `json:"tls-protocols,omitempty"` AdditionalProperties map[string]interface{} } @@ -68,9 +68,9 @@ func NewInstanceParameters() *InstanceParameters { this.EnableMonitoring = &enableMonitoring var failoverTimeout int32 = 30000 this.FailoverTimeout = &failoverTimeout - var lazyfreeLazyEviction string = "no" + var lazyfreeLazyEviction InstanceParametersLazyfreeLazyEviction = INSTANCEPARAMETERSLAZYFREELAZYEVICTION_NO this.LazyfreeLazyEviction = &lazyfreeLazyEviction - var lazyfreeLazyExpire string = "no" + var lazyfreeLazyExpire InstanceParametersLazyfreeLazyExpire = INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_NO this.LazyfreeLazyExpire = &lazyfreeLazyExpire var luaTimeLimit int32 = 5000 this.LuaTimeLimit = &luaTimeLimit @@ -78,7 +78,7 @@ func NewInstanceParameters() *InstanceParameters { this.MaxDiskThreshold = &maxDiskThreshold var maxclients int32 = 10000 this.Maxclients = &maxclients - var maxmemoryPolicy string = "volatile-lru" + var maxmemoryPolicy InstanceParametersMaxmemoryPolicy = INSTANCEPARAMETERSMAXMEMORYPOLICY_VOLATILE_LRU this.MaxmemoryPolicy = &maxmemoryPolicy var maxmemorySamples int32 = 5 this.MaxmemorySamples = &maxmemorySamples @@ -102,9 +102,9 @@ func NewInstanceParametersWithDefaults() *InstanceParameters { this.EnableMonitoring = &enableMonitoring var failoverTimeout int32 = 30000 this.FailoverTimeout = &failoverTimeout - var lazyfreeLazyEviction string = "no" + var lazyfreeLazyEviction InstanceParametersLazyfreeLazyEviction = INSTANCEPARAMETERSLAZYFREELAZYEVICTION_NO this.LazyfreeLazyEviction = &lazyfreeLazyEviction - var lazyfreeLazyExpire string = "no" + var lazyfreeLazyExpire InstanceParametersLazyfreeLazyExpire = INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_NO this.LazyfreeLazyExpire = &lazyfreeLazyExpire var luaTimeLimit int32 = 5000 this.LuaTimeLimit = &luaTimeLimit @@ -112,7 +112,7 @@ func NewInstanceParametersWithDefaults() *InstanceParameters { this.MaxDiskThreshold = &maxDiskThreshold var maxclients int32 = 10000 this.Maxclients = &maxclients - var maxmemoryPolicy string = "volatile-lru" + var maxmemoryPolicy InstanceParametersMaxmemoryPolicy = INSTANCEPARAMETERSMAXMEMORYPOLICY_VOLATILE_LRU this.MaxmemoryPolicy = &maxmemoryPolicy var maxmemorySamples int32 = 5 this.MaxmemorySamples = &maxmemorySamples @@ -254,9 +254,9 @@ func (o *InstanceParameters) SetGraphite(v string) { } // GetLazyfreeLazyEviction returns the LazyfreeLazyEviction field value if set, zero value otherwise. -func (o *InstanceParameters) GetLazyfreeLazyEviction() string { +func (o *InstanceParameters) GetLazyfreeLazyEviction() InstanceParametersLazyfreeLazyEviction { if o == nil || IsNil(o.LazyfreeLazyEviction) { - var ret string + var ret InstanceParametersLazyfreeLazyEviction return ret } return *o.LazyfreeLazyEviction @@ -264,7 +264,7 @@ func (o *InstanceParameters) GetLazyfreeLazyEviction() string { // GetLazyfreeLazyEvictionOk returns a tuple with the LazyfreeLazyEviction field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceParameters) GetLazyfreeLazyEvictionOk() (*string, bool) { +func (o *InstanceParameters) GetLazyfreeLazyEvictionOk() (*InstanceParametersLazyfreeLazyEviction, bool) { if o == nil || IsNil(o.LazyfreeLazyEviction) { return nil, false } @@ -280,15 +280,15 @@ func (o *InstanceParameters) HasLazyfreeLazyEviction() bool { return false } -// SetLazyfreeLazyEviction gets a reference to the given string and assigns it to the LazyfreeLazyEviction field. -func (o *InstanceParameters) SetLazyfreeLazyEviction(v string) { +// SetLazyfreeLazyEviction gets a reference to the given InstanceParametersLazyfreeLazyEviction and assigns it to the LazyfreeLazyEviction field. +func (o *InstanceParameters) SetLazyfreeLazyEviction(v InstanceParametersLazyfreeLazyEviction) { o.LazyfreeLazyEviction = &v } // GetLazyfreeLazyExpire returns the LazyfreeLazyExpire field value if set, zero value otherwise. -func (o *InstanceParameters) GetLazyfreeLazyExpire() string { +func (o *InstanceParameters) GetLazyfreeLazyExpire() InstanceParametersLazyfreeLazyExpire { if o == nil || IsNil(o.LazyfreeLazyExpire) { - var ret string + var ret InstanceParametersLazyfreeLazyExpire return ret } return *o.LazyfreeLazyExpire @@ -296,7 +296,7 @@ func (o *InstanceParameters) GetLazyfreeLazyExpire() string { // GetLazyfreeLazyExpireOk returns a tuple with the LazyfreeLazyExpire field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceParameters) GetLazyfreeLazyExpireOk() (*string, bool) { +func (o *InstanceParameters) GetLazyfreeLazyExpireOk() (*InstanceParametersLazyfreeLazyExpire, bool) { if o == nil || IsNil(o.LazyfreeLazyExpire) { return nil, false } @@ -312,8 +312,8 @@ func (o *InstanceParameters) HasLazyfreeLazyExpire() bool { return false } -// SetLazyfreeLazyExpire gets a reference to the given string and assigns it to the LazyfreeLazyExpire field. -func (o *InstanceParameters) SetLazyfreeLazyExpire(v string) { +// SetLazyfreeLazyExpire gets a reference to the given InstanceParametersLazyfreeLazyExpire and assigns it to the LazyfreeLazyExpire field. +func (o *InstanceParameters) SetLazyfreeLazyExpire(v InstanceParametersLazyfreeLazyExpire) { o.LazyfreeLazyExpire = &v } @@ -414,9 +414,9 @@ func (o *InstanceParameters) SetMaxclients(v int32) { } // GetMaxmemoryPolicy returns the MaxmemoryPolicy field value if set, zero value otherwise. -func (o *InstanceParameters) GetMaxmemoryPolicy() string { +func (o *InstanceParameters) GetMaxmemoryPolicy() InstanceParametersMaxmemoryPolicy { if o == nil || IsNil(o.MaxmemoryPolicy) { - var ret string + var ret InstanceParametersMaxmemoryPolicy return ret } return *o.MaxmemoryPolicy @@ -424,7 +424,7 @@ func (o *InstanceParameters) GetMaxmemoryPolicy() string { // GetMaxmemoryPolicyOk returns a tuple with the MaxmemoryPolicy field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceParameters) GetMaxmemoryPolicyOk() (*string, bool) { +func (o *InstanceParameters) GetMaxmemoryPolicyOk() (*InstanceParametersMaxmemoryPolicy, bool) { if o == nil || IsNil(o.MaxmemoryPolicy) { return nil, false } @@ -440,8 +440,8 @@ func (o *InstanceParameters) HasMaxmemoryPolicy() bool { return false } -// SetMaxmemoryPolicy gets a reference to the given string and assigns it to the MaxmemoryPolicy field. -func (o *InstanceParameters) SetMaxmemoryPolicy(v string) { +// SetMaxmemoryPolicy gets a reference to the given InstanceParametersMaxmemoryPolicy and assigns it to the MaxmemoryPolicy field. +func (o *InstanceParameters) SetMaxmemoryPolicy(v InstanceParametersMaxmemoryPolicy) { o.MaxmemoryPolicy = &v } @@ -798,9 +798,9 @@ func (o *InstanceParameters) SetTlsCiphersuites(v string) { } // GetTlsProtocols returns the TlsProtocols field value if set, zero value otherwise. -func (o *InstanceParameters) GetTlsProtocols() string { +func (o *InstanceParameters) GetTlsProtocols() InstanceParametersTlsProtocols { if o == nil || IsNil(o.TlsProtocols) { - var ret string + var ret InstanceParametersTlsProtocols return ret } return *o.TlsProtocols @@ -808,7 +808,7 @@ func (o *InstanceParameters) GetTlsProtocols() string { // GetTlsProtocolsOk returns a tuple with the TlsProtocols field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InstanceParameters) GetTlsProtocolsOk() (*string, bool) { +func (o *InstanceParameters) GetTlsProtocolsOk() (*InstanceParametersTlsProtocols, bool) { if o == nil || IsNil(o.TlsProtocols) { return nil, false } @@ -824,8 +824,8 @@ func (o *InstanceParameters) HasTlsProtocols() bool { return false } -// SetTlsProtocols gets a reference to the given string and assigns it to the TlsProtocols field. -func (o *InstanceParameters) SetTlsProtocols(v string) { +// SetTlsProtocols gets a reference to the given InstanceParametersTlsProtocols and assigns it to the TlsProtocols field. +func (o *InstanceParameters) SetTlsProtocols(v InstanceParametersTlsProtocols) { o.TlsProtocols = &v } diff --git a/services/redis/v1api/model_instance_parameters_lazyfree_lazy_eviction.go b/services/redis/v1api/model_instance_parameters_lazyfree_lazy_eviction.go new file mode 100644 index 000000000..5250eaf89 --- /dev/null +++ b/services/redis/v1api/model_instance_parameters_lazyfree_lazy_eviction.go @@ -0,0 +1,113 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersLazyfreeLazyEviction the model 'InstanceParametersLazyfreeLazyEviction' +type InstanceParametersLazyfreeLazyEviction string + +// List of InstanceParameters_lazyfree_lazy_eviction +const ( + INSTANCEPARAMETERSLAZYFREELAZYEVICTION_YES InstanceParametersLazyfreeLazyEviction = "yes" + INSTANCEPARAMETERSLAZYFREELAZYEVICTION_NO InstanceParametersLazyfreeLazyEviction = "no" + INSTANCEPARAMETERSLAZYFREELAZYEVICTION_UNKNOWN_DEFAULT_OPEN_API InstanceParametersLazyfreeLazyEviction = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersLazyfreeLazyEviction enum +var AllowedInstanceParametersLazyfreeLazyEvictionEnumValues = []InstanceParametersLazyfreeLazyEviction{ + "yes", + "no", + "unknown_default_open_api", +} + +func (v *InstanceParametersLazyfreeLazyEviction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersLazyfreeLazyEviction(value) + for _, existing := range AllowedInstanceParametersLazyfreeLazyEvictionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSLAZYFREELAZYEVICTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersLazyfreeLazyEvictionFromValue returns a pointer to a valid InstanceParametersLazyfreeLazyEviction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersLazyfreeLazyEvictionFromValue(v string) (*InstanceParametersLazyfreeLazyEviction, error) { + ev := InstanceParametersLazyfreeLazyEviction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersLazyfreeLazyEviction: valid values are %v", v, AllowedInstanceParametersLazyfreeLazyEvictionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersLazyfreeLazyEviction) IsValid() bool { + for _, existing := range AllowedInstanceParametersLazyfreeLazyEvictionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_lazyfree_lazy_eviction value +func (v InstanceParametersLazyfreeLazyEviction) Ptr() *InstanceParametersLazyfreeLazyEviction { + return &v +} + +type NullableInstanceParametersLazyfreeLazyEviction struct { + value *InstanceParametersLazyfreeLazyEviction + isSet bool +} + +func (v NullableInstanceParametersLazyfreeLazyEviction) Get() *InstanceParametersLazyfreeLazyEviction { + return v.value +} + +func (v *NullableInstanceParametersLazyfreeLazyEviction) Set(val *InstanceParametersLazyfreeLazyEviction) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersLazyfreeLazyEviction) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersLazyfreeLazyEviction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersLazyfreeLazyEviction(val *InstanceParametersLazyfreeLazyEviction) *NullableInstanceParametersLazyfreeLazyEviction { + return &NullableInstanceParametersLazyfreeLazyEviction{value: val, isSet: true} +} + +func (v NullableInstanceParametersLazyfreeLazyEviction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersLazyfreeLazyEviction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v1api/model_instance_parameters_lazyfree_lazy_expire.go b/services/redis/v1api/model_instance_parameters_lazyfree_lazy_expire.go new file mode 100644 index 000000000..c594cbe6b --- /dev/null +++ b/services/redis/v1api/model_instance_parameters_lazyfree_lazy_expire.go @@ -0,0 +1,113 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersLazyfreeLazyExpire the model 'InstanceParametersLazyfreeLazyExpire' +type InstanceParametersLazyfreeLazyExpire string + +// List of InstanceParameters_lazyfree_lazy_expire +const ( + INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_YES InstanceParametersLazyfreeLazyExpire = "yes" + INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_NO InstanceParametersLazyfreeLazyExpire = "no" + INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_UNKNOWN_DEFAULT_OPEN_API InstanceParametersLazyfreeLazyExpire = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersLazyfreeLazyExpire enum +var AllowedInstanceParametersLazyfreeLazyExpireEnumValues = []InstanceParametersLazyfreeLazyExpire{ + "yes", + "no", + "unknown_default_open_api", +} + +func (v *InstanceParametersLazyfreeLazyExpire) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersLazyfreeLazyExpire(value) + for _, existing := range AllowedInstanceParametersLazyfreeLazyExpireEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSLAZYFREELAZYEXPIRE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersLazyfreeLazyExpireFromValue returns a pointer to a valid InstanceParametersLazyfreeLazyExpire +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersLazyfreeLazyExpireFromValue(v string) (*InstanceParametersLazyfreeLazyExpire, error) { + ev := InstanceParametersLazyfreeLazyExpire(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersLazyfreeLazyExpire: valid values are %v", v, AllowedInstanceParametersLazyfreeLazyExpireEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersLazyfreeLazyExpire) IsValid() bool { + for _, existing := range AllowedInstanceParametersLazyfreeLazyExpireEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_lazyfree_lazy_expire value +func (v InstanceParametersLazyfreeLazyExpire) Ptr() *InstanceParametersLazyfreeLazyExpire { + return &v +} + +type NullableInstanceParametersLazyfreeLazyExpire struct { + value *InstanceParametersLazyfreeLazyExpire + isSet bool +} + +func (v NullableInstanceParametersLazyfreeLazyExpire) Get() *InstanceParametersLazyfreeLazyExpire { + return v.value +} + +func (v *NullableInstanceParametersLazyfreeLazyExpire) Set(val *InstanceParametersLazyfreeLazyExpire) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersLazyfreeLazyExpire) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersLazyfreeLazyExpire) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersLazyfreeLazyExpire(val *InstanceParametersLazyfreeLazyExpire) *NullableInstanceParametersLazyfreeLazyExpire { + return &NullableInstanceParametersLazyfreeLazyExpire{value: val, isSet: true} +} + +func (v NullableInstanceParametersLazyfreeLazyExpire) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersLazyfreeLazyExpire) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v1api/model_instance_parameters_maxmemory_policy.go b/services/redis/v1api/model_instance_parameters_maxmemory_policy.go new file mode 100644 index 000000000..21b107586 --- /dev/null +++ b/services/redis/v1api/model_instance_parameters_maxmemory_policy.go @@ -0,0 +1,121 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersMaxmemoryPolicy the model 'InstanceParametersMaxmemoryPolicy' +type InstanceParametersMaxmemoryPolicy string + +// List of InstanceParameters_maxmemory_policy +const ( + INSTANCEPARAMETERSMAXMEMORYPOLICY_VOLATILE_LRU InstanceParametersMaxmemoryPolicy = "volatile-lru" + INSTANCEPARAMETERSMAXMEMORYPOLICY_ALLKEYS_LRU InstanceParametersMaxmemoryPolicy = "allkeys-lru" + INSTANCEPARAMETERSMAXMEMORYPOLICY_VOLATILE_RANDOM InstanceParametersMaxmemoryPolicy = "volatile-random" + INSTANCEPARAMETERSMAXMEMORYPOLICY_ALLKEYS_RANDOM InstanceParametersMaxmemoryPolicy = "allkeys-random" + INSTANCEPARAMETERSMAXMEMORYPOLICY_VOLATILE_TTL InstanceParametersMaxmemoryPolicy = "volatile-ttl" + INSTANCEPARAMETERSMAXMEMORYPOLICY_NOEVICTION InstanceParametersMaxmemoryPolicy = "noeviction" + INSTANCEPARAMETERSMAXMEMORYPOLICY_UNKNOWN_DEFAULT_OPEN_API InstanceParametersMaxmemoryPolicy = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersMaxmemoryPolicy enum +var AllowedInstanceParametersMaxmemoryPolicyEnumValues = []InstanceParametersMaxmemoryPolicy{ + "volatile-lru", + "allkeys-lru", + "volatile-random", + "allkeys-random", + "volatile-ttl", + "noeviction", + "unknown_default_open_api", +} + +func (v *InstanceParametersMaxmemoryPolicy) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersMaxmemoryPolicy(value) + for _, existing := range AllowedInstanceParametersMaxmemoryPolicyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSMAXMEMORYPOLICY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceParametersMaxmemoryPolicyFromValue returns a pointer to a valid InstanceParametersMaxmemoryPolicy +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceParametersMaxmemoryPolicyFromValue(v string) (*InstanceParametersMaxmemoryPolicy, error) { + ev := InstanceParametersMaxmemoryPolicy(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceParametersMaxmemoryPolicy: valid values are %v", v, AllowedInstanceParametersMaxmemoryPolicyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceParametersMaxmemoryPolicy) IsValid() bool { + for _, existing := range AllowedInstanceParametersMaxmemoryPolicyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InstanceParameters_maxmemory_policy value +func (v InstanceParametersMaxmemoryPolicy) Ptr() *InstanceParametersMaxmemoryPolicy { + return &v +} + +type NullableInstanceParametersMaxmemoryPolicy struct { + value *InstanceParametersMaxmemoryPolicy + isSet bool +} + +func (v NullableInstanceParametersMaxmemoryPolicy) Get() *InstanceParametersMaxmemoryPolicy { + return v.value +} + +func (v *NullableInstanceParametersMaxmemoryPolicy) Set(val *InstanceParametersMaxmemoryPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersMaxmemoryPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersMaxmemoryPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersMaxmemoryPolicy(val *InstanceParametersMaxmemoryPolicy) *NullableInstanceParametersMaxmemoryPolicy { + return &NullableInstanceParametersMaxmemoryPolicy{value: val, isSet: true} +} + +func (v NullableInstanceParametersMaxmemoryPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersMaxmemoryPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/redis/v1api/model_instance_parameters_tls_protocols.go b/services/redis/v1api/model_instance_parameters_tls_protocols.go new file mode 100644 index 000000000..2f099aeb8 --- /dev/null +++ b/services/redis/v1api/model_instance_parameters_tls_protocols.go @@ -0,0 +1,113 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceParametersTlsProtocols the model 'InstanceParametersTlsProtocols' +type InstanceParametersTlsProtocols string + +// List of InstanceParameters_tls_protocols +const ( + INSTANCEPARAMETERSTLSPROTOCOLS_TLSV1_2 InstanceParametersTlsProtocols = "TLSv1.2" + INSTANCEPARAMETERSTLSPROTOCOLS_TLSV1_3 InstanceParametersTlsProtocols = "TLSv1.3" + INSTANCEPARAMETERSTLSPROTOCOLS_UNKNOWN_DEFAULT_OPEN_API InstanceParametersTlsProtocols = "unknown_default_open_api" +) + +// All allowed values of InstanceParametersTlsProtocols enum +var AllowedInstanceParametersTlsProtocolsEnumValues = []InstanceParametersTlsProtocols{ + "TLSv1.2", + "TLSv1.3", + "unknown_default_open_api", +} + +func (v *InstanceParametersTlsProtocols) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceParametersTlsProtocols(value) + for _, existing := range AllowedInstanceParametersTlsProtocolsEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCEPARAMETERSTLSPROTOCOLS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// 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 string) (*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 InstanceParameters_tls_protocols 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) +} diff --git a/services/redis/v1api/model_instance_status.go b/services/redis/v1api/model_instance_status.go new file mode 100644 index 000000000..b55d45fb6 --- /dev/null +++ b/services/redis/v1api/model_instance_status.go @@ -0,0 +1,121 @@ +/* +STACKIT Redis API + +The STACKIT Redis API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// InstanceStatus the model 'InstanceStatus' +type InstanceStatus string + +// List of Instance_status +const ( + INSTANCESTATUS_ACTIVE InstanceStatus = "active" + INSTANCESTATUS_FAILED InstanceStatus = "failed" + INSTANCESTATUS_STOPPED InstanceStatus = "stopped" + INSTANCESTATUS_CREATING InstanceStatus = "creating" + INSTANCESTATUS_DELETING InstanceStatus = "deleting" + INSTANCESTATUS_UPDATING InstanceStatus = "updating" + INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API InstanceStatus = "unknown_default_open_api" +) + +// All allowed values of InstanceStatus enum +var AllowedInstanceStatusEnumValues = []InstanceStatus{ + "active", + "failed", + "stopped", + "creating", + "deleting", + "updating", + "unknown_default_open_api", +} + +func (v *InstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceStatus(value) + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStatusFromValue(v string) (*InstanceStatus, error) { + ev := InstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceStatus) IsValid() bool { + for _, existing := range AllowedInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_status value +func (v InstanceStatus) Ptr() *InstanceStatus { + return &v +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 4213799b13eddce9a93aab6b71485458b93b918a Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:32:05 +0200 Subject: [PATCH 38/66] chore(redis): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/redis/CHANGELOG.md | 3 +++ services/redis/v1api/wait/wait.go | 12 +++++------ services/redis/v1api/wait/wait_test.go | 30 +++++++++++++------------- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f56052dfa..7a9a57f48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -333,6 +333,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v0.28.2](services/redis/CHANGELOG.md#v0282) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` + - [v0.30.0](services/redis/CHANGELOG.md#v0300) + - **Feature:** Introduce enums for various attributes - `resourcemanager`: - [v0.21.2](services/resourcemanager/CHANGELOG.md#v0212) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/redis/CHANGELOG.md b/services/redis/CHANGELOG.md index cf6d467b0..a4a098505 100644 --- a/services/redis/CHANGELOG.md +++ b/services/redis/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.30.0 +- **Feature:** Introduce enums for various attributes + ## v0.28.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` diff --git a/services/redis/v1api/wait/wait.go b/services/redis/v1api/wait/wait.go index ae0e8c238..56825b4e9 100644 --- a/services/redis/v1api/wait/wait.go +++ b/services/redis/v1api/wait/wait.go @@ -36,9 +36,9 @@ func CreateInstanceWaitHandler(ctx context.Context, a redis.DefaultAPI, projectI return false, nil, fmt.Errorf("create failed for instance with id %s. The response is not valid: the status is missing", instanceId) } switch *s.Status { - case INSTANCESTATUS_ACTIVE: + case redis.INSTANCESTATUS_ACTIVE: return true, s, nil - case INSTANCESTATUS_FAILED: + case redis.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("create failed for instance with id %s: %s", instanceId, s.LastOperation.Description) } return false, nil, nil @@ -58,9 +58,9 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, a redis.DefaultAPI, p return false, nil, fmt.Errorf("update failed for instance with id %s. The response is not valid: the instance id or the status are missing", instanceId) } switch *s.Status { - case INSTANCESTATUS_ACTIVE: + case redis.INSTANCESTATUS_ACTIVE: return true, s, nil - case INSTANCESTATUS_FAILED: + case redis.INSTANCESTATUS_FAILED: return true, s, fmt.Errorf("update failed for instance with id %s: %s", instanceId, s.LastOperation.Description) } return false, nil, nil @@ -77,10 +77,10 @@ func DeleteInstanceWaitHandler(ctx context.Context, a redis.DefaultAPI, projectI if s.Status == nil { return false, nil, fmt.Errorf("delete failed for instance with id %s. The response is not valid: The status is missing", instanceId) } - if *s.Status != INSTANCESTATUS_DELETING { + if *s.Status != redis.INSTANCESTATUS_DELETING { return false, nil, nil } - if *s.Status == INSTANCESTATUS_ACTIVE { + if *s.Status == redis.INSTANCESTATUS_ACTIVE { if strings.Contains(s.LastOperation.Description, "DeleteFailed") || strings.Contains(s.LastOperation.Description, "failed") { return true, nil, fmt.Errorf("instance was deleted successfully but has errors: %s", s.LastOperation.Description) } diff --git a/services/redis/v1api/wait/wait_test.go b/services/redis/v1api/wait/wait_test.go index e71d036b1..fbd9144f6 100644 --- a/services/redis/v1api/wait/wait_test.go +++ b/services/redis/v1api/wait/wait_test.go @@ -17,8 +17,8 @@ type mockSettings struct { instanceGetFails bool instanceDeletionSucceedsWithErrors bool instanceResourceId string - instanceResourceOperation string - instanceResourceState *string + instanceResourceOperation redis.InstanceLastOperationType + instanceResourceState *redis.InstanceStatus instanceResourceDescription string credentialGetFails bool @@ -35,7 +35,7 @@ func newAPIMock(settings *mockSettings) redis.DefaultAPI { StatusCode: 500, } } - if settings.instanceResourceOperation == INSTANCELASTOPERATIONTYPE_DELETE && settings.instanceResourceState != nil && *settings.instanceResourceState == INSTANCESTATUS_ACTIVE { + if settings.instanceResourceOperation == redis.INSTANCELASTOPERATIONTYPE_DELETE && settings.instanceResourceState != nil && *settings.instanceResourceState == redis.INSTANCESTATUS_ACTIVE { if settings.instanceDeletionSucceedsWithErrors { return &redis.Instance{ InstanceId: &settings.instanceResourceId, @@ -80,21 +80,21 @@ func TestCreateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState *string + resourceState *redis.InstanceStatus wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(redis.INSTANCESTATUS_ACTIVE), wantErr: false, wantResp: true, }, { desc: "create_failed", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: utils.Ptr(redis.INSTANCESTATUS_FAILED), wantErr: true, wantResp: true, }, @@ -107,7 +107,7 @@ func TestCreateInstanceWaitHandler(t *testing.T) { { desc: "timeout", getFails: false, - resourceState: utils.Ptr("ANOTHER STATE"), + resourceState: utils.Ptr(redis.InstanceStatus("ANOTHER STATE")), wantErr: true, wantResp: false, }, @@ -151,21 +151,21 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState *string + resourceState *redis.InstanceStatus wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(redis.INSTANCESTATUS_ACTIVE), wantErr: false, wantResp: true, }, { desc: "update_failed", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: utils.Ptr(redis.INSTANCESTATUS_FAILED), wantErr: true, wantResp: true, }, @@ -178,7 +178,7 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { { desc: "timeout", getFails: false, - resourceState: utils.Ptr("ANOTHER STATE"), + resourceState: utils.Ptr(redis.InstanceStatus("ANOTHER STATE")), wantErr: true, wantResp: false, }, @@ -222,7 +222,7 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc string getFails bool deleteSucceeedsWithErrors bool - resourceState *string + resourceState *redis.InstanceStatus resourceDescription string wantErr bool }{ @@ -230,20 +230,20 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { desc: "delete_succeeded", getFails: false, deleteSucceeedsWithErrors: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(redis.INSTANCESTATUS_ACTIVE), wantErr: false, }, { desc: "delete_failed", getFails: false, deleteSucceeedsWithErrors: false, - resourceState: utils.Ptr(INSTANCESTATUS_FAILED), + resourceState: utils.Ptr(redis.INSTANCESTATUS_FAILED), wantErr: true, }, { desc: "delete_succeeds_with_errors", getFails: false, - resourceState: utils.Ptr(INSTANCESTATUS_ACTIVE), + resourceState: utils.Ptr(redis.INSTANCESTATUS_ACTIVE), deleteSucceeedsWithErrors: true, resourceDescription: "Deleting resource: cf failed with error: DeleteFailed", wantErr: true, From 2c595f269035d4b17cd74b640245eb89f40c2fe1 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:35:03 +0200 Subject: [PATCH 39/66] refac(resourcemanager): introduce inline enums --- .../v0api/model_container_search_result.go | 15 ++- ..._container_search_result_container_type.go | 113 ++++++++++++++++++ .../resourcemanager/v0api/model_parent.go | 15 ++- .../v0api/model_parent_list_inner.go | 15 ++- .../v0api/model_parent_list_inner_type.go | 113 ++++++++++++++++++ .../v0api/model_parent_type.go | 113 ++++++++++++++++++ 6 files changed, 360 insertions(+), 24 deletions(-) create mode 100644 services/resourcemanager/v0api/model_container_search_result_container_type.go create mode 100644 services/resourcemanager/v0api/model_parent_list_inner_type.go create mode 100644 services/resourcemanager/v0api/model_parent_type.go diff --git a/services/resourcemanager/v0api/model_container_search_result.go b/services/resourcemanager/v0api/model_container_search_result.go index 3e1155824..d17ce420b 100644 --- a/services/resourcemanager/v0api/model_container_search_result.go +++ b/services/resourcemanager/v0api/model_container_search_result.go @@ -21,9 +21,8 @@ var _ MappedNullable = &ContainerSearchResult{} // ContainerSearchResult struct for ContainerSearchResult type ContainerSearchResult struct { // Globally unique user-friendly identifier. - ContainerId string `json:"containerId"` - // Resource container type. - ContainerType string `json:"containerType"` + ContainerId string `json:"containerId"` + ContainerType ContainerSearchResultContainerType `json:"containerType"` // Globally unique identifier. Id string `json:"id"` LifecycleState *LifecycleState `json:"lifecycleState,omitempty"` @@ -40,7 +39,7 @@ type _ContainerSearchResult ContainerSearchResult // 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 NewContainerSearchResult(containerId string, containerType string, id string, name string) *ContainerSearchResult { +func NewContainerSearchResult(containerId string, containerType ContainerSearchResultContainerType, id string, name string) *ContainerSearchResult { this := ContainerSearchResult{} this.ContainerId = containerId this.ContainerType = containerType @@ -82,9 +81,9 @@ func (o *ContainerSearchResult) SetContainerId(v string) { } // GetContainerType returns the ContainerType field value -func (o *ContainerSearchResult) GetContainerType() string { +func (o *ContainerSearchResult) GetContainerType() ContainerSearchResultContainerType { if o == nil { - var ret string + var ret ContainerSearchResultContainerType return ret } @@ -93,7 +92,7 @@ func (o *ContainerSearchResult) GetContainerType() string { // GetContainerTypeOk returns a tuple with the ContainerType field value // and a boolean to check if the value has been set. -func (o *ContainerSearchResult) GetContainerTypeOk() (*string, bool) { +func (o *ContainerSearchResult) GetContainerTypeOk() (*ContainerSearchResultContainerType, bool) { if o == nil { return nil, false } @@ -101,7 +100,7 @@ func (o *ContainerSearchResult) GetContainerTypeOk() (*string, bool) { } // SetContainerType sets field value -func (o *ContainerSearchResult) SetContainerType(v string) { +func (o *ContainerSearchResult) SetContainerType(v ContainerSearchResultContainerType) { o.ContainerType = v } diff --git a/services/resourcemanager/v0api/model_container_search_result_container_type.go b/services/resourcemanager/v0api/model_container_search_result_container_type.go new file mode 100644 index 000000000..a66d44530 --- /dev/null +++ b/services/resourcemanager/v0api/model_container_search_result_container_type.go @@ -0,0 +1,113 @@ +/* +STACKIT Resource Manager API + +API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v0api + +import ( + "encoding/json" + "fmt" +) + +// ContainerSearchResultContainerType Resource container type. +type ContainerSearchResultContainerType string + +// List of ContainerSearchResult_containerType +const ( + CONTAINERSEARCHRESULTCONTAINERTYPE_PROJECT ContainerSearchResultContainerType = "PROJECT" + CONTAINERSEARCHRESULTCONTAINERTYPE_FOLDER ContainerSearchResultContainerType = "FOLDER" + CONTAINERSEARCHRESULTCONTAINERTYPE_UNKNOWN_DEFAULT_OPEN_API ContainerSearchResultContainerType = "unknown_default_open_api" +) + +// All allowed values of ContainerSearchResultContainerType enum +var AllowedContainerSearchResultContainerTypeEnumValues = []ContainerSearchResultContainerType{ + "PROJECT", + "FOLDER", + "unknown_default_open_api", +} + +func (v *ContainerSearchResultContainerType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ContainerSearchResultContainerType(value) + for _, existing := range AllowedContainerSearchResultContainerTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CONTAINERSEARCHRESULTCONTAINERTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewContainerSearchResultContainerTypeFromValue returns a pointer to a valid ContainerSearchResultContainerType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewContainerSearchResultContainerTypeFromValue(v string) (*ContainerSearchResultContainerType, error) { + ev := ContainerSearchResultContainerType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ContainerSearchResultContainerType: valid values are %v", v, AllowedContainerSearchResultContainerTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ContainerSearchResultContainerType) IsValid() bool { + for _, existing := range AllowedContainerSearchResultContainerTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ContainerSearchResult_containerType value +func (v ContainerSearchResultContainerType) Ptr() *ContainerSearchResultContainerType { + return &v +} + +type NullableContainerSearchResultContainerType struct { + value *ContainerSearchResultContainerType + isSet bool +} + +func (v NullableContainerSearchResultContainerType) Get() *ContainerSearchResultContainerType { + return v.value +} + +func (v *NullableContainerSearchResultContainerType) Set(val *ContainerSearchResultContainerType) { + v.value = val + v.isSet = true +} + +func (v NullableContainerSearchResultContainerType) IsSet() bool { + return v.isSet +} + +func (v *NullableContainerSearchResultContainerType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContainerSearchResultContainerType(val *ContainerSearchResultContainerType) *NullableContainerSearchResultContainerType { + return &NullableContainerSearchResultContainerType{value: val, isSet: true} +} + +func (v NullableContainerSearchResultContainerType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContainerSearchResultContainerType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/resourcemanager/v0api/model_parent.go b/services/resourcemanager/v0api/model_parent.go index f2ff4b4b8..f12197012 100644 --- a/services/resourcemanager/v0api/model_parent.go +++ b/services/resourcemanager/v0api/model_parent.go @@ -23,9 +23,8 @@ type Parent struct { // User-friendly identifier of either organization or folder (will replace id). ContainerId string `json:"containerId"` // Identifier of either organization or folder. - Id string `json:"id"` - // Container type of parent container. - Type string `json:"type"` + Id string `json:"id"` + Type ParentType `json:"type"` AdditionalProperties map[string]interface{} } @@ -35,7 +34,7 @@ type _Parent Parent // 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 NewParent(containerId string, id string, types string) *Parent { +func NewParent(containerId string, id string, types ParentType) *Parent { this := Parent{} this.ContainerId = containerId this.Id = id @@ -100,9 +99,9 @@ func (o *Parent) SetId(v string) { } // GetType returns the Type field value -func (o *Parent) GetType() string { +func (o *Parent) GetType() ParentType { if o == nil { - var ret string + var ret ParentType return ret } @@ -111,7 +110,7 @@ func (o *Parent) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *Parent) GetTypeOk() (*string, bool) { +func (o *Parent) GetTypeOk() (*ParentType, bool) { if o == nil { return nil, false } @@ -119,7 +118,7 @@ func (o *Parent) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *Parent) SetType(v string) { +func (o *Parent) SetType(v ParentType) { o.Type = v } diff --git a/services/resourcemanager/v0api/model_parent_list_inner.go b/services/resourcemanager/v0api/model_parent_list_inner.go index 1fedfbe91..8358c4727 100644 --- a/services/resourcemanager/v0api/model_parent_list_inner.go +++ b/services/resourcemanager/v0api/model_parent_list_inner.go @@ -29,9 +29,8 @@ type ParentListInner struct { // Parent container name. Name string `json:"name"` // Identifier of the parent resource container. - ParentId *string `json:"parentId,omitempty"` - // Parent container type. - Type string `json:"type"` + ParentId *string `json:"parentId,omitempty"` + Type ParentListInnerType `json:"type"` AdditionalProperties map[string]interface{} } @@ -41,7 +40,7 @@ type _ParentListInner ParentListInner // 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 NewParentListInner(containerId string, id string, name string, types string) *ParentListInner { +func NewParentListInner(containerId string, id string, name string, types ParentListInnerType) *ParentListInner { this := ParentListInner{} this.ContainerId = containerId this.Id = id @@ -195,9 +194,9 @@ func (o *ParentListInner) SetParentId(v string) { } // GetType returns the Type field value -func (o *ParentListInner) GetType() string { +func (o *ParentListInner) GetType() ParentListInnerType { if o == nil { - var ret string + var ret ParentListInnerType return ret } @@ -206,7 +205,7 @@ func (o *ParentListInner) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *ParentListInner) GetTypeOk() (*string, bool) { +func (o *ParentListInner) GetTypeOk() (*ParentListInnerType, bool) { if o == nil { return nil, false } @@ -214,7 +213,7 @@ func (o *ParentListInner) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *ParentListInner) SetType(v string) { +func (o *ParentListInner) SetType(v ParentListInnerType) { o.Type = v } diff --git a/services/resourcemanager/v0api/model_parent_list_inner_type.go b/services/resourcemanager/v0api/model_parent_list_inner_type.go new file mode 100644 index 000000000..ae4d222b6 --- /dev/null +++ b/services/resourcemanager/v0api/model_parent_list_inner_type.go @@ -0,0 +1,113 @@ +/* +STACKIT Resource Manager API + +API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v0api + +import ( + "encoding/json" + "fmt" +) + +// ParentListInnerType Parent container type. +type ParentListInnerType string + +// List of ParentList_inner_type +const ( + PARENTLISTINNERTYPE_FOLDER ParentListInnerType = "FOLDER" + PARENTLISTINNERTYPE_ORGANIZATION ParentListInnerType = "ORGANIZATION" + PARENTLISTINNERTYPE_UNKNOWN_DEFAULT_OPEN_API ParentListInnerType = "unknown_default_open_api" +) + +// All allowed values of ParentListInnerType enum +var AllowedParentListInnerTypeEnumValues = []ParentListInnerType{ + "FOLDER", + "ORGANIZATION", + "unknown_default_open_api", +} + +func (v *ParentListInnerType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ParentListInnerType(value) + for _, existing := range AllowedParentListInnerTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARENTLISTINNERTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewParentListInnerTypeFromValue returns a pointer to a valid ParentListInnerType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewParentListInnerTypeFromValue(v string) (*ParentListInnerType, error) { + ev := ParentListInnerType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ParentListInnerType: valid values are %v", v, AllowedParentListInnerTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ParentListInnerType) IsValid() bool { + for _, existing := range AllowedParentListInnerTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ParentList_inner_type value +func (v ParentListInnerType) Ptr() *ParentListInnerType { + return &v +} + +type NullableParentListInnerType struct { + value *ParentListInnerType + isSet bool +} + +func (v NullableParentListInnerType) Get() *ParentListInnerType { + return v.value +} + +func (v *NullableParentListInnerType) Set(val *ParentListInnerType) { + v.value = val + v.isSet = true +} + +func (v NullableParentListInnerType) IsSet() bool { + return v.isSet +} + +func (v *NullableParentListInnerType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParentListInnerType(val *ParentListInnerType) *NullableParentListInnerType { + return &NullableParentListInnerType{value: val, isSet: true} +} + +func (v NullableParentListInnerType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParentListInnerType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/resourcemanager/v0api/model_parent_type.go b/services/resourcemanager/v0api/model_parent_type.go new file mode 100644 index 000000000..0a87655b3 --- /dev/null +++ b/services/resourcemanager/v0api/model_parent_type.go @@ -0,0 +1,113 @@ +/* +STACKIT Resource Manager API + +API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v0api + +import ( + "encoding/json" + "fmt" +) + +// ParentType Container type of parent container. +type ParentType string + +// List of Parent_type +const ( + PARENTTYPE_ORGANIZATION ParentType = "ORGANIZATION" + PARENTTYPE_FOLDER ParentType = "FOLDER" + PARENTTYPE_UNKNOWN_DEFAULT_OPEN_API ParentType = "unknown_default_open_api" +) + +// All allowed values of ParentType enum +var AllowedParentTypeEnumValues = []ParentType{ + "ORGANIZATION", + "FOLDER", + "unknown_default_open_api", +} + +func (v *ParentType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ParentType(value) + for _, existing := range AllowedParentTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARENTTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewParentTypeFromValue returns a pointer to a valid ParentType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewParentTypeFromValue(v string) (*ParentType, error) { + ev := ParentType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ParentType: valid values are %v", v, AllowedParentTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ParentType) IsValid() bool { + for _, existing := range AllowedParentTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Parent_type value +func (v ParentType) Ptr() *ParentType { + return &v +} + +type NullableParentType struct { + value *ParentType + isSet bool +} + +func (v NullableParentType) Get() *ParentType { + return v.value +} + +func (v *NullableParentType) Set(val *ParentType) { + v.value = val + v.isSet = true +} + +func (v NullableParentType) IsSet() bool { + return v.isSet +} + +func (v *NullableParentType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParentType(val *ParentType) *NullableParentType { + return &NullableParentType{value: val, isSet: true} +} + +func (v NullableParentType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParentType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From f4a2a52941d1f569a1a966207643df8a059b42c2 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:41:50 +0200 Subject: [PATCH 40/66] chore(resourcemanager): write changelog, bump version --- CHANGELOG.md | 2 ++ services/resourcemanager/CHANGELOG.md | 3 +++ services/resourcemanager/VERSION | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a9a57f48..66d64b262 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -346,6 +346,8 @@ - **Dependencies:** Bump STACKIT SDK core module to `v0.26.0` - [v0.23.0](services/resourcemanager/CHANGELOG.md#v0230) - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. + - [v0.24.0](services/resourcemanager/CHANGELOG.md#v0240) + - **Feature:** Introduce enums for various attributes - `runcommand`: - [v1.6.3](services/runcommand/CHANGELOG.md#v163) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/resourcemanager/CHANGELOG.md b/services/resourcemanager/CHANGELOG.md index 59f6bb77a..f9f7dacf5 100644 --- a/services/resourcemanager/CHANGELOG.md +++ b/services/resourcemanager/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.24.0 +- **Feature:** Introduce enums for various attributes + ## v0.23.0 - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. diff --git a/services/resourcemanager/VERSION b/services/resourcemanager/VERSION index 0c2a959e8..6897c006a 100644 --- a/services/resourcemanager/VERSION +++ b/services/resourcemanager/VERSION @@ -1 +1 @@ -v0.23.0 +v0.24.0 From e772b3c0e639d4e36307248b68457611d73d01d0 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:46:15 +0200 Subject: [PATCH 41/66] refac(runcommand): introduce inline enums --- .../runcommand/v1api/model_command_details.go | 28 ++--- .../v1api/model_command_details_status.go | 118 ++++++++++++++++++ services/runcommand/v1api/model_commands.go | 22 ++-- .../runcommand/v1api/model_commands_status.go | 118 ++++++++++++++++++ .../v1betaapi/model_command_details.go | 28 ++--- .../v1betaapi/model_command_details_status.go | 118 ++++++++++++++++++ .../runcommand/v1betaapi/model_commands.go | 22 ++-- .../v1betaapi/model_commands_status.go | 118 ++++++++++++++++++ .../runcommand/v2api/model_command_details.go | 28 ++--- .../v2api/model_command_details_status.go | 118 ++++++++++++++++++ services/runcommand/v2api/model_commands.go | 22 ++-- .../runcommand/v2api/model_commands_status.go | 118 ++++++++++++++++++ .../v2betaapi/model_command_details.go | 28 ++--- .../v2betaapi/model_command_details_status.go | 118 ++++++++++++++++++ .../runcommand/v2betaapi/model_commands.go | 22 ++-- .../v2betaapi/model_commands_status.go | 118 ++++++++++++++++++ 16 files changed, 1044 insertions(+), 100 deletions(-) create mode 100644 services/runcommand/v1api/model_command_details_status.go create mode 100644 services/runcommand/v1api/model_commands_status.go create mode 100644 services/runcommand/v1betaapi/model_command_details_status.go create mode 100644 services/runcommand/v1betaapi/model_commands_status.go create mode 100644 services/runcommand/v2api/model_command_details_status.go create mode 100644 services/runcommand/v2api/model_commands_status.go create mode 100644 services/runcommand/v2betaapi/model_command_details_status.go create mode 100644 services/runcommand/v2betaapi/model_commands_status.go diff --git a/services/runcommand/v1api/model_command_details.go b/services/runcommand/v1api/model_command_details.go index e522b1696..6cb162471 100644 --- a/services/runcommand/v1api/model_command_details.go +++ b/services/runcommand/v1api/model_command_details.go @@ -20,15 +20,15 @@ var _ MappedNullable = &CommandDetails{} // CommandDetails struct for CommandDetails type CommandDetails struct { - CommandTemplateName *string `json:"commandTemplateName,omitempty"` - CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` - ExitCode *int32 `json:"exitCode,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` - Id *int32 `json:"id,omitempty"` - Output *string `json:"output,omitempty"` - Script *string `json:"script,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + CommandTemplateName *string `json:"commandTemplateName,omitempty"` + CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` + ExitCode *int32 `json:"exitCode,omitempty"` + FinishedAt *string `json:"finishedAt,omitempty"` + Id *int32 `json:"id,omitempty"` + Output *string `json:"output,omitempty"` + Script *string `json:"script,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *CommandDetailsStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -308,9 +308,9 @@ func (o *CommandDetails) SetStartedAt(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CommandDetails) GetStatus() string { +func (o *CommandDetails) GetStatus() CommandDetailsStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CommandDetailsStatus return ret } return *o.Status @@ -318,7 +318,7 @@ func (o *CommandDetails) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetStatusOk() (*string, bool) { +func (o *CommandDetails) GetStatusOk() (*CommandDetailsStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -334,8 +334,8 @@ func (o *CommandDetails) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CommandDetails) SetStatus(v string) { +// SetStatus gets a reference to the given CommandDetailsStatus and assigns it to the Status field. +func (o *CommandDetails) SetStatus(v CommandDetailsStatus) { o.Status = &v } diff --git a/services/runcommand/v1api/model_command_details_status.go b/services/runcommand/v1api/model_command_details_status.go new file mode 100644 index 000000000..cef021641 --- /dev/null +++ b/services/runcommand/v1api/model_command_details_status.go @@ -0,0 +1,118 @@ +/* +STACKIT Run Commands Service API + +API endpoints for the STACKIT Run Commands Service API + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CommandDetailsStatus the model 'CommandDetailsStatus' +type CommandDetailsStatus string + +// List of CommandDetails_status +const ( + COMMANDDETAILSSTATUS_PENDING CommandDetailsStatus = "pending" + COMMANDDETAILSSTATUS_RUNNING CommandDetailsStatus = "running" + COMMANDDETAILSSTATUS_COMPLETED CommandDetailsStatus = "completed" + COMMANDDETAILSSTATUS_FAILED CommandDetailsStatus = "failed" + COMMANDDETAILSSTATUS_UNKNOWN_DEFAULT_OPEN_API CommandDetailsStatus = "unknown_default_open_api" +) + +// All allowed values of CommandDetailsStatus enum +var AllowedCommandDetailsStatusEnumValues = []CommandDetailsStatus{ + "pending", + "running", + "completed", + "failed", + "unknown_default_open_api", +} + +func (v *CommandDetailsStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CommandDetailsStatus(value) + for _, existing := range AllowedCommandDetailsStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = COMMANDDETAILSSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCommandDetailsStatusFromValue returns a pointer to a valid CommandDetailsStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCommandDetailsStatusFromValue(v string) (*CommandDetailsStatus, error) { + ev := CommandDetailsStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CommandDetailsStatus: valid values are %v", v, AllowedCommandDetailsStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CommandDetailsStatus) IsValid() bool { + for _, existing := range AllowedCommandDetailsStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CommandDetails_status value +func (v CommandDetailsStatus) Ptr() *CommandDetailsStatus { + return &v +} + +type NullableCommandDetailsStatus struct { + value *CommandDetailsStatus + isSet bool +} + +func (v NullableCommandDetailsStatus) Get() *CommandDetailsStatus { + return v.value +} + +func (v *NullableCommandDetailsStatus) Set(val *CommandDetailsStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCommandDetailsStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCommandDetailsStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommandDetailsStatus(val *CommandDetailsStatus) *NullableCommandDetailsStatus { + return &NullableCommandDetailsStatus{value: val, isSet: true} +} + +func (v NullableCommandDetailsStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommandDetailsStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/runcommand/v1api/model_commands.go b/services/runcommand/v1api/model_commands.go index 3c88d294b..baae918ae 100644 --- a/services/runcommand/v1api/model_commands.go +++ b/services/runcommand/v1api/model_commands.go @@ -20,12 +20,12 @@ var _ MappedNullable = &Commands{} // Commands struct for Commands type Commands struct { - CommandTemplateName *string `json:"commandTemplateName,omitempty"` - CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` - Id *int32 `json:"id,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + CommandTemplateName *string `json:"commandTemplateName,omitempty"` + CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` + FinishedAt *string `json:"finishedAt,omitempty"` + Id *int32 `json:"id,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *CommandsStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -209,9 +209,9 @@ func (o *Commands) SetStartedAt(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Commands) GetStatus() string { +func (o *Commands) GetStatus() CommandsStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CommandsStatus return ret } return *o.Status @@ -219,7 +219,7 @@ func (o *Commands) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Commands) GetStatusOk() (*string, bool) { +func (o *Commands) GetStatusOk() (*CommandsStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -235,8 +235,8 @@ func (o *Commands) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Commands) SetStatus(v string) { +// SetStatus gets a reference to the given CommandsStatus and assigns it to the Status field. +func (o *Commands) SetStatus(v CommandsStatus) { o.Status = &v } diff --git a/services/runcommand/v1api/model_commands_status.go b/services/runcommand/v1api/model_commands_status.go new file mode 100644 index 000000000..6fe3f014a --- /dev/null +++ b/services/runcommand/v1api/model_commands_status.go @@ -0,0 +1,118 @@ +/* +STACKIT Run Commands Service API + +API endpoints for the STACKIT Run Commands Service API + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CommandsStatus the model 'CommandsStatus' +type CommandsStatus string + +// List of Commands_status +const ( + COMMANDSSTATUS_PENDING CommandsStatus = "pending" + COMMANDSSTATUS_RUNNING CommandsStatus = "running" + COMMANDSSTATUS_COMPLETED CommandsStatus = "completed" + COMMANDSSTATUS_FAILED CommandsStatus = "failed" + COMMANDSSTATUS_UNKNOWN_DEFAULT_OPEN_API CommandsStatus = "unknown_default_open_api" +) + +// All allowed values of CommandsStatus enum +var AllowedCommandsStatusEnumValues = []CommandsStatus{ + "pending", + "running", + "completed", + "failed", + "unknown_default_open_api", +} + +func (v *CommandsStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CommandsStatus(value) + for _, existing := range AllowedCommandsStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = COMMANDSSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCommandsStatusFromValue returns a pointer to a valid CommandsStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCommandsStatusFromValue(v string) (*CommandsStatus, error) { + ev := CommandsStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CommandsStatus: valid values are %v", v, AllowedCommandsStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CommandsStatus) IsValid() bool { + for _, existing := range AllowedCommandsStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Commands_status value +func (v CommandsStatus) Ptr() *CommandsStatus { + return &v +} + +type NullableCommandsStatus struct { + value *CommandsStatus + isSet bool +} + +func (v NullableCommandsStatus) Get() *CommandsStatus { + return v.value +} + +func (v *NullableCommandsStatus) Set(val *CommandsStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCommandsStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCommandsStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommandsStatus(val *CommandsStatus) *NullableCommandsStatus { + return &NullableCommandsStatus{value: val, isSet: true} +} + +func (v NullableCommandsStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommandsStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/runcommand/v1betaapi/model_command_details.go b/services/runcommand/v1betaapi/model_command_details.go index 3f9a9a4db..6992e9813 100644 --- a/services/runcommand/v1betaapi/model_command_details.go +++ b/services/runcommand/v1betaapi/model_command_details.go @@ -20,15 +20,15 @@ var _ MappedNullable = &CommandDetails{} // CommandDetails struct for CommandDetails type CommandDetails struct { - CommandTemplateName *string `json:"commandTemplateName,omitempty"` - CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` - ExitCode *int32 `json:"exitCode,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` - Id *int32 `json:"id,omitempty"` - Output *string `json:"output,omitempty"` - Script *string `json:"script,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + CommandTemplateName *string `json:"commandTemplateName,omitempty"` + CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` + ExitCode *int32 `json:"exitCode,omitempty"` + FinishedAt *string `json:"finishedAt,omitempty"` + Id *int32 `json:"id,omitempty"` + Output *string `json:"output,omitempty"` + Script *string `json:"script,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *CommandDetailsStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -308,9 +308,9 @@ func (o *CommandDetails) SetStartedAt(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CommandDetails) GetStatus() string { +func (o *CommandDetails) GetStatus() CommandDetailsStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CommandDetailsStatus return ret } return *o.Status @@ -318,7 +318,7 @@ func (o *CommandDetails) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetStatusOk() (*string, bool) { +func (o *CommandDetails) GetStatusOk() (*CommandDetailsStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -334,8 +334,8 @@ func (o *CommandDetails) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CommandDetails) SetStatus(v string) { +// SetStatus gets a reference to the given CommandDetailsStatus and assigns it to the Status field. +func (o *CommandDetails) SetStatus(v CommandDetailsStatus) { o.Status = &v } diff --git a/services/runcommand/v1betaapi/model_command_details_status.go b/services/runcommand/v1betaapi/model_command_details_status.go new file mode 100644 index 000000000..07bf1b44c --- /dev/null +++ b/services/runcommand/v1betaapi/model_command_details_status.go @@ -0,0 +1,118 @@ +/* +STACKIT Run Commands Service API + +API endpoints for the STACKIT Run Commands Service API + +API version: 1beta.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// CommandDetailsStatus the model 'CommandDetailsStatus' +type CommandDetailsStatus string + +// List of CommandDetails_status +const ( + COMMANDDETAILSSTATUS_PENDING CommandDetailsStatus = "pending" + COMMANDDETAILSSTATUS_RUNNING CommandDetailsStatus = "running" + COMMANDDETAILSSTATUS_COMPLETED CommandDetailsStatus = "completed" + COMMANDDETAILSSTATUS_FAILED CommandDetailsStatus = "failed" + COMMANDDETAILSSTATUS_UNKNOWN_DEFAULT_OPEN_API CommandDetailsStatus = "unknown_default_open_api" +) + +// All allowed values of CommandDetailsStatus enum +var AllowedCommandDetailsStatusEnumValues = []CommandDetailsStatus{ + "pending", + "running", + "completed", + "failed", + "unknown_default_open_api", +} + +func (v *CommandDetailsStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CommandDetailsStatus(value) + for _, existing := range AllowedCommandDetailsStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = COMMANDDETAILSSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCommandDetailsStatusFromValue returns a pointer to a valid CommandDetailsStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCommandDetailsStatusFromValue(v string) (*CommandDetailsStatus, error) { + ev := CommandDetailsStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CommandDetailsStatus: valid values are %v", v, AllowedCommandDetailsStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CommandDetailsStatus) IsValid() bool { + for _, existing := range AllowedCommandDetailsStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CommandDetails_status value +func (v CommandDetailsStatus) Ptr() *CommandDetailsStatus { + return &v +} + +type NullableCommandDetailsStatus struct { + value *CommandDetailsStatus + isSet bool +} + +func (v NullableCommandDetailsStatus) Get() *CommandDetailsStatus { + return v.value +} + +func (v *NullableCommandDetailsStatus) Set(val *CommandDetailsStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCommandDetailsStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCommandDetailsStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommandDetailsStatus(val *CommandDetailsStatus) *NullableCommandDetailsStatus { + return &NullableCommandDetailsStatus{value: val, isSet: true} +} + +func (v NullableCommandDetailsStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommandDetailsStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/runcommand/v1betaapi/model_commands.go b/services/runcommand/v1betaapi/model_commands.go index 3972be89a..af9b0ef67 100644 --- a/services/runcommand/v1betaapi/model_commands.go +++ b/services/runcommand/v1betaapi/model_commands.go @@ -20,12 +20,12 @@ var _ MappedNullable = &Commands{} // Commands struct for Commands type Commands struct { - CommandTemplateName *string `json:"commandTemplateName,omitempty"` - CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` - Id *int32 `json:"id,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + CommandTemplateName *string `json:"commandTemplateName,omitempty"` + CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` + FinishedAt *string `json:"finishedAt,omitempty"` + Id *int32 `json:"id,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *CommandsStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -209,9 +209,9 @@ func (o *Commands) SetStartedAt(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Commands) GetStatus() string { +func (o *Commands) GetStatus() CommandsStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CommandsStatus return ret } return *o.Status @@ -219,7 +219,7 @@ func (o *Commands) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Commands) GetStatusOk() (*string, bool) { +func (o *Commands) GetStatusOk() (*CommandsStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -235,8 +235,8 @@ func (o *Commands) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Commands) SetStatus(v string) { +// SetStatus gets a reference to the given CommandsStatus and assigns it to the Status field. +func (o *Commands) SetStatus(v CommandsStatus) { o.Status = &v } diff --git a/services/runcommand/v1betaapi/model_commands_status.go b/services/runcommand/v1betaapi/model_commands_status.go new file mode 100644 index 000000000..d26ea9fff --- /dev/null +++ b/services/runcommand/v1betaapi/model_commands_status.go @@ -0,0 +1,118 @@ +/* +STACKIT Run Commands Service API + +API endpoints for the STACKIT Run Commands Service API + +API version: 1beta.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// CommandsStatus the model 'CommandsStatus' +type CommandsStatus string + +// List of Commands_status +const ( + COMMANDSSTATUS_PENDING CommandsStatus = "pending" + COMMANDSSTATUS_RUNNING CommandsStatus = "running" + COMMANDSSTATUS_COMPLETED CommandsStatus = "completed" + COMMANDSSTATUS_FAILED CommandsStatus = "failed" + COMMANDSSTATUS_UNKNOWN_DEFAULT_OPEN_API CommandsStatus = "unknown_default_open_api" +) + +// All allowed values of CommandsStatus enum +var AllowedCommandsStatusEnumValues = []CommandsStatus{ + "pending", + "running", + "completed", + "failed", + "unknown_default_open_api", +} + +func (v *CommandsStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CommandsStatus(value) + for _, existing := range AllowedCommandsStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = COMMANDSSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCommandsStatusFromValue returns a pointer to a valid CommandsStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCommandsStatusFromValue(v string) (*CommandsStatus, error) { + ev := CommandsStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CommandsStatus: valid values are %v", v, AllowedCommandsStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CommandsStatus) IsValid() bool { + for _, existing := range AllowedCommandsStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Commands_status value +func (v CommandsStatus) Ptr() *CommandsStatus { + return &v +} + +type NullableCommandsStatus struct { + value *CommandsStatus + isSet bool +} + +func (v NullableCommandsStatus) Get() *CommandsStatus { + return v.value +} + +func (v *NullableCommandsStatus) Set(val *CommandsStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCommandsStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCommandsStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommandsStatus(val *CommandsStatus) *NullableCommandsStatus { + return &NullableCommandsStatus{value: val, isSet: true} +} + +func (v NullableCommandsStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommandsStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/runcommand/v2api/model_command_details.go b/services/runcommand/v2api/model_command_details.go index b518cacec..7e5c2a297 100644 --- a/services/runcommand/v2api/model_command_details.go +++ b/services/runcommand/v2api/model_command_details.go @@ -20,15 +20,15 @@ var _ MappedNullable = &CommandDetails{} // CommandDetails struct for CommandDetails type CommandDetails struct { - CommandTemplateName *string `json:"commandTemplateName,omitempty"` - CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` - ExitCode *int32 `json:"exitCode,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` - Id *int32 `json:"id,omitempty"` - Output *string `json:"output,omitempty"` - Script *string `json:"script,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + CommandTemplateName *string `json:"commandTemplateName,omitempty"` + CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` + ExitCode *int32 `json:"exitCode,omitempty"` + FinishedAt *string `json:"finishedAt,omitempty"` + Id *int32 `json:"id,omitempty"` + Output *string `json:"output,omitempty"` + Script *string `json:"script,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *CommandDetailsStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -308,9 +308,9 @@ func (o *CommandDetails) SetStartedAt(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CommandDetails) GetStatus() string { +func (o *CommandDetails) GetStatus() CommandDetailsStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CommandDetailsStatus return ret } return *o.Status @@ -318,7 +318,7 @@ func (o *CommandDetails) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetStatusOk() (*string, bool) { +func (o *CommandDetails) GetStatusOk() (*CommandDetailsStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -334,8 +334,8 @@ func (o *CommandDetails) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CommandDetails) SetStatus(v string) { +// SetStatus gets a reference to the given CommandDetailsStatus and assigns it to the Status field. +func (o *CommandDetails) SetStatus(v CommandDetailsStatus) { o.Status = &v } diff --git a/services/runcommand/v2api/model_command_details_status.go b/services/runcommand/v2api/model_command_details_status.go new file mode 100644 index 000000000..172458513 --- /dev/null +++ b/services/runcommand/v2api/model_command_details_status.go @@ -0,0 +1,118 @@ +/* +STACKIT Run Commands Service API + +API endpoints for the STACKIT Run Commands Service API + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CommandDetailsStatus the model 'CommandDetailsStatus' +type CommandDetailsStatus string + +// List of CommandDetails_status +const ( + COMMANDDETAILSSTATUS_PENDING CommandDetailsStatus = "pending" + COMMANDDETAILSSTATUS_RUNNING CommandDetailsStatus = "running" + COMMANDDETAILSSTATUS_COMPLETED CommandDetailsStatus = "completed" + COMMANDDETAILSSTATUS_FAILED CommandDetailsStatus = "failed" + COMMANDDETAILSSTATUS_UNKNOWN_DEFAULT_OPEN_API CommandDetailsStatus = "unknown_default_open_api" +) + +// All allowed values of CommandDetailsStatus enum +var AllowedCommandDetailsStatusEnumValues = []CommandDetailsStatus{ + "pending", + "running", + "completed", + "failed", + "unknown_default_open_api", +} + +func (v *CommandDetailsStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CommandDetailsStatus(value) + for _, existing := range AllowedCommandDetailsStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = COMMANDDETAILSSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCommandDetailsStatusFromValue returns a pointer to a valid CommandDetailsStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCommandDetailsStatusFromValue(v string) (*CommandDetailsStatus, error) { + ev := CommandDetailsStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CommandDetailsStatus: valid values are %v", v, AllowedCommandDetailsStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CommandDetailsStatus) IsValid() bool { + for _, existing := range AllowedCommandDetailsStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CommandDetails_status value +func (v CommandDetailsStatus) Ptr() *CommandDetailsStatus { + return &v +} + +type NullableCommandDetailsStatus struct { + value *CommandDetailsStatus + isSet bool +} + +func (v NullableCommandDetailsStatus) Get() *CommandDetailsStatus { + return v.value +} + +func (v *NullableCommandDetailsStatus) Set(val *CommandDetailsStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCommandDetailsStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCommandDetailsStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommandDetailsStatus(val *CommandDetailsStatus) *NullableCommandDetailsStatus { + return &NullableCommandDetailsStatus{value: val, isSet: true} +} + +func (v NullableCommandDetailsStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommandDetailsStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/runcommand/v2api/model_commands.go b/services/runcommand/v2api/model_commands.go index 3ca9f9287..413c2b94b 100644 --- a/services/runcommand/v2api/model_commands.go +++ b/services/runcommand/v2api/model_commands.go @@ -20,12 +20,12 @@ var _ MappedNullable = &Commands{} // Commands struct for Commands type Commands struct { - CommandTemplateName *string `json:"commandTemplateName,omitempty"` - CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` - Id *int32 `json:"id,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + CommandTemplateName *string `json:"commandTemplateName,omitempty"` + CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` + FinishedAt *string `json:"finishedAt,omitempty"` + Id *int32 `json:"id,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *CommandsStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -209,9 +209,9 @@ func (o *Commands) SetStartedAt(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Commands) GetStatus() string { +func (o *Commands) GetStatus() CommandsStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CommandsStatus return ret } return *o.Status @@ -219,7 +219,7 @@ func (o *Commands) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Commands) GetStatusOk() (*string, bool) { +func (o *Commands) GetStatusOk() (*CommandsStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -235,8 +235,8 @@ func (o *Commands) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Commands) SetStatus(v string) { +// SetStatus gets a reference to the given CommandsStatus and assigns it to the Status field. +func (o *Commands) SetStatus(v CommandsStatus) { o.Status = &v } diff --git a/services/runcommand/v2api/model_commands_status.go b/services/runcommand/v2api/model_commands_status.go new file mode 100644 index 000000000..e67fc40d2 --- /dev/null +++ b/services/runcommand/v2api/model_commands_status.go @@ -0,0 +1,118 @@ +/* +STACKIT Run Commands Service API + +API endpoints for the STACKIT Run Commands Service API + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CommandsStatus the model 'CommandsStatus' +type CommandsStatus string + +// List of Commands_status +const ( + COMMANDSSTATUS_PENDING CommandsStatus = "pending" + COMMANDSSTATUS_RUNNING CommandsStatus = "running" + COMMANDSSTATUS_COMPLETED CommandsStatus = "completed" + COMMANDSSTATUS_FAILED CommandsStatus = "failed" + COMMANDSSTATUS_UNKNOWN_DEFAULT_OPEN_API CommandsStatus = "unknown_default_open_api" +) + +// All allowed values of CommandsStatus enum +var AllowedCommandsStatusEnumValues = []CommandsStatus{ + "pending", + "running", + "completed", + "failed", + "unknown_default_open_api", +} + +func (v *CommandsStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CommandsStatus(value) + for _, existing := range AllowedCommandsStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = COMMANDSSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCommandsStatusFromValue returns a pointer to a valid CommandsStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCommandsStatusFromValue(v string) (*CommandsStatus, error) { + ev := CommandsStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CommandsStatus: valid values are %v", v, AllowedCommandsStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CommandsStatus) IsValid() bool { + for _, existing := range AllowedCommandsStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Commands_status value +func (v CommandsStatus) Ptr() *CommandsStatus { + return &v +} + +type NullableCommandsStatus struct { + value *CommandsStatus + isSet bool +} + +func (v NullableCommandsStatus) Get() *CommandsStatus { + return v.value +} + +func (v *NullableCommandsStatus) Set(val *CommandsStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCommandsStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCommandsStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommandsStatus(val *CommandsStatus) *NullableCommandsStatus { + return &NullableCommandsStatus{value: val, isSet: true} +} + +func (v NullableCommandsStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommandsStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/runcommand/v2betaapi/model_command_details.go b/services/runcommand/v2betaapi/model_command_details.go index 518603db3..322dd00c9 100644 --- a/services/runcommand/v2betaapi/model_command_details.go +++ b/services/runcommand/v2betaapi/model_command_details.go @@ -20,15 +20,15 @@ var _ MappedNullable = &CommandDetails{} // CommandDetails struct for CommandDetails type CommandDetails struct { - CommandTemplateName *string `json:"commandTemplateName,omitempty"` - CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` - ExitCode *int32 `json:"exitCode,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` - Id *int32 `json:"id,omitempty"` - Output *string `json:"output,omitempty"` - Script *string `json:"script,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + CommandTemplateName *string `json:"commandTemplateName,omitempty"` + CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` + ExitCode *int32 `json:"exitCode,omitempty"` + FinishedAt *string `json:"finishedAt,omitempty"` + Id *int32 `json:"id,omitempty"` + Output *string `json:"output,omitempty"` + Script *string `json:"script,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *CommandDetailsStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -308,9 +308,9 @@ func (o *CommandDetails) SetStartedAt(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CommandDetails) GetStatus() string { +func (o *CommandDetails) GetStatus() CommandDetailsStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CommandDetailsStatus return ret } return *o.Status @@ -318,7 +318,7 @@ func (o *CommandDetails) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CommandDetails) GetStatusOk() (*string, bool) { +func (o *CommandDetails) GetStatusOk() (*CommandDetailsStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -334,8 +334,8 @@ func (o *CommandDetails) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *CommandDetails) SetStatus(v string) { +// SetStatus gets a reference to the given CommandDetailsStatus and assigns it to the Status field. +func (o *CommandDetails) SetStatus(v CommandDetailsStatus) { o.Status = &v } diff --git a/services/runcommand/v2betaapi/model_command_details_status.go b/services/runcommand/v2betaapi/model_command_details_status.go new file mode 100644 index 000000000..578711b74 --- /dev/null +++ b/services/runcommand/v2betaapi/model_command_details_status.go @@ -0,0 +1,118 @@ +/* +STACKIT Run Commands Service API + +API endpoints for the STACKIT Run Commands Service API + +API version: 2beta.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2betaapi + +import ( + "encoding/json" + "fmt" +) + +// CommandDetailsStatus the model 'CommandDetailsStatus' +type CommandDetailsStatus string + +// List of CommandDetails_status +const ( + COMMANDDETAILSSTATUS_PENDING CommandDetailsStatus = "pending" + COMMANDDETAILSSTATUS_RUNNING CommandDetailsStatus = "running" + COMMANDDETAILSSTATUS_COMPLETED CommandDetailsStatus = "completed" + COMMANDDETAILSSTATUS_FAILED CommandDetailsStatus = "failed" + COMMANDDETAILSSTATUS_UNKNOWN_DEFAULT_OPEN_API CommandDetailsStatus = "unknown_default_open_api" +) + +// All allowed values of CommandDetailsStatus enum +var AllowedCommandDetailsStatusEnumValues = []CommandDetailsStatus{ + "pending", + "running", + "completed", + "failed", + "unknown_default_open_api", +} + +func (v *CommandDetailsStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CommandDetailsStatus(value) + for _, existing := range AllowedCommandDetailsStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = COMMANDDETAILSSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCommandDetailsStatusFromValue returns a pointer to a valid CommandDetailsStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCommandDetailsStatusFromValue(v string) (*CommandDetailsStatus, error) { + ev := CommandDetailsStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CommandDetailsStatus: valid values are %v", v, AllowedCommandDetailsStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CommandDetailsStatus) IsValid() bool { + for _, existing := range AllowedCommandDetailsStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CommandDetails_status value +func (v CommandDetailsStatus) Ptr() *CommandDetailsStatus { + return &v +} + +type NullableCommandDetailsStatus struct { + value *CommandDetailsStatus + isSet bool +} + +func (v NullableCommandDetailsStatus) Get() *CommandDetailsStatus { + return v.value +} + +func (v *NullableCommandDetailsStatus) Set(val *CommandDetailsStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCommandDetailsStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCommandDetailsStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommandDetailsStatus(val *CommandDetailsStatus) *NullableCommandDetailsStatus { + return &NullableCommandDetailsStatus{value: val, isSet: true} +} + +func (v NullableCommandDetailsStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommandDetailsStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/runcommand/v2betaapi/model_commands.go b/services/runcommand/v2betaapi/model_commands.go index 144ffe3a6..4fd8ce196 100644 --- a/services/runcommand/v2betaapi/model_commands.go +++ b/services/runcommand/v2betaapi/model_commands.go @@ -20,12 +20,12 @@ var _ MappedNullable = &Commands{} // Commands struct for Commands type Commands struct { - CommandTemplateName *string `json:"commandTemplateName,omitempty"` - CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` - FinishedAt *string `json:"finishedAt,omitempty"` - Id *int32 `json:"id,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + CommandTemplateName *string `json:"commandTemplateName,omitempty"` + CommandTemplateTitle *string `json:"commandTemplateTitle,omitempty"` + FinishedAt *string `json:"finishedAt,omitempty"` + Id *int32 `json:"id,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *CommandsStatus `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -209,9 +209,9 @@ func (o *Commands) SetStartedAt(v string) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Commands) GetStatus() string { +func (o *Commands) GetStatus() CommandsStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret CommandsStatus return ret } return *o.Status @@ -219,7 +219,7 @@ func (o *Commands) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Commands) GetStatusOk() (*string, bool) { +func (o *Commands) GetStatusOk() (*CommandsStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -235,8 +235,8 @@ func (o *Commands) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Commands) SetStatus(v string) { +// SetStatus gets a reference to the given CommandsStatus and assigns it to the Status field. +func (o *Commands) SetStatus(v CommandsStatus) { o.Status = &v } diff --git a/services/runcommand/v2betaapi/model_commands_status.go b/services/runcommand/v2betaapi/model_commands_status.go new file mode 100644 index 000000000..5a810e52f --- /dev/null +++ b/services/runcommand/v2betaapi/model_commands_status.go @@ -0,0 +1,118 @@ +/* +STACKIT Run Commands Service API + +API endpoints for the STACKIT Run Commands Service API + +API version: 2beta.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2betaapi + +import ( + "encoding/json" + "fmt" +) + +// CommandsStatus the model 'CommandsStatus' +type CommandsStatus string + +// List of Commands_status +const ( + COMMANDSSTATUS_PENDING CommandsStatus = "pending" + COMMANDSSTATUS_RUNNING CommandsStatus = "running" + COMMANDSSTATUS_COMPLETED CommandsStatus = "completed" + COMMANDSSTATUS_FAILED CommandsStatus = "failed" + COMMANDSSTATUS_UNKNOWN_DEFAULT_OPEN_API CommandsStatus = "unknown_default_open_api" +) + +// All allowed values of CommandsStatus enum +var AllowedCommandsStatusEnumValues = []CommandsStatus{ + "pending", + "running", + "completed", + "failed", + "unknown_default_open_api", +} + +func (v *CommandsStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CommandsStatus(value) + for _, existing := range AllowedCommandsStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = COMMANDSSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCommandsStatusFromValue returns a pointer to a valid CommandsStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCommandsStatusFromValue(v string) (*CommandsStatus, error) { + ev := CommandsStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CommandsStatus: valid values are %v", v, AllowedCommandsStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CommandsStatus) IsValid() bool { + for _, existing := range AllowedCommandsStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Commands_status value +func (v CommandsStatus) Ptr() *CommandsStatus { + return &v +} + +type NullableCommandsStatus struct { + value *CommandsStatus + isSet bool +} + +func (v NullableCommandsStatus) Get() *CommandsStatus { + return v.value +} + +func (v *NullableCommandsStatus) Set(val *CommandsStatus) { + v.value = val + v.isSet = true +} + +func (v NullableCommandsStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableCommandsStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommandsStatus(val *CommandsStatus) *NullableCommandsStatus { + return &NullableCommandsStatus{value: val, isSet: true} +} + +func (v NullableCommandsStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommandsStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 526be85af5743a1e93516106d1fa0fe9a4dad56a Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:48:26 +0200 Subject: [PATCH 42/66] chore(runcommand): write changelog, bump version --- CHANGELOG.md | 2 ++ services/runcommand/CHANGELOG.md | 3 +++ services/runcommand/VERSION | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66d64b262..ca498289d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -357,6 +357,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v1.7.2](services/runcommand/CHANGELOG.md#v172) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` + - [v1.8.0](services/runcommand/CHANGELOG.md#v180) + - **Feature:** Introduce enums for various attributes - `scf`: - [v0.6.3](services/scf/CHANGELOG.md#v063) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/runcommand/CHANGELOG.md b/services/runcommand/CHANGELOG.md index a717be561..fd7f00e15 100644 --- a/services/runcommand/CHANGELOG.md +++ b/services/runcommand/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.8.0 +- **Feature:** Introduce enums for various attributes + ## v1.7.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` diff --git a/services/runcommand/VERSION b/services/runcommand/VERSION index 75e47606b..4e2cea3bb 100644 --- a/services/runcommand/VERSION +++ b/services/runcommand/VERSION @@ -1 +1 @@ -v1.7.2 \ No newline at end of file +v1.8.0 \ No newline at end of file From 5f320834e5413a6fc6042ce3134885bcefe581ac Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:49:04 +0200 Subject: [PATCH 43/66] refac(auditlog): introduce inline enums --- .../v2api/model_audit_log_entry_response.go | 39 +++--- ...del_audit_log_entry_response_event_type.go | 115 ++++++++++++++++++ ...model_audit_log_entry_response_severity.go | 113 +++++++++++++++++ ...del_audit_log_entry_response_visibility.go | 113 +++++++++++++++++ 4 files changed, 359 insertions(+), 21 deletions(-) create mode 100644 services/auditlog/v2api/model_audit_log_entry_response_event_type.go create mode 100644 services/auditlog/v2api/model_audit_log_entry_response_severity.go create mode 100644 services/auditlog/v2api/model_audit_log_entry_response_visibility.go diff --git a/services/auditlog/v2api/model_audit_log_entry_response.go b/services/auditlog/v2api/model_audit_log_entry_response.go index 8206bec84..cdbcc7cc5 100644 --- a/services/auditlog/v2api/model_audit_log_entry_response.go +++ b/services/auditlog/v2api/model_audit_log_entry_response.go @@ -31,9 +31,8 @@ type AuditLogEntryResponse struct { // The service in which the causing event was handled. EventSource string `json:"eventSource"` // Timestamp at which the event was triggered. - EventTimeStamp time.Time `json:"eventTimeStamp"` - // Type that can be assigned to the event. For example, an event \"Organization created\" can be assigned to the type ADMIN_EVENT - EventType string `json:"eventType"` + EventTimeStamp time.Time `json:"eventTimeStamp"` + EventType AuditLogEntryResponseEventType `json:"eventType"` // Version of the log event format. EventVersion string `json:"eventVersion"` // Unique ID generated by the audit log. @@ -51,14 +50,12 @@ type AuditLogEntryResponse struct { // Object representing the change resulting from this event. May be omitted if no change has been applied. May contain arbitrary data. Result map[string]interface{} `json:"result,omitempty"` ServiceAccountDelegationInfo *AuditLogEntryServiceAccountDelegationInfoResponse `json:"serviceAccountDelegationInfo,omitempty"` - // The severity of this request. - Severity string `json:"severity"` + Severity AuditLogEntryResponseSeverity `json:"severity"` // IP address that the request was made from SourceIpAddress string `json:"sourceIpAddress"` // Agent through which the request was made from (e.g. Portal, CLI, SDK, ...) - UserAgent string `json:"userAgent"` - // PUBLIC for entries that are intended for end users, while PRIVATE entries can only be viewed with system privileges. - Visibility string `json:"visibility"` + UserAgent string `json:"userAgent"` + Visibility AuditLogEntryResponseVisibility `json:"visibility"` AdditionalProperties map[string]interface{} } @@ -68,7 +65,7 @@ type _AuditLogEntryResponse AuditLogEntryResponse // 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 NewAuditLogEntryResponse(eventName string, eventSource string, eventTimeStamp time.Time, eventType string, eventVersion string, id string, initiator AuditLogEntryInitiatorResponse, receivedTimeStamp time.Time, region string, request AuditLogEntryRequestResponse, severity string, sourceIpAddress string, userAgent string, visibility string) *AuditLogEntryResponse { +func NewAuditLogEntryResponse(eventName string, eventSource string, eventTimeStamp time.Time, eventType AuditLogEntryResponseEventType, eventVersion string, id string, initiator AuditLogEntryInitiatorResponse, receivedTimeStamp time.Time, region string, request AuditLogEntryRequestResponse, severity AuditLogEntryResponseSeverity, sourceIpAddress string, userAgent string, visibility AuditLogEntryResponseVisibility) *AuditLogEntryResponse { this := AuditLogEntryResponse{} this.EventName = eventName this.EventSource = eventSource @@ -264,9 +261,9 @@ func (o *AuditLogEntryResponse) SetEventTimeStamp(v time.Time) { } // GetEventType returns the EventType field value -func (o *AuditLogEntryResponse) GetEventType() string { +func (o *AuditLogEntryResponse) GetEventType() AuditLogEntryResponseEventType { if o == nil { - var ret string + var ret AuditLogEntryResponseEventType return ret } @@ -275,7 +272,7 @@ func (o *AuditLogEntryResponse) GetEventType() string { // GetEventTypeOk returns a tuple with the EventType field value // and a boolean to check if the value has been set. -func (o *AuditLogEntryResponse) GetEventTypeOk() (*string, bool) { +func (o *AuditLogEntryResponse) GetEventTypeOk() (*AuditLogEntryResponseEventType, bool) { if o == nil { return nil, false } @@ -283,7 +280,7 @@ func (o *AuditLogEntryResponse) GetEventTypeOk() (*string, bool) { } // SetEventType sets field value -func (o *AuditLogEntryResponse) SetEventType(v string) { +func (o *AuditLogEntryResponse) SetEventType(v AuditLogEntryResponseEventType) { o.EventType = v } @@ -560,9 +557,9 @@ func (o *AuditLogEntryResponse) SetServiceAccountDelegationInfo(v AuditLogEntryS } // GetSeverity returns the Severity field value -func (o *AuditLogEntryResponse) GetSeverity() string { +func (o *AuditLogEntryResponse) GetSeverity() AuditLogEntryResponseSeverity { if o == nil { - var ret string + var ret AuditLogEntryResponseSeverity return ret } @@ -571,7 +568,7 @@ func (o *AuditLogEntryResponse) GetSeverity() string { // GetSeverityOk returns a tuple with the Severity field value // and a boolean to check if the value has been set. -func (o *AuditLogEntryResponse) GetSeverityOk() (*string, bool) { +func (o *AuditLogEntryResponse) GetSeverityOk() (*AuditLogEntryResponseSeverity, bool) { if o == nil { return nil, false } @@ -579,7 +576,7 @@ func (o *AuditLogEntryResponse) GetSeverityOk() (*string, bool) { } // SetSeverity sets field value -func (o *AuditLogEntryResponse) SetSeverity(v string) { +func (o *AuditLogEntryResponse) SetSeverity(v AuditLogEntryResponseSeverity) { o.Severity = v } @@ -632,9 +629,9 @@ func (o *AuditLogEntryResponse) SetUserAgent(v string) { } // GetVisibility returns the Visibility field value -func (o *AuditLogEntryResponse) GetVisibility() string { +func (o *AuditLogEntryResponse) GetVisibility() AuditLogEntryResponseVisibility { if o == nil { - var ret string + var ret AuditLogEntryResponseVisibility return ret } @@ -643,7 +640,7 @@ func (o *AuditLogEntryResponse) GetVisibility() string { // GetVisibilityOk returns a tuple with the Visibility field value // and a boolean to check if the value has been set. -func (o *AuditLogEntryResponse) GetVisibilityOk() (*string, bool) { +func (o *AuditLogEntryResponse) GetVisibilityOk() (*AuditLogEntryResponseVisibility, bool) { if o == nil { return nil, false } @@ -651,7 +648,7 @@ func (o *AuditLogEntryResponse) GetVisibilityOk() (*string, bool) { } // SetVisibility sets field value -func (o *AuditLogEntryResponse) SetVisibility(v string) { +func (o *AuditLogEntryResponse) SetVisibility(v AuditLogEntryResponseVisibility) { o.Visibility = v } diff --git a/services/auditlog/v2api/model_audit_log_entry_response_event_type.go b/services/auditlog/v2api/model_audit_log_entry_response_event_type.go new file mode 100644 index 000000000..f63c024a7 --- /dev/null +++ b/services/auditlog/v2api/model_audit_log_entry_response_event_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Audit Log API + +API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// AuditLogEntryResponseEventType Type that can be assigned to the event. For example, an event \"Organization created\" can be assigned to the type ADMIN_EVENT +type AuditLogEntryResponseEventType string + +// List of AuditLogEntryResponse_eventType +const ( + AUDITLOGENTRYRESPONSEEVENTTYPE_ADMIN_ACTIVITY AuditLogEntryResponseEventType = "ADMIN_ACTIVITY" + AUDITLOGENTRYRESPONSEEVENTTYPE_SYSTEM_EVENT AuditLogEntryResponseEventType = "SYSTEM_EVENT" + AUDITLOGENTRYRESPONSEEVENTTYPE_POLICY_DENIED AuditLogEntryResponseEventType = "POLICY_DENIED" + AUDITLOGENTRYRESPONSEEVENTTYPE_UNKNOWN_DEFAULT_OPEN_API AuditLogEntryResponseEventType = "unknown_default_open_api" +) + +// All allowed values of AuditLogEntryResponseEventType enum +var AllowedAuditLogEntryResponseEventTypeEnumValues = []AuditLogEntryResponseEventType{ + "ADMIN_ACTIVITY", + "SYSTEM_EVENT", + "POLICY_DENIED", + "unknown_default_open_api", +} + +func (v *AuditLogEntryResponseEventType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuditLogEntryResponseEventType(value) + for _, existing := range AllowedAuditLogEntryResponseEventTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = AUDITLOGENTRYRESPONSEEVENTTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAuditLogEntryResponseEventTypeFromValue returns a pointer to a valid AuditLogEntryResponseEventType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuditLogEntryResponseEventTypeFromValue(v string) (*AuditLogEntryResponseEventType, error) { + ev := AuditLogEntryResponseEventType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuditLogEntryResponseEventType: valid values are %v", v, AllowedAuditLogEntryResponseEventTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuditLogEntryResponseEventType) IsValid() bool { + for _, existing := range AllowedAuditLogEntryResponseEventTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AuditLogEntryResponse_eventType value +func (v AuditLogEntryResponseEventType) Ptr() *AuditLogEntryResponseEventType { + return &v +} + +type NullableAuditLogEntryResponseEventType struct { + value *AuditLogEntryResponseEventType + isSet bool +} + +func (v NullableAuditLogEntryResponseEventType) Get() *AuditLogEntryResponseEventType { + return v.value +} + +func (v *NullableAuditLogEntryResponseEventType) Set(val *AuditLogEntryResponseEventType) { + v.value = val + v.isSet = true +} + +func (v NullableAuditLogEntryResponseEventType) IsSet() bool { + return v.isSet +} + +func (v *NullableAuditLogEntryResponseEventType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuditLogEntryResponseEventType(val *AuditLogEntryResponseEventType) *NullableAuditLogEntryResponseEventType { + return &NullableAuditLogEntryResponseEventType{value: val, isSet: true} +} + +func (v NullableAuditLogEntryResponseEventType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuditLogEntryResponseEventType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/auditlog/v2api/model_audit_log_entry_response_severity.go b/services/auditlog/v2api/model_audit_log_entry_response_severity.go new file mode 100644 index 000000000..0b3f8c3dd --- /dev/null +++ b/services/auditlog/v2api/model_audit_log_entry_response_severity.go @@ -0,0 +1,113 @@ +/* +STACKIT Audit Log API + +API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// AuditLogEntryResponseSeverity The severity of this request. +type AuditLogEntryResponseSeverity string + +// List of AuditLogEntryResponse_severity +const ( + AUDITLOGENTRYRESPONSESEVERITY_INFO AuditLogEntryResponseSeverity = "INFO" + AUDITLOGENTRYRESPONSESEVERITY_ERROR AuditLogEntryResponseSeverity = "ERROR" + AUDITLOGENTRYRESPONSESEVERITY_UNKNOWN_DEFAULT_OPEN_API AuditLogEntryResponseSeverity = "unknown_default_open_api" +) + +// All allowed values of AuditLogEntryResponseSeverity enum +var AllowedAuditLogEntryResponseSeverityEnumValues = []AuditLogEntryResponseSeverity{ + "INFO", + "ERROR", + "unknown_default_open_api", +} + +func (v *AuditLogEntryResponseSeverity) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuditLogEntryResponseSeverity(value) + for _, existing := range AllowedAuditLogEntryResponseSeverityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = AUDITLOGENTRYRESPONSESEVERITY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAuditLogEntryResponseSeverityFromValue returns a pointer to a valid AuditLogEntryResponseSeverity +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuditLogEntryResponseSeverityFromValue(v string) (*AuditLogEntryResponseSeverity, error) { + ev := AuditLogEntryResponseSeverity(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuditLogEntryResponseSeverity: valid values are %v", v, AllowedAuditLogEntryResponseSeverityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuditLogEntryResponseSeverity) IsValid() bool { + for _, existing := range AllowedAuditLogEntryResponseSeverityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AuditLogEntryResponse_severity value +func (v AuditLogEntryResponseSeverity) Ptr() *AuditLogEntryResponseSeverity { + return &v +} + +type NullableAuditLogEntryResponseSeverity struct { + value *AuditLogEntryResponseSeverity + isSet bool +} + +func (v NullableAuditLogEntryResponseSeverity) Get() *AuditLogEntryResponseSeverity { + return v.value +} + +func (v *NullableAuditLogEntryResponseSeverity) Set(val *AuditLogEntryResponseSeverity) { + v.value = val + v.isSet = true +} + +func (v NullableAuditLogEntryResponseSeverity) IsSet() bool { + return v.isSet +} + +func (v *NullableAuditLogEntryResponseSeverity) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuditLogEntryResponseSeverity(val *AuditLogEntryResponseSeverity) *NullableAuditLogEntryResponseSeverity { + return &NullableAuditLogEntryResponseSeverity{value: val, isSet: true} +} + +func (v NullableAuditLogEntryResponseSeverity) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuditLogEntryResponseSeverity) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/auditlog/v2api/model_audit_log_entry_response_visibility.go b/services/auditlog/v2api/model_audit_log_entry_response_visibility.go new file mode 100644 index 000000000..9da3060e7 --- /dev/null +++ b/services/auditlog/v2api/model_audit_log_entry_response_visibility.go @@ -0,0 +1,113 @@ +/* +STACKIT Audit Log API + +API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// AuditLogEntryResponseVisibility PUBLIC for entries that are intended for end users, while PRIVATE entries can only be viewed with system privileges. +type AuditLogEntryResponseVisibility string + +// List of AuditLogEntryResponse_visibility +const ( + AUDITLOGENTRYRESPONSEVISIBILITY_PUBLIC AuditLogEntryResponseVisibility = "PUBLIC" + AUDITLOGENTRYRESPONSEVISIBILITY_PRIVATE AuditLogEntryResponseVisibility = "PRIVATE" + AUDITLOGENTRYRESPONSEVISIBILITY_UNKNOWN_DEFAULT_OPEN_API AuditLogEntryResponseVisibility = "unknown_default_open_api" +) + +// All allowed values of AuditLogEntryResponseVisibility enum +var AllowedAuditLogEntryResponseVisibilityEnumValues = []AuditLogEntryResponseVisibility{ + "PUBLIC", + "PRIVATE", + "unknown_default_open_api", +} + +func (v *AuditLogEntryResponseVisibility) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuditLogEntryResponseVisibility(value) + for _, existing := range AllowedAuditLogEntryResponseVisibilityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = AUDITLOGENTRYRESPONSEVISIBILITY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAuditLogEntryResponseVisibilityFromValue returns a pointer to a valid AuditLogEntryResponseVisibility +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuditLogEntryResponseVisibilityFromValue(v string) (*AuditLogEntryResponseVisibility, error) { + ev := AuditLogEntryResponseVisibility(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuditLogEntryResponseVisibility: valid values are %v", v, AllowedAuditLogEntryResponseVisibilityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuditLogEntryResponseVisibility) IsValid() bool { + for _, existing := range AllowedAuditLogEntryResponseVisibilityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AuditLogEntryResponse_visibility value +func (v AuditLogEntryResponseVisibility) Ptr() *AuditLogEntryResponseVisibility { + return &v +} + +type NullableAuditLogEntryResponseVisibility struct { + value *AuditLogEntryResponseVisibility + isSet bool +} + +func (v NullableAuditLogEntryResponseVisibility) Get() *AuditLogEntryResponseVisibility { + return v.value +} + +func (v *NullableAuditLogEntryResponseVisibility) Set(val *AuditLogEntryResponseVisibility) { + v.value = val + v.isSet = true +} + +func (v NullableAuditLogEntryResponseVisibility) IsSet() bool { + return v.isSet +} + +func (v *NullableAuditLogEntryResponseVisibility) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuditLogEntryResponseVisibility(val *AuditLogEntryResponseVisibility) *NullableAuditLogEntryResponseVisibility { + return &NullableAuditLogEntryResponseVisibility{value: val, isSet: true} +} + +func (v NullableAuditLogEntryResponseVisibility) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuditLogEntryResponseVisibility) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 05ae3868a728b39f08ede8ba5f8328ba1b319b14 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:50:36 +0200 Subject: [PATCH 44/66] chore(auditlog): write changelog, bump version --- CHANGELOG.md | 2 ++ services/auditlog/CHANGELOG.md | 3 +++ services/auditlog/VERSION | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca498289d..28bab120f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v0.4.2](services/auditlog/CHANGELOG.md#v042) - **Dependencies:** Bump STACKIT SDK core module to `v0.26.0` + - [v0.5.0](services/auditlog/CHANGELOG.md#v050) + - **Feature:** Introduce enums for various attributes - `authorization`: - [v0.14.3](services/authorization/CHANGELOG.md#v0143) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/auditlog/CHANGELOG.md b/services/auditlog/CHANGELOG.md index 41e669dcb..165c2c675 100644 --- a/services/auditlog/CHANGELOG.md +++ b/services/auditlog/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.5.0 +- **Feature:** Introduce enums for various attributes + ## v0.4.2 - **Dependencies:** Bump STACKIT SDK core module to `v0.26.0` diff --git a/services/auditlog/VERSION b/services/auditlog/VERSION index 0eec13e47..b043aa648 100644 --- a/services/auditlog/VERSION +++ b/services/auditlog/VERSION @@ -1 +1 @@ -v0.4.2 +v0.5.0 From 0ff21667a78a7335e4414d2f7f0b075a6415562f Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:51:37 +0200 Subject: [PATCH 45/66] refac(serverbackup): introduce inline enums --- services/serverbackup/v1api/model_backup.go | 12 +- .../serverbackup/v1api/model_backup_status.go | 126 +++++++++++++++++ .../model_backup_volume_backups_inner.go | 22 +-- ...odel_backup_volume_backups_inner_status.go | 128 ++++++++++++++++++ services/serverbackup/v2api/model_backup.go | 12 +- .../serverbackup/v2api/model_backup_status.go | 126 +++++++++++++++++ .../model_backup_volume_backups_inner.go | 22 +-- ...odel_backup_volume_backups_inner_status.go | 128 ++++++++++++++++++ 8 files changed, 542 insertions(+), 34 deletions(-) create mode 100644 services/serverbackup/v1api/model_backup_status.go create mode 100644 services/serverbackup/v1api/model_backup_volume_backups_inner_status.go create mode 100644 services/serverbackup/v2api/model_backup_status.go create mode 100644 services/serverbackup/v2api/model_backup_volume_backups_inner_status.go diff --git a/services/serverbackup/v1api/model_backup.go b/services/serverbackup/v1api/model_backup.go index 3e8abc1e8..6e5dd0662 100644 --- a/services/serverbackup/v1api/model_backup.go +++ b/services/serverbackup/v1api/model_backup.go @@ -27,7 +27,7 @@ type Backup struct { LastRestoredAt *string `json:"lastRestoredAt,omitempty"` Name string `json:"name"` Size *int32 `json:"size,omitempty"` - Status string `json:"status"` + Status BackupStatus `json:"status"` VolumeBackups []BackupVolumeBackupsInner `json:"volumeBackups,omitempty"` AdditionalProperties map[string]interface{} } @@ -38,7 +38,7 @@ type _Backup Backup // 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 NewBackup(createdAt string, expireAt string, id string, name string, status string) *Backup { +func NewBackup(createdAt string, expireAt string, id string, name string, status BackupStatus) *Backup { this := Backup{} this.CreatedAt = createdAt this.ExpireAt = expireAt @@ -217,9 +217,9 @@ func (o *Backup) SetSize(v int32) { } // GetStatus returns the Status field value -func (o *Backup) GetStatus() string { +func (o *Backup) GetStatus() BackupStatus { if o == nil { - var ret string + var ret BackupStatus return ret } @@ -228,7 +228,7 @@ func (o *Backup) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *Backup) GetStatusOk() (*string, bool) { +func (o *Backup) GetStatusOk() (*BackupStatus, bool) { if o == nil { return nil, false } @@ -236,7 +236,7 @@ func (o *Backup) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *Backup) SetStatus(v string) { +func (o *Backup) SetStatus(v BackupStatus) { o.Status = v } diff --git a/services/serverbackup/v1api/model_backup_status.go b/services/serverbackup/v1api/model_backup_status.go new file mode 100644 index 000000000..00ae9a82c --- /dev/null +++ b/services/serverbackup/v1api/model_backup_status.go @@ -0,0 +1,126 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// BackupStatus the model 'BackupStatus' +type BackupStatus string + +// List of Backup_status +const ( + BACKUPSTATUS_IN_PROGRESS BackupStatus = "in-progress" + BACKUPSTATUS_INCONSISTENT BackupStatus = "inconsistent" + BACKUPSTATUS_AVAILABLE BackupStatus = "available" + BACKUPSTATUS_ERROR BackupStatus = "error" + BACKUPSTATUS_ERROR_RESTORING BackupStatus = "error-restoring" + BACKUPSTATUS_ERROR_CREATING BackupStatus = "error-creating" + BACKUPSTATUS_ERROR_DELETING BackupStatus = "error-deleting" + BACKUPSTATUS_UNRECOGNIZED BackupStatus = "unrecognized" + BACKUPSTATUS_UNKNOWN_DEFAULT_OPEN_API BackupStatus = "unknown_default_open_api" +) + +// All allowed values of BackupStatus enum +var AllowedBackupStatusEnumValues = []BackupStatus{ + "in-progress", + "inconsistent", + "available", + "error", + "error-restoring", + "error-creating", + "error-deleting", + "unrecognized", + "unknown_default_open_api", +} + +func (v *BackupStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BackupStatus(value) + for _, existing := range AllowedBackupStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = BACKUPSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewBackupStatusFromValue returns a pointer to a valid BackupStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBackupStatusFromValue(v string) (*BackupStatus, error) { + ev := BackupStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BackupStatus: valid values are %v", v, AllowedBackupStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BackupStatus) IsValid() bool { + for _, existing := range AllowedBackupStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Backup_status value +func (v BackupStatus) Ptr() *BackupStatus { + return &v +} + +type NullableBackupStatus struct { + value *BackupStatus + isSet bool +} + +func (v NullableBackupStatus) Get() *BackupStatus { + return v.value +} + +func (v *NullableBackupStatus) Set(val *BackupStatus) { + v.value = val + v.isSet = true +} + +func (v NullableBackupStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupStatus(val *BackupStatus) *NullableBackupStatus { + return &NullableBackupStatus{value: val, isSet: true} +} + +func (v NullableBackupStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v1api/model_backup_volume_backups_inner.go b/services/serverbackup/v1api/model_backup_volume_backups_inner.go index 19a956171..3d230d0a0 100644 --- a/services/serverbackup/v1api/model_backup_volume_backups_inner.go +++ b/services/serverbackup/v1api/model_backup_volume_backups_inner.go @@ -20,12 +20,12 @@ var _ MappedNullable = &BackupVolumeBackupsInner{} // BackupVolumeBackupsInner struct for BackupVolumeBackupsInner type BackupVolumeBackupsInner struct { - Id *string `json:"id,omitempty"` - LastRestoredAt *string `json:"lastRestoredAt,omitempty"` - LastRestoredVolumeId *string `json:"lastRestoredVolumeId,omitempty"` - Size *int32 `json:"size,omitempty"` - Status *string `json:"status,omitempty"` - VolumeId *string `json:"volumeId,omitempty"` + Id *string `json:"id,omitempty"` + LastRestoredAt *string `json:"lastRestoredAt,omitempty"` + LastRestoredVolumeId *string `json:"lastRestoredVolumeId,omitempty"` + Size *int32 `json:"size,omitempty"` + Status *BackupVolumeBackupsInnerStatus `json:"status,omitempty"` + VolumeId *string `json:"volumeId,omitempty"` AdditionalProperties map[string]interface{} } @@ -177,9 +177,9 @@ func (o *BackupVolumeBackupsInner) SetSize(v int32) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *BackupVolumeBackupsInner) GetStatus() string { +func (o *BackupVolumeBackupsInner) GetStatus() BackupVolumeBackupsInnerStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret BackupVolumeBackupsInnerStatus return ret } return *o.Status @@ -187,7 +187,7 @@ func (o *BackupVolumeBackupsInner) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BackupVolumeBackupsInner) GetStatusOk() (*string, bool) { +func (o *BackupVolumeBackupsInner) GetStatusOk() (*BackupVolumeBackupsInnerStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -203,8 +203,8 @@ func (o *BackupVolumeBackupsInner) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *BackupVolumeBackupsInner) SetStatus(v string) { +// SetStatus gets a reference to the given BackupVolumeBackupsInnerStatus and assigns it to the Status field. +func (o *BackupVolumeBackupsInner) SetStatus(v BackupVolumeBackupsInnerStatus) { o.Status = &v } diff --git a/services/serverbackup/v1api/model_backup_volume_backups_inner_status.go b/services/serverbackup/v1api/model_backup_volume_backups_inner_status.go new file mode 100644 index 000000000..36ae09c1c --- /dev/null +++ b/services/serverbackup/v1api/model_backup_volume_backups_inner_status.go @@ -0,0 +1,128 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// BackupVolumeBackupsInnerStatus the model 'BackupVolumeBackupsInnerStatus' +type BackupVolumeBackupsInnerStatus string + +// List of Backup_volumeBackups_inner_status +const ( + BACKUPVOLUMEBACKUPSINNERSTATUS_AVAILABLE BackupVolumeBackupsInnerStatus = "available" + BACKUPVOLUMEBACKUPSINNERSTATUS_CREATING BackupVolumeBackupsInnerStatus = "creating" + BACKUPVOLUMEBACKUPSINNERSTATUS_DELETING BackupVolumeBackupsInnerStatus = "deleting" + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_DELETING BackupVolumeBackupsInnerStatus = "error-deleting" + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR BackupVolumeBackupsInnerStatus = "error" + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_RESTORING BackupVolumeBackupsInnerStatus = "error-restoring" + BACKUPVOLUMEBACKUPSINNERSTATUS_RESTORING BackupVolumeBackupsInnerStatus = "restoring" + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_CREATING BackupVolumeBackupsInnerStatus = "error-creating" + BACKUPVOLUMEBACKUPSINNERSTATUS_UNRECOGNIZED BackupVolumeBackupsInnerStatus = "unrecognized" + BACKUPVOLUMEBACKUPSINNERSTATUS_UNKNOWN_DEFAULT_OPEN_API BackupVolumeBackupsInnerStatus = "unknown_default_open_api" +) + +// All allowed values of BackupVolumeBackupsInnerStatus enum +var AllowedBackupVolumeBackupsInnerStatusEnumValues = []BackupVolumeBackupsInnerStatus{ + "available", + "creating", + "deleting", + "error-deleting", + "error", + "error-restoring", + "restoring", + "error-creating", + "unrecognized", + "unknown_default_open_api", +} + +func (v *BackupVolumeBackupsInnerStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BackupVolumeBackupsInnerStatus(value) + for _, existing := range AllowedBackupVolumeBackupsInnerStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = BACKUPVOLUMEBACKUPSINNERSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewBackupVolumeBackupsInnerStatusFromValue returns a pointer to a valid BackupVolumeBackupsInnerStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBackupVolumeBackupsInnerStatusFromValue(v string) (*BackupVolumeBackupsInnerStatus, error) { + ev := BackupVolumeBackupsInnerStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BackupVolumeBackupsInnerStatus: valid values are %v", v, AllowedBackupVolumeBackupsInnerStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BackupVolumeBackupsInnerStatus) IsValid() bool { + for _, existing := range AllowedBackupVolumeBackupsInnerStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Backup_volumeBackups_inner_status value +func (v BackupVolumeBackupsInnerStatus) Ptr() *BackupVolumeBackupsInnerStatus { + return &v +} + +type NullableBackupVolumeBackupsInnerStatus struct { + value *BackupVolumeBackupsInnerStatus + isSet bool +} + +func (v NullableBackupVolumeBackupsInnerStatus) Get() *BackupVolumeBackupsInnerStatus { + return v.value +} + +func (v *NullableBackupVolumeBackupsInnerStatus) Set(val *BackupVolumeBackupsInnerStatus) { + v.value = val + v.isSet = true +} + +func (v NullableBackupVolumeBackupsInnerStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupVolumeBackupsInnerStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupVolumeBackupsInnerStatus(val *BackupVolumeBackupsInnerStatus) *NullableBackupVolumeBackupsInnerStatus { + return &NullableBackupVolumeBackupsInnerStatus{value: val, isSet: true} +} + +func (v NullableBackupVolumeBackupsInnerStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupVolumeBackupsInnerStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v2api/model_backup.go b/services/serverbackup/v2api/model_backup.go index 275414a9f..200762147 100644 --- a/services/serverbackup/v2api/model_backup.go +++ b/services/serverbackup/v2api/model_backup.go @@ -27,7 +27,7 @@ type Backup struct { LastRestoredAt *string `json:"lastRestoredAt,omitempty"` Name string `json:"name"` Size *int32 `json:"size,omitempty"` - Status string `json:"status"` + Status BackupStatus `json:"status"` VolumeBackups []BackupVolumeBackupsInner `json:"volumeBackups,omitempty"` AdditionalProperties map[string]interface{} } @@ -38,7 +38,7 @@ type _Backup Backup // 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 NewBackup(createdAt string, expireAt string, id string, name string, status string) *Backup { +func NewBackup(createdAt string, expireAt string, id string, name string, status BackupStatus) *Backup { this := Backup{} this.CreatedAt = createdAt this.ExpireAt = expireAt @@ -217,9 +217,9 @@ func (o *Backup) SetSize(v int32) { } // GetStatus returns the Status field value -func (o *Backup) GetStatus() string { +func (o *Backup) GetStatus() BackupStatus { if o == nil { - var ret string + var ret BackupStatus return ret } @@ -228,7 +228,7 @@ func (o *Backup) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *Backup) GetStatusOk() (*string, bool) { +func (o *Backup) GetStatusOk() (*BackupStatus, bool) { if o == nil { return nil, false } @@ -236,7 +236,7 @@ func (o *Backup) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *Backup) SetStatus(v string) { +func (o *Backup) SetStatus(v BackupStatus) { o.Status = v } diff --git a/services/serverbackup/v2api/model_backup_status.go b/services/serverbackup/v2api/model_backup_status.go new file mode 100644 index 000000000..424842d6c --- /dev/null +++ b/services/serverbackup/v2api/model_backup_status.go @@ -0,0 +1,126 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// BackupStatus the model 'BackupStatus' +type BackupStatus string + +// List of Backup_status +const ( + BACKUPSTATUS_IN_PROGRESS BackupStatus = "in-progress" + BACKUPSTATUS_INCONSISTENT BackupStatus = "inconsistent" + BACKUPSTATUS_AVAILABLE BackupStatus = "available" + BACKUPSTATUS_ERROR BackupStatus = "error" + BACKUPSTATUS_ERROR_RESTORING BackupStatus = "error-restoring" + BACKUPSTATUS_ERROR_CREATING BackupStatus = "error-creating" + BACKUPSTATUS_ERROR_DELETING BackupStatus = "error-deleting" + BACKUPSTATUS_UNRECOGNIZED BackupStatus = "unrecognized" + BACKUPSTATUS_UNKNOWN_DEFAULT_OPEN_API BackupStatus = "unknown_default_open_api" +) + +// All allowed values of BackupStatus enum +var AllowedBackupStatusEnumValues = []BackupStatus{ + "in-progress", + "inconsistent", + "available", + "error", + "error-restoring", + "error-creating", + "error-deleting", + "unrecognized", + "unknown_default_open_api", +} + +func (v *BackupStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BackupStatus(value) + for _, existing := range AllowedBackupStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = BACKUPSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewBackupStatusFromValue returns a pointer to a valid BackupStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBackupStatusFromValue(v string) (*BackupStatus, error) { + ev := BackupStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BackupStatus: valid values are %v", v, AllowedBackupStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BackupStatus) IsValid() bool { + for _, existing := range AllowedBackupStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Backup_status value +func (v BackupStatus) Ptr() *BackupStatus { + return &v +} + +type NullableBackupStatus struct { + value *BackupStatus + isSet bool +} + +func (v NullableBackupStatus) Get() *BackupStatus { + return v.value +} + +func (v *NullableBackupStatus) Set(val *BackupStatus) { + v.value = val + v.isSet = true +} + +func (v NullableBackupStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupStatus(val *BackupStatus) *NullableBackupStatus { + return &NullableBackupStatus{value: val, isSet: true} +} + +func (v NullableBackupStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v2api/model_backup_volume_backups_inner.go b/services/serverbackup/v2api/model_backup_volume_backups_inner.go index 3d4940765..93e86a79a 100644 --- a/services/serverbackup/v2api/model_backup_volume_backups_inner.go +++ b/services/serverbackup/v2api/model_backup_volume_backups_inner.go @@ -20,12 +20,12 @@ var _ MappedNullable = &BackupVolumeBackupsInner{} // BackupVolumeBackupsInner struct for BackupVolumeBackupsInner type BackupVolumeBackupsInner struct { - Id *string `json:"id,omitempty"` - LastRestoredAt *string `json:"lastRestoredAt,omitempty"` - LastRestoredVolumeId *string `json:"lastRestoredVolumeId,omitempty"` - Size *int32 `json:"size,omitempty"` - Status *string `json:"status,omitempty"` - VolumeId *string `json:"volumeId,omitempty"` + Id *string `json:"id,omitempty"` + LastRestoredAt *string `json:"lastRestoredAt,omitempty"` + LastRestoredVolumeId *string `json:"lastRestoredVolumeId,omitempty"` + Size *int32 `json:"size,omitempty"` + Status *BackupVolumeBackupsInnerStatus `json:"status,omitempty"` + VolumeId *string `json:"volumeId,omitempty"` AdditionalProperties map[string]interface{} } @@ -177,9 +177,9 @@ func (o *BackupVolumeBackupsInner) SetSize(v int32) { } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *BackupVolumeBackupsInner) GetStatus() string { +func (o *BackupVolumeBackupsInner) GetStatus() BackupVolumeBackupsInnerStatus { if o == nil || IsNil(o.Status) { - var ret string + var ret BackupVolumeBackupsInnerStatus return ret } return *o.Status @@ -187,7 +187,7 @@ func (o *BackupVolumeBackupsInner) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BackupVolumeBackupsInner) GetStatusOk() (*string, bool) { +func (o *BackupVolumeBackupsInner) GetStatusOk() (*BackupVolumeBackupsInnerStatus, bool) { if o == nil || IsNil(o.Status) { return nil, false } @@ -203,8 +203,8 @@ func (o *BackupVolumeBackupsInner) HasStatus() bool { return false } -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *BackupVolumeBackupsInner) SetStatus(v string) { +// SetStatus gets a reference to the given BackupVolumeBackupsInnerStatus and assigns it to the Status field. +func (o *BackupVolumeBackupsInner) SetStatus(v BackupVolumeBackupsInnerStatus) { o.Status = &v } diff --git a/services/serverbackup/v2api/model_backup_volume_backups_inner_status.go b/services/serverbackup/v2api/model_backup_volume_backups_inner_status.go new file mode 100644 index 000000000..590f0f3ec --- /dev/null +++ b/services/serverbackup/v2api/model_backup_volume_backups_inner_status.go @@ -0,0 +1,128 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// BackupVolumeBackupsInnerStatus the model 'BackupVolumeBackupsInnerStatus' +type BackupVolumeBackupsInnerStatus string + +// List of Backup_volumeBackups_inner_status +const ( + BACKUPVOLUMEBACKUPSINNERSTATUS_AVAILABLE BackupVolumeBackupsInnerStatus = "available" + BACKUPVOLUMEBACKUPSINNERSTATUS_CREATING BackupVolumeBackupsInnerStatus = "creating" + BACKUPVOLUMEBACKUPSINNERSTATUS_DELETING BackupVolumeBackupsInnerStatus = "deleting" + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_DELETING BackupVolumeBackupsInnerStatus = "error-deleting" + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR BackupVolumeBackupsInnerStatus = "error" + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_RESTORING BackupVolumeBackupsInnerStatus = "error-restoring" + BACKUPVOLUMEBACKUPSINNERSTATUS_RESTORING BackupVolumeBackupsInnerStatus = "restoring" + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_CREATING BackupVolumeBackupsInnerStatus = "error-creating" + BACKUPVOLUMEBACKUPSINNERSTATUS_UNRECOGNIZED BackupVolumeBackupsInnerStatus = "unrecognized" + BACKUPVOLUMEBACKUPSINNERSTATUS_UNKNOWN_DEFAULT_OPEN_API BackupVolumeBackupsInnerStatus = "unknown_default_open_api" +) + +// All allowed values of BackupVolumeBackupsInnerStatus enum +var AllowedBackupVolumeBackupsInnerStatusEnumValues = []BackupVolumeBackupsInnerStatus{ + "available", + "creating", + "deleting", + "error-deleting", + "error", + "error-restoring", + "restoring", + "error-creating", + "unrecognized", + "unknown_default_open_api", +} + +func (v *BackupVolumeBackupsInnerStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BackupVolumeBackupsInnerStatus(value) + for _, existing := range AllowedBackupVolumeBackupsInnerStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = BACKUPVOLUMEBACKUPSINNERSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewBackupVolumeBackupsInnerStatusFromValue returns a pointer to a valid BackupVolumeBackupsInnerStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBackupVolumeBackupsInnerStatusFromValue(v string) (*BackupVolumeBackupsInnerStatus, error) { + ev := BackupVolumeBackupsInnerStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BackupVolumeBackupsInnerStatus: valid values are %v", v, AllowedBackupVolumeBackupsInnerStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BackupVolumeBackupsInnerStatus) IsValid() bool { + for _, existing := range AllowedBackupVolumeBackupsInnerStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Backup_volumeBackups_inner_status value +func (v BackupVolumeBackupsInnerStatus) Ptr() *BackupVolumeBackupsInnerStatus { + return &v +} + +type NullableBackupVolumeBackupsInnerStatus struct { + value *BackupVolumeBackupsInnerStatus + isSet bool +} + +func (v NullableBackupVolumeBackupsInnerStatus) Get() *BackupVolumeBackupsInnerStatus { + return v.value +} + +func (v *NullableBackupVolumeBackupsInnerStatus) Set(val *BackupVolumeBackupsInnerStatus) { + v.value = val + v.isSet = true +} + +func (v NullableBackupVolumeBackupsInnerStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupVolumeBackupsInnerStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupVolumeBackupsInnerStatus(val *BackupVolumeBackupsInnerStatus) *NullableBackupVolumeBackupsInnerStatus { + return &NullableBackupVolumeBackupsInnerStatus{value: val, isSet: true} +} + +func (v NullableBackupVolumeBackupsInnerStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupVolumeBackupsInnerStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 5f053a7dae027492c6d7cf70ac3edc802593431a Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 13:53:58 +0200 Subject: [PATCH 46/66] chore(serverbackup): write changelog, bump version --- CHANGELOG.md | 2 ++ services/serverbackup/CHANGELOG.md | 3 +++ services/serverbackup/VERSION | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28bab120f..2e13420c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -391,6 +391,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.24.1` to `v0.25.0` - [v1.6.2](services/serverbackup/CHANGELOG.md#v162) - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` + - [v1.7.0](services/serverbackup/CHANGELOG.md#v170) + - **Feature:** Introduce enums for various attributes - `serverupdate`: - [v1.4.3](services/serverupdate/CHANGELOG.md#v143) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/serverbackup/CHANGELOG.md b/services/serverbackup/CHANGELOG.md index 4a9c5e1f5..4dfa24991 100644 --- a/services/serverbackup/CHANGELOG.md +++ b/services/serverbackup/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.7.0 +- **Feature:** Introduce enums for various attributes + ## v1.6.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` diff --git a/services/serverbackup/VERSION b/services/serverbackup/VERSION index 98610aa42..b7c8e167d 100644 --- a/services/serverbackup/VERSION +++ b/services/serverbackup/VERSION @@ -1 +1 @@ -v1.6.2 \ No newline at end of file +v1.7.0 \ No newline at end of file From f968d067de0f5c682ea2c12028893fab1d8e9f04 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 14:02:53 +0200 Subject: [PATCH 47/66] refac(serviceaccount): introduce inline enums --- services/serviceaccount/v2api/api_default.go | 11 +- ...odel_create_service_account_key_payload.go | 13 +- ...e_service_account_key_payload_algorithm.go | 113 ++++++++++++++++++ ...del_create_service_account_key_response.go | 34 +++--- ...vice_account_key_response_key_algorithm.go | 113 ++++++++++++++++++ ...service_account_key_response_key_origin.go | 113 ++++++++++++++++++ ...e_service_account_key_response_key_type.go | 113 ++++++++++++++++++ ...t_lived_access_token_payload_grant_type.go | 113 ++++++++++++++++++ ...reate_short_lived_access_token_response.go | 14 +-- ..._lived_access_token_response_token_type.go | 111 +++++++++++++++++ ...et_service_account_key_format_parameter.go | 111 +++++++++++++++++ .../model_get_service_account_key_response.go | 34 +++--- ...vice_account_key_response_key_algorithm.go | 113 ++++++++++++++++++ ...service_account_key_response_key_origin.go | 113 ++++++++++++++++++ ...t_service_account_key_response_key_type.go | 113 ++++++++++++++++++ ...ial_update_service_account_key_response.go | 34 +++--- ...vice_account_key_response_key_algorithm.go | 113 ++++++++++++++++++ ...service_account_key_response_key_origin.go | 113 ++++++++++++++++++ ...e_service_account_key_response_key_type.go | 113 ++++++++++++++++++ ...model_service_account_key_list_response.go | 34 +++--- ...account_key_list_response_key_algorithm.go | 113 ++++++++++++++++++ ...ce_account_key_list_response_key_origin.go | 113 ++++++++++++++++++ ...vice_account_key_list_response_key_type.go | 113 ++++++++++++++++++ 23 files changed, 1890 insertions(+), 88 deletions(-) create mode 100644 services/serviceaccount/v2api/model_create_service_account_key_payload_algorithm.go create mode 100644 services/serviceaccount/v2api/model_create_service_account_key_response_key_algorithm.go create mode 100644 services/serviceaccount/v2api/model_create_service_account_key_response_key_origin.go create mode 100644 services/serviceaccount/v2api/model_create_service_account_key_response_key_type.go create mode 100644 services/serviceaccount/v2api/model_create_short_lived_access_token_payload_grant_type.go create mode 100644 services/serviceaccount/v2api/model_create_short_lived_access_token_response_token_type.go create mode 100644 services/serviceaccount/v2api/model_get_service_account_key_format_parameter.go create mode 100644 services/serviceaccount/v2api/model_get_service_account_key_response_key_algorithm.go create mode 100644 services/serviceaccount/v2api/model_get_service_account_key_response_key_origin.go create mode 100644 services/serviceaccount/v2api/model_get_service_account_key_response_key_type.go create mode 100644 services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_algorithm.go create mode 100644 services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_origin.go create mode 100644 services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_type.go create mode 100644 services/serviceaccount/v2api/model_service_account_key_list_response_key_algorithm.go create mode 100644 services/serviceaccount/v2api/model_service_account_key_list_response_key_origin.go create mode 100644 services/serviceaccount/v2api/model_service_account_key_list_response_key_type.go diff --git a/services/serviceaccount/v2api/api_default.go b/services/serviceaccount/v2api/api_default.go index 413218b96..8198c600f 100644 --- a/services/serviceaccount/v2api/api_default.go +++ b/services/serviceaccount/v2api/api_default.go @@ -1008,13 +1008,12 @@ func (a *DefaultAPIService) CreateServiceAccountKeyExecute(r ApiCreateServiceAcc type ApiCreateShortLivedAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI - grantType *string + grantType *CreateShortLivedAccessTokenPayloadGrantType assertion *string refreshToken *string } -// Always use URL encoded values. E.g. urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer -func (r ApiCreateShortLivedAccessTokenRequest) GrantType(grantType string) ApiCreateShortLivedAccessTokenRequest { +func (r ApiCreateShortLivedAccessTokenRequest) GrantType(grantType CreateShortLivedAccessTokenPayloadGrantType) ApiCreateShortLivedAccessTokenRequest { r.grantType = &grantType return r } @@ -2075,11 +2074,11 @@ type ApiGetServiceAccountKeyRequest struct { projectId string serviceAccountEmail string keyId string - format *string + format *GetServiceAccountKeyFormatParameter } // Requested format for the public key -func (r ApiGetServiceAccountKeyRequest) Format(format string) ApiGetServiceAccountKeyRequest { +func (r ApiGetServiceAccountKeyRequest) Format(format GetServiceAccountKeyFormatParameter) ApiGetServiceAccountKeyRequest { r.format = &format return r } @@ -2137,7 +2136,7 @@ func (a *DefaultAPIService) GetServiceAccountKeyExecute(r ApiGetServiceAccountKe if r.format != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") } else { - var defaultValue string = "X509_PEM" + var defaultValue GetServiceAccountKeyFormatParameter = "X509_PEM" parameterAddToHeaderOrQuery(localVarQueryParams, "format", defaultValue, "form", "") r.format = &defaultValue } diff --git a/services/serviceaccount/v2api/model_create_service_account_key_payload.go b/services/serviceaccount/v2api/model_create_service_account_key_payload.go index a9345dd13..785f9bfbf 100644 --- a/services/serviceaccount/v2api/model_create_service_account_key_payload.go +++ b/services/serviceaccount/v2api/model_create_service_account_key_payload.go @@ -20,8 +20,7 @@ var _ MappedNullable = &CreateServiceAccountKeyPayload{} // CreateServiceAccountKeyPayload struct for CreateServiceAccountKeyPayload type CreateServiceAccountKeyPayload struct { - // Optional, key algorithm of the generated key-pair. Used only if publicKey attribute is not specified, otherwise the algorithm is derived from the public key. - Algorithm *string `json:"algorithm,omitempty"` + Algorithm *CreateServiceAccountKeyPayloadAlgorithm `json:"algorithm,omitempty"` // Optional, public key part of the user generated RSA key-pair wrapped in a [X.509 v3 certificate](https://www.rfc-editor.org/rfc/rfc5280) PublicKey *string `json:"publicKey,omitempty"` // Optional, date of key expiration. When omitted, key is valid until deleted @@ -49,9 +48,9 @@ func NewCreateServiceAccountKeyPayloadWithDefaults() *CreateServiceAccountKeyPay } // GetAlgorithm returns the Algorithm field value if set, zero value otherwise. -func (o *CreateServiceAccountKeyPayload) GetAlgorithm() string { +func (o *CreateServiceAccountKeyPayload) GetAlgorithm() CreateServiceAccountKeyPayloadAlgorithm { if o == nil || IsNil(o.Algorithm) { - var ret string + var ret CreateServiceAccountKeyPayloadAlgorithm return ret } return *o.Algorithm @@ -59,7 +58,7 @@ func (o *CreateServiceAccountKeyPayload) GetAlgorithm() string { // GetAlgorithmOk returns a tuple with the Algorithm field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyPayload) GetAlgorithmOk() (*string, bool) { +func (o *CreateServiceAccountKeyPayload) GetAlgorithmOk() (*CreateServiceAccountKeyPayloadAlgorithm, bool) { if o == nil || IsNil(o.Algorithm) { return nil, false } @@ -75,8 +74,8 @@ func (o *CreateServiceAccountKeyPayload) HasAlgorithm() bool { return false } -// SetAlgorithm gets a reference to the given string and assigns it to the Algorithm field. -func (o *CreateServiceAccountKeyPayload) SetAlgorithm(v string) { +// SetAlgorithm gets a reference to the given CreateServiceAccountKeyPayloadAlgorithm and assigns it to the Algorithm field. +func (o *CreateServiceAccountKeyPayload) SetAlgorithm(v CreateServiceAccountKeyPayloadAlgorithm) { o.Algorithm = &v } diff --git a/services/serviceaccount/v2api/model_create_service_account_key_payload_algorithm.go b/services/serviceaccount/v2api/model_create_service_account_key_payload_algorithm.go new file mode 100644 index 000000000..023fb5c12 --- /dev/null +++ b/services/serviceaccount/v2api/model_create_service_account_key_payload_algorithm.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateServiceAccountKeyPayloadAlgorithm Optional, key algorithm of the generated key-pair. Used only if publicKey attribute is not specified, otherwise the algorithm is derived from the public key. +type CreateServiceAccountKeyPayloadAlgorithm string + +// List of CreateServiceAccountKeyPayload_algorithm +const ( + CREATESERVICEACCOUNTKEYPAYLOADALGORITHM_RSA_2048 CreateServiceAccountKeyPayloadAlgorithm = "RSA_2048" + CREATESERVICEACCOUNTKEYPAYLOADALGORITHM_RSA_4096 CreateServiceAccountKeyPayloadAlgorithm = "RSA_4096" + CREATESERVICEACCOUNTKEYPAYLOADALGORITHM_UNKNOWN_DEFAULT_OPEN_API CreateServiceAccountKeyPayloadAlgorithm = "unknown_default_open_api" +) + +// All allowed values of CreateServiceAccountKeyPayloadAlgorithm enum +var AllowedCreateServiceAccountKeyPayloadAlgorithmEnumValues = []CreateServiceAccountKeyPayloadAlgorithm{ + "RSA_2048", + "RSA_4096", + "unknown_default_open_api", +} + +func (v *CreateServiceAccountKeyPayloadAlgorithm) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateServiceAccountKeyPayloadAlgorithm(value) + for _, existing := range AllowedCreateServiceAccountKeyPayloadAlgorithmEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATESERVICEACCOUNTKEYPAYLOADALGORITHM_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateServiceAccountKeyPayloadAlgorithmFromValue returns a pointer to a valid CreateServiceAccountKeyPayloadAlgorithm +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateServiceAccountKeyPayloadAlgorithmFromValue(v string) (*CreateServiceAccountKeyPayloadAlgorithm, error) { + ev := CreateServiceAccountKeyPayloadAlgorithm(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateServiceAccountKeyPayloadAlgorithm: valid values are %v", v, AllowedCreateServiceAccountKeyPayloadAlgorithmEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateServiceAccountKeyPayloadAlgorithm) IsValid() bool { + for _, existing := range AllowedCreateServiceAccountKeyPayloadAlgorithmEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateServiceAccountKeyPayload_algorithm value +func (v CreateServiceAccountKeyPayloadAlgorithm) Ptr() *CreateServiceAccountKeyPayloadAlgorithm { + return &v +} + +type NullableCreateServiceAccountKeyPayloadAlgorithm struct { + value *CreateServiceAccountKeyPayloadAlgorithm + isSet bool +} + +func (v NullableCreateServiceAccountKeyPayloadAlgorithm) Get() *CreateServiceAccountKeyPayloadAlgorithm { + return v.value +} + +func (v *NullableCreateServiceAccountKeyPayloadAlgorithm) Set(val *CreateServiceAccountKeyPayloadAlgorithm) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServiceAccountKeyPayloadAlgorithm) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServiceAccountKeyPayloadAlgorithm) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServiceAccountKeyPayloadAlgorithm(val *CreateServiceAccountKeyPayloadAlgorithm) *NullableCreateServiceAccountKeyPayloadAlgorithm { + return &NullableCreateServiceAccountKeyPayloadAlgorithm{value: val, isSet: true} +} + +func (v NullableCreateServiceAccountKeyPayloadAlgorithm) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServiceAccountKeyPayloadAlgorithm) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_create_service_account_key_response.go b/services/serviceaccount/v2api/model_create_service_account_key_response.go index a24ea18fa..fa76bdc5c 100644 --- a/services/serviceaccount/v2api/model_create_service_account_key_response.go +++ b/services/serviceaccount/v2api/model_create_service_account_key_response.go @@ -26,10 +26,10 @@ type CreateServiceAccountKeyResponse struct { CreatedAt time.Time `json:"createdAt"` Credentials CreateServiceAccountKeyResponseCredentials `json:"credentials"` // Unique ID of the key. - Id string `json:"id"` - KeyAlgorithm string `json:"keyAlgorithm"` - KeyOrigin string `json:"keyOrigin"` - KeyType string `json:"keyType"` + Id string `json:"id"` + KeyAlgorithm CreateServiceAccountKeyResponseKeyAlgorithm `json:"keyAlgorithm"` + KeyOrigin CreateServiceAccountKeyResponseKeyOrigin `json:"keyOrigin"` + KeyType CreateServiceAccountKeyResponseKeyType `json:"keyType"` // Public key, that was provider, or was generated by the service account API PublicKey string `json:"publicKey"` // If specified, the timestamp until the key is active. May be null @@ -43,7 +43,7 @@ type _CreateServiceAccountKeyResponse CreateServiceAccountKeyResponse // 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 NewCreateServiceAccountKeyResponse(active bool, createdAt time.Time, credentials CreateServiceAccountKeyResponseCredentials, id string, keyAlgorithm string, keyOrigin string, keyType string, publicKey string) *CreateServiceAccountKeyResponse { +func NewCreateServiceAccountKeyResponse(active bool, createdAt time.Time, credentials CreateServiceAccountKeyResponseCredentials, id string, keyAlgorithm CreateServiceAccountKeyResponseKeyAlgorithm, keyOrigin CreateServiceAccountKeyResponseKeyOrigin, keyType CreateServiceAccountKeyResponseKeyType, publicKey string) *CreateServiceAccountKeyResponse { this := CreateServiceAccountKeyResponse{} this.Active = active this.CreatedAt = createdAt @@ -161,9 +161,9 @@ func (o *CreateServiceAccountKeyResponse) SetId(v string) { } // GetKeyAlgorithm returns the KeyAlgorithm field value -func (o *CreateServiceAccountKeyResponse) GetKeyAlgorithm() string { +func (o *CreateServiceAccountKeyResponse) GetKeyAlgorithm() CreateServiceAccountKeyResponseKeyAlgorithm { if o == nil { - var ret string + var ret CreateServiceAccountKeyResponseKeyAlgorithm return ret } @@ -172,7 +172,7 @@ func (o *CreateServiceAccountKeyResponse) GetKeyAlgorithm() string { // GetKeyAlgorithmOk returns a tuple with the KeyAlgorithm field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetKeyAlgorithmOk() (*string, bool) { +func (o *CreateServiceAccountKeyResponse) GetKeyAlgorithmOk() (*CreateServiceAccountKeyResponseKeyAlgorithm, bool) { if o == nil { return nil, false } @@ -180,14 +180,14 @@ func (o *CreateServiceAccountKeyResponse) GetKeyAlgorithmOk() (*string, bool) { } // SetKeyAlgorithm sets field value -func (o *CreateServiceAccountKeyResponse) SetKeyAlgorithm(v string) { +func (o *CreateServiceAccountKeyResponse) SetKeyAlgorithm(v CreateServiceAccountKeyResponseKeyAlgorithm) { o.KeyAlgorithm = v } // GetKeyOrigin returns the KeyOrigin field value -func (o *CreateServiceAccountKeyResponse) GetKeyOrigin() string { +func (o *CreateServiceAccountKeyResponse) GetKeyOrigin() CreateServiceAccountKeyResponseKeyOrigin { if o == nil { - var ret string + var ret CreateServiceAccountKeyResponseKeyOrigin return ret } @@ -196,7 +196,7 @@ func (o *CreateServiceAccountKeyResponse) GetKeyOrigin() string { // GetKeyOriginOk returns a tuple with the KeyOrigin field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetKeyOriginOk() (*string, bool) { +func (o *CreateServiceAccountKeyResponse) GetKeyOriginOk() (*CreateServiceAccountKeyResponseKeyOrigin, bool) { if o == nil { return nil, false } @@ -204,14 +204,14 @@ func (o *CreateServiceAccountKeyResponse) GetKeyOriginOk() (*string, bool) { } // SetKeyOrigin sets field value -func (o *CreateServiceAccountKeyResponse) SetKeyOrigin(v string) { +func (o *CreateServiceAccountKeyResponse) SetKeyOrigin(v CreateServiceAccountKeyResponseKeyOrigin) { o.KeyOrigin = v } // GetKeyType returns the KeyType field value -func (o *CreateServiceAccountKeyResponse) GetKeyType() string { +func (o *CreateServiceAccountKeyResponse) GetKeyType() CreateServiceAccountKeyResponseKeyType { if o == nil { - var ret string + var ret CreateServiceAccountKeyResponseKeyType return ret } @@ -220,7 +220,7 @@ func (o *CreateServiceAccountKeyResponse) GetKeyType() string { // GetKeyTypeOk returns a tuple with the KeyType field value // and a boolean to check if the value has been set. -func (o *CreateServiceAccountKeyResponse) GetKeyTypeOk() (*string, bool) { +func (o *CreateServiceAccountKeyResponse) GetKeyTypeOk() (*CreateServiceAccountKeyResponseKeyType, bool) { if o == nil { return nil, false } @@ -228,7 +228,7 @@ func (o *CreateServiceAccountKeyResponse) GetKeyTypeOk() (*string, bool) { } // SetKeyType sets field value -func (o *CreateServiceAccountKeyResponse) SetKeyType(v string) { +func (o *CreateServiceAccountKeyResponse) SetKeyType(v CreateServiceAccountKeyResponseKeyType) { o.KeyType = v } diff --git a/services/serviceaccount/v2api/model_create_service_account_key_response_key_algorithm.go b/services/serviceaccount/v2api/model_create_service_account_key_response_key_algorithm.go new file mode 100644 index 000000000..f0fc16082 --- /dev/null +++ b/services/serviceaccount/v2api/model_create_service_account_key_response_key_algorithm.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateServiceAccountKeyResponseKeyAlgorithm the model 'CreateServiceAccountKeyResponseKeyAlgorithm' +type CreateServiceAccountKeyResponseKeyAlgorithm string + +// List of CreateServiceAccountKeyResponse_keyAlgorithm +const ( + CREATESERVICEACCOUNTKEYRESPONSEKEYALGORITHM_RSA_2048 CreateServiceAccountKeyResponseKeyAlgorithm = "RSA_2048" + CREATESERVICEACCOUNTKEYRESPONSEKEYALGORITHM_RSA_4096 CreateServiceAccountKeyResponseKeyAlgorithm = "RSA_4096" + CREATESERVICEACCOUNTKEYRESPONSEKEYALGORITHM_UNKNOWN_DEFAULT_OPEN_API CreateServiceAccountKeyResponseKeyAlgorithm = "unknown_default_open_api" +) + +// All allowed values of CreateServiceAccountKeyResponseKeyAlgorithm enum +var AllowedCreateServiceAccountKeyResponseKeyAlgorithmEnumValues = []CreateServiceAccountKeyResponseKeyAlgorithm{ + "RSA_2048", + "RSA_4096", + "unknown_default_open_api", +} + +func (v *CreateServiceAccountKeyResponseKeyAlgorithm) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateServiceAccountKeyResponseKeyAlgorithm(value) + for _, existing := range AllowedCreateServiceAccountKeyResponseKeyAlgorithmEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATESERVICEACCOUNTKEYRESPONSEKEYALGORITHM_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateServiceAccountKeyResponseKeyAlgorithmFromValue returns a pointer to a valid CreateServiceAccountKeyResponseKeyAlgorithm +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateServiceAccountKeyResponseKeyAlgorithmFromValue(v string) (*CreateServiceAccountKeyResponseKeyAlgorithm, error) { + ev := CreateServiceAccountKeyResponseKeyAlgorithm(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateServiceAccountKeyResponseKeyAlgorithm: valid values are %v", v, AllowedCreateServiceAccountKeyResponseKeyAlgorithmEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateServiceAccountKeyResponseKeyAlgorithm) IsValid() bool { + for _, existing := range AllowedCreateServiceAccountKeyResponseKeyAlgorithmEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateServiceAccountKeyResponse_keyAlgorithm value +func (v CreateServiceAccountKeyResponseKeyAlgorithm) Ptr() *CreateServiceAccountKeyResponseKeyAlgorithm { + return &v +} + +type NullableCreateServiceAccountKeyResponseKeyAlgorithm struct { + value *CreateServiceAccountKeyResponseKeyAlgorithm + isSet bool +} + +func (v NullableCreateServiceAccountKeyResponseKeyAlgorithm) Get() *CreateServiceAccountKeyResponseKeyAlgorithm { + return v.value +} + +func (v *NullableCreateServiceAccountKeyResponseKeyAlgorithm) Set(val *CreateServiceAccountKeyResponseKeyAlgorithm) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServiceAccountKeyResponseKeyAlgorithm) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServiceAccountKeyResponseKeyAlgorithm) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServiceAccountKeyResponseKeyAlgorithm(val *CreateServiceAccountKeyResponseKeyAlgorithm) *NullableCreateServiceAccountKeyResponseKeyAlgorithm { + return &NullableCreateServiceAccountKeyResponseKeyAlgorithm{value: val, isSet: true} +} + +func (v NullableCreateServiceAccountKeyResponseKeyAlgorithm) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServiceAccountKeyResponseKeyAlgorithm) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_create_service_account_key_response_key_origin.go b/services/serviceaccount/v2api/model_create_service_account_key_response_key_origin.go new file mode 100644 index 000000000..7a5c8812e --- /dev/null +++ b/services/serviceaccount/v2api/model_create_service_account_key_response_key_origin.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateServiceAccountKeyResponseKeyOrigin the model 'CreateServiceAccountKeyResponseKeyOrigin' +type CreateServiceAccountKeyResponseKeyOrigin string + +// List of CreateServiceAccountKeyResponse_keyOrigin +const ( + CREATESERVICEACCOUNTKEYRESPONSEKEYORIGIN_USER_PROVIDED CreateServiceAccountKeyResponseKeyOrigin = "USER_PROVIDED" + CREATESERVICEACCOUNTKEYRESPONSEKEYORIGIN_GENERATED CreateServiceAccountKeyResponseKeyOrigin = "GENERATED" + CREATESERVICEACCOUNTKEYRESPONSEKEYORIGIN_UNKNOWN_DEFAULT_OPEN_API CreateServiceAccountKeyResponseKeyOrigin = "unknown_default_open_api" +) + +// All allowed values of CreateServiceAccountKeyResponseKeyOrigin enum +var AllowedCreateServiceAccountKeyResponseKeyOriginEnumValues = []CreateServiceAccountKeyResponseKeyOrigin{ + "USER_PROVIDED", + "GENERATED", + "unknown_default_open_api", +} + +func (v *CreateServiceAccountKeyResponseKeyOrigin) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateServiceAccountKeyResponseKeyOrigin(value) + for _, existing := range AllowedCreateServiceAccountKeyResponseKeyOriginEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATESERVICEACCOUNTKEYRESPONSEKEYORIGIN_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateServiceAccountKeyResponseKeyOriginFromValue returns a pointer to a valid CreateServiceAccountKeyResponseKeyOrigin +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateServiceAccountKeyResponseKeyOriginFromValue(v string) (*CreateServiceAccountKeyResponseKeyOrigin, error) { + ev := CreateServiceAccountKeyResponseKeyOrigin(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateServiceAccountKeyResponseKeyOrigin: valid values are %v", v, AllowedCreateServiceAccountKeyResponseKeyOriginEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateServiceAccountKeyResponseKeyOrigin) IsValid() bool { + for _, existing := range AllowedCreateServiceAccountKeyResponseKeyOriginEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateServiceAccountKeyResponse_keyOrigin value +func (v CreateServiceAccountKeyResponseKeyOrigin) Ptr() *CreateServiceAccountKeyResponseKeyOrigin { + return &v +} + +type NullableCreateServiceAccountKeyResponseKeyOrigin struct { + value *CreateServiceAccountKeyResponseKeyOrigin + isSet bool +} + +func (v NullableCreateServiceAccountKeyResponseKeyOrigin) Get() *CreateServiceAccountKeyResponseKeyOrigin { + return v.value +} + +func (v *NullableCreateServiceAccountKeyResponseKeyOrigin) Set(val *CreateServiceAccountKeyResponseKeyOrigin) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServiceAccountKeyResponseKeyOrigin) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServiceAccountKeyResponseKeyOrigin) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServiceAccountKeyResponseKeyOrigin(val *CreateServiceAccountKeyResponseKeyOrigin) *NullableCreateServiceAccountKeyResponseKeyOrigin { + return &NullableCreateServiceAccountKeyResponseKeyOrigin{value: val, isSet: true} +} + +func (v NullableCreateServiceAccountKeyResponseKeyOrigin) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServiceAccountKeyResponseKeyOrigin) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_create_service_account_key_response_key_type.go b/services/serviceaccount/v2api/model_create_service_account_key_response_key_type.go new file mode 100644 index 000000000..081ef162b --- /dev/null +++ b/services/serviceaccount/v2api/model_create_service_account_key_response_key_type.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateServiceAccountKeyResponseKeyType the model 'CreateServiceAccountKeyResponseKeyType' +type CreateServiceAccountKeyResponseKeyType string + +// List of CreateServiceAccountKeyResponse_keyType +const ( + CREATESERVICEACCOUNTKEYRESPONSEKEYTYPE_USER_MANAGED CreateServiceAccountKeyResponseKeyType = "USER_MANAGED" + CREATESERVICEACCOUNTKEYRESPONSEKEYTYPE_SYSTEM_MANAGED CreateServiceAccountKeyResponseKeyType = "SYSTEM_MANAGED" + CREATESERVICEACCOUNTKEYRESPONSEKEYTYPE_UNKNOWN_DEFAULT_OPEN_API CreateServiceAccountKeyResponseKeyType = "unknown_default_open_api" +) + +// All allowed values of CreateServiceAccountKeyResponseKeyType enum +var AllowedCreateServiceAccountKeyResponseKeyTypeEnumValues = []CreateServiceAccountKeyResponseKeyType{ + "USER_MANAGED", + "SYSTEM_MANAGED", + "unknown_default_open_api", +} + +func (v *CreateServiceAccountKeyResponseKeyType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateServiceAccountKeyResponseKeyType(value) + for _, existing := range AllowedCreateServiceAccountKeyResponseKeyTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATESERVICEACCOUNTKEYRESPONSEKEYTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateServiceAccountKeyResponseKeyTypeFromValue returns a pointer to a valid CreateServiceAccountKeyResponseKeyType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateServiceAccountKeyResponseKeyTypeFromValue(v string) (*CreateServiceAccountKeyResponseKeyType, error) { + ev := CreateServiceAccountKeyResponseKeyType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateServiceAccountKeyResponseKeyType: valid values are %v", v, AllowedCreateServiceAccountKeyResponseKeyTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateServiceAccountKeyResponseKeyType) IsValid() bool { + for _, existing := range AllowedCreateServiceAccountKeyResponseKeyTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateServiceAccountKeyResponse_keyType value +func (v CreateServiceAccountKeyResponseKeyType) Ptr() *CreateServiceAccountKeyResponseKeyType { + return &v +} + +type NullableCreateServiceAccountKeyResponseKeyType struct { + value *CreateServiceAccountKeyResponseKeyType + isSet bool +} + +func (v NullableCreateServiceAccountKeyResponseKeyType) Get() *CreateServiceAccountKeyResponseKeyType { + return v.value +} + +func (v *NullableCreateServiceAccountKeyResponseKeyType) Set(val *CreateServiceAccountKeyResponseKeyType) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServiceAccountKeyResponseKeyType) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServiceAccountKeyResponseKeyType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServiceAccountKeyResponseKeyType(val *CreateServiceAccountKeyResponseKeyType) *NullableCreateServiceAccountKeyResponseKeyType { + return &NullableCreateServiceAccountKeyResponseKeyType{value: val, isSet: true} +} + +func (v NullableCreateServiceAccountKeyResponseKeyType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServiceAccountKeyResponseKeyType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_create_short_lived_access_token_payload_grant_type.go b/services/serviceaccount/v2api/model_create_short_lived_access_token_payload_grant_type.go new file mode 100644 index 000000000..1a638426e --- /dev/null +++ b/services/serviceaccount/v2api/model_create_short_lived_access_token_payload_grant_type.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateShortLivedAccessTokenPayloadGrantType Always use URL encoded values. E.g. urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer +type CreateShortLivedAccessTokenPayloadGrantType string + +// List of CreateShortLivedAccessTokenPayload_grant_type +const ( + CREATESHORTLIVEDACCESSTOKENPAYLOADGRANTTYPE_URN_IETF_PARAMS_OAUTH_GRANT_TYPE_JWT_BEARER CreateShortLivedAccessTokenPayloadGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer" + CREATESHORTLIVEDACCESSTOKENPAYLOADGRANTTYPE_REFRESH_TOKEN CreateShortLivedAccessTokenPayloadGrantType = "refresh_token" + CREATESHORTLIVEDACCESSTOKENPAYLOADGRANTTYPE_UNKNOWN_DEFAULT_OPEN_API CreateShortLivedAccessTokenPayloadGrantType = "unknown_default_open_api" +) + +// All allowed values of CreateShortLivedAccessTokenPayloadGrantType enum +var AllowedCreateShortLivedAccessTokenPayloadGrantTypeEnumValues = []CreateShortLivedAccessTokenPayloadGrantType{ + "urn:ietf:params:oauth:grant-type:jwt-bearer", + "refresh_token", + "unknown_default_open_api", +} + +func (v *CreateShortLivedAccessTokenPayloadGrantType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateShortLivedAccessTokenPayloadGrantType(value) + for _, existing := range AllowedCreateShortLivedAccessTokenPayloadGrantTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATESHORTLIVEDACCESSTOKENPAYLOADGRANTTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateShortLivedAccessTokenPayloadGrantTypeFromValue returns a pointer to a valid CreateShortLivedAccessTokenPayloadGrantType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateShortLivedAccessTokenPayloadGrantTypeFromValue(v string) (*CreateShortLivedAccessTokenPayloadGrantType, error) { + ev := CreateShortLivedAccessTokenPayloadGrantType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateShortLivedAccessTokenPayloadGrantType: valid values are %v", v, AllowedCreateShortLivedAccessTokenPayloadGrantTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateShortLivedAccessTokenPayloadGrantType) IsValid() bool { + for _, existing := range AllowedCreateShortLivedAccessTokenPayloadGrantTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateShortLivedAccessTokenPayload_grant_type value +func (v CreateShortLivedAccessTokenPayloadGrantType) Ptr() *CreateShortLivedAccessTokenPayloadGrantType { + return &v +} + +type NullableCreateShortLivedAccessTokenPayloadGrantType struct { + value *CreateShortLivedAccessTokenPayloadGrantType + isSet bool +} + +func (v NullableCreateShortLivedAccessTokenPayloadGrantType) Get() *CreateShortLivedAccessTokenPayloadGrantType { + return v.value +} + +func (v *NullableCreateShortLivedAccessTokenPayloadGrantType) Set(val *CreateShortLivedAccessTokenPayloadGrantType) { + v.value = val + v.isSet = true +} + +func (v NullableCreateShortLivedAccessTokenPayloadGrantType) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateShortLivedAccessTokenPayloadGrantType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateShortLivedAccessTokenPayloadGrantType(val *CreateShortLivedAccessTokenPayloadGrantType) *NullableCreateShortLivedAccessTokenPayloadGrantType { + return &NullableCreateShortLivedAccessTokenPayloadGrantType{value: val, isSet: true} +} + +func (v NullableCreateShortLivedAccessTokenPayloadGrantType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateShortLivedAccessTokenPayloadGrantType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_create_short_lived_access_token_response.go b/services/serviceaccount/v2api/model_create_short_lived_access_token_response.go index cffe04e6e..74dad3bc2 100644 --- a/services/serviceaccount/v2api/model_create_short_lived_access_token_response.go +++ b/services/serviceaccount/v2api/model_create_short_lived_access_token_response.go @@ -26,8 +26,8 @@ type CreateShortLivedAccessTokenResponse struct { // Refresh token that can be used to request a new access token when it expires (and before refresh token expires). Tokens are rotated. RefreshToken string `json:"refresh_token"` // scope field of the self signed token - Scope string `json:"scope"` - TokenType string `json:"token_type"` + Scope string `json:"scope"` + TokenType CreateShortLivedAccessTokenResponseTokenType `json:"token_type"` AdditionalProperties map[string]interface{} } @@ -37,7 +37,7 @@ type _CreateShortLivedAccessTokenResponse CreateShortLivedAccessTokenResponse // 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 NewCreateShortLivedAccessTokenResponse(accessToken string, expiresIn int32, refreshToken string, scope string, tokenType string) *CreateShortLivedAccessTokenResponse { +func NewCreateShortLivedAccessTokenResponse(accessToken string, expiresIn int32, refreshToken string, scope string, tokenType CreateShortLivedAccessTokenResponseTokenType) *CreateShortLivedAccessTokenResponse { this := CreateShortLivedAccessTokenResponse{} this.AccessToken = accessToken this.ExpiresIn = expiresIn @@ -152,9 +152,9 @@ func (o *CreateShortLivedAccessTokenResponse) SetScope(v string) { } // GetTokenType returns the TokenType field value -func (o *CreateShortLivedAccessTokenResponse) GetTokenType() string { +func (o *CreateShortLivedAccessTokenResponse) GetTokenType() CreateShortLivedAccessTokenResponseTokenType { if o == nil { - var ret string + var ret CreateShortLivedAccessTokenResponseTokenType return ret } @@ -163,7 +163,7 @@ func (o *CreateShortLivedAccessTokenResponse) GetTokenType() string { // GetTokenTypeOk returns a tuple with the TokenType field value // and a boolean to check if the value has been set. -func (o *CreateShortLivedAccessTokenResponse) GetTokenTypeOk() (*string, bool) { +func (o *CreateShortLivedAccessTokenResponse) GetTokenTypeOk() (*CreateShortLivedAccessTokenResponseTokenType, bool) { if o == nil { return nil, false } @@ -171,7 +171,7 @@ func (o *CreateShortLivedAccessTokenResponse) GetTokenTypeOk() (*string, bool) { } // SetTokenType sets field value -func (o *CreateShortLivedAccessTokenResponse) SetTokenType(v string) { +func (o *CreateShortLivedAccessTokenResponse) SetTokenType(v CreateShortLivedAccessTokenResponseTokenType) { o.TokenType = v } diff --git a/services/serviceaccount/v2api/model_create_short_lived_access_token_response_token_type.go b/services/serviceaccount/v2api/model_create_short_lived_access_token_response_token_type.go new file mode 100644 index 000000000..f021413b8 --- /dev/null +++ b/services/serviceaccount/v2api/model_create_short_lived_access_token_response_token_type.go @@ -0,0 +1,111 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateShortLivedAccessTokenResponseTokenType the model 'CreateShortLivedAccessTokenResponseTokenType' +type CreateShortLivedAccessTokenResponseTokenType string + +// List of CreateShortLivedAccessTokenResponse_token_type +const ( + CREATESHORTLIVEDACCESSTOKENRESPONSETOKENTYPE_BEARER CreateShortLivedAccessTokenResponseTokenType = "Bearer" + CREATESHORTLIVEDACCESSTOKENRESPONSETOKENTYPE_UNKNOWN_DEFAULT_OPEN_API CreateShortLivedAccessTokenResponseTokenType = "unknown_default_open_api" +) + +// All allowed values of CreateShortLivedAccessTokenResponseTokenType enum +var AllowedCreateShortLivedAccessTokenResponseTokenTypeEnumValues = []CreateShortLivedAccessTokenResponseTokenType{ + "Bearer", + "unknown_default_open_api", +} + +func (v *CreateShortLivedAccessTokenResponseTokenType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateShortLivedAccessTokenResponseTokenType(value) + for _, existing := range AllowedCreateShortLivedAccessTokenResponseTokenTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATESHORTLIVEDACCESSTOKENRESPONSETOKENTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateShortLivedAccessTokenResponseTokenTypeFromValue returns a pointer to a valid CreateShortLivedAccessTokenResponseTokenType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateShortLivedAccessTokenResponseTokenTypeFromValue(v string) (*CreateShortLivedAccessTokenResponseTokenType, error) { + ev := CreateShortLivedAccessTokenResponseTokenType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateShortLivedAccessTokenResponseTokenType: valid values are %v", v, AllowedCreateShortLivedAccessTokenResponseTokenTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateShortLivedAccessTokenResponseTokenType) IsValid() bool { + for _, existing := range AllowedCreateShortLivedAccessTokenResponseTokenTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateShortLivedAccessTokenResponse_token_type value +func (v CreateShortLivedAccessTokenResponseTokenType) Ptr() *CreateShortLivedAccessTokenResponseTokenType { + return &v +} + +type NullableCreateShortLivedAccessTokenResponseTokenType struct { + value *CreateShortLivedAccessTokenResponseTokenType + isSet bool +} + +func (v NullableCreateShortLivedAccessTokenResponseTokenType) Get() *CreateShortLivedAccessTokenResponseTokenType { + return v.value +} + +func (v *NullableCreateShortLivedAccessTokenResponseTokenType) Set(val *CreateShortLivedAccessTokenResponseTokenType) { + v.value = val + v.isSet = true +} + +func (v NullableCreateShortLivedAccessTokenResponseTokenType) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateShortLivedAccessTokenResponseTokenType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateShortLivedAccessTokenResponseTokenType(val *CreateShortLivedAccessTokenResponseTokenType) *NullableCreateShortLivedAccessTokenResponseTokenType { + return &NullableCreateShortLivedAccessTokenResponseTokenType{value: val, isSet: true} +} + +func (v NullableCreateShortLivedAccessTokenResponseTokenType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateShortLivedAccessTokenResponseTokenType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_get_service_account_key_format_parameter.go b/services/serviceaccount/v2api/model_get_service_account_key_format_parameter.go new file mode 100644 index 000000000..cef8e46f4 --- /dev/null +++ b/services/serviceaccount/v2api/model_get_service_account_key_format_parameter.go @@ -0,0 +1,111 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetServiceAccountKeyFormatParameter the model 'GetServiceAccountKeyFormatParameter' +type GetServiceAccountKeyFormatParameter string + +// List of GetServiceAccountKey_format_parameter +const ( + GETSERVICEACCOUNTKEYFORMATPARAMETER_X509_PEM GetServiceAccountKeyFormatParameter = "X509_PEM" + GETSERVICEACCOUNTKEYFORMATPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetServiceAccountKeyFormatParameter = "unknown_default_open_api" +) + +// All allowed values of GetServiceAccountKeyFormatParameter enum +var AllowedGetServiceAccountKeyFormatParameterEnumValues = []GetServiceAccountKeyFormatParameter{ + "X509_PEM", + "unknown_default_open_api", +} + +func (v *GetServiceAccountKeyFormatParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetServiceAccountKeyFormatParameter(value) + for _, existing := range AllowedGetServiceAccountKeyFormatParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETSERVICEACCOUNTKEYFORMATPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetServiceAccountKeyFormatParameterFromValue returns a pointer to a valid GetServiceAccountKeyFormatParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetServiceAccountKeyFormatParameterFromValue(v string) (*GetServiceAccountKeyFormatParameter, error) { + ev := GetServiceAccountKeyFormatParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetServiceAccountKeyFormatParameter: valid values are %v", v, AllowedGetServiceAccountKeyFormatParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetServiceAccountKeyFormatParameter) IsValid() bool { + for _, existing := range AllowedGetServiceAccountKeyFormatParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetServiceAccountKey_format_parameter value +func (v GetServiceAccountKeyFormatParameter) Ptr() *GetServiceAccountKeyFormatParameter { + return &v +} + +type NullableGetServiceAccountKeyFormatParameter struct { + value *GetServiceAccountKeyFormatParameter + isSet bool +} + +func (v NullableGetServiceAccountKeyFormatParameter) Get() *GetServiceAccountKeyFormatParameter { + return v.value +} + +func (v *NullableGetServiceAccountKeyFormatParameter) Set(val *GetServiceAccountKeyFormatParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetServiceAccountKeyFormatParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServiceAccountKeyFormatParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServiceAccountKeyFormatParameter(val *GetServiceAccountKeyFormatParameter) *NullableGetServiceAccountKeyFormatParameter { + return &NullableGetServiceAccountKeyFormatParameter{value: val, isSet: true} +} + +func (v NullableGetServiceAccountKeyFormatParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServiceAccountKeyFormatParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_get_service_account_key_response.go b/services/serviceaccount/v2api/model_get_service_account_key_response.go index 072504e68..8a7b5f907 100644 --- a/services/serviceaccount/v2api/model_get_service_account_key_response.go +++ b/services/serviceaccount/v2api/model_get_service_account_key_response.go @@ -26,10 +26,10 @@ type GetServiceAccountKeyResponse struct { CreatedAt time.Time `json:"createdAt"` Credentials GetServiceAccountKeyResponseCredentials `json:"credentials"` // Unique ID of the key. - Id string `json:"id"` - KeyAlgorithm string `json:"keyAlgorithm"` - KeyOrigin string `json:"keyOrigin"` - KeyType string `json:"keyType"` + Id string `json:"id"` + KeyAlgorithm GetServiceAccountKeyResponseKeyAlgorithm `json:"keyAlgorithm"` + KeyOrigin GetServiceAccountKeyResponseKeyOrigin `json:"keyOrigin"` + KeyType GetServiceAccountKeyResponseKeyType `json:"keyType"` // Public key, in the requested format PublicKey *string `json:"publicKey,omitempty"` // If specified, the timestamp until the key is active. May be null @@ -43,7 +43,7 @@ type _GetServiceAccountKeyResponse GetServiceAccountKeyResponse // 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 NewGetServiceAccountKeyResponse(active bool, createdAt time.Time, credentials GetServiceAccountKeyResponseCredentials, id string, keyAlgorithm string, keyOrigin string, keyType string) *GetServiceAccountKeyResponse { +func NewGetServiceAccountKeyResponse(active bool, createdAt time.Time, credentials GetServiceAccountKeyResponseCredentials, id string, keyAlgorithm GetServiceAccountKeyResponseKeyAlgorithm, keyOrigin GetServiceAccountKeyResponseKeyOrigin, keyType GetServiceAccountKeyResponseKeyType) *GetServiceAccountKeyResponse { this := GetServiceAccountKeyResponse{} this.Active = active this.CreatedAt = createdAt @@ -160,9 +160,9 @@ func (o *GetServiceAccountKeyResponse) SetId(v string) { } // GetKeyAlgorithm returns the KeyAlgorithm field value -func (o *GetServiceAccountKeyResponse) GetKeyAlgorithm() string { +func (o *GetServiceAccountKeyResponse) GetKeyAlgorithm() GetServiceAccountKeyResponseKeyAlgorithm { if o == nil { - var ret string + var ret GetServiceAccountKeyResponseKeyAlgorithm return ret } @@ -171,7 +171,7 @@ func (o *GetServiceAccountKeyResponse) GetKeyAlgorithm() string { // GetKeyAlgorithmOk returns a tuple with the KeyAlgorithm field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetKeyAlgorithmOk() (*string, bool) { +func (o *GetServiceAccountKeyResponse) GetKeyAlgorithmOk() (*GetServiceAccountKeyResponseKeyAlgorithm, bool) { if o == nil { return nil, false } @@ -179,14 +179,14 @@ func (o *GetServiceAccountKeyResponse) GetKeyAlgorithmOk() (*string, bool) { } // SetKeyAlgorithm sets field value -func (o *GetServiceAccountKeyResponse) SetKeyAlgorithm(v string) { +func (o *GetServiceAccountKeyResponse) SetKeyAlgorithm(v GetServiceAccountKeyResponseKeyAlgorithm) { o.KeyAlgorithm = v } // GetKeyOrigin returns the KeyOrigin field value -func (o *GetServiceAccountKeyResponse) GetKeyOrigin() string { +func (o *GetServiceAccountKeyResponse) GetKeyOrigin() GetServiceAccountKeyResponseKeyOrigin { if o == nil { - var ret string + var ret GetServiceAccountKeyResponseKeyOrigin return ret } @@ -195,7 +195,7 @@ func (o *GetServiceAccountKeyResponse) GetKeyOrigin() string { // GetKeyOriginOk returns a tuple with the KeyOrigin field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetKeyOriginOk() (*string, bool) { +func (o *GetServiceAccountKeyResponse) GetKeyOriginOk() (*GetServiceAccountKeyResponseKeyOrigin, bool) { if o == nil { return nil, false } @@ -203,14 +203,14 @@ func (o *GetServiceAccountKeyResponse) GetKeyOriginOk() (*string, bool) { } // SetKeyOrigin sets field value -func (o *GetServiceAccountKeyResponse) SetKeyOrigin(v string) { +func (o *GetServiceAccountKeyResponse) SetKeyOrigin(v GetServiceAccountKeyResponseKeyOrigin) { o.KeyOrigin = v } // GetKeyType returns the KeyType field value -func (o *GetServiceAccountKeyResponse) GetKeyType() string { +func (o *GetServiceAccountKeyResponse) GetKeyType() GetServiceAccountKeyResponseKeyType { if o == nil { - var ret string + var ret GetServiceAccountKeyResponseKeyType return ret } @@ -219,7 +219,7 @@ func (o *GetServiceAccountKeyResponse) GetKeyType() string { // GetKeyTypeOk returns a tuple with the KeyType field value // and a boolean to check if the value has been set. -func (o *GetServiceAccountKeyResponse) GetKeyTypeOk() (*string, bool) { +func (o *GetServiceAccountKeyResponse) GetKeyTypeOk() (*GetServiceAccountKeyResponseKeyType, bool) { if o == nil { return nil, false } @@ -227,7 +227,7 @@ func (o *GetServiceAccountKeyResponse) GetKeyTypeOk() (*string, bool) { } // SetKeyType sets field value -func (o *GetServiceAccountKeyResponse) SetKeyType(v string) { +func (o *GetServiceAccountKeyResponse) SetKeyType(v GetServiceAccountKeyResponseKeyType) { o.KeyType = v } diff --git a/services/serviceaccount/v2api/model_get_service_account_key_response_key_algorithm.go b/services/serviceaccount/v2api/model_get_service_account_key_response_key_algorithm.go new file mode 100644 index 000000000..e6807d102 --- /dev/null +++ b/services/serviceaccount/v2api/model_get_service_account_key_response_key_algorithm.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetServiceAccountKeyResponseKeyAlgorithm the model 'GetServiceAccountKeyResponseKeyAlgorithm' +type GetServiceAccountKeyResponseKeyAlgorithm string + +// List of GetServiceAccountKeyResponse_keyAlgorithm +const ( + GETSERVICEACCOUNTKEYRESPONSEKEYALGORITHM_RSA_2048 GetServiceAccountKeyResponseKeyAlgorithm = "RSA_2048" + GETSERVICEACCOUNTKEYRESPONSEKEYALGORITHM_RSA_4096 GetServiceAccountKeyResponseKeyAlgorithm = "RSA_4096" + GETSERVICEACCOUNTKEYRESPONSEKEYALGORITHM_UNKNOWN_DEFAULT_OPEN_API GetServiceAccountKeyResponseKeyAlgorithm = "unknown_default_open_api" +) + +// All allowed values of GetServiceAccountKeyResponseKeyAlgorithm enum +var AllowedGetServiceAccountKeyResponseKeyAlgorithmEnumValues = []GetServiceAccountKeyResponseKeyAlgorithm{ + "RSA_2048", + "RSA_4096", + "unknown_default_open_api", +} + +func (v *GetServiceAccountKeyResponseKeyAlgorithm) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetServiceAccountKeyResponseKeyAlgorithm(value) + for _, existing := range AllowedGetServiceAccountKeyResponseKeyAlgorithmEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETSERVICEACCOUNTKEYRESPONSEKEYALGORITHM_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetServiceAccountKeyResponseKeyAlgorithmFromValue returns a pointer to a valid GetServiceAccountKeyResponseKeyAlgorithm +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetServiceAccountKeyResponseKeyAlgorithmFromValue(v string) (*GetServiceAccountKeyResponseKeyAlgorithm, error) { + ev := GetServiceAccountKeyResponseKeyAlgorithm(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetServiceAccountKeyResponseKeyAlgorithm: valid values are %v", v, AllowedGetServiceAccountKeyResponseKeyAlgorithmEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetServiceAccountKeyResponseKeyAlgorithm) IsValid() bool { + for _, existing := range AllowedGetServiceAccountKeyResponseKeyAlgorithmEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetServiceAccountKeyResponse_keyAlgorithm value +func (v GetServiceAccountKeyResponseKeyAlgorithm) Ptr() *GetServiceAccountKeyResponseKeyAlgorithm { + return &v +} + +type NullableGetServiceAccountKeyResponseKeyAlgorithm struct { + value *GetServiceAccountKeyResponseKeyAlgorithm + isSet bool +} + +func (v NullableGetServiceAccountKeyResponseKeyAlgorithm) Get() *GetServiceAccountKeyResponseKeyAlgorithm { + return v.value +} + +func (v *NullableGetServiceAccountKeyResponseKeyAlgorithm) Set(val *GetServiceAccountKeyResponseKeyAlgorithm) { + v.value = val + v.isSet = true +} + +func (v NullableGetServiceAccountKeyResponseKeyAlgorithm) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServiceAccountKeyResponseKeyAlgorithm) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServiceAccountKeyResponseKeyAlgorithm(val *GetServiceAccountKeyResponseKeyAlgorithm) *NullableGetServiceAccountKeyResponseKeyAlgorithm { + return &NullableGetServiceAccountKeyResponseKeyAlgorithm{value: val, isSet: true} +} + +func (v NullableGetServiceAccountKeyResponseKeyAlgorithm) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServiceAccountKeyResponseKeyAlgorithm) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_get_service_account_key_response_key_origin.go b/services/serviceaccount/v2api/model_get_service_account_key_response_key_origin.go new file mode 100644 index 000000000..a629eda4d --- /dev/null +++ b/services/serviceaccount/v2api/model_get_service_account_key_response_key_origin.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetServiceAccountKeyResponseKeyOrigin the model 'GetServiceAccountKeyResponseKeyOrigin' +type GetServiceAccountKeyResponseKeyOrigin string + +// List of GetServiceAccountKeyResponse_keyOrigin +const ( + GETSERVICEACCOUNTKEYRESPONSEKEYORIGIN_USER_PROVIDED GetServiceAccountKeyResponseKeyOrigin = "USER_PROVIDED" + GETSERVICEACCOUNTKEYRESPONSEKEYORIGIN_GENERATED GetServiceAccountKeyResponseKeyOrigin = "GENERATED" + GETSERVICEACCOUNTKEYRESPONSEKEYORIGIN_UNKNOWN_DEFAULT_OPEN_API GetServiceAccountKeyResponseKeyOrigin = "unknown_default_open_api" +) + +// All allowed values of GetServiceAccountKeyResponseKeyOrigin enum +var AllowedGetServiceAccountKeyResponseKeyOriginEnumValues = []GetServiceAccountKeyResponseKeyOrigin{ + "USER_PROVIDED", + "GENERATED", + "unknown_default_open_api", +} + +func (v *GetServiceAccountKeyResponseKeyOrigin) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetServiceAccountKeyResponseKeyOrigin(value) + for _, existing := range AllowedGetServiceAccountKeyResponseKeyOriginEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETSERVICEACCOUNTKEYRESPONSEKEYORIGIN_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetServiceAccountKeyResponseKeyOriginFromValue returns a pointer to a valid GetServiceAccountKeyResponseKeyOrigin +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetServiceAccountKeyResponseKeyOriginFromValue(v string) (*GetServiceAccountKeyResponseKeyOrigin, error) { + ev := GetServiceAccountKeyResponseKeyOrigin(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetServiceAccountKeyResponseKeyOrigin: valid values are %v", v, AllowedGetServiceAccountKeyResponseKeyOriginEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetServiceAccountKeyResponseKeyOrigin) IsValid() bool { + for _, existing := range AllowedGetServiceAccountKeyResponseKeyOriginEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetServiceAccountKeyResponse_keyOrigin value +func (v GetServiceAccountKeyResponseKeyOrigin) Ptr() *GetServiceAccountKeyResponseKeyOrigin { + return &v +} + +type NullableGetServiceAccountKeyResponseKeyOrigin struct { + value *GetServiceAccountKeyResponseKeyOrigin + isSet bool +} + +func (v NullableGetServiceAccountKeyResponseKeyOrigin) Get() *GetServiceAccountKeyResponseKeyOrigin { + return v.value +} + +func (v *NullableGetServiceAccountKeyResponseKeyOrigin) Set(val *GetServiceAccountKeyResponseKeyOrigin) { + v.value = val + v.isSet = true +} + +func (v NullableGetServiceAccountKeyResponseKeyOrigin) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServiceAccountKeyResponseKeyOrigin) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServiceAccountKeyResponseKeyOrigin(val *GetServiceAccountKeyResponseKeyOrigin) *NullableGetServiceAccountKeyResponseKeyOrigin { + return &NullableGetServiceAccountKeyResponseKeyOrigin{value: val, isSet: true} +} + +func (v NullableGetServiceAccountKeyResponseKeyOrigin) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServiceAccountKeyResponseKeyOrigin) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_get_service_account_key_response_key_type.go b/services/serviceaccount/v2api/model_get_service_account_key_response_key_type.go new file mode 100644 index 000000000..75eb3a941 --- /dev/null +++ b/services/serviceaccount/v2api/model_get_service_account_key_response_key_type.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetServiceAccountKeyResponseKeyType the model 'GetServiceAccountKeyResponseKeyType' +type GetServiceAccountKeyResponseKeyType string + +// List of GetServiceAccountKeyResponse_keyType +const ( + GETSERVICEACCOUNTKEYRESPONSEKEYTYPE_USER_MANAGED GetServiceAccountKeyResponseKeyType = "USER_MANAGED" + GETSERVICEACCOUNTKEYRESPONSEKEYTYPE_SYSTEM_MANAGED GetServiceAccountKeyResponseKeyType = "SYSTEM_MANAGED" + GETSERVICEACCOUNTKEYRESPONSEKEYTYPE_UNKNOWN_DEFAULT_OPEN_API GetServiceAccountKeyResponseKeyType = "unknown_default_open_api" +) + +// All allowed values of GetServiceAccountKeyResponseKeyType enum +var AllowedGetServiceAccountKeyResponseKeyTypeEnumValues = []GetServiceAccountKeyResponseKeyType{ + "USER_MANAGED", + "SYSTEM_MANAGED", + "unknown_default_open_api", +} + +func (v *GetServiceAccountKeyResponseKeyType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetServiceAccountKeyResponseKeyType(value) + for _, existing := range AllowedGetServiceAccountKeyResponseKeyTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETSERVICEACCOUNTKEYRESPONSEKEYTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetServiceAccountKeyResponseKeyTypeFromValue returns a pointer to a valid GetServiceAccountKeyResponseKeyType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetServiceAccountKeyResponseKeyTypeFromValue(v string) (*GetServiceAccountKeyResponseKeyType, error) { + ev := GetServiceAccountKeyResponseKeyType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetServiceAccountKeyResponseKeyType: valid values are %v", v, AllowedGetServiceAccountKeyResponseKeyTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetServiceAccountKeyResponseKeyType) IsValid() bool { + for _, existing := range AllowedGetServiceAccountKeyResponseKeyTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetServiceAccountKeyResponse_keyType value +func (v GetServiceAccountKeyResponseKeyType) Ptr() *GetServiceAccountKeyResponseKeyType { + return &v +} + +type NullableGetServiceAccountKeyResponseKeyType struct { + value *GetServiceAccountKeyResponseKeyType + isSet bool +} + +func (v NullableGetServiceAccountKeyResponseKeyType) Get() *GetServiceAccountKeyResponseKeyType { + return v.value +} + +func (v *NullableGetServiceAccountKeyResponseKeyType) Set(val *GetServiceAccountKeyResponseKeyType) { + v.value = val + v.isSet = true +} + +func (v NullableGetServiceAccountKeyResponseKeyType) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServiceAccountKeyResponseKeyType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServiceAccountKeyResponseKeyType(val *GetServiceAccountKeyResponseKeyType) *NullableGetServiceAccountKeyResponseKeyType { + return &NullableGetServiceAccountKeyResponseKeyType{value: val, isSet: true} +} + +func (v NullableGetServiceAccountKeyResponseKeyType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServiceAccountKeyResponseKeyType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_partial_update_service_account_key_response.go b/services/serviceaccount/v2api/model_partial_update_service_account_key_response.go index b4d0e026a..68692e60f 100644 --- a/services/serviceaccount/v2api/model_partial_update_service_account_key_response.go +++ b/services/serviceaccount/v2api/model_partial_update_service_account_key_response.go @@ -25,10 +25,10 @@ type PartialUpdateServiceAccountKeyResponse struct { // Creation time of the key CreatedAt time.Time `json:"createdAt"` // Unique ID of the key. - Id string `json:"id"` - KeyAlgorithm string `json:"keyAlgorithm"` - KeyOrigin string `json:"keyOrigin"` - KeyType string `json:"keyType"` + Id string `json:"id"` + KeyAlgorithm PartialUpdateServiceAccountKeyResponseKeyAlgorithm `json:"keyAlgorithm"` + KeyOrigin PartialUpdateServiceAccountKeyResponseKeyOrigin `json:"keyOrigin"` + KeyType PartialUpdateServiceAccountKeyResponseKeyType `json:"keyType"` // If specified, the timestamp until the key is active. May be null ValidUntil *time.Time `json:"validUntil,omitempty"` AdditionalProperties map[string]interface{} @@ -40,7 +40,7 @@ type _PartialUpdateServiceAccountKeyResponse PartialUpdateServiceAccountKeyRespo // 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 NewPartialUpdateServiceAccountKeyResponse(active bool, createdAt time.Time, id string, keyAlgorithm string, keyOrigin string, keyType string) *PartialUpdateServiceAccountKeyResponse { +func NewPartialUpdateServiceAccountKeyResponse(active bool, createdAt time.Time, id string, keyAlgorithm PartialUpdateServiceAccountKeyResponseKeyAlgorithm, keyOrigin PartialUpdateServiceAccountKeyResponseKeyOrigin, keyType PartialUpdateServiceAccountKeyResponseKeyType) *PartialUpdateServiceAccountKeyResponse { this := PartialUpdateServiceAccountKeyResponse{} this.Active = active this.CreatedAt = createdAt @@ -132,9 +132,9 @@ func (o *PartialUpdateServiceAccountKeyResponse) SetId(v string) { } // GetKeyAlgorithm returns the KeyAlgorithm field value -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyAlgorithm() string { +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyAlgorithm() PartialUpdateServiceAccountKeyResponseKeyAlgorithm { if o == nil { - var ret string + var ret PartialUpdateServiceAccountKeyResponseKeyAlgorithm return ret } @@ -143,7 +143,7 @@ func (o *PartialUpdateServiceAccountKeyResponse) GetKeyAlgorithm() string { // GetKeyAlgorithmOk returns a tuple with the KeyAlgorithm field value // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyAlgorithmOk() (*string, bool) { +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyAlgorithmOk() (*PartialUpdateServiceAccountKeyResponseKeyAlgorithm, bool) { if o == nil { return nil, false } @@ -151,14 +151,14 @@ func (o *PartialUpdateServiceAccountKeyResponse) GetKeyAlgorithmOk() (*string, b } // SetKeyAlgorithm sets field value -func (o *PartialUpdateServiceAccountKeyResponse) SetKeyAlgorithm(v string) { +func (o *PartialUpdateServiceAccountKeyResponse) SetKeyAlgorithm(v PartialUpdateServiceAccountKeyResponseKeyAlgorithm) { o.KeyAlgorithm = v } // GetKeyOrigin returns the KeyOrigin field value -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyOrigin() string { +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyOrigin() PartialUpdateServiceAccountKeyResponseKeyOrigin { if o == nil { - var ret string + var ret PartialUpdateServiceAccountKeyResponseKeyOrigin return ret } @@ -167,7 +167,7 @@ func (o *PartialUpdateServiceAccountKeyResponse) GetKeyOrigin() string { // GetKeyOriginOk returns a tuple with the KeyOrigin field value // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyOriginOk() (*string, bool) { +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyOriginOk() (*PartialUpdateServiceAccountKeyResponseKeyOrigin, bool) { if o == nil { return nil, false } @@ -175,14 +175,14 @@ func (o *PartialUpdateServiceAccountKeyResponse) GetKeyOriginOk() (*string, bool } // SetKeyOrigin sets field value -func (o *PartialUpdateServiceAccountKeyResponse) SetKeyOrigin(v string) { +func (o *PartialUpdateServiceAccountKeyResponse) SetKeyOrigin(v PartialUpdateServiceAccountKeyResponseKeyOrigin) { o.KeyOrigin = v } // GetKeyType returns the KeyType field value -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyType() string { +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyType() PartialUpdateServiceAccountKeyResponseKeyType { if o == nil { - var ret string + var ret PartialUpdateServiceAccountKeyResponseKeyType return ret } @@ -191,7 +191,7 @@ func (o *PartialUpdateServiceAccountKeyResponse) GetKeyType() string { // GetKeyTypeOk returns a tuple with the KeyType field value // and a boolean to check if the value has been set. -func (o *PartialUpdateServiceAccountKeyResponse) GetKeyTypeOk() (*string, bool) { +func (o *PartialUpdateServiceAccountKeyResponse) GetKeyTypeOk() (*PartialUpdateServiceAccountKeyResponseKeyType, bool) { if o == nil { return nil, false } @@ -199,7 +199,7 @@ func (o *PartialUpdateServiceAccountKeyResponse) GetKeyTypeOk() (*string, bool) } // SetKeyType sets field value -func (o *PartialUpdateServiceAccountKeyResponse) SetKeyType(v string) { +func (o *PartialUpdateServiceAccountKeyResponse) SetKeyType(v PartialUpdateServiceAccountKeyResponseKeyType) { o.KeyType = v } diff --git a/services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_algorithm.go b/services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_algorithm.go new file mode 100644 index 000000000..84d3c796b --- /dev/null +++ b/services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_algorithm.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// PartialUpdateServiceAccountKeyResponseKeyAlgorithm the model 'PartialUpdateServiceAccountKeyResponseKeyAlgorithm' +type PartialUpdateServiceAccountKeyResponseKeyAlgorithm string + +// List of PartialUpdateServiceAccountKeyResponse_keyAlgorithm +const ( + PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYALGORITHM_RSA_2048 PartialUpdateServiceAccountKeyResponseKeyAlgorithm = "RSA_2048" + PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYALGORITHM_RSA_4096 PartialUpdateServiceAccountKeyResponseKeyAlgorithm = "RSA_4096" + PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYALGORITHM_UNKNOWN_DEFAULT_OPEN_API PartialUpdateServiceAccountKeyResponseKeyAlgorithm = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateServiceAccountKeyResponseKeyAlgorithm enum +var AllowedPartialUpdateServiceAccountKeyResponseKeyAlgorithmEnumValues = []PartialUpdateServiceAccountKeyResponseKeyAlgorithm{ + "RSA_2048", + "RSA_4096", + "unknown_default_open_api", +} + +func (v *PartialUpdateServiceAccountKeyResponseKeyAlgorithm) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateServiceAccountKeyResponseKeyAlgorithm(value) + for _, existing := range AllowedPartialUpdateServiceAccountKeyResponseKeyAlgorithmEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYALGORITHM_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateServiceAccountKeyResponseKeyAlgorithmFromValue returns a pointer to a valid PartialUpdateServiceAccountKeyResponseKeyAlgorithm +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateServiceAccountKeyResponseKeyAlgorithmFromValue(v string) (*PartialUpdateServiceAccountKeyResponseKeyAlgorithm, error) { + ev := PartialUpdateServiceAccountKeyResponseKeyAlgorithm(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateServiceAccountKeyResponseKeyAlgorithm: valid values are %v", v, AllowedPartialUpdateServiceAccountKeyResponseKeyAlgorithmEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateServiceAccountKeyResponseKeyAlgorithm) IsValid() bool { + for _, existing := range AllowedPartialUpdateServiceAccountKeyResponseKeyAlgorithmEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateServiceAccountKeyResponse_keyAlgorithm value +func (v PartialUpdateServiceAccountKeyResponseKeyAlgorithm) Ptr() *PartialUpdateServiceAccountKeyResponseKeyAlgorithm { + return &v +} + +type NullablePartialUpdateServiceAccountKeyResponseKeyAlgorithm struct { + value *PartialUpdateServiceAccountKeyResponseKeyAlgorithm + isSet bool +} + +func (v NullablePartialUpdateServiceAccountKeyResponseKeyAlgorithm) Get() *PartialUpdateServiceAccountKeyResponseKeyAlgorithm { + return v.value +} + +func (v *NullablePartialUpdateServiceAccountKeyResponseKeyAlgorithm) Set(val *PartialUpdateServiceAccountKeyResponseKeyAlgorithm) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateServiceAccountKeyResponseKeyAlgorithm) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateServiceAccountKeyResponseKeyAlgorithm) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateServiceAccountKeyResponseKeyAlgorithm(val *PartialUpdateServiceAccountKeyResponseKeyAlgorithm) *NullablePartialUpdateServiceAccountKeyResponseKeyAlgorithm { + return &NullablePartialUpdateServiceAccountKeyResponseKeyAlgorithm{value: val, isSet: true} +} + +func (v NullablePartialUpdateServiceAccountKeyResponseKeyAlgorithm) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateServiceAccountKeyResponseKeyAlgorithm) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_origin.go b/services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_origin.go new file mode 100644 index 000000000..255a70b95 --- /dev/null +++ b/services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_origin.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// PartialUpdateServiceAccountKeyResponseKeyOrigin the model 'PartialUpdateServiceAccountKeyResponseKeyOrigin' +type PartialUpdateServiceAccountKeyResponseKeyOrigin string + +// List of PartialUpdateServiceAccountKeyResponse_keyOrigin +const ( + PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYORIGIN_USER_PROVIDED PartialUpdateServiceAccountKeyResponseKeyOrigin = "USER_PROVIDED" + PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYORIGIN_GENERATED PartialUpdateServiceAccountKeyResponseKeyOrigin = "GENERATED" + PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYORIGIN_UNKNOWN_DEFAULT_OPEN_API PartialUpdateServiceAccountKeyResponseKeyOrigin = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateServiceAccountKeyResponseKeyOrigin enum +var AllowedPartialUpdateServiceAccountKeyResponseKeyOriginEnumValues = []PartialUpdateServiceAccountKeyResponseKeyOrigin{ + "USER_PROVIDED", + "GENERATED", + "unknown_default_open_api", +} + +func (v *PartialUpdateServiceAccountKeyResponseKeyOrigin) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateServiceAccountKeyResponseKeyOrigin(value) + for _, existing := range AllowedPartialUpdateServiceAccountKeyResponseKeyOriginEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYORIGIN_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateServiceAccountKeyResponseKeyOriginFromValue returns a pointer to a valid PartialUpdateServiceAccountKeyResponseKeyOrigin +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateServiceAccountKeyResponseKeyOriginFromValue(v string) (*PartialUpdateServiceAccountKeyResponseKeyOrigin, error) { + ev := PartialUpdateServiceAccountKeyResponseKeyOrigin(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateServiceAccountKeyResponseKeyOrigin: valid values are %v", v, AllowedPartialUpdateServiceAccountKeyResponseKeyOriginEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateServiceAccountKeyResponseKeyOrigin) IsValid() bool { + for _, existing := range AllowedPartialUpdateServiceAccountKeyResponseKeyOriginEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateServiceAccountKeyResponse_keyOrigin value +func (v PartialUpdateServiceAccountKeyResponseKeyOrigin) Ptr() *PartialUpdateServiceAccountKeyResponseKeyOrigin { + return &v +} + +type NullablePartialUpdateServiceAccountKeyResponseKeyOrigin struct { + value *PartialUpdateServiceAccountKeyResponseKeyOrigin + isSet bool +} + +func (v NullablePartialUpdateServiceAccountKeyResponseKeyOrigin) Get() *PartialUpdateServiceAccountKeyResponseKeyOrigin { + return v.value +} + +func (v *NullablePartialUpdateServiceAccountKeyResponseKeyOrigin) Set(val *PartialUpdateServiceAccountKeyResponseKeyOrigin) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateServiceAccountKeyResponseKeyOrigin) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateServiceAccountKeyResponseKeyOrigin) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateServiceAccountKeyResponseKeyOrigin(val *PartialUpdateServiceAccountKeyResponseKeyOrigin) *NullablePartialUpdateServiceAccountKeyResponseKeyOrigin { + return &NullablePartialUpdateServiceAccountKeyResponseKeyOrigin{value: val, isSet: true} +} + +func (v NullablePartialUpdateServiceAccountKeyResponseKeyOrigin) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateServiceAccountKeyResponseKeyOrigin) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_type.go b/services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_type.go new file mode 100644 index 000000000..5791ae82b --- /dev/null +++ b/services/serviceaccount/v2api/model_partial_update_service_account_key_response_key_type.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// PartialUpdateServiceAccountKeyResponseKeyType the model 'PartialUpdateServiceAccountKeyResponseKeyType' +type PartialUpdateServiceAccountKeyResponseKeyType string + +// List of PartialUpdateServiceAccountKeyResponse_keyType +const ( + PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYTYPE_USER_MANAGED PartialUpdateServiceAccountKeyResponseKeyType = "USER_MANAGED" + PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYTYPE_SYSTEM_MANAGED PartialUpdateServiceAccountKeyResponseKeyType = "SYSTEM_MANAGED" + PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYTYPE_UNKNOWN_DEFAULT_OPEN_API PartialUpdateServiceAccountKeyResponseKeyType = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateServiceAccountKeyResponseKeyType enum +var AllowedPartialUpdateServiceAccountKeyResponseKeyTypeEnumValues = []PartialUpdateServiceAccountKeyResponseKeyType{ + "USER_MANAGED", + "SYSTEM_MANAGED", + "unknown_default_open_api", +} + +func (v *PartialUpdateServiceAccountKeyResponseKeyType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateServiceAccountKeyResponseKeyType(value) + for _, existing := range AllowedPartialUpdateServiceAccountKeyResponseKeyTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATESERVICEACCOUNTKEYRESPONSEKEYTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateServiceAccountKeyResponseKeyTypeFromValue returns a pointer to a valid PartialUpdateServiceAccountKeyResponseKeyType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateServiceAccountKeyResponseKeyTypeFromValue(v string) (*PartialUpdateServiceAccountKeyResponseKeyType, error) { + ev := PartialUpdateServiceAccountKeyResponseKeyType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateServiceAccountKeyResponseKeyType: valid values are %v", v, AllowedPartialUpdateServiceAccountKeyResponseKeyTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateServiceAccountKeyResponseKeyType) IsValid() bool { + for _, existing := range AllowedPartialUpdateServiceAccountKeyResponseKeyTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateServiceAccountKeyResponse_keyType value +func (v PartialUpdateServiceAccountKeyResponseKeyType) Ptr() *PartialUpdateServiceAccountKeyResponseKeyType { + return &v +} + +type NullablePartialUpdateServiceAccountKeyResponseKeyType struct { + value *PartialUpdateServiceAccountKeyResponseKeyType + isSet bool +} + +func (v NullablePartialUpdateServiceAccountKeyResponseKeyType) Get() *PartialUpdateServiceAccountKeyResponseKeyType { + return v.value +} + +func (v *NullablePartialUpdateServiceAccountKeyResponseKeyType) Set(val *PartialUpdateServiceAccountKeyResponseKeyType) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateServiceAccountKeyResponseKeyType) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateServiceAccountKeyResponseKeyType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateServiceAccountKeyResponseKeyType(val *PartialUpdateServiceAccountKeyResponseKeyType) *NullablePartialUpdateServiceAccountKeyResponseKeyType { + return &NullablePartialUpdateServiceAccountKeyResponseKeyType{value: val, isSet: true} +} + +func (v NullablePartialUpdateServiceAccountKeyResponseKeyType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateServiceAccountKeyResponseKeyType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_service_account_key_list_response.go b/services/serviceaccount/v2api/model_service_account_key_list_response.go index 85d74c04f..fc1142242 100644 --- a/services/serviceaccount/v2api/model_service_account_key_list_response.go +++ b/services/serviceaccount/v2api/model_service_account_key_list_response.go @@ -25,10 +25,10 @@ type ServiceAccountKeyListResponse struct { // Creation time of the key CreatedAt time.Time `json:"createdAt"` // Unique ID of the key. - Id string `json:"id"` - KeyAlgorithm string `json:"keyAlgorithm"` - KeyOrigin string `json:"keyOrigin"` - KeyType string `json:"keyType"` + Id string `json:"id"` + KeyAlgorithm ServiceAccountKeyListResponseKeyAlgorithm `json:"keyAlgorithm"` + KeyOrigin ServiceAccountKeyListResponseKeyOrigin `json:"keyOrigin"` + KeyType ServiceAccountKeyListResponseKeyType `json:"keyType"` // If specified, the timestamp until the key is active. May be null ValidUntil *time.Time `json:"validUntil,omitempty"` AdditionalProperties map[string]interface{} @@ -40,7 +40,7 @@ type _ServiceAccountKeyListResponse ServiceAccountKeyListResponse // 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 NewServiceAccountKeyListResponse(active bool, createdAt time.Time, id string, keyAlgorithm string, keyOrigin string, keyType string) *ServiceAccountKeyListResponse { +func NewServiceAccountKeyListResponse(active bool, createdAt time.Time, id string, keyAlgorithm ServiceAccountKeyListResponseKeyAlgorithm, keyOrigin ServiceAccountKeyListResponseKeyOrigin, keyType ServiceAccountKeyListResponseKeyType) *ServiceAccountKeyListResponse { this := ServiceAccountKeyListResponse{} this.Active = active this.CreatedAt = createdAt @@ -132,9 +132,9 @@ func (o *ServiceAccountKeyListResponse) SetId(v string) { } // GetKeyAlgorithm returns the KeyAlgorithm field value -func (o *ServiceAccountKeyListResponse) GetKeyAlgorithm() string { +func (o *ServiceAccountKeyListResponse) GetKeyAlgorithm() ServiceAccountKeyListResponseKeyAlgorithm { if o == nil { - var ret string + var ret ServiceAccountKeyListResponseKeyAlgorithm return ret } @@ -143,7 +143,7 @@ func (o *ServiceAccountKeyListResponse) GetKeyAlgorithm() string { // GetKeyAlgorithmOk returns a tuple with the KeyAlgorithm field value // and a boolean to check if the value has been set. -func (o *ServiceAccountKeyListResponse) GetKeyAlgorithmOk() (*string, bool) { +func (o *ServiceAccountKeyListResponse) GetKeyAlgorithmOk() (*ServiceAccountKeyListResponseKeyAlgorithm, bool) { if o == nil { return nil, false } @@ -151,14 +151,14 @@ func (o *ServiceAccountKeyListResponse) GetKeyAlgorithmOk() (*string, bool) { } // SetKeyAlgorithm sets field value -func (o *ServiceAccountKeyListResponse) SetKeyAlgorithm(v string) { +func (o *ServiceAccountKeyListResponse) SetKeyAlgorithm(v ServiceAccountKeyListResponseKeyAlgorithm) { o.KeyAlgorithm = v } // GetKeyOrigin returns the KeyOrigin field value -func (o *ServiceAccountKeyListResponse) GetKeyOrigin() string { +func (o *ServiceAccountKeyListResponse) GetKeyOrigin() ServiceAccountKeyListResponseKeyOrigin { if o == nil { - var ret string + var ret ServiceAccountKeyListResponseKeyOrigin return ret } @@ -167,7 +167,7 @@ func (o *ServiceAccountKeyListResponse) GetKeyOrigin() string { // GetKeyOriginOk returns a tuple with the KeyOrigin field value // and a boolean to check if the value has been set. -func (o *ServiceAccountKeyListResponse) GetKeyOriginOk() (*string, bool) { +func (o *ServiceAccountKeyListResponse) GetKeyOriginOk() (*ServiceAccountKeyListResponseKeyOrigin, bool) { if o == nil { return nil, false } @@ -175,14 +175,14 @@ func (o *ServiceAccountKeyListResponse) GetKeyOriginOk() (*string, bool) { } // SetKeyOrigin sets field value -func (o *ServiceAccountKeyListResponse) SetKeyOrigin(v string) { +func (o *ServiceAccountKeyListResponse) SetKeyOrigin(v ServiceAccountKeyListResponseKeyOrigin) { o.KeyOrigin = v } // GetKeyType returns the KeyType field value -func (o *ServiceAccountKeyListResponse) GetKeyType() string { +func (o *ServiceAccountKeyListResponse) GetKeyType() ServiceAccountKeyListResponseKeyType { if o == nil { - var ret string + var ret ServiceAccountKeyListResponseKeyType return ret } @@ -191,7 +191,7 @@ func (o *ServiceAccountKeyListResponse) GetKeyType() string { // GetKeyTypeOk returns a tuple with the KeyType field value // and a boolean to check if the value has been set. -func (o *ServiceAccountKeyListResponse) GetKeyTypeOk() (*string, bool) { +func (o *ServiceAccountKeyListResponse) GetKeyTypeOk() (*ServiceAccountKeyListResponseKeyType, bool) { if o == nil { return nil, false } @@ -199,7 +199,7 @@ func (o *ServiceAccountKeyListResponse) GetKeyTypeOk() (*string, bool) { } // SetKeyType sets field value -func (o *ServiceAccountKeyListResponse) SetKeyType(v string) { +func (o *ServiceAccountKeyListResponse) SetKeyType(v ServiceAccountKeyListResponseKeyType) { o.KeyType = v } diff --git a/services/serviceaccount/v2api/model_service_account_key_list_response_key_algorithm.go b/services/serviceaccount/v2api/model_service_account_key_list_response_key_algorithm.go new file mode 100644 index 000000000..dc05d7a11 --- /dev/null +++ b/services/serviceaccount/v2api/model_service_account_key_list_response_key_algorithm.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ServiceAccountKeyListResponseKeyAlgorithm the model 'ServiceAccountKeyListResponseKeyAlgorithm' +type ServiceAccountKeyListResponseKeyAlgorithm string + +// List of ServiceAccountKeyListResponse_keyAlgorithm +const ( + SERVICEACCOUNTKEYLISTRESPONSEKEYALGORITHM_RSA_2048 ServiceAccountKeyListResponseKeyAlgorithm = "RSA_2048" + SERVICEACCOUNTKEYLISTRESPONSEKEYALGORITHM_RSA_4096 ServiceAccountKeyListResponseKeyAlgorithm = "RSA_4096" + SERVICEACCOUNTKEYLISTRESPONSEKEYALGORITHM_UNKNOWN_DEFAULT_OPEN_API ServiceAccountKeyListResponseKeyAlgorithm = "unknown_default_open_api" +) + +// All allowed values of ServiceAccountKeyListResponseKeyAlgorithm enum +var AllowedServiceAccountKeyListResponseKeyAlgorithmEnumValues = []ServiceAccountKeyListResponseKeyAlgorithm{ + "RSA_2048", + "RSA_4096", + "unknown_default_open_api", +} + +func (v *ServiceAccountKeyListResponseKeyAlgorithm) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceAccountKeyListResponseKeyAlgorithm(value) + for _, existing := range AllowedServiceAccountKeyListResponseKeyAlgorithmEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICEACCOUNTKEYLISTRESPONSEKEYALGORITHM_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceAccountKeyListResponseKeyAlgorithmFromValue returns a pointer to a valid ServiceAccountKeyListResponseKeyAlgorithm +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceAccountKeyListResponseKeyAlgorithmFromValue(v string) (*ServiceAccountKeyListResponseKeyAlgorithm, error) { + ev := ServiceAccountKeyListResponseKeyAlgorithm(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceAccountKeyListResponseKeyAlgorithm: valid values are %v", v, AllowedServiceAccountKeyListResponseKeyAlgorithmEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceAccountKeyListResponseKeyAlgorithm) IsValid() bool { + for _, existing := range AllowedServiceAccountKeyListResponseKeyAlgorithmEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceAccountKeyListResponse_keyAlgorithm value +func (v ServiceAccountKeyListResponseKeyAlgorithm) Ptr() *ServiceAccountKeyListResponseKeyAlgorithm { + return &v +} + +type NullableServiceAccountKeyListResponseKeyAlgorithm struct { + value *ServiceAccountKeyListResponseKeyAlgorithm + isSet bool +} + +func (v NullableServiceAccountKeyListResponseKeyAlgorithm) Get() *ServiceAccountKeyListResponseKeyAlgorithm { + return v.value +} + +func (v *NullableServiceAccountKeyListResponseKeyAlgorithm) Set(val *ServiceAccountKeyListResponseKeyAlgorithm) { + v.value = val + v.isSet = true +} + +func (v NullableServiceAccountKeyListResponseKeyAlgorithm) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceAccountKeyListResponseKeyAlgorithm) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceAccountKeyListResponseKeyAlgorithm(val *ServiceAccountKeyListResponseKeyAlgorithm) *NullableServiceAccountKeyListResponseKeyAlgorithm { + return &NullableServiceAccountKeyListResponseKeyAlgorithm{value: val, isSet: true} +} + +func (v NullableServiceAccountKeyListResponseKeyAlgorithm) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceAccountKeyListResponseKeyAlgorithm) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_service_account_key_list_response_key_origin.go b/services/serviceaccount/v2api/model_service_account_key_list_response_key_origin.go new file mode 100644 index 000000000..ace217fea --- /dev/null +++ b/services/serviceaccount/v2api/model_service_account_key_list_response_key_origin.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ServiceAccountKeyListResponseKeyOrigin the model 'ServiceAccountKeyListResponseKeyOrigin' +type ServiceAccountKeyListResponseKeyOrigin string + +// List of ServiceAccountKeyListResponse_keyOrigin +const ( + SERVICEACCOUNTKEYLISTRESPONSEKEYORIGIN_USER_PROVIDED ServiceAccountKeyListResponseKeyOrigin = "USER_PROVIDED" + SERVICEACCOUNTKEYLISTRESPONSEKEYORIGIN_GENERATED ServiceAccountKeyListResponseKeyOrigin = "GENERATED" + SERVICEACCOUNTKEYLISTRESPONSEKEYORIGIN_UNKNOWN_DEFAULT_OPEN_API ServiceAccountKeyListResponseKeyOrigin = "unknown_default_open_api" +) + +// All allowed values of ServiceAccountKeyListResponseKeyOrigin enum +var AllowedServiceAccountKeyListResponseKeyOriginEnumValues = []ServiceAccountKeyListResponseKeyOrigin{ + "USER_PROVIDED", + "GENERATED", + "unknown_default_open_api", +} + +func (v *ServiceAccountKeyListResponseKeyOrigin) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceAccountKeyListResponseKeyOrigin(value) + for _, existing := range AllowedServiceAccountKeyListResponseKeyOriginEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICEACCOUNTKEYLISTRESPONSEKEYORIGIN_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceAccountKeyListResponseKeyOriginFromValue returns a pointer to a valid ServiceAccountKeyListResponseKeyOrigin +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceAccountKeyListResponseKeyOriginFromValue(v string) (*ServiceAccountKeyListResponseKeyOrigin, error) { + ev := ServiceAccountKeyListResponseKeyOrigin(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceAccountKeyListResponseKeyOrigin: valid values are %v", v, AllowedServiceAccountKeyListResponseKeyOriginEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceAccountKeyListResponseKeyOrigin) IsValid() bool { + for _, existing := range AllowedServiceAccountKeyListResponseKeyOriginEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceAccountKeyListResponse_keyOrigin value +func (v ServiceAccountKeyListResponseKeyOrigin) Ptr() *ServiceAccountKeyListResponseKeyOrigin { + return &v +} + +type NullableServiceAccountKeyListResponseKeyOrigin struct { + value *ServiceAccountKeyListResponseKeyOrigin + isSet bool +} + +func (v NullableServiceAccountKeyListResponseKeyOrigin) Get() *ServiceAccountKeyListResponseKeyOrigin { + return v.value +} + +func (v *NullableServiceAccountKeyListResponseKeyOrigin) Set(val *ServiceAccountKeyListResponseKeyOrigin) { + v.value = val + v.isSet = true +} + +func (v NullableServiceAccountKeyListResponseKeyOrigin) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceAccountKeyListResponseKeyOrigin) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceAccountKeyListResponseKeyOrigin(val *ServiceAccountKeyListResponseKeyOrigin) *NullableServiceAccountKeyListResponseKeyOrigin { + return &NullableServiceAccountKeyListResponseKeyOrigin{value: val, isSet: true} +} + +func (v NullableServiceAccountKeyListResponseKeyOrigin) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceAccountKeyListResponseKeyOrigin) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceaccount/v2api/model_service_account_key_list_response_key_type.go b/services/serviceaccount/v2api/model_service_account_key_list_response_key_type.go new file mode 100644 index 000000000..90a93e429 --- /dev/null +++ b/services/serviceaccount/v2api/model_service_account_key_list_response_key_type.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Account API + +API to manage Service Accounts and their Access Tokens. ### System for Cross-domain Identity Management (SCIM) Service Account Service offers SCIM APIs to query state. The SCIM protocol was created as standard for automating the exchange of user identity information between identity domains, or IT systems. Service accounts are be handled as indentites similar to SCIM users. A custom SCIM schema has been created: `/ServiceAccounts` #### Syntax ##### Attribute operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | eq | equal | | ne | not equal | | co | contains | | sw | starts with | | ew | ends with | ##### Logical operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | and | logical \"and\" | | or | logical \"or\" | ##### Grouping operators | OPERATOR | DESCRIPTION | |----------|--------------------------| | () | precending grouping | ##### Example ``` filter=email eq \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email ne \"my-service-account-aBc2defg@sa.stackit.cloud\" filter=email co \"my-service-account\" filter=name sw \"my\" filter=name ew \"account\" filter=email co \"my-service-account\" and name sw \"my\" filter=email co \"my-service-account\" and (name sw \"my\" or name ew \"account\") ``` #### Sorting > Sorting is optional | PARAMETER | DESCRIPTION | |-----------|--------------------------------------| | sortBy | attribute response is ordered by | | sortOrder | 'ASCENDING' (default) or 'DESCENDING'| #### Pagination | PARAMETER | DESCRIPTION | |--------------|----------------------------------------------| | startIndex | index of first query result, default: 1 | | count | maximum number of query results, default: 100| + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ServiceAccountKeyListResponseKeyType the model 'ServiceAccountKeyListResponseKeyType' +type ServiceAccountKeyListResponseKeyType string + +// List of ServiceAccountKeyListResponse_keyType +const ( + SERVICEACCOUNTKEYLISTRESPONSEKEYTYPE_USER_MANAGED ServiceAccountKeyListResponseKeyType = "USER_MANAGED" + SERVICEACCOUNTKEYLISTRESPONSEKEYTYPE_SYSTEM_MANAGED ServiceAccountKeyListResponseKeyType = "SYSTEM_MANAGED" + SERVICEACCOUNTKEYLISTRESPONSEKEYTYPE_UNKNOWN_DEFAULT_OPEN_API ServiceAccountKeyListResponseKeyType = "unknown_default_open_api" +) + +// All allowed values of ServiceAccountKeyListResponseKeyType enum +var AllowedServiceAccountKeyListResponseKeyTypeEnumValues = []ServiceAccountKeyListResponseKeyType{ + "USER_MANAGED", + "SYSTEM_MANAGED", + "unknown_default_open_api", +} + +func (v *ServiceAccountKeyListResponseKeyType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceAccountKeyListResponseKeyType(value) + for _, existing := range AllowedServiceAccountKeyListResponseKeyTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICEACCOUNTKEYLISTRESPONSEKEYTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceAccountKeyListResponseKeyTypeFromValue returns a pointer to a valid ServiceAccountKeyListResponseKeyType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceAccountKeyListResponseKeyTypeFromValue(v string) (*ServiceAccountKeyListResponseKeyType, error) { + ev := ServiceAccountKeyListResponseKeyType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceAccountKeyListResponseKeyType: valid values are %v", v, AllowedServiceAccountKeyListResponseKeyTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceAccountKeyListResponseKeyType) IsValid() bool { + for _, existing := range AllowedServiceAccountKeyListResponseKeyTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceAccountKeyListResponse_keyType value +func (v ServiceAccountKeyListResponseKeyType) Ptr() *ServiceAccountKeyListResponseKeyType { + return &v +} + +type NullableServiceAccountKeyListResponseKeyType struct { + value *ServiceAccountKeyListResponseKeyType + isSet bool +} + +func (v NullableServiceAccountKeyListResponseKeyType) Get() *ServiceAccountKeyListResponseKeyType { + return v.value +} + +func (v *NullableServiceAccountKeyListResponseKeyType) Set(val *ServiceAccountKeyListResponseKeyType) { + v.value = val + v.isSet = true +} + +func (v NullableServiceAccountKeyListResponseKeyType) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceAccountKeyListResponseKeyType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceAccountKeyListResponseKeyType(val *ServiceAccountKeyListResponseKeyType) *NullableServiceAccountKeyListResponseKeyType { + return &NullableServiceAccountKeyListResponseKeyType{value: val, isSet: true} +} + +func (v NullableServiceAccountKeyListResponseKeyType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceAccountKeyListResponseKeyType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From fab5a1aba8df027ec13a3ed3e25300ac8e6bb488 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 14:04:30 +0200 Subject: [PATCH 48/66] chore(serviceaccount): write changelog, bump version --- CHANGELOG.md | 2 ++ services/serviceaccount/CHANGELOG.md | 3 +++ services/serviceaccount/VERSION | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e13420c0..481e8c270 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -423,6 +423,8 @@ - **Feature:**: New API client method `GetFederatedIdentityProvider` - Deprecated SDK layer in root of the module: - **Feature:**: New API client method `GetFederatedIdentityProvider` + - [v0.20.0](services/serviceaccount/CHANGELOG.md#v0200) + - **Feature:** Introduce enums for various attributes - `serviceenablement`: - [v1.4.3](services/serviceenablement/CHANGELOG.md#v143) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/serviceaccount/CHANGELOG.md b/services/serviceaccount/CHANGELOG.md index 5b0c4376f..10638f2f9 100644 --- a/services/serviceaccount/CHANGELOG.md +++ b/services/serviceaccount/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.20.0 +- **Feature:** Introduce enums for various attributes + ## v0.19.0 - `v2api`: - **Feature:**: New API client method `GetFederatedIdentityProvider` diff --git a/services/serviceaccount/VERSION b/services/serviceaccount/VERSION index 96fb87f8e..1847373e9 100644 --- a/services/serviceaccount/VERSION +++ b/services/serviceaccount/VERSION @@ -1 +1 @@ -v0.19.0 +v0.20.0 From 8c1f2dcf332f49585ab5c9c3c826fd1cd4b2a559 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 14:05:30 +0200 Subject: [PATCH 49/66] refac(serviceenablement): introduce inline enums --- .../v1api/model_action_error.go | 13 +- .../v1api/model_action_error_action.go | 113 +++++++++++++++++ .../v1api/model_cloud_service.go | 16 +-- .../v1api/model_cloud_service_scope.go | 113 +++++++++++++++++ .../v1api/model_parameters_general.go | 20 +-- .../model_parameters_general_project_scope.go | 113 +++++++++++++++++ .../v1api/model_service_status.go | 75 ++++++----- .../v1api/model_service_status_enablement.go | 113 +++++++++++++++++ .../v1api/model_service_status_lifecycle.go | 113 +++++++++++++++++ .../v1api/model_service_status_scope.go | 113 +++++++++++++++++ .../v1api/model_service_status_state.go | 117 ++++++++++++++++++ .../v2api/model_action_error.go | 13 +- .../v2api/model_action_error_action.go | 113 +++++++++++++++++ .../v2api/model_check_service.go | 18 +-- .../model_check_service_resource_type.go | 111 +++++++++++++++++ .../v2api/model_cloud_service.go | 16 +-- .../v2api/model_cloud_service_scope.go | 113 +++++++++++++++++ .../v2api/model_parameters_general.go | 20 +-- .../model_parameters_general_project_scope.go | 113 +++++++++++++++++ .../v2api/model_service_status.go | 75 ++++++----- .../v2api/model_service_status_enablement.go | 113 +++++++++++++++++ .../v2api/model_service_status_lifecycle.go | 113 +++++++++++++++++ .../v2api/model_service_status_scope.go | 113 +++++++++++++++++ .../v2api/model_service_status_state.go | 117 ++++++++++++++++++ 24 files changed, 1832 insertions(+), 135 deletions(-) create mode 100644 services/serviceenablement/v1api/model_action_error_action.go create mode 100644 services/serviceenablement/v1api/model_cloud_service_scope.go create mode 100644 services/serviceenablement/v1api/model_parameters_general_project_scope.go create mode 100644 services/serviceenablement/v1api/model_service_status_enablement.go create mode 100644 services/serviceenablement/v1api/model_service_status_lifecycle.go create mode 100644 services/serviceenablement/v1api/model_service_status_scope.go create mode 100644 services/serviceenablement/v1api/model_service_status_state.go create mode 100644 services/serviceenablement/v2api/model_action_error_action.go create mode 100644 services/serviceenablement/v2api/model_check_service_resource_type.go create mode 100644 services/serviceenablement/v2api/model_cloud_service_scope.go create mode 100644 services/serviceenablement/v2api/model_parameters_general_project_scope.go create mode 100644 services/serviceenablement/v2api/model_service_status_enablement.go create mode 100644 services/serviceenablement/v2api/model_service_status_lifecycle.go create mode 100644 services/serviceenablement/v2api/model_service_status_scope.go create mode 100644 services/serviceenablement/v2api/model_service_status_state.go diff --git a/services/serviceenablement/v1api/model_action_error.go b/services/serviceenablement/v1api/model_action_error.go index 6d78948f4..e2458fac0 100644 --- a/services/serviceenablement/v1api/model_action_error.go +++ b/services/serviceenablement/v1api/model_action_error.go @@ -19,8 +19,7 @@ var _ MappedNullable = &ActionError{} // ActionError the last error for this service. type ActionError struct { - // the last action which was triggered on this service - Action *string `json:"action,omitempty"` + Action *ActionErrorAction `json:"action,omitempty"` // the error code if provided by the service Code *string `json:"code,omitempty"` // the error reason provided by the service @@ -48,9 +47,9 @@ func NewActionErrorWithDefaults() *ActionError { } // GetAction returns the Action field value if set, zero value otherwise. -func (o *ActionError) GetAction() string { +func (o *ActionError) GetAction() ActionErrorAction { if o == nil || IsNil(o.Action) { - var ret string + var ret ActionErrorAction return ret } return *o.Action @@ -58,7 +57,7 @@ func (o *ActionError) GetAction() string { // GetActionOk returns a tuple with the Action field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ActionError) GetActionOk() (*string, bool) { +func (o *ActionError) GetActionOk() (*ActionErrorAction, bool) { if o == nil || IsNil(o.Action) { return nil, false } @@ -74,8 +73,8 @@ func (o *ActionError) HasAction() bool { return false } -// SetAction gets a reference to the given string and assigns it to the Action field. -func (o *ActionError) SetAction(v string) { +// SetAction gets a reference to the given ActionErrorAction and assigns it to the Action field. +func (o *ActionError) SetAction(v ActionErrorAction) { o.Action = &v } diff --git a/services/serviceenablement/v1api/model_action_error_action.go b/services/serviceenablement/v1api/model_action_error_action.go new file mode 100644 index 000000000..761a8b772 --- /dev/null +++ b/services/serviceenablement/v1api/model_action_error_action.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ActionErrorAction the last action which was triggered on this service +type ActionErrorAction string + +// List of ActionError_action +const ( + ACTIONERRORACTION_DISABLE ActionErrorAction = "DISABLE" + ACTIONERRORACTION_ENABLE ActionErrorAction = "ENABLE" + ACTIONERRORACTION_UNKNOWN_DEFAULT_OPEN_API ActionErrorAction = "unknown_default_open_api" +) + +// All allowed values of ActionErrorAction enum +var AllowedActionErrorActionEnumValues = []ActionErrorAction{ + "DISABLE", + "ENABLE", + "unknown_default_open_api", +} + +func (v *ActionErrorAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ActionErrorAction(value) + for _, existing := range AllowedActionErrorActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ACTIONERRORACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewActionErrorActionFromValue returns a pointer to a valid ActionErrorAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewActionErrorActionFromValue(v string) (*ActionErrorAction, error) { + ev := ActionErrorAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ActionErrorAction: valid values are %v", v, AllowedActionErrorActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ActionErrorAction) IsValid() bool { + for _, existing := range AllowedActionErrorActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ActionError_action value +func (v ActionErrorAction) Ptr() *ActionErrorAction { + return &v +} + +type NullableActionErrorAction struct { + value *ActionErrorAction + isSet bool +} + +func (v NullableActionErrorAction) Get() *ActionErrorAction { + return v.value +} + +func (v *NullableActionErrorAction) Set(val *ActionErrorAction) { + v.value = val + v.isSet = true +} + +func (v NullableActionErrorAction) IsSet() bool { + return v.isSet +} + +func (v *NullableActionErrorAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActionErrorAction(val *ActionErrorAction) *NullableActionErrorAction { + return &NullableActionErrorAction{value: val, isSet: true} +} + +func (v NullableActionErrorAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActionErrorAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v1api/model_cloud_service.go b/services/serviceenablement/v1api/model_cloud_service.go index 5c7a82adf..1d4dbf6ae 100644 --- a/services/serviceenablement/v1api/model_cloud_service.go +++ b/services/serviceenablement/v1api/model_cloud_service.go @@ -21,7 +21,7 @@ var _ MappedNullable = &CloudService{} type CloudService struct { Dependencies *Dependencies `json:"dependencies,omitempty"` Labels *map[string]string `json:"labels,omitempty"` - Scope *string `json:"scope,omitempty"` + Scope *CloudServiceScope `json:"scope,omitempty"` // the id of the service ServiceId *string `json:"serviceId,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$"` AdditionalProperties map[string]interface{} @@ -35,7 +35,7 @@ type _CloudService CloudService // will change when the set of required properties is changed func NewCloudService() *CloudService { this := CloudService{} - var scope string = "PUBLIC" + var scope CloudServiceScope = CLOUDSERVICESCOPE_PUBLIC this.Scope = &scope return &this } @@ -45,7 +45,7 @@ func NewCloudService() *CloudService { // but it doesn't guarantee that properties required by API are set func NewCloudServiceWithDefaults() *CloudService { this := CloudService{} - var scope string = "PUBLIC" + var scope CloudServiceScope = CLOUDSERVICESCOPE_PUBLIC this.Scope = &scope return &this } @@ -115,9 +115,9 @@ func (o *CloudService) SetLabels(v map[string]string) { } // GetScope returns the Scope field value if set, zero value otherwise. -func (o *CloudService) GetScope() string { +func (o *CloudService) GetScope() CloudServiceScope { if o == nil || IsNil(o.Scope) { - var ret string + var ret CloudServiceScope return ret } return *o.Scope @@ -125,7 +125,7 @@ func (o *CloudService) GetScope() string { // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CloudService) GetScopeOk() (*string, bool) { +func (o *CloudService) GetScopeOk() (*CloudServiceScope, bool) { if o == nil || IsNil(o.Scope) { return nil, false } @@ -141,8 +141,8 @@ func (o *CloudService) HasScope() bool { return false } -// SetScope gets a reference to the given string and assigns it to the Scope field. -func (o *CloudService) SetScope(v string) { +// SetScope gets a reference to the given CloudServiceScope and assigns it to the Scope field. +func (o *CloudService) SetScope(v CloudServiceScope) { o.Scope = &v } diff --git a/services/serviceenablement/v1api/model_cloud_service_scope.go b/services/serviceenablement/v1api/model_cloud_service_scope.go new file mode 100644 index 000000000..1a0a08d6a --- /dev/null +++ b/services/serviceenablement/v1api/model_cloud_service_scope.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CloudServiceScope the model 'CloudServiceScope' +type CloudServiceScope string + +// List of CloudService_scope +const ( + CLOUDSERVICESCOPE_PRIVATE CloudServiceScope = "PRIVATE" + CLOUDSERVICESCOPE_PUBLIC CloudServiceScope = "PUBLIC" + CLOUDSERVICESCOPE_UNKNOWN_DEFAULT_OPEN_API CloudServiceScope = "unknown_default_open_api" +) + +// All allowed values of CloudServiceScope enum +var AllowedCloudServiceScopeEnumValues = []CloudServiceScope{ + "PRIVATE", + "PUBLIC", + "unknown_default_open_api", +} + +func (v *CloudServiceScope) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CloudServiceScope(value) + for _, existing := range AllowedCloudServiceScopeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CLOUDSERVICESCOPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCloudServiceScopeFromValue returns a pointer to a valid CloudServiceScope +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCloudServiceScopeFromValue(v string) (*CloudServiceScope, error) { + ev := CloudServiceScope(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CloudServiceScope: valid values are %v", v, AllowedCloudServiceScopeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CloudServiceScope) IsValid() bool { + for _, existing := range AllowedCloudServiceScopeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CloudService_scope value +func (v CloudServiceScope) Ptr() *CloudServiceScope { + return &v +} + +type NullableCloudServiceScope struct { + value *CloudServiceScope + isSet bool +} + +func (v NullableCloudServiceScope) Get() *CloudServiceScope { + return v.value +} + +func (v *NullableCloudServiceScope) Set(val *CloudServiceScope) { + v.value = val + v.isSet = true +} + +func (v NullableCloudServiceScope) IsSet() bool { + return v.isSet +} + +func (v *NullableCloudServiceScope) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloudServiceScope(val *CloudServiceScope) *NullableCloudServiceScope { + return &NullableCloudServiceScope{value: val, isSet: true} +} + +func (v NullableCloudServiceScope) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloudServiceScope) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v1api/model_parameters_general.go b/services/serviceenablement/v1api/model_parameters_general.go index 5f3f57569..62e20ae71 100644 --- a/services/serviceenablement/v1api/model_parameters_general.go +++ b/services/serviceenablement/v1api/model_parameters_general.go @@ -19,9 +19,9 @@ var _ MappedNullable = &ParametersGeneral{} // ParametersGeneral struct for ParametersGeneral type ParametersGeneral struct { - OrganizationId *string `json:"organizationId,omitempty"` - ProjectName *string `json:"projectName,omitempty"` - ProjectScope *string `json:"projectScope,omitempty"` + OrganizationId *string `json:"organizationId,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + ProjectScope *ParametersGeneralProjectScope `json:"projectScope,omitempty"` AdditionalProperties map[string]interface{} } @@ -33,7 +33,7 @@ type _ParametersGeneral ParametersGeneral // will change when the set of required properties is changed func NewParametersGeneral() *ParametersGeneral { this := ParametersGeneral{} - var projectScope string = "PUBLIC" + var projectScope ParametersGeneralProjectScope = PARAMETERSGENERALPROJECTSCOPE_PUBLIC this.ProjectScope = &projectScope return &this } @@ -43,7 +43,7 @@ func NewParametersGeneral() *ParametersGeneral { // but it doesn't guarantee that properties required by API are set func NewParametersGeneralWithDefaults() *ParametersGeneral { this := ParametersGeneral{} - var projectScope string = "PUBLIC" + var projectScope ParametersGeneralProjectScope = PARAMETERSGENERALPROJECTSCOPE_PUBLIC this.ProjectScope = &projectScope return &this } @@ -113,9 +113,9 @@ func (o *ParametersGeneral) SetProjectName(v string) { } // GetProjectScope returns the ProjectScope field value if set, zero value otherwise. -func (o *ParametersGeneral) GetProjectScope() string { +func (o *ParametersGeneral) GetProjectScope() ParametersGeneralProjectScope { if o == nil || IsNil(o.ProjectScope) { - var ret string + var ret ParametersGeneralProjectScope return ret } return *o.ProjectScope @@ -123,7 +123,7 @@ func (o *ParametersGeneral) GetProjectScope() string { // GetProjectScopeOk returns a tuple with the ProjectScope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ParametersGeneral) GetProjectScopeOk() (*string, bool) { +func (o *ParametersGeneral) GetProjectScopeOk() (*ParametersGeneralProjectScope, bool) { if o == nil || IsNil(o.ProjectScope) { return nil, false } @@ -139,8 +139,8 @@ func (o *ParametersGeneral) HasProjectScope() bool { return false } -// SetProjectScope gets a reference to the given string and assigns it to the ProjectScope field. -func (o *ParametersGeneral) SetProjectScope(v string) { +// SetProjectScope gets a reference to the given ParametersGeneralProjectScope and assigns it to the ProjectScope field. +func (o *ParametersGeneral) SetProjectScope(v ParametersGeneralProjectScope) { o.ProjectScope = &v } diff --git a/services/serviceenablement/v1api/model_parameters_general_project_scope.go b/services/serviceenablement/v1api/model_parameters_general_project_scope.go new file mode 100644 index 000000000..842ea730e --- /dev/null +++ b/services/serviceenablement/v1api/model_parameters_general_project_scope.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ParametersGeneralProjectScope the model 'ParametersGeneralProjectScope' +type ParametersGeneralProjectScope string + +// List of Parameters_general_projectScope +const ( + PARAMETERSGENERALPROJECTSCOPE_SCHWARZ ParametersGeneralProjectScope = "SCHWARZ" + PARAMETERSGENERALPROJECTSCOPE_PUBLIC ParametersGeneralProjectScope = "PUBLIC" + PARAMETERSGENERALPROJECTSCOPE_UNKNOWN_DEFAULT_OPEN_API ParametersGeneralProjectScope = "unknown_default_open_api" +) + +// All allowed values of ParametersGeneralProjectScope enum +var AllowedParametersGeneralProjectScopeEnumValues = []ParametersGeneralProjectScope{ + "SCHWARZ", + "PUBLIC", + "unknown_default_open_api", +} + +func (v *ParametersGeneralProjectScope) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ParametersGeneralProjectScope(value) + for _, existing := range AllowedParametersGeneralProjectScopeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARAMETERSGENERALPROJECTSCOPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewParametersGeneralProjectScopeFromValue returns a pointer to a valid ParametersGeneralProjectScope +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewParametersGeneralProjectScopeFromValue(v string) (*ParametersGeneralProjectScope, error) { + ev := ParametersGeneralProjectScope(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ParametersGeneralProjectScope: valid values are %v", v, AllowedParametersGeneralProjectScopeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ParametersGeneralProjectScope) IsValid() bool { + for _, existing := range AllowedParametersGeneralProjectScopeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Parameters_general_projectScope value +func (v ParametersGeneralProjectScope) Ptr() *ParametersGeneralProjectScope { + return &v +} + +type NullableParametersGeneralProjectScope struct { + value *ParametersGeneralProjectScope + isSet bool +} + +func (v NullableParametersGeneralProjectScope) Get() *ParametersGeneralProjectScope { + return v.value +} + +func (v *NullableParametersGeneralProjectScope) Set(val *ParametersGeneralProjectScope) { + v.value = val + v.isSet = true +} + +func (v NullableParametersGeneralProjectScope) IsSet() bool { + return v.isSet +} + +func (v *NullableParametersGeneralProjectScope) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParametersGeneralProjectScope(val *ParametersGeneralProjectScope) *NullableParametersGeneralProjectScope { + return &NullableParametersGeneralProjectScope{value: val, isSet: true} +} + +func (v NullableParametersGeneralProjectScope) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParametersGeneralProjectScope) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v1api/model_service_status.go b/services/serviceenablement/v1api/model_service_status.go index c7cef8737..3bdb6f485 100644 --- a/services/serviceenablement/v1api/model_service_status.go +++ b/services/serviceenablement/v1api/model_service_status.go @@ -19,17 +19,16 @@ var _ MappedNullable = &ServiceStatus{} // ServiceStatus struct for ServiceStatus type ServiceStatus struct { - Dependencies *Dependencies `json:"dependencies,omitempty"` - Enablement *string `json:"enablement,omitempty"` - Error *ActionError `json:"error,omitempty"` - Labels *map[string]string `json:"labels,omitempty"` - Lifecycle *string `json:"lifecycle,omitempty"` - Parameters *Parameters `json:"parameters,omitempty"` - Scope *string `json:"scope,omitempty"` + Dependencies *Dependencies `json:"dependencies,omitempty"` + Enablement *ServiceStatusEnablement `json:"enablement,omitempty"` + Error *ActionError `json:"error,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + Lifecycle *ServiceStatusLifecycle `json:"lifecycle,omitempty"` + Parameters *Parameters `json:"parameters,omitempty"` + Scope *ServiceStatusScope `json:"scope,omitempty"` // the id of the service - ServiceId *string `json:"serviceId,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$"` - // the state of a service within a project - State *string `json:"state,omitempty"` + ServiceId *string `json:"serviceId,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$"` + State *ServiceStatusState `json:"state,omitempty"` AdditionalProperties map[string]interface{} } @@ -41,13 +40,13 @@ type _ServiceStatus ServiceStatus // will change when the set of required properties is changed func NewServiceStatus() *ServiceStatus { this := ServiceStatus{} - var enablement string = "REQUEST" + var enablement ServiceStatusEnablement = SERVICESTATUSENABLEMENT_REQUEST this.Enablement = &enablement - var lifecycle string = "FLEX" + var lifecycle ServiceStatusLifecycle = SERVICESTATUSLIFECYCLE_FLEX this.Lifecycle = &lifecycle - var scope string = "PUBLIC" + var scope ServiceStatusScope = SERVICESTATUSSCOPE_PUBLIC this.Scope = &scope - var state string = "ENABLED" + var state ServiceStatusState = SERVICESTATUSSTATE_ENABLED this.State = &state return &this } @@ -57,13 +56,13 @@ func NewServiceStatus() *ServiceStatus { // but it doesn't guarantee that properties required by API are set func NewServiceStatusWithDefaults() *ServiceStatus { this := ServiceStatus{} - var enablement string = "REQUEST" + var enablement ServiceStatusEnablement = SERVICESTATUSENABLEMENT_REQUEST this.Enablement = &enablement - var lifecycle string = "FLEX" + var lifecycle ServiceStatusLifecycle = SERVICESTATUSLIFECYCLE_FLEX this.Lifecycle = &lifecycle - var scope string = "PUBLIC" + var scope ServiceStatusScope = SERVICESTATUSSCOPE_PUBLIC this.Scope = &scope - var state string = "ENABLED" + var state ServiceStatusState = SERVICESTATUSSTATE_ENABLED this.State = &state return &this } @@ -101,9 +100,9 @@ func (o *ServiceStatus) SetDependencies(v Dependencies) { } // GetEnablement returns the Enablement field value if set, zero value otherwise. -func (o *ServiceStatus) GetEnablement() string { +func (o *ServiceStatus) GetEnablement() ServiceStatusEnablement { if o == nil || IsNil(o.Enablement) { - var ret string + var ret ServiceStatusEnablement return ret } return *o.Enablement @@ -111,7 +110,7 @@ func (o *ServiceStatus) GetEnablement() string { // GetEnablementOk returns a tuple with the Enablement field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetEnablementOk() (*string, bool) { +func (o *ServiceStatus) GetEnablementOk() (*ServiceStatusEnablement, bool) { if o == nil || IsNil(o.Enablement) { return nil, false } @@ -127,8 +126,8 @@ func (o *ServiceStatus) HasEnablement() bool { return false } -// SetEnablement gets a reference to the given string and assigns it to the Enablement field. -func (o *ServiceStatus) SetEnablement(v string) { +// SetEnablement gets a reference to the given ServiceStatusEnablement and assigns it to the Enablement field. +func (o *ServiceStatus) SetEnablement(v ServiceStatusEnablement) { o.Enablement = &v } @@ -197,9 +196,9 @@ func (o *ServiceStatus) SetLabels(v map[string]string) { } // GetLifecycle returns the Lifecycle field value if set, zero value otherwise. -func (o *ServiceStatus) GetLifecycle() string { +func (o *ServiceStatus) GetLifecycle() ServiceStatusLifecycle { if o == nil || IsNil(o.Lifecycle) { - var ret string + var ret ServiceStatusLifecycle return ret } return *o.Lifecycle @@ -207,7 +206,7 @@ func (o *ServiceStatus) GetLifecycle() string { // GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetLifecycleOk() (*string, bool) { +func (o *ServiceStatus) GetLifecycleOk() (*ServiceStatusLifecycle, bool) { if o == nil || IsNil(o.Lifecycle) { return nil, false } @@ -223,8 +222,8 @@ func (o *ServiceStatus) HasLifecycle() bool { return false } -// SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. -func (o *ServiceStatus) SetLifecycle(v string) { +// SetLifecycle gets a reference to the given ServiceStatusLifecycle and assigns it to the Lifecycle field. +func (o *ServiceStatus) SetLifecycle(v ServiceStatusLifecycle) { o.Lifecycle = &v } @@ -261,9 +260,9 @@ func (o *ServiceStatus) SetParameters(v Parameters) { } // GetScope returns the Scope field value if set, zero value otherwise. -func (o *ServiceStatus) GetScope() string { +func (o *ServiceStatus) GetScope() ServiceStatusScope { if o == nil || IsNil(o.Scope) { - var ret string + var ret ServiceStatusScope return ret } return *o.Scope @@ -271,7 +270,7 @@ func (o *ServiceStatus) GetScope() string { // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetScopeOk() (*string, bool) { +func (o *ServiceStatus) GetScopeOk() (*ServiceStatusScope, bool) { if o == nil || IsNil(o.Scope) { return nil, false } @@ -287,8 +286,8 @@ func (o *ServiceStatus) HasScope() bool { return false } -// SetScope gets a reference to the given string and assigns it to the Scope field. -func (o *ServiceStatus) SetScope(v string) { +// SetScope gets a reference to the given ServiceStatusScope and assigns it to the Scope field. +func (o *ServiceStatus) SetScope(v ServiceStatusScope) { o.Scope = &v } @@ -325,9 +324,9 @@ func (o *ServiceStatus) SetServiceId(v string) { } // GetState returns the State field value if set, zero value otherwise. -func (o *ServiceStatus) GetState() string { +func (o *ServiceStatus) GetState() ServiceStatusState { if o == nil || IsNil(o.State) { - var ret string + var ret ServiceStatusState return ret } return *o.State @@ -335,7 +334,7 @@ func (o *ServiceStatus) 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 *ServiceStatus) GetStateOk() (*string, bool) { +func (o *ServiceStatus) GetStateOk() (*ServiceStatusState, bool) { if o == nil || IsNil(o.State) { return nil, false } @@ -351,8 +350,8 @@ func (o *ServiceStatus) HasState() bool { return false } -// SetState gets a reference to the given string and assigns it to the State field. -func (o *ServiceStatus) SetState(v string) { +// SetState gets a reference to the given ServiceStatusState and assigns it to the State field. +func (o *ServiceStatus) SetState(v ServiceStatusState) { o.State = &v } diff --git a/services/serviceenablement/v1api/model_service_status_enablement.go b/services/serviceenablement/v1api/model_service_status_enablement.go new file mode 100644 index 000000000..48f4e1276 --- /dev/null +++ b/services/serviceenablement/v1api/model_service_status_enablement.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ServiceStatusEnablement the model 'ServiceStatusEnablement' +type ServiceStatusEnablement string + +// List of ServiceStatus_enablement +const ( + SERVICESTATUSENABLEMENT_REQUEST ServiceStatusEnablement = "REQUEST" + SERVICESTATUSENABLEMENT_AUTO ServiceStatusEnablement = "AUTO" + SERVICESTATUSENABLEMENT_UNKNOWN_DEFAULT_OPEN_API ServiceStatusEnablement = "unknown_default_open_api" +) + +// All allowed values of ServiceStatusEnablement enum +var AllowedServiceStatusEnablementEnumValues = []ServiceStatusEnablement{ + "REQUEST", + "AUTO", + "unknown_default_open_api", +} + +func (v *ServiceStatusEnablement) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceStatusEnablement(value) + for _, existing := range AllowedServiceStatusEnablementEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICESTATUSENABLEMENT_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceStatusEnablementFromValue returns a pointer to a valid ServiceStatusEnablement +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceStatusEnablementFromValue(v string) (*ServiceStatusEnablement, error) { + ev := ServiceStatusEnablement(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceStatusEnablement: valid values are %v", v, AllowedServiceStatusEnablementEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceStatusEnablement) IsValid() bool { + for _, existing := range AllowedServiceStatusEnablementEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceStatus_enablement value +func (v ServiceStatusEnablement) Ptr() *ServiceStatusEnablement { + return &v +} + +type NullableServiceStatusEnablement struct { + value *ServiceStatusEnablement + isSet bool +} + +func (v NullableServiceStatusEnablement) Get() *ServiceStatusEnablement { + return v.value +} + +func (v *NullableServiceStatusEnablement) Set(val *ServiceStatusEnablement) { + v.value = val + v.isSet = true +} + +func (v NullableServiceStatusEnablement) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceStatusEnablement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceStatusEnablement(val *ServiceStatusEnablement) *NullableServiceStatusEnablement { + return &NullableServiceStatusEnablement{value: val, isSet: true} +} + +func (v NullableServiceStatusEnablement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceStatusEnablement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v1api/model_service_status_lifecycle.go b/services/serviceenablement/v1api/model_service_status_lifecycle.go new file mode 100644 index 000000000..49724e2ab --- /dev/null +++ b/services/serviceenablement/v1api/model_service_status_lifecycle.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ServiceStatusLifecycle the model 'ServiceStatusLifecycle' +type ServiceStatusLifecycle string + +// List of ServiceStatus_lifecycle +const ( + SERVICESTATUSLIFECYCLE_FLEX ServiceStatusLifecycle = "FLEX" + SERVICESTATUSLIFECYCLE_PROJECT ServiceStatusLifecycle = "PROJECT" + SERVICESTATUSLIFECYCLE_UNKNOWN_DEFAULT_OPEN_API ServiceStatusLifecycle = "unknown_default_open_api" +) + +// All allowed values of ServiceStatusLifecycle enum +var AllowedServiceStatusLifecycleEnumValues = []ServiceStatusLifecycle{ + "FLEX", + "PROJECT", + "unknown_default_open_api", +} + +func (v *ServiceStatusLifecycle) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceStatusLifecycle(value) + for _, existing := range AllowedServiceStatusLifecycleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICESTATUSLIFECYCLE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceStatusLifecycleFromValue returns a pointer to a valid ServiceStatusLifecycle +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceStatusLifecycleFromValue(v string) (*ServiceStatusLifecycle, error) { + ev := ServiceStatusLifecycle(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceStatusLifecycle: valid values are %v", v, AllowedServiceStatusLifecycleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceStatusLifecycle) IsValid() bool { + for _, existing := range AllowedServiceStatusLifecycleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceStatus_lifecycle value +func (v ServiceStatusLifecycle) Ptr() *ServiceStatusLifecycle { + return &v +} + +type NullableServiceStatusLifecycle struct { + value *ServiceStatusLifecycle + isSet bool +} + +func (v NullableServiceStatusLifecycle) Get() *ServiceStatusLifecycle { + return v.value +} + +func (v *NullableServiceStatusLifecycle) Set(val *ServiceStatusLifecycle) { + v.value = val + v.isSet = true +} + +func (v NullableServiceStatusLifecycle) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceStatusLifecycle) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceStatusLifecycle(val *ServiceStatusLifecycle) *NullableServiceStatusLifecycle { + return &NullableServiceStatusLifecycle{value: val, isSet: true} +} + +func (v NullableServiceStatusLifecycle) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceStatusLifecycle) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v1api/model_service_status_scope.go b/services/serviceenablement/v1api/model_service_status_scope.go new file mode 100644 index 000000000..b2effebfc --- /dev/null +++ b/services/serviceenablement/v1api/model_service_status_scope.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ServiceStatusScope the model 'ServiceStatusScope' +type ServiceStatusScope string + +// List of ServiceStatus_scope +const ( + SERVICESTATUSSCOPE_PRIVATE ServiceStatusScope = "PRIVATE" + SERVICESTATUSSCOPE_PUBLIC ServiceStatusScope = "PUBLIC" + SERVICESTATUSSCOPE_UNKNOWN_DEFAULT_OPEN_API ServiceStatusScope = "unknown_default_open_api" +) + +// All allowed values of ServiceStatusScope enum +var AllowedServiceStatusScopeEnumValues = []ServiceStatusScope{ + "PRIVATE", + "PUBLIC", + "unknown_default_open_api", +} + +func (v *ServiceStatusScope) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceStatusScope(value) + for _, existing := range AllowedServiceStatusScopeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICESTATUSSCOPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceStatusScopeFromValue returns a pointer to a valid ServiceStatusScope +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceStatusScopeFromValue(v string) (*ServiceStatusScope, error) { + ev := ServiceStatusScope(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceStatusScope: valid values are %v", v, AllowedServiceStatusScopeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceStatusScope) IsValid() bool { + for _, existing := range AllowedServiceStatusScopeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceStatus_scope value +func (v ServiceStatusScope) Ptr() *ServiceStatusScope { + return &v +} + +type NullableServiceStatusScope struct { + value *ServiceStatusScope + isSet bool +} + +func (v NullableServiceStatusScope) Get() *ServiceStatusScope { + return v.value +} + +func (v *NullableServiceStatusScope) Set(val *ServiceStatusScope) { + v.value = val + v.isSet = true +} + +func (v NullableServiceStatusScope) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceStatusScope) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceStatusScope(val *ServiceStatusScope) *NullableServiceStatusScope { + return &NullableServiceStatusScope{value: val, isSet: true} +} + +func (v NullableServiceStatusScope) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceStatusScope) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v1api/model_service_status_state.go b/services/serviceenablement/v1api/model_service_status_state.go new file mode 100644 index 000000000..cf0d5ff16 --- /dev/null +++ b/services/serviceenablement/v1api/model_service_status_state.go @@ -0,0 +1,117 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ServiceStatusState the state of a service within a project +type ServiceStatusState string + +// List of ServiceStatus_state +const ( + SERVICESTATUSSTATE_ENABLED ServiceStatusState = "ENABLED" + SERVICESTATUSSTATE_ENABLING ServiceStatusState = "ENABLING" + SERVICESTATUSSTATE_DISABLED ServiceStatusState = "DISABLED" + SERVICESTATUSSTATE_DISABLING ServiceStatusState = "DISABLING" + SERVICESTATUSSTATE_UNKNOWN_DEFAULT_OPEN_API ServiceStatusState = "unknown_default_open_api" +) + +// All allowed values of ServiceStatusState enum +var AllowedServiceStatusStateEnumValues = []ServiceStatusState{ + "ENABLED", + "ENABLING", + "DISABLED", + "DISABLING", + "unknown_default_open_api", +} + +func (v *ServiceStatusState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceStatusState(value) + for _, existing := range AllowedServiceStatusStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICESTATUSSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceStatusStateFromValue returns a pointer to a valid ServiceStatusState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceStatusStateFromValue(v string) (*ServiceStatusState, error) { + ev := ServiceStatusState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceStatusState: valid values are %v", v, AllowedServiceStatusStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceStatusState) IsValid() bool { + for _, existing := range AllowedServiceStatusStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceStatus_state value +func (v ServiceStatusState) Ptr() *ServiceStatusState { + return &v +} + +type NullableServiceStatusState struct { + value *ServiceStatusState + isSet bool +} + +func (v NullableServiceStatusState) Get() *ServiceStatusState { + return v.value +} + +func (v *NullableServiceStatusState) Set(val *ServiceStatusState) { + v.value = val + v.isSet = true +} + +func (v NullableServiceStatusState) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceStatusState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceStatusState(val *ServiceStatusState) *NullableServiceStatusState { + return &NullableServiceStatusState{value: val, isSet: true} +} + +func (v NullableServiceStatusState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceStatusState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_action_error.go b/services/serviceenablement/v2api/model_action_error.go index 6c86fa0fb..f53847853 100644 --- a/services/serviceenablement/v2api/model_action_error.go +++ b/services/serviceenablement/v2api/model_action_error.go @@ -19,8 +19,7 @@ var _ MappedNullable = &ActionError{} // ActionError the last error for this service. type ActionError struct { - // the last action which was triggered on this service - Action *string `json:"action,omitempty"` + Action *ActionErrorAction `json:"action,omitempty"` // the error code if provided by the service Code *string `json:"code,omitempty"` // the error reason provided by the service @@ -48,9 +47,9 @@ func NewActionErrorWithDefaults() *ActionError { } // GetAction returns the Action field value if set, zero value otherwise. -func (o *ActionError) GetAction() string { +func (o *ActionError) GetAction() ActionErrorAction { if o == nil || IsNil(o.Action) { - var ret string + var ret ActionErrorAction return ret } return *o.Action @@ -58,7 +57,7 @@ func (o *ActionError) GetAction() string { // GetActionOk returns a tuple with the Action field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ActionError) GetActionOk() (*string, bool) { +func (o *ActionError) GetActionOk() (*ActionErrorAction, bool) { if o == nil || IsNil(o.Action) { return nil, false } @@ -74,8 +73,8 @@ func (o *ActionError) HasAction() bool { return false } -// SetAction gets a reference to the given string and assigns it to the Action field. -func (o *ActionError) SetAction(v string) { +// SetAction gets a reference to the given ActionErrorAction and assigns it to the Action field. +func (o *ActionError) SetAction(v ActionErrorAction) { o.Action = &v } diff --git a/services/serviceenablement/v2api/model_action_error_action.go b/services/serviceenablement/v2api/model_action_error_action.go new file mode 100644 index 000000000..ff564cbfc --- /dev/null +++ b/services/serviceenablement/v2api/model_action_error_action.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ActionErrorAction the last action which was triggered on this service +type ActionErrorAction string + +// List of ActionError_action +const ( + ACTIONERRORACTION_DISABLE ActionErrorAction = "DISABLE" + ACTIONERRORACTION_ENABLE ActionErrorAction = "ENABLE" + ACTIONERRORACTION_UNKNOWN_DEFAULT_OPEN_API ActionErrorAction = "unknown_default_open_api" +) + +// All allowed values of ActionErrorAction enum +var AllowedActionErrorActionEnumValues = []ActionErrorAction{ + "DISABLE", + "ENABLE", + "unknown_default_open_api", +} + +func (v *ActionErrorAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ActionErrorAction(value) + for _, existing := range AllowedActionErrorActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ACTIONERRORACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewActionErrorActionFromValue returns a pointer to a valid ActionErrorAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewActionErrorActionFromValue(v string) (*ActionErrorAction, error) { + ev := ActionErrorAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ActionErrorAction: valid values are %v", v, AllowedActionErrorActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ActionErrorAction) IsValid() bool { + for _, existing := range AllowedActionErrorActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ActionError_action value +func (v ActionErrorAction) Ptr() *ActionErrorAction { + return &v +} + +type NullableActionErrorAction struct { + value *ActionErrorAction + isSet bool +} + +func (v NullableActionErrorAction) Get() *ActionErrorAction { + return v.value +} + +func (v *NullableActionErrorAction) Set(val *ActionErrorAction) { + v.value = val + v.isSet = true +} + +func (v NullableActionErrorAction) IsSet() bool { + return v.isSet +} + +func (v *NullableActionErrorAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActionErrorAction(val *ActionErrorAction) *NullableActionErrorAction { + return &NullableActionErrorAction{value: val, isSet: true} +} + +func (v NullableActionErrorAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActionErrorAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_check_service.go b/services/serviceenablement/v2api/model_check_service.go index 7316fe1f6..520d8ec20 100644 --- a/services/serviceenablement/v2api/model_check_service.go +++ b/services/serviceenablement/v2api/model_check_service.go @@ -20,8 +20,8 @@ var _ MappedNullable = &CheckService{} // CheckService struct for CheckService type CheckService struct { // the identifier of the resource e.g. projectID - Resource *string `json:"resource,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` + Resource *string `json:"resource,omitempty"` + ResourceType *CheckServiceResourceType `json:"resourceType,omitempty"` // the id of the service ServiceId *string `json:"serviceId,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$"` AdditionalProperties map[string]interface{} @@ -35,7 +35,7 @@ type _CheckService CheckService // will change when the set of required properties is changed func NewCheckService() *CheckService { this := CheckService{} - var resourceType string = "project" + var resourceType CheckServiceResourceType = CHECKSERVICERESOURCETYPE_PROJECT this.ResourceType = &resourceType return &this } @@ -45,7 +45,7 @@ func NewCheckService() *CheckService { // but it doesn't guarantee that properties required by API are set func NewCheckServiceWithDefaults() *CheckService { this := CheckService{} - var resourceType string = "project" + var resourceType CheckServiceResourceType = CHECKSERVICERESOURCETYPE_PROJECT this.ResourceType = &resourceType return &this } @@ -83,9 +83,9 @@ func (o *CheckService) SetResource(v string) { } // GetResourceType returns the ResourceType field value if set, zero value otherwise. -func (o *CheckService) GetResourceType() string { +func (o *CheckService) GetResourceType() CheckServiceResourceType { if o == nil || IsNil(o.ResourceType) { - var ret string + var ret CheckServiceResourceType return ret } return *o.ResourceType @@ -93,7 +93,7 @@ func (o *CheckService) GetResourceType() string { // GetResourceTypeOk returns a tuple with the ResourceType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckService) GetResourceTypeOk() (*string, bool) { +func (o *CheckService) GetResourceTypeOk() (*CheckServiceResourceType, bool) { if o == nil || IsNil(o.ResourceType) { return nil, false } @@ -109,8 +109,8 @@ func (o *CheckService) HasResourceType() bool { return false } -// SetResourceType gets a reference to the given string and assigns it to the ResourceType field. -func (o *CheckService) SetResourceType(v string) { +// SetResourceType gets a reference to the given CheckServiceResourceType and assigns it to the ResourceType field. +func (o *CheckService) SetResourceType(v CheckServiceResourceType) { o.ResourceType = &v } diff --git a/services/serviceenablement/v2api/model_check_service_resource_type.go b/services/serviceenablement/v2api/model_check_service_resource_type.go new file mode 100644 index 000000000..32d66184b --- /dev/null +++ b/services/serviceenablement/v2api/model_check_service_resource_type.go @@ -0,0 +1,111 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CheckServiceResourceType the model 'CheckServiceResourceType' +type CheckServiceResourceType string + +// List of CheckService_resourceType +const ( + CHECKSERVICERESOURCETYPE_PROJECT CheckServiceResourceType = "project" + CHECKSERVICERESOURCETYPE_UNKNOWN_DEFAULT_OPEN_API CheckServiceResourceType = "unknown_default_open_api" +) + +// All allowed values of CheckServiceResourceType enum +var AllowedCheckServiceResourceTypeEnumValues = []CheckServiceResourceType{ + "project", + "unknown_default_open_api", +} + +func (v *CheckServiceResourceType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CheckServiceResourceType(value) + for _, existing := range AllowedCheckServiceResourceTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CHECKSERVICERESOURCETYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCheckServiceResourceTypeFromValue returns a pointer to a valid CheckServiceResourceType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCheckServiceResourceTypeFromValue(v string) (*CheckServiceResourceType, error) { + ev := CheckServiceResourceType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CheckServiceResourceType: valid values are %v", v, AllowedCheckServiceResourceTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CheckServiceResourceType) IsValid() bool { + for _, existing := range AllowedCheckServiceResourceTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CheckService_resourceType value +func (v CheckServiceResourceType) Ptr() *CheckServiceResourceType { + return &v +} + +type NullableCheckServiceResourceType struct { + value *CheckServiceResourceType + isSet bool +} + +func (v NullableCheckServiceResourceType) Get() *CheckServiceResourceType { + return v.value +} + +func (v *NullableCheckServiceResourceType) Set(val *CheckServiceResourceType) { + v.value = val + v.isSet = true +} + +func (v NullableCheckServiceResourceType) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckServiceResourceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckServiceResourceType(val *CheckServiceResourceType) *NullableCheckServiceResourceType { + return &NullableCheckServiceResourceType{value: val, isSet: true} +} + +func (v NullableCheckServiceResourceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckServiceResourceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_cloud_service.go b/services/serviceenablement/v2api/model_cloud_service.go index 444574b1f..cebe7c1e0 100644 --- a/services/serviceenablement/v2api/model_cloud_service.go +++ b/services/serviceenablement/v2api/model_cloud_service.go @@ -21,7 +21,7 @@ var _ MappedNullable = &CloudService{} type CloudService struct { Dependencies *Dependencies `json:"dependencies,omitempty"` Labels *map[string]string `json:"labels,omitempty"` - Scope *string `json:"scope,omitempty"` + Scope *CloudServiceScope `json:"scope,omitempty"` // the id of the service ServiceId *string `json:"serviceId,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$"` AdditionalProperties map[string]interface{} @@ -35,7 +35,7 @@ type _CloudService CloudService // will change when the set of required properties is changed func NewCloudService() *CloudService { this := CloudService{} - var scope string = "PUBLIC" + var scope CloudServiceScope = CLOUDSERVICESCOPE_PUBLIC this.Scope = &scope return &this } @@ -45,7 +45,7 @@ func NewCloudService() *CloudService { // but it doesn't guarantee that properties required by API are set func NewCloudServiceWithDefaults() *CloudService { this := CloudService{} - var scope string = "PUBLIC" + var scope CloudServiceScope = CLOUDSERVICESCOPE_PUBLIC this.Scope = &scope return &this } @@ -115,9 +115,9 @@ func (o *CloudService) SetLabels(v map[string]string) { } // GetScope returns the Scope field value if set, zero value otherwise. -func (o *CloudService) GetScope() string { +func (o *CloudService) GetScope() CloudServiceScope { if o == nil || IsNil(o.Scope) { - var ret string + var ret CloudServiceScope return ret } return *o.Scope @@ -125,7 +125,7 @@ func (o *CloudService) GetScope() string { // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CloudService) GetScopeOk() (*string, bool) { +func (o *CloudService) GetScopeOk() (*CloudServiceScope, bool) { if o == nil || IsNil(o.Scope) { return nil, false } @@ -141,8 +141,8 @@ func (o *CloudService) HasScope() bool { return false } -// SetScope gets a reference to the given string and assigns it to the Scope field. -func (o *CloudService) SetScope(v string) { +// SetScope gets a reference to the given CloudServiceScope and assigns it to the Scope field. +func (o *CloudService) SetScope(v CloudServiceScope) { o.Scope = &v } diff --git a/services/serviceenablement/v2api/model_cloud_service_scope.go b/services/serviceenablement/v2api/model_cloud_service_scope.go new file mode 100644 index 000000000..2635e476f --- /dev/null +++ b/services/serviceenablement/v2api/model_cloud_service_scope.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CloudServiceScope the model 'CloudServiceScope' +type CloudServiceScope string + +// List of CloudService_scope +const ( + CLOUDSERVICESCOPE_PRIVATE CloudServiceScope = "PRIVATE" + CLOUDSERVICESCOPE_PUBLIC CloudServiceScope = "PUBLIC" + CLOUDSERVICESCOPE_UNKNOWN_DEFAULT_OPEN_API CloudServiceScope = "unknown_default_open_api" +) + +// All allowed values of CloudServiceScope enum +var AllowedCloudServiceScopeEnumValues = []CloudServiceScope{ + "PRIVATE", + "PUBLIC", + "unknown_default_open_api", +} + +func (v *CloudServiceScope) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CloudServiceScope(value) + for _, existing := range AllowedCloudServiceScopeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CLOUDSERVICESCOPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCloudServiceScopeFromValue returns a pointer to a valid CloudServiceScope +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCloudServiceScopeFromValue(v string) (*CloudServiceScope, error) { + ev := CloudServiceScope(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CloudServiceScope: valid values are %v", v, AllowedCloudServiceScopeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CloudServiceScope) IsValid() bool { + for _, existing := range AllowedCloudServiceScopeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CloudService_scope value +func (v CloudServiceScope) Ptr() *CloudServiceScope { + return &v +} + +type NullableCloudServiceScope struct { + value *CloudServiceScope + isSet bool +} + +func (v NullableCloudServiceScope) Get() *CloudServiceScope { + return v.value +} + +func (v *NullableCloudServiceScope) Set(val *CloudServiceScope) { + v.value = val + v.isSet = true +} + +func (v NullableCloudServiceScope) IsSet() bool { + return v.isSet +} + +func (v *NullableCloudServiceScope) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloudServiceScope(val *CloudServiceScope) *NullableCloudServiceScope { + return &NullableCloudServiceScope{value: val, isSet: true} +} + +func (v NullableCloudServiceScope) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloudServiceScope) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_parameters_general.go b/services/serviceenablement/v2api/model_parameters_general.go index cc860ddcf..f52ac8296 100644 --- a/services/serviceenablement/v2api/model_parameters_general.go +++ b/services/serviceenablement/v2api/model_parameters_general.go @@ -19,9 +19,9 @@ var _ MappedNullable = &ParametersGeneral{} // ParametersGeneral struct for ParametersGeneral type ParametersGeneral struct { - OrganizationId *string `json:"organizationId,omitempty"` - ProjectName *string `json:"projectName,omitempty"` - ProjectScope *string `json:"projectScope,omitempty"` + OrganizationId *string `json:"organizationId,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + ProjectScope *ParametersGeneralProjectScope `json:"projectScope,omitempty"` AdditionalProperties map[string]interface{} } @@ -33,7 +33,7 @@ type _ParametersGeneral ParametersGeneral // will change when the set of required properties is changed func NewParametersGeneral() *ParametersGeneral { this := ParametersGeneral{} - var projectScope string = "PUBLIC" + var projectScope ParametersGeneralProjectScope = PARAMETERSGENERALPROJECTSCOPE_PUBLIC this.ProjectScope = &projectScope return &this } @@ -43,7 +43,7 @@ func NewParametersGeneral() *ParametersGeneral { // but it doesn't guarantee that properties required by API are set func NewParametersGeneralWithDefaults() *ParametersGeneral { this := ParametersGeneral{} - var projectScope string = "PUBLIC" + var projectScope ParametersGeneralProjectScope = PARAMETERSGENERALPROJECTSCOPE_PUBLIC this.ProjectScope = &projectScope return &this } @@ -113,9 +113,9 @@ func (o *ParametersGeneral) SetProjectName(v string) { } // GetProjectScope returns the ProjectScope field value if set, zero value otherwise. -func (o *ParametersGeneral) GetProjectScope() string { +func (o *ParametersGeneral) GetProjectScope() ParametersGeneralProjectScope { if o == nil || IsNil(o.ProjectScope) { - var ret string + var ret ParametersGeneralProjectScope return ret } return *o.ProjectScope @@ -123,7 +123,7 @@ func (o *ParametersGeneral) GetProjectScope() string { // GetProjectScopeOk returns a tuple with the ProjectScope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ParametersGeneral) GetProjectScopeOk() (*string, bool) { +func (o *ParametersGeneral) GetProjectScopeOk() (*ParametersGeneralProjectScope, bool) { if o == nil || IsNil(o.ProjectScope) { return nil, false } @@ -139,8 +139,8 @@ func (o *ParametersGeneral) HasProjectScope() bool { return false } -// SetProjectScope gets a reference to the given string and assigns it to the ProjectScope field. -func (o *ParametersGeneral) SetProjectScope(v string) { +// SetProjectScope gets a reference to the given ParametersGeneralProjectScope and assigns it to the ProjectScope field. +func (o *ParametersGeneral) SetProjectScope(v ParametersGeneralProjectScope) { o.ProjectScope = &v } diff --git a/services/serviceenablement/v2api/model_parameters_general_project_scope.go b/services/serviceenablement/v2api/model_parameters_general_project_scope.go new file mode 100644 index 000000000..2065d7fcc --- /dev/null +++ b/services/serviceenablement/v2api/model_parameters_general_project_scope.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ParametersGeneralProjectScope the model 'ParametersGeneralProjectScope' +type ParametersGeneralProjectScope string + +// List of Parameters_general_projectScope +const ( + PARAMETERSGENERALPROJECTSCOPE_SCHWARZ ParametersGeneralProjectScope = "SCHWARZ" + PARAMETERSGENERALPROJECTSCOPE_PUBLIC ParametersGeneralProjectScope = "PUBLIC" + PARAMETERSGENERALPROJECTSCOPE_UNKNOWN_DEFAULT_OPEN_API ParametersGeneralProjectScope = "unknown_default_open_api" +) + +// All allowed values of ParametersGeneralProjectScope enum +var AllowedParametersGeneralProjectScopeEnumValues = []ParametersGeneralProjectScope{ + "SCHWARZ", + "PUBLIC", + "unknown_default_open_api", +} + +func (v *ParametersGeneralProjectScope) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ParametersGeneralProjectScope(value) + for _, existing := range AllowedParametersGeneralProjectScopeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARAMETERSGENERALPROJECTSCOPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewParametersGeneralProjectScopeFromValue returns a pointer to a valid ParametersGeneralProjectScope +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewParametersGeneralProjectScopeFromValue(v string) (*ParametersGeneralProjectScope, error) { + ev := ParametersGeneralProjectScope(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ParametersGeneralProjectScope: valid values are %v", v, AllowedParametersGeneralProjectScopeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ParametersGeneralProjectScope) IsValid() bool { + for _, existing := range AllowedParametersGeneralProjectScopeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Parameters_general_projectScope value +func (v ParametersGeneralProjectScope) Ptr() *ParametersGeneralProjectScope { + return &v +} + +type NullableParametersGeneralProjectScope struct { + value *ParametersGeneralProjectScope + isSet bool +} + +func (v NullableParametersGeneralProjectScope) Get() *ParametersGeneralProjectScope { + return v.value +} + +func (v *NullableParametersGeneralProjectScope) Set(val *ParametersGeneralProjectScope) { + v.value = val + v.isSet = true +} + +func (v NullableParametersGeneralProjectScope) IsSet() bool { + return v.isSet +} + +func (v *NullableParametersGeneralProjectScope) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParametersGeneralProjectScope(val *ParametersGeneralProjectScope) *NullableParametersGeneralProjectScope { + return &NullableParametersGeneralProjectScope{value: val, isSet: true} +} + +func (v NullableParametersGeneralProjectScope) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParametersGeneralProjectScope) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_service_status.go b/services/serviceenablement/v2api/model_service_status.go index 8ae66ef35..b325c7c54 100644 --- a/services/serviceenablement/v2api/model_service_status.go +++ b/services/serviceenablement/v2api/model_service_status.go @@ -19,17 +19,16 @@ var _ MappedNullable = &ServiceStatus{} // ServiceStatus struct for ServiceStatus type ServiceStatus struct { - Dependencies *Dependencies `json:"dependencies,omitempty"` - Enablement *string `json:"enablement,omitempty"` - Error *ActionError `json:"error,omitempty"` - Labels *map[string]string `json:"labels,omitempty"` - Lifecycle *string `json:"lifecycle,omitempty"` - Parameters *Parameters `json:"parameters,omitempty"` - Scope *string `json:"scope,omitempty"` + Dependencies *Dependencies `json:"dependencies,omitempty"` + Enablement *ServiceStatusEnablement `json:"enablement,omitempty"` + Error *ActionError `json:"error,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + Lifecycle *ServiceStatusLifecycle `json:"lifecycle,omitempty"` + Parameters *Parameters `json:"parameters,omitempty"` + Scope *ServiceStatusScope `json:"scope,omitempty"` // the id of the service - ServiceId *string `json:"serviceId,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$"` - // the state of a service within a project - State *string `json:"state,omitempty"` + ServiceId *string `json:"serviceId,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$"` + State *ServiceStatusState `json:"state,omitempty"` AdditionalProperties map[string]interface{} } @@ -41,13 +40,13 @@ type _ServiceStatus ServiceStatus // will change when the set of required properties is changed func NewServiceStatus() *ServiceStatus { this := ServiceStatus{} - var enablement string = "REQUEST" + var enablement ServiceStatusEnablement = SERVICESTATUSENABLEMENT_REQUEST this.Enablement = &enablement - var lifecycle string = "FLEX" + var lifecycle ServiceStatusLifecycle = SERVICESTATUSLIFECYCLE_FLEX this.Lifecycle = &lifecycle - var scope string = "PUBLIC" + var scope ServiceStatusScope = SERVICESTATUSSCOPE_PUBLIC this.Scope = &scope - var state string = "ENABLED" + var state ServiceStatusState = SERVICESTATUSSTATE_ENABLED this.State = &state return &this } @@ -57,13 +56,13 @@ func NewServiceStatus() *ServiceStatus { // but it doesn't guarantee that properties required by API are set func NewServiceStatusWithDefaults() *ServiceStatus { this := ServiceStatus{} - var enablement string = "REQUEST" + var enablement ServiceStatusEnablement = SERVICESTATUSENABLEMENT_REQUEST this.Enablement = &enablement - var lifecycle string = "FLEX" + var lifecycle ServiceStatusLifecycle = SERVICESTATUSLIFECYCLE_FLEX this.Lifecycle = &lifecycle - var scope string = "PUBLIC" + var scope ServiceStatusScope = SERVICESTATUSSCOPE_PUBLIC this.Scope = &scope - var state string = "ENABLED" + var state ServiceStatusState = SERVICESTATUSSTATE_ENABLED this.State = &state return &this } @@ -101,9 +100,9 @@ func (o *ServiceStatus) SetDependencies(v Dependencies) { } // GetEnablement returns the Enablement field value if set, zero value otherwise. -func (o *ServiceStatus) GetEnablement() string { +func (o *ServiceStatus) GetEnablement() ServiceStatusEnablement { if o == nil || IsNil(o.Enablement) { - var ret string + var ret ServiceStatusEnablement return ret } return *o.Enablement @@ -111,7 +110,7 @@ func (o *ServiceStatus) GetEnablement() string { // GetEnablementOk returns a tuple with the Enablement field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetEnablementOk() (*string, bool) { +func (o *ServiceStatus) GetEnablementOk() (*ServiceStatusEnablement, bool) { if o == nil || IsNil(o.Enablement) { return nil, false } @@ -127,8 +126,8 @@ func (o *ServiceStatus) HasEnablement() bool { return false } -// SetEnablement gets a reference to the given string and assigns it to the Enablement field. -func (o *ServiceStatus) SetEnablement(v string) { +// SetEnablement gets a reference to the given ServiceStatusEnablement and assigns it to the Enablement field. +func (o *ServiceStatus) SetEnablement(v ServiceStatusEnablement) { o.Enablement = &v } @@ -197,9 +196,9 @@ func (o *ServiceStatus) SetLabels(v map[string]string) { } // GetLifecycle returns the Lifecycle field value if set, zero value otherwise. -func (o *ServiceStatus) GetLifecycle() string { +func (o *ServiceStatus) GetLifecycle() ServiceStatusLifecycle { if o == nil || IsNil(o.Lifecycle) { - var ret string + var ret ServiceStatusLifecycle return ret } return *o.Lifecycle @@ -207,7 +206,7 @@ func (o *ServiceStatus) GetLifecycle() string { // GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetLifecycleOk() (*string, bool) { +func (o *ServiceStatus) GetLifecycleOk() (*ServiceStatusLifecycle, bool) { if o == nil || IsNil(o.Lifecycle) { return nil, false } @@ -223,8 +222,8 @@ func (o *ServiceStatus) HasLifecycle() bool { return false } -// SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. -func (o *ServiceStatus) SetLifecycle(v string) { +// SetLifecycle gets a reference to the given ServiceStatusLifecycle and assigns it to the Lifecycle field. +func (o *ServiceStatus) SetLifecycle(v ServiceStatusLifecycle) { o.Lifecycle = &v } @@ -261,9 +260,9 @@ func (o *ServiceStatus) SetParameters(v Parameters) { } // GetScope returns the Scope field value if set, zero value otherwise. -func (o *ServiceStatus) GetScope() string { +func (o *ServiceStatus) GetScope() ServiceStatusScope { if o == nil || IsNil(o.Scope) { - var ret string + var ret ServiceStatusScope return ret } return *o.Scope @@ -271,7 +270,7 @@ func (o *ServiceStatus) GetScope() string { // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetScopeOk() (*string, bool) { +func (o *ServiceStatus) GetScopeOk() (*ServiceStatusScope, bool) { if o == nil || IsNil(o.Scope) { return nil, false } @@ -287,8 +286,8 @@ func (o *ServiceStatus) HasScope() bool { return false } -// SetScope gets a reference to the given string and assigns it to the Scope field. -func (o *ServiceStatus) SetScope(v string) { +// SetScope gets a reference to the given ServiceStatusScope and assigns it to the Scope field. +func (o *ServiceStatus) SetScope(v ServiceStatusScope) { o.Scope = &v } @@ -325,9 +324,9 @@ func (o *ServiceStatus) SetServiceId(v string) { } // GetState returns the State field value if set, zero value otherwise. -func (o *ServiceStatus) GetState() string { +func (o *ServiceStatus) GetState() ServiceStatusState { if o == nil || IsNil(o.State) { - var ret string + var ret ServiceStatusState return ret } return *o.State @@ -335,7 +334,7 @@ func (o *ServiceStatus) 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 *ServiceStatus) GetStateOk() (*string, bool) { +func (o *ServiceStatus) GetStateOk() (*ServiceStatusState, bool) { if o == nil || IsNil(o.State) { return nil, false } @@ -351,8 +350,8 @@ func (o *ServiceStatus) HasState() bool { return false } -// SetState gets a reference to the given string and assigns it to the State field. -func (o *ServiceStatus) SetState(v string) { +// SetState gets a reference to the given ServiceStatusState and assigns it to the State field. +func (o *ServiceStatus) SetState(v ServiceStatusState) { o.State = &v } diff --git a/services/serviceenablement/v2api/model_service_status_enablement.go b/services/serviceenablement/v2api/model_service_status_enablement.go new file mode 100644 index 000000000..5932155e7 --- /dev/null +++ b/services/serviceenablement/v2api/model_service_status_enablement.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ServiceStatusEnablement the model 'ServiceStatusEnablement' +type ServiceStatusEnablement string + +// List of ServiceStatus_enablement +const ( + SERVICESTATUSENABLEMENT_REQUEST ServiceStatusEnablement = "REQUEST" + SERVICESTATUSENABLEMENT_AUTO ServiceStatusEnablement = "AUTO" + SERVICESTATUSENABLEMENT_UNKNOWN_DEFAULT_OPEN_API ServiceStatusEnablement = "unknown_default_open_api" +) + +// All allowed values of ServiceStatusEnablement enum +var AllowedServiceStatusEnablementEnumValues = []ServiceStatusEnablement{ + "REQUEST", + "AUTO", + "unknown_default_open_api", +} + +func (v *ServiceStatusEnablement) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceStatusEnablement(value) + for _, existing := range AllowedServiceStatusEnablementEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICESTATUSENABLEMENT_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceStatusEnablementFromValue returns a pointer to a valid ServiceStatusEnablement +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceStatusEnablementFromValue(v string) (*ServiceStatusEnablement, error) { + ev := ServiceStatusEnablement(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceStatusEnablement: valid values are %v", v, AllowedServiceStatusEnablementEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceStatusEnablement) IsValid() bool { + for _, existing := range AllowedServiceStatusEnablementEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceStatus_enablement value +func (v ServiceStatusEnablement) Ptr() *ServiceStatusEnablement { + return &v +} + +type NullableServiceStatusEnablement struct { + value *ServiceStatusEnablement + isSet bool +} + +func (v NullableServiceStatusEnablement) Get() *ServiceStatusEnablement { + return v.value +} + +func (v *NullableServiceStatusEnablement) Set(val *ServiceStatusEnablement) { + v.value = val + v.isSet = true +} + +func (v NullableServiceStatusEnablement) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceStatusEnablement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceStatusEnablement(val *ServiceStatusEnablement) *NullableServiceStatusEnablement { + return &NullableServiceStatusEnablement{value: val, isSet: true} +} + +func (v NullableServiceStatusEnablement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceStatusEnablement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_service_status_lifecycle.go b/services/serviceenablement/v2api/model_service_status_lifecycle.go new file mode 100644 index 000000000..3d51ea094 --- /dev/null +++ b/services/serviceenablement/v2api/model_service_status_lifecycle.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ServiceStatusLifecycle the model 'ServiceStatusLifecycle' +type ServiceStatusLifecycle string + +// List of ServiceStatus_lifecycle +const ( + SERVICESTATUSLIFECYCLE_FLEX ServiceStatusLifecycle = "FLEX" + SERVICESTATUSLIFECYCLE_PROJECT ServiceStatusLifecycle = "PROJECT" + SERVICESTATUSLIFECYCLE_UNKNOWN_DEFAULT_OPEN_API ServiceStatusLifecycle = "unknown_default_open_api" +) + +// All allowed values of ServiceStatusLifecycle enum +var AllowedServiceStatusLifecycleEnumValues = []ServiceStatusLifecycle{ + "FLEX", + "PROJECT", + "unknown_default_open_api", +} + +func (v *ServiceStatusLifecycle) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceStatusLifecycle(value) + for _, existing := range AllowedServiceStatusLifecycleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICESTATUSLIFECYCLE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceStatusLifecycleFromValue returns a pointer to a valid ServiceStatusLifecycle +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceStatusLifecycleFromValue(v string) (*ServiceStatusLifecycle, error) { + ev := ServiceStatusLifecycle(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceStatusLifecycle: valid values are %v", v, AllowedServiceStatusLifecycleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceStatusLifecycle) IsValid() bool { + for _, existing := range AllowedServiceStatusLifecycleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceStatus_lifecycle value +func (v ServiceStatusLifecycle) Ptr() *ServiceStatusLifecycle { + return &v +} + +type NullableServiceStatusLifecycle struct { + value *ServiceStatusLifecycle + isSet bool +} + +func (v NullableServiceStatusLifecycle) Get() *ServiceStatusLifecycle { + return v.value +} + +func (v *NullableServiceStatusLifecycle) Set(val *ServiceStatusLifecycle) { + v.value = val + v.isSet = true +} + +func (v NullableServiceStatusLifecycle) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceStatusLifecycle) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceStatusLifecycle(val *ServiceStatusLifecycle) *NullableServiceStatusLifecycle { + return &NullableServiceStatusLifecycle{value: val, isSet: true} +} + +func (v NullableServiceStatusLifecycle) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceStatusLifecycle) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_service_status_scope.go b/services/serviceenablement/v2api/model_service_status_scope.go new file mode 100644 index 000000000..1c6c5ceed --- /dev/null +++ b/services/serviceenablement/v2api/model_service_status_scope.go @@ -0,0 +1,113 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ServiceStatusScope the model 'ServiceStatusScope' +type ServiceStatusScope string + +// List of ServiceStatus_scope +const ( + SERVICESTATUSSCOPE_PRIVATE ServiceStatusScope = "PRIVATE" + SERVICESTATUSSCOPE_PUBLIC ServiceStatusScope = "PUBLIC" + SERVICESTATUSSCOPE_UNKNOWN_DEFAULT_OPEN_API ServiceStatusScope = "unknown_default_open_api" +) + +// All allowed values of ServiceStatusScope enum +var AllowedServiceStatusScopeEnumValues = []ServiceStatusScope{ + "PRIVATE", + "PUBLIC", + "unknown_default_open_api", +} + +func (v *ServiceStatusScope) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceStatusScope(value) + for _, existing := range AllowedServiceStatusScopeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICESTATUSSCOPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceStatusScopeFromValue returns a pointer to a valid ServiceStatusScope +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceStatusScopeFromValue(v string) (*ServiceStatusScope, error) { + ev := ServiceStatusScope(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceStatusScope: valid values are %v", v, AllowedServiceStatusScopeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceStatusScope) IsValid() bool { + for _, existing := range AllowedServiceStatusScopeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceStatus_scope value +func (v ServiceStatusScope) Ptr() *ServiceStatusScope { + return &v +} + +type NullableServiceStatusScope struct { + value *ServiceStatusScope + isSet bool +} + +func (v NullableServiceStatusScope) Get() *ServiceStatusScope { + return v.value +} + +func (v *NullableServiceStatusScope) Set(val *ServiceStatusScope) { + v.value = val + v.isSet = true +} + +func (v NullableServiceStatusScope) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceStatusScope) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceStatusScope(val *ServiceStatusScope) *NullableServiceStatusScope { + return &NullableServiceStatusScope{value: val, isSet: true} +} + +func (v NullableServiceStatusScope) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceStatusScope) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_service_status_state.go b/services/serviceenablement/v2api/model_service_status_state.go new file mode 100644 index 000000000..a96ce2939 --- /dev/null +++ b/services/serviceenablement/v2api/model_service_status_state.go @@ -0,0 +1,117 @@ +/* +STACKIT Service Enablement API + +STACKIT Service Enablement API + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ServiceStatusState the state of a service within a project +type ServiceStatusState string + +// List of ServiceStatus_state +const ( + SERVICESTATUSSTATE_ENABLED ServiceStatusState = "ENABLED" + SERVICESTATUSSTATE_ENABLING ServiceStatusState = "ENABLING" + SERVICESTATUSSTATE_DISABLED ServiceStatusState = "DISABLED" + SERVICESTATUSSTATE_DISABLING ServiceStatusState = "DISABLING" + SERVICESTATUSSTATE_UNKNOWN_DEFAULT_OPEN_API ServiceStatusState = "unknown_default_open_api" +) + +// All allowed values of ServiceStatusState enum +var AllowedServiceStatusStateEnumValues = []ServiceStatusState{ + "ENABLED", + "ENABLING", + "DISABLED", + "DISABLING", + "unknown_default_open_api", +} + +func (v *ServiceStatusState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ServiceStatusState(value) + for _, existing := range AllowedServiceStatusStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SERVICESTATUSSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewServiceStatusStateFromValue returns a pointer to a valid ServiceStatusState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewServiceStatusStateFromValue(v string) (*ServiceStatusState, error) { + ev := ServiceStatusState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ServiceStatusState: valid values are %v", v, AllowedServiceStatusStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ServiceStatusState) IsValid() bool { + for _, existing := range AllowedServiceStatusStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ServiceStatus_state value +func (v ServiceStatusState) Ptr() *ServiceStatusState { + return &v +} + +type NullableServiceStatusState struct { + value *ServiceStatusState + isSet bool +} + +func (v NullableServiceStatusState) Get() *ServiceStatusState { + return v.value +} + +func (v *NullableServiceStatusState) Set(val *ServiceStatusState) { + v.value = val + v.isSet = true +} + +func (v NullableServiceStatusState) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceStatusState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceStatusState(val *ServiceStatusState) *NullableServiceStatusState { + return &NullableServiceStatusState{value: val, isSet: true} +} + +func (v NullableServiceStatusState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceStatusState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From a6c910506217c3c4f1c8e8aa9e157379ad09998d Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 14:09:00 +0200 Subject: [PATCH 50/66] chore(serviceenablement): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/serviceenablement/CHANGELOG.md | 3 +++ services/serviceenablement/VERSION | 2 +- services/serviceenablement/v2api/wait/wait.go | 16 ++++++------ .../serviceenablement/v2api/wait/wait_test.go | 26 +++++++++---------- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 481e8c270..cfc94217c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -436,6 +436,8 @@ - **Dependencies:** Bump STACKIT SDK core module to `v0.26.0` - [v1.5.3](services/serviceenablement/CHANGELOG.md#v153) - `v2api`: Removal of duplicated return statements in `DefaultAPIService` implementations + - [v1.6.0](services/serviceenablement/CHANGELOG.md#v160) + - **Feature:** Introduce enums for various attributes - `sfs`: - [v0.6.3](services/sfs/CHANGELOG.md#v063) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/serviceenablement/CHANGELOG.md b/services/serviceenablement/CHANGELOG.md index ef7e0abd0..efe2ba61c 100644 --- a/services/serviceenablement/CHANGELOG.md +++ b/services/serviceenablement/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.6.0 +- **Feature:** Introduce enums for various attributes + ## v1.5.3 - `v2api`: Removal of duplicated return statements in `DefaultAPIService` implementations diff --git a/services/serviceenablement/VERSION b/services/serviceenablement/VERSION index f1a2e631d..b7c0a9b1d 100644 --- a/services/serviceenablement/VERSION +++ b/services/serviceenablement/VERSION @@ -1 +1 @@ -v1.5.3 +v1.6.0 diff --git a/services/serviceenablement/v2api/wait/wait.go b/services/serviceenablement/v2api/wait/wait.go index 419ca12fd..e691086bf 100644 --- a/services/serviceenablement/v2api/wait/wait.go +++ b/services/serviceenablement/v2api/wait/wait.go @@ -28,13 +28,13 @@ func EnableServiceWaitHandler(ctx context.Context, a serviceenablement.DefaultAP switch *s.State { default: return true, s, fmt.Errorf("service with id %s has unexpected state %s", serviceId, *s.State) - case SERVICESTATUSSTATE_ENABLED: + case serviceenablement.SERVICESTATUSSTATE_ENABLED: return true, s, nil - case SERVICESTATUSSTATE_ENABLING: + case serviceenablement.SERVICESTATUSSTATE_ENABLING: return false, nil, nil - case SERVICESTATUSSTATE_DISABLED: + case serviceenablement.SERVICESTATUSSTATE_DISABLED: return true, s, fmt.Errorf("enabling failed for service with id %s", serviceId) - case SERVICESTATUSSTATE_DISABLING: + case serviceenablement.SERVICESTATUSSTATE_DISABLING: return true, s, fmt.Errorf("service with id %s is in state %s", serviceId, *s.State) } }) @@ -55,13 +55,13 @@ func DisableServiceWaitHandler(ctx context.Context, a serviceenablement.DefaultA switch *s.State { default: return true, s, fmt.Errorf("service with id %s has unexpected state %s", serviceId, *s.State) - case SERVICESTATUSSTATE_DISABLED: + case serviceenablement.SERVICESTATUSSTATE_DISABLED: return true, s, nil - case SERVICESTATUSSTATE_DISABLING: + case serviceenablement.SERVICESTATUSSTATE_DISABLING: return false, nil, nil - case SERVICESTATUSSTATE_ENABLED: + case serviceenablement.SERVICESTATUSSTATE_ENABLED: return true, s, fmt.Errorf("disabling failed for service with id %s", serviceId) - case SERVICESTATUSSTATE_ENABLING: + case serviceenablement.SERVICESTATUSSTATE_ENABLING: return true, s, fmt.Errorf("service with id %s is in state %s", serviceId, *s.State) } }) diff --git a/services/serviceenablement/v2api/wait/wait_test.go b/services/serviceenablement/v2api/wait/wait_test.go index 75e998ae1..404bc2886 100644 --- a/services/serviceenablement/v2api/wait/wait_test.go +++ b/services/serviceenablement/v2api/wait/wait_test.go @@ -15,7 +15,7 @@ import ( type mockSettings struct { serviceId string - serviceState *string + serviceState *serviceenablement.ServiceStatusState getServiceFails bool } @@ -40,42 +40,42 @@ func TestEnableServiceWaitHandler(t *testing.T) { tests := []struct { desc string getServiceFails bool - serviceState *string + serviceState *serviceenablement.ServiceStatusState wantErr bool wantResp bool }{ { desc: "enable_succeeded", getServiceFails: false, - serviceState: utils.Ptr(SERVICESTATUSSTATE_ENABLED), + serviceState: utils.Ptr(serviceenablement.SERVICESTATUSSTATE_ENABLED), wantErr: false, wantResp: true, }, { desc: "enable_failed", getServiceFails: false, - serviceState: utils.Ptr(SERVICESTATUSSTATE_DISABLED), + serviceState: utils.Ptr(serviceenablement.SERVICESTATUSSTATE_DISABLED), wantErr: true, wantResp: false, }, { desc: "enable_failed_2", getServiceFails: false, - serviceState: utils.Ptr(SERVICESTATUSSTATE_DISABLING), + serviceState: utils.Ptr(serviceenablement.SERVICESTATUSSTATE_DISABLING), wantErr: true, wantResp: false, }, { desc: "timeout", getServiceFails: false, - serviceState: utils.Ptr(SERVICESTATUSSTATE_ENABLING), + serviceState: utils.Ptr(serviceenablement.SERVICESTATUSSTATE_ENABLING), wantErr: true, wantResp: false, }, { desc: "get_service_fails", getServiceFails: true, - serviceState: utils.Ptr(SERVICESTATUSSTATE_ENABLING), + serviceState: utils.Ptr(serviceenablement.SERVICESTATUSSTATE_ENABLING), wantErr: true, wantResp: false, }, @@ -124,42 +124,42 @@ func TestDisableServiceWaitHandler(t *testing.T) { tests := []struct { desc string getServiceFails bool - serviceState *string + serviceState *serviceenablement.ServiceStatusState wantErr bool wantResp bool }{ { desc: "disable_succeeded", getServiceFails: false, - serviceState: utils.Ptr(SERVICESTATUSSTATE_DISABLED), + serviceState: utils.Ptr(serviceenablement.SERVICESTATUSSTATE_DISABLED), wantErr: false, wantResp: true, }, { desc: "disable_failed", getServiceFails: false, - serviceState: utils.Ptr(SERVICESTATUSSTATE_ENABLED), + serviceState: utils.Ptr(serviceenablement.SERVICESTATUSSTATE_ENABLED), wantErr: true, wantResp: false, }, { desc: "disable_failed_2", getServiceFails: false, - serviceState: utils.Ptr(SERVICESTATUSSTATE_ENABLING), + serviceState: utils.Ptr(serviceenablement.SERVICESTATUSSTATE_ENABLING), wantErr: true, wantResp: false, }, { desc: "timeout", getServiceFails: false, - serviceState: utils.Ptr(SERVICESTATUSSTATE_DISABLING), + serviceState: utils.Ptr(serviceenablement.SERVICESTATUSSTATE_DISABLING), wantErr: true, wantResp: false, }, { desc: "get_service_fails", getServiceFails: true, - serviceState: utils.Ptr(SERVICESTATUSSTATE_DISABLING), + serviceState: utils.Ptr(serviceenablement.SERVICESTATUSSTATE_DISABLING), wantErr: true, wantResp: false, }, From def9dae1b69cd183488cda7888ea60cc3855d134 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 14:09:57 +0200 Subject: [PATCH 51/66] refac(ske): introduce inline enums --- services/ske/v1api/model_cluster_error.go | 2 +- .../v1api/model_credentials_rotation_state.go | 15 +- .../model_credentials_rotation_state_phase.go | 119 ++++++++++++++++ services/ske/v1api/model_cri.go | 12 +- .../v1api/model_name_of_the_cri_library.go | 111 +++++++++++++++ services/ske/v1api/model_runtime_error.go | 17 ++- .../ske/v1api/model_runtime_error_code.go | 131 ++++++++++++++++++ services/ske/v1api/model_taint.go | 16 +-- services/ske/v1api/model_taint_effect.go | 115 +++++++++++++++ services/ske/v2api/api_default.go | 4 +- services/ske/v2api/model_cluster_error.go | 2 +- .../v2api/model_credentials_rotation_state.go | 15 +- .../model_credentials_rotation_state_phase.go | 119 ++++++++++++++++ services/ske/v2api/model_cri.go | 12 +- services/ske/v2api/model_dns.go | 40 +++++- ...rovider_options_version_state_parameter.go | 111 +++++++++++++++ .../v2api/model_name_of_the_cri_library.go | 111 +++++++++++++++ services/ske/v2api/model_runtime_error.go | 17 ++- .../ske/v2api/model_runtime_error_code.go | 131 ++++++++++++++++++ services/ske/v2api/model_taint.go | 16 +-- services/ske/v2api/model_taint_effect.go | 115 +++++++++++++++ 21 files changed, 1164 insertions(+), 67 deletions(-) create mode 100644 services/ske/v1api/model_credentials_rotation_state_phase.go create mode 100644 services/ske/v1api/model_name_of_the_cri_library.go create mode 100644 services/ske/v1api/model_runtime_error_code.go create mode 100644 services/ske/v1api/model_taint_effect.go create mode 100644 services/ske/v2api/model_credentials_rotation_state_phase.go create mode 100644 services/ske/v2api/model_list_provider_options_version_state_parameter.go create mode 100644 services/ske/v2api/model_name_of_the_cri_library.go create mode 100644 services/ske/v2api/model_runtime_error_code.go create mode 100644 services/ske/v2api/model_taint_effect.go diff --git a/services/ske/v1api/model_cluster_error.go b/services/ske/v1api/model_cluster_error.go index b1a1abf90..cd1796d6b 100644 --- a/services/ske/v1api/model_cluster_error.go +++ b/services/ske/v1api/model_cluster_error.go @@ -19,7 +19,7 @@ var _ MappedNullable = &ClusterError{} // ClusterError struct for ClusterError type ClusterError struct { - // Possible values: `\"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND\"`, `\"SKE_DNS_ZONE_NOT_FOUND\"`, `\"SKE_NODE_NO_VALID_HOST_FOUND\"`, `\"SKE_NODE_MISCONFIGURED_PDB\"`, `\"SKE_NODE_MACHINE_TYPE_NOT_FOUND\"`, `\"SKE_INFRA_SNA_NETWORK_NOT_FOUND\"`, `\"SKE_FETCHING_ERRORS_NOT_POSSIBLE\"` + // Possible values: `\"SKE_INFRA_SNA_NETWORK_NOT_FOUND\"`, `\"SKE_INFRA_SNA_NETWORK_NO_ROUTER\"`, `\"SKE_NODE_NO_VALID_HOST_FOUND\"`, `\"SKE_NODE_MISCONFIGURED_PDB\"`, `\"SKE_NODE_MACHINE_TYPE_NOT_FOUND\"`, `\"SKE_NETWORK_NO_DNS_CONFIGURED\"`, `\"SKE_NETWORK_NO_AVAILABLE_IPS\"`, `\"SKE_NODE_MEMORY_PRESSURE\"`, `\"SKE_NODE_DISK_PRESSURE\"`, `\"SKE_NODE_PID_PRESSURE\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_READY\"`, `\"SKE_DNS_ZONE_NOT_FOUND\"`, `\"SKE_SNA_DOES_NOT_SUPPORT_SERVICE_ROUTES\"`, `\"SKE_FETCHING_ERRORS_NOT_POSSIBLE\"` Code *string `json:"code,omitempty"` Message *string `json:"message,omitempty"` AdditionalProperties map[string]interface{} diff --git a/services/ske/v1api/model_credentials_rotation_state.go b/services/ske/v1api/model_credentials_rotation_state.go index 83f5c436f..98b21fd25 100644 --- a/services/ske/v1api/model_credentials_rotation_state.go +++ b/services/ske/v1api/model_credentials_rotation_state.go @@ -23,9 +23,8 @@ type CredentialsRotationState struct { // Format: `2024-02-15T11:06:29Z` LastCompletionTime *time.Time `json:"lastCompletionTime,omitempty"` // Format: `2024-02-15T11:06:29Z` - LastInitiationTime *time.Time `json:"lastInitiationTime,omitempty"` - // Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. - Phase *string `json:"phase,omitempty"` + LastInitiationTime *time.Time `json:"lastInitiationTime,omitempty"` + Phase *CredentialsRotationStatePhase `json:"phase,omitempty"` AdditionalProperties map[string]interface{} } @@ -113,9 +112,9 @@ func (o *CredentialsRotationState) SetLastInitiationTime(v time.Time) { } // GetPhase returns the Phase field value if set, zero value otherwise. -func (o *CredentialsRotationState) GetPhase() string { +func (o *CredentialsRotationState) GetPhase() CredentialsRotationStatePhase { if o == nil || IsNil(o.Phase) { - var ret string + var ret CredentialsRotationStatePhase return ret } return *o.Phase @@ -123,7 +122,7 @@ func (o *CredentialsRotationState) GetPhase() string { // GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CredentialsRotationState) GetPhaseOk() (*string, bool) { +func (o *CredentialsRotationState) GetPhaseOk() (*CredentialsRotationStatePhase, bool) { if o == nil || IsNil(o.Phase) { return nil, false } @@ -139,8 +138,8 @@ func (o *CredentialsRotationState) HasPhase() bool { return false } -// SetPhase gets a reference to the given string and assigns it to the Phase field. -func (o *CredentialsRotationState) SetPhase(v string) { +// SetPhase gets a reference to the given CredentialsRotationStatePhase and assigns it to the Phase field. +func (o *CredentialsRotationState) SetPhase(v CredentialsRotationStatePhase) { o.Phase = &v } diff --git a/services/ske/v1api/model_credentials_rotation_state_phase.go b/services/ske/v1api/model_credentials_rotation_state_phase.go new file mode 100644 index 000000000..18c01ab3a --- /dev/null +++ b/services/ske/v1api/model_credentials_rotation_state_phase.go @@ -0,0 +1,119 @@ +/* +STACKIT Kubernetes Engine API + +The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CredentialsRotationStatePhase Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. +type CredentialsRotationStatePhase string + +// List of CredentialsRotationState_phase +const ( + CREDENTIALSROTATIONSTATEPHASE_NEVER CredentialsRotationStatePhase = "NEVER" + CREDENTIALSROTATIONSTATEPHASE_PREPARING CredentialsRotationStatePhase = "PREPARING" + CREDENTIALSROTATIONSTATEPHASE_PREPARED CredentialsRotationStatePhase = "PREPARED" + CREDENTIALSROTATIONSTATEPHASE_COMPLETING CredentialsRotationStatePhase = "COMPLETING" + CREDENTIALSROTATIONSTATEPHASE_COMPLETED CredentialsRotationStatePhase = "COMPLETED" + CREDENTIALSROTATIONSTATEPHASE_UNKNOWN_DEFAULT_OPEN_API CredentialsRotationStatePhase = "unknown_default_open_api" +) + +// All allowed values of CredentialsRotationStatePhase enum +var AllowedCredentialsRotationStatePhaseEnumValues = []CredentialsRotationStatePhase{ + "NEVER", + "PREPARING", + "PREPARED", + "COMPLETING", + "COMPLETED", + "unknown_default_open_api", +} + +func (v *CredentialsRotationStatePhase) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CredentialsRotationStatePhase(value) + for _, existing := range AllowedCredentialsRotationStatePhaseEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREDENTIALSROTATIONSTATEPHASE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCredentialsRotationStatePhaseFromValue returns a pointer to a valid CredentialsRotationStatePhase +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCredentialsRotationStatePhaseFromValue(v string) (*CredentialsRotationStatePhase, error) { + ev := CredentialsRotationStatePhase(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CredentialsRotationStatePhase: valid values are %v", v, AllowedCredentialsRotationStatePhaseEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CredentialsRotationStatePhase) IsValid() bool { + for _, existing := range AllowedCredentialsRotationStatePhaseEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CredentialsRotationState_phase value +func (v CredentialsRotationStatePhase) Ptr() *CredentialsRotationStatePhase { + return &v +} + +type NullableCredentialsRotationStatePhase struct { + value *CredentialsRotationStatePhase + isSet bool +} + +func (v NullableCredentialsRotationStatePhase) Get() *CredentialsRotationStatePhase { + return v.value +} + +func (v *NullableCredentialsRotationStatePhase) Set(val *CredentialsRotationStatePhase) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsRotationStatePhase) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsRotationStatePhase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsRotationStatePhase(val *CredentialsRotationStatePhase) *NullableCredentialsRotationStatePhase { + return &NullableCredentialsRotationStatePhase{value: val, isSet: true} +} + +func (v NullableCredentialsRotationStatePhase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsRotationStatePhase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/ske/v1api/model_cri.go b/services/ske/v1api/model_cri.go index 488d1fd29..f55fc19ad 100644 --- a/services/ske/v1api/model_cri.go +++ b/services/ske/v1api/model_cri.go @@ -19,7 +19,7 @@ var _ MappedNullable = &CRI{} // CRI struct for CRI type CRI struct { - Name *string `json:"name,omitempty"` + Name *NameOfTheCriLibrary `json:"name,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,9 +43,9 @@ func NewCRIWithDefaults() *CRI { } // GetName returns the Name field value if set, zero value otherwise. -func (o *CRI) GetName() string { +func (o *CRI) GetName() NameOfTheCriLibrary { if o == nil || IsNil(o.Name) { - var ret string + var ret NameOfTheCriLibrary return ret } return *o.Name @@ -53,7 +53,7 @@ func (o *CRI) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CRI) GetNameOk() (*string, bool) { +func (o *CRI) GetNameOk() (*NameOfTheCriLibrary, bool) { if o == nil || IsNil(o.Name) { return nil, false } @@ -69,8 +69,8 @@ func (o *CRI) HasName() bool { return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CRI) SetName(v string) { +// SetName gets a reference to the given NameOfTheCriLibrary and assigns it to the Name field. +func (o *CRI) SetName(v NameOfTheCriLibrary) { o.Name = &v } diff --git a/services/ske/v1api/model_name_of_the_cri_library.go b/services/ske/v1api/model_name_of_the_cri_library.go new file mode 100644 index 000000000..0923a2c3c --- /dev/null +++ b/services/ske/v1api/model_name_of_the_cri_library.go @@ -0,0 +1,111 @@ +/* +STACKIT Kubernetes Engine API + +The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// NameOfTheCriLibrary the model 'NameOfTheCriLibrary' +type NameOfTheCriLibrary string + +// List of Name_of_the_cri_library +const ( + NAMEOFTHECRILIBRARY_CONTAINERD NameOfTheCriLibrary = "containerd" + NAMEOFTHECRILIBRARY_UNKNOWN_DEFAULT_OPEN_API NameOfTheCriLibrary = "unknown_default_open_api" +) + +// All allowed values of NameOfTheCriLibrary enum +var AllowedNameOfTheCriLibraryEnumValues = []NameOfTheCriLibrary{ + "containerd", + "unknown_default_open_api", +} + +func (v *NameOfTheCriLibrary) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NameOfTheCriLibrary(value) + for _, existing := range AllowedNameOfTheCriLibraryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = NAMEOFTHECRILIBRARY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewNameOfTheCriLibraryFromValue returns a pointer to a valid NameOfTheCriLibrary +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewNameOfTheCriLibraryFromValue(v string) (*NameOfTheCriLibrary, error) { + ev := NameOfTheCriLibrary(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for NameOfTheCriLibrary: valid values are %v", v, AllowedNameOfTheCriLibraryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v NameOfTheCriLibrary) IsValid() bool { + for _, existing := range AllowedNameOfTheCriLibraryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Name_of_the_cri_library value +func (v NameOfTheCriLibrary) Ptr() *NameOfTheCriLibrary { + return &v +} + +type NullableNameOfTheCriLibrary struct { + value *NameOfTheCriLibrary + isSet bool +} + +func (v NullableNameOfTheCriLibrary) Get() *NameOfTheCriLibrary { + return v.value +} + +func (v *NullableNameOfTheCriLibrary) Set(val *NameOfTheCriLibrary) { + v.value = val + v.isSet = true +} + +func (v NullableNameOfTheCriLibrary) IsSet() bool { + return v.isSet +} + +func (v *NullableNameOfTheCriLibrary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNameOfTheCriLibrary(val *NameOfTheCriLibrary) *NullableNameOfTheCriLibrary { + return &NullableNameOfTheCriLibrary{value: val, isSet: true} +} + +func (v NullableNameOfTheCriLibrary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNameOfTheCriLibrary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/ske/v1api/model_runtime_error.go b/services/ske/v1api/model_runtime_error.go index fe3dbca7c..70036d96c 100644 --- a/services/ske/v1api/model_runtime_error.go +++ b/services/ske/v1api/model_runtime_error.go @@ -19,10 +19,9 @@ var _ MappedNullable = &RuntimeError{} // RuntimeError struct for RuntimeError type RuntimeError struct { - // - Code: `SKE_UNSPECIFIED` Message: \"An error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_TMP_AUTH_ERROR` Message: \"Authentication failed. This is a temporary error. Please wait while the system recovers.\" - Code: `SKE_QUOTA_EXCEEDED` Message: \"Your project's resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster.\" - Code: `SKE_ARGUS_INSTANCE_NOT_FOUND` Message: \"The provided Argus instance could not be found.\" - Code: `SKE_RATE_LIMITS` Message: \"While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers.\" - Code: `SKE_INFRA_ERROR` Message: \"An error occurred with the underlying infrastructure. Please open a support ticket if this error persists.\" - Code: `SKE_REMAINING_RESOURCES` Message: \"There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them.\" - Code: `SKE_CONFIGURATION_PROBLEM` Message: \"A configuration error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_UNREADY_NODES` Message: \"Not all worker nodes are ready. Please open a support ticket if this error persists.\" - Code: `SKE_API_SERVER_ERROR` Message: \"The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists.\" - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: \"The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone.\" - Code *string `json:"code,omitempty"` - Details *string `json:"details,omitempty"` - Message *string `json:"message,omitempty"` + Code *RuntimeErrorCode `json:"code,omitempty"` + Details *string `json:"details,omitempty"` + Message *string `json:"message,omitempty"` AdditionalProperties map[string]interface{} } @@ -46,9 +45,9 @@ func NewRuntimeErrorWithDefaults() *RuntimeError { } // GetCode returns the Code field value if set, zero value otherwise. -func (o *RuntimeError) GetCode() string { +func (o *RuntimeError) GetCode() RuntimeErrorCode { if o == nil || IsNil(o.Code) { - var ret string + var ret RuntimeErrorCode return ret } return *o.Code @@ -56,7 +55,7 @@ func (o *RuntimeError) GetCode() string { // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RuntimeError) GetCodeOk() (*string, bool) { +func (o *RuntimeError) GetCodeOk() (*RuntimeErrorCode, bool) { if o == nil || IsNil(o.Code) { return nil, false } @@ -72,8 +71,8 @@ func (o *RuntimeError) HasCode() bool { return false } -// SetCode gets a reference to the given string and assigns it to the Code field. -func (o *RuntimeError) SetCode(v string) { +// SetCode gets a reference to the given RuntimeErrorCode and assigns it to the Code field. +func (o *RuntimeError) SetCode(v RuntimeErrorCode) { o.Code = &v } diff --git a/services/ske/v1api/model_runtime_error_code.go b/services/ske/v1api/model_runtime_error_code.go new file mode 100644 index 000000000..bdee82087 --- /dev/null +++ b/services/ske/v1api/model_runtime_error_code.go @@ -0,0 +1,131 @@ +/* +STACKIT Kubernetes Engine API + +The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// RuntimeErrorCode - Code: `SKE_UNSPECIFIED` Message: \"An error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_TMP_AUTH_ERROR` Message: \"Authentication failed. This is a temporary error. Please wait while the system recovers.\" - Code: `SKE_QUOTA_EXCEEDED` Message: \"Your project's resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster.\" - Code: `SKE_ARGUS_INSTANCE_NOT_FOUND` Message: \"The provided Argus instance could not be found.\" - Code: `SKE_RATE_LIMITS` Message: \"While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers.\" - Code: `SKE_INFRA_ERROR` Message: \"An error occurred with the underlying infrastructure. Please open a support ticket if this error persists.\" - Code: `SKE_REMAINING_RESOURCES` Message: \"There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them.\" - Code: `SKE_CONFIGURATION_PROBLEM` Message: \"A configuration error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_UNREADY_NODES` Message: \"Not all worker nodes are ready. Please open a support ticket if this error persists.\" - Code: `SKE_API_SERVER_ERROR` Message: \"The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists.\" - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: \"The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone.\" +type RuntimeErrorCode string + +// List of RuntimeError_code +const ( + RUNTIMEERRORCODE_SKE_UNSPECIFIED RuntimeErrorCode = "SKE_UNSPECIFIED" + RUNTIMEERRORCODE_SKE_TMP_AUTH_ERROR RuntimeErrorCode = "SKE_TMP_AUTH_ERROR" + RUNTIMEERRORCODE_SKE_QUOTA_EXCEEDED RuntimeErrorCode = "SKE_QUOTA_EXCEEDED" + RUNTIMEERRORCODE_SKE_ARGUS_INSTANCE_NOT_FOUND RuntimeErrorCode = "SKE_ARGUS_INSTANCE_NOT_FOUND" + RUNTIMEERRORCODE_SKE_RATE_LIMITS RuntimeErrorCode = "SKE_RATE_LIMITS" + RUNTIMEERRORCODE_SKE_INFRA_ERROR RuntimeErrorCode = "SKE_INFRA_ERROR" + RUNTIMEERRORCODE_SKE_REMAINING_RESOURCES RuntimeErrorCode = "SKE_REMAINING_RESOURCES" + RUNTIMEERRORCODE_SKE_CONFIGURATION_PROBLEM RuntimeErrorCode = "SKE_CONFIGURATION_PROBLEM" + RUNTIMEERRORCODE_SKE_UNREADY_NODES RuntimeErrorCode = "SKE_UNREADY_NODES" + RUNTIMEERRORCODE_SKE_API_SERVER_ERROR RuntimeErrorCode = "SKE_API_SERVER_ERROR" + RUNTIMEERRORCODE_SKE_DNS_ZONE_NOT_FOUND RuntimeErrorCode = "SKE_DNS_ZONE_NOT_FOUND" + RUNTIMEERRORCODE_UNKNOWN_DEFAULT_OPEN_API RuntimeErrorCode = "unknown_default_open_api" +) + +// All allowed values of RuntimeErrorCode enum +var AllowedRuntimeErrorCodeEnumValues = []RuntimeErrorCode{ + "SKE_UNSPECIFIED", + "SKE_TMP_AUTH_ERROR", + "SKE_QUOTA_EXCEEDED", + "SKE_ARGUS_INSTANCE_NOT_FOUND", + "SKE_RATE_LIMITS", + "SKE_INFRA_ERROR", + "SKE_REMAINING_RESOURCES", + "SKE_CONFIGURATION_PROBLEM", + "SKE_UNREADY_NODES", + "SKE_API_SERVER_ERROR", + "SKE_DNS_ZONE_NOT_FOUND", + "unknown_default_open_api", +} + +func (v *RuntimeErrorCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RuntimeErrorCode(value) + for _, existing := range AllowedRuntimeErrorCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = RUNTIMEERRORCODE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewRuntimeErrorCodeFromValue returns a pointer to a valid RuntimeErrorCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRuntimeErrorCodeFromValue(v string) (*RuntimeErrorCode, error) { + ev := RuntimeErrorCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RuntimeErrorCode: valid values are %v", v, AllowedRuntimeErrorCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RuntimeErrorCode) IsValid() bool { + for _, existing := range AllowedRuntimeErrorCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RuntimeError_code value +func (v RuntimeErrorCode) Ptr() *RuntimeErrorCode { + return &v +} + +type NullableRuntimeErrorCode struct { + value *RuntimeErrorCode + isSet bool +} + +func (v NullableRuntimeErrorCode) Get() *RuntimeErrorCode { + return v.value +} + +func (v *NullableRuntimeErrorCode) Set(val *RuntimeErrorCode) { + v.value = val + v.isSet = true +} + +func (v NullableRuntimeErrorCode) IsSet() bool { + return v.isSet +} + +func (v *NullableRuntimeErrorCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRuntimeErrorCode(val *RuntimeErrorCode) *NullableRuntimeErrorCode { + return &NullableRuntimeErrorCode{value: val, isSet: true} +} + +func (v NullableRuntimeErrorCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRuntimeErrorCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/ske/v1api/model_taint.go b/services/ske/v1api/model_taint.go index 0fbd36323..2a4c37a0a 100644 --- a/services/ske/v1api/model_taint.go +++ b/services/ske/v1api/model_taint.go @@ -20,9 +20,9 @@ var _ MappedNullable = &Taint{} // Taint struct for Taint type Taint struct { - Effect string `json:"effect"` - Key string `json:"key"` - Value *string `json:"value,omitempty"` + Effect TaintEffect `json:"effect"` + Key string `json:"key"` + Value *string `json:"value,omitempty"` AdditionalProperties map[string]interface{} } @@ -32,7 +32,7 @@ type _Taint Taint // 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 NewTaint(effect string, key string) *Taint { +func NewTaint(effect TaintEffect, key string) *Taint { this := Taint{} this.Effect = effect this.Key = key @@ -48,9 +48,9 @@ func NewTaintWithDefaults() *Taint { } // GetEffect returns the Effect field value -func (o *Taint) GetEffect() string { +func (o *Taint) GetEffect() TaintEffect { if o == nil { - var ret string + var ret TaintEffect return ret } @@ -59,7 +59,7 @@ func (o *Taint) GetEffect() string { // GetEffectOk returns a tuple with the Effect field value // and a boolean to check if the value has been set. -func (o *Taint) GetEffectOk() (*string, bool) { +func (o *Taint) GetEffectOk() (*TaintEffect, bool) { if o == nil { return nil, false } @@ -67,7 +67,7 @@ func (o *Taint) GetEffectOk() (*string, bool) { } // SetEffect sets field value -func (o *Taint) SetEffect(v string) { +func (o *Taint) SetEffect(v TaintEffect) { o.Effect = v } diff --git a/services/ske/v1api/model_taint_effect.go b/services/ske/v1api/model_taint_effect.go new file mode 100644 index 000000000..ff8cf9555 --- /dev/null +++ b/services/ske/v1api/model_taint_effect.go @@ -0,0 +1,115 @@ +/* +STACKIT Kubernetes Engine API + +The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// TaintEffect the model 'TaintEffect' +type TaintEffect string + +// List of Taint_effect +const ( + TAINTEFFECT_NO_SCHEDULE TaintEffect = "NoSchedule" + TAINTEFFECT_PREFER_NO_SCHEDULE TaintEffect = "PreferNoSchedule" + TAINTEFFECT_NO_EXECUTE TaintEffect = "NoExecute" + TAINTEFFECT_UNKNOWN_DEFAULT_OPEN_API TaintEffect = "unknown_default_open_api" +) + +// All allowed values of TaintEffect enum +var AllowedTaintEffectEnumValues = []TaintEffect{ + "NoSchedule", + "PreferNoSchedule", + "NoExecute", + "unknown_default_open_api", +} + +func (v *TaintEffect) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TaintEffect(value) + for _, existing := range AllowedTaintEffectEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TAINTEFFECT_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTaintEffectFromValue returns a pointer to a valid TaintEffect +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTaintEffectFromValue(v string) (*TaintEffect, error) { + ev := TaintEffect(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TaintEffect: valid values are %v", v, AllowedTaintEffectEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TaintEffect) IsValid() bool { + for _, existing := range AllowedTaintEffectEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Taint_effect value +func (v TaintEffect) Ptr() *TaintEffect { + return &v +} + +type NullableTaintEffect struct { + value *TaintEffect + isSet bool +} + +func (v NullableTaintEffect) Get() *TaintEffect { + return v.value +} + +func (v *NullableTaintEffect) Set(val *TaintEffect) { + v.value = val + v.isSet = true +} + +func (v NullableTaintEffect) IsSet() bool { + return v.isSet +} + +func (v *NullableTaintEffect) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaintEffect(val *TaintEffect) *NullableTaintEffect { + return &NullableTaintEffect{value: val, isSet: true} +} + +func (v NullableTaintEffect) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaintEffect) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/ske/v2api/api_default.go b/services/ske/v2api/api_default.go index 2c24224b6..a86b47e70 100644 --- a/services/ske/v2api/api_default.go +++ b/services/ske/v2api/api_default.go @@ -1524,10 +1524,10 @@ type ApiListProviderOptionsRequest struct { ctx context.Context ApiService DefaultAPI region string - versionState *string + versionState *ListProviderOptionsVersionStateParameter } -func (r ApiListProviderOptionsRequest) VersionState(versionState string) ApiListProviderOptionsRequest { +func (r ApiListProviderOptionsRequest) VersionState(versionState ListProviderOptionsVersionStateParameter) ApiListProviderOptionsRequest { r.versionState = &versionState return r } diff --git a/services/ske/v2api/model_cluster_error.go b/services/ske/v2api/model_cluster_error.go index 3ffd1b1e6..bd58c34f3 100644 --- a/services/ske/v2api/model_cluster_error.go +++ b/services/ske/v2api/model_cluster_error.go @@ -19,7 +19,7 @@ var _ MappedNullable = &ClusterError{} // ClusterError struct for ClusterError type ClusterError struct { - // Possible values: `\"SKE_INFRA_SNA_NETWORK_NOT_FOUND\"`, `\"SKE_INFRA_SNA_NETWORK_NO_ROUTER\"`, `\"SKE_NODE_NO_VALID_HOST_FOUND\"`, `\"SKE_NODE_MISCONFIGURED_PDB\"`, `\"SKE_NODE_MACHINE_TYPE_NOT_FOUND\"`, `\"SKE_NETWORK_NO_DNS_CONFIGURED\"`, `\"SKE_NETWORK_NO_AVAILABLE_IPS\"`, `\"SKE_NODE_MEMORY_PRESSURE\"`, `\"SKE_NODE_DISK_PRESSURE\"`, `\"SKE_NODE_PID_PRESSURE\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_READY\"`, `\"SKE_DNS_ZONE_NOT_FOUND\"`, `\"SKE_FETCHING_ERRORS_NOT_POSSIBLE\"` + // Possible values: `\"SKE_INFRA_SNA_NETWORK_NOT_FOUND\"`, `\"SKE_INFRA_SNA_NETWORK_NO_ROUTER\"`, `\"SKE_NODE_NO_VALID_HOST_FOUND\"`, `\"SKE_NODE_MISCONFIGURED_PDB\"`, `\"SKE_NODE_MACHINE_TYPE_NOT_FOUND\"`, `\"SKE_NETWORK_NO_DNS_CONFIGURED\"`, `\"SKE_NETWORK_NO_AVAILABLE_IPS\"`, `\"SKE_NODE_MEMORY_PRESSURE\"`, `\"SKE_NODE_DISK_PRESSURE\"`, `\"SKE_NODE_PID_PRESSURE\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_READY\"`, `\"SKE_DNS_ZONE_NOT_FOUND\"`, `\"SKE_SNA_DOES_NOT_SUPPORT_SERVICE_ROUTES\"`, `\"SKE_FETCHING_ERRORS_NOT_POSSIBLE\"` Code *string `json:"code,omitempty"` Message *string `json:"message,omitempty"` AdditionalProperties map[string]interface{} diff --git a/services/ske/v2api/model_credentials_rotation_state.go b/services/ske/v2api/model_credentials_rotation_state.go index 843a87b43..0b10b4cfb 100644 --- a/services/ske/v2api/model_credentials_rotation_state.go +++ b/services/ske/v2api/model_credentials_rotation_state.go @@ -23,9 +23,8 @@ type CredentialsRotationState struct { // Format: `2024-02-15T11:06:29Z` LastCompletionTime *time.Time `json:"lastCompletionTime,omitempty"` // Format: `2024-02-15T11:06:29Z` - LastInitiationTime *time.Time `json:"lastInitiationTime,omitempty"` - // Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. - Phase *string `json:"phase,omitempty"` + LastInitiationTime *time.Time `json:"lastInitiationTime,omitempty"` + Phase *CredentialsRotationStatePhase `json:"phase,omitempty"` AdditionalProperties map[string]interface{} } @@ -113,9 +112,9 @@ func (o *CredentialsRotationState) SetLastInitiationTime(v time.Time) { } // GetPhase returns the Phase field value if set, zero value otherwise. -func (o *CredentialsRotationState) GetPhase() string { +func (o *CredentialsRotationState) GetPhase() CredentialsRotationStatePhase { if o == nil || IsNil(o.Phase) { - var ret string + var ret CredentialsRotationStatePhase return ret } return *o.Phase @@ -123,7 +122,7 @@ func (o *CredentialsRotationState) GetPhase() string { // GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CredentialsRotationState) GetPhaseOk() (*string, bool) { +func (o *CredentialsRotationState) GetPhaseOk() (*CredentialsRotationStatePhase, bool) { if o == nil || IsNil(o.Phase) { return nil, false } @@ -139,8 +138,8 @@ func (o *CredentialsRotationState) HasPhase() bool { return false } -// SetPhase gets a reference to the given string and assigns it to the Phase field. -func (o *CredentialsRotationState) SetPhase(v string) { +// SetPhase gets a reference to the given CredentialsRotationStatePhase and assigns it to the Phase field. +func (o *CredentialsRotationState) SetPhase(v CredentialsRotationStatePhase) { o.Phase = &v } diff --git a/services/ske/v2api/model_credentials_rotation_state_phase.go b/services/ske/v2api/model_credentials_rotation_state_phase.go new file mode 100644 index 000000000..12f913815 --- /dev/null +++ b/services/ske/v2api/model_credentials_rotation_state_phase.go @@ -0,0 +1,119 @@ +/* +STACKIT Kubernetes Engine API + +The SKE API provides endpoints to create, update or delete clusters within STACKIT projects and to trigger further cluster management tasks. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CredentialsRotationStatePhase Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. +type CredentialsRotationStatePhase string + +// List of CredentialsRotationState_phase +const ( + CREDENTIALSROTATIONSTATEPHASE_NEVER CredentialsRotationStatePhase = "NEVER" + CREDENTIALSROTATIONSTATEPHASE_PREPARING CredentialsRotationStatePhase = "PREPARING" + CREDENTIALSROTATIONSTATEPHASE_PREPARED CredentialsRotationStatePhase = "PREPARED" + CREDENTIALSROTATIONSTATEPHASE_COMPLETING CredentialsRotationStatePhase = "COMPLETING" + CREDENTIALSROTATIONSTATEPHASE_COMPLETED CredentialsRotationStatePhase = "COMPLETED" + CREDENTIALSROTATIONSTATEPHASE_UNKNOWN_DEFAULT_OPEN_API CredentialsRotationStatePhase = "unknown_default_open_api" +) + +// All allowed values of CredentialsRotationStatePhase enum +var AllowedCredentialsRotationStatePhaseEnumValues = []CredentialsRotationStatePhase{ + "NEVER", + "PREPARING", + "PREPARED", + "COMPLETING", + "COMPLETED", + "unknown_default_open_api", +} + +func (v *CredentialsRotationStatePhase) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CredentialsRotationStatePhase(value) + for _, existing := range AllowedCredentialsRotationStatePhaseEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREDENTIALSROTATIONSTATEPHASE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCredentialsRotationStatePhaseFromValue returns a pointer to a valid CredentialsRotationStatePhase +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCredentialsRotationStatePhaseFromValue(v string) (*CredentialsRotationStatePhase, error) { + ev := CredentialsRotationStatePhase(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CredentialsRotationStatePhase: valid values are %v", v, AllowedCredentialsRotationStatePhaseEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CredentialsRotationStatePhase) IsValid() bool { + for _, existing := range AllowedCredentialsRotationStatePhaseEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CredentialsRotationState_phase value +func (v CredentialsRotationStatePhase) Ptr() *CredentialsRotationStatePhase { + return &v +} + +type NullableCredentialsRotationStatePhase struct { + value *CredentialsRotationStatePhase + isSet bool +} + +func (v NullableCredentialsRotationStatePhase) Get() *CredentialsRotationStatePhase { + return v.value +} + +func (v *NullableCredentialsRotationStatePhase) Set(val *CredentialsRotationStatePhase) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsRotationStatePhase) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsRotationStatePhase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsRotationStatePhase(val *CredentialsRotationStatePhase) *NullableCredentialsRotationStatePhase { + return &NullableCredentialsRotationStatePhase{value: val, isSet: true} +} + +func (v NullableCredentialsRotationStatePhase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsRotationStatePhase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/ske/v2api/model_cri.go b/services/ske/v2api/model_cri.go index 25010b7a0..75b553e39 100644 --- a/services/ske/v2api/model_cri.go +++ b/services/ske/v2api/model_cri.go @@ -19,7 +19,7 @@ var _ MappedNullable = &CRI{} // CRI struct for CRI type CRI struct { - Name *string `json:"name,omitempty"` + Name *NameOfTheCriLibrary `json:"name,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,9 +43,9 @@ func NewCRIWithDefaults() *CRI { } // GetName returns the Name field value if set, zero value otherwise. -func (o *CRI) GetName() string { +func (o *CRI) GetName() NameOfTheCriLibrary { if o == nil || IsNil(o.Name) { - var ret string + var ret NameOfTheCriLibrary return ret } return *o.Name @@ -53,7 +53,7 @@ func (o *CRI) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CRI) GetNameOk() (*string, bool) { +func (o *CRI) GetNameOk() (*NameOfTheCriLibrary, bool) { if o == nil || IsNil(o.Name) { return nil, false } @@ -69,8 +69,8 @@ func (o *CRI) HasName() bool { return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CRI) SetName(v string) { +// SetName gets a reference to the given NameOfTheCriLibrary and assigns it to the Name field. +func (o *CRI) SetName(v NameOfTheCriLibrary) { o.Name = &v } diff --git a/services/ske/v2api/model_dns.go b/services/ske/v2api/model_dns.go index cc4030123..472ee5315 100644 --- a/services/ske/v2api/model_dns.go +++ b/services/ske/v2api/model_dns.go @@ -22,7 +22,9 @@ var _ MappedNullable = &DNS{} type DNS struct { // Enables the dns extension. Enabled bool `json:"enabled"` - // Array of domain filters for externalDNS, e.g., *.runs.onstackit.cloud. + // Enables Gateway API support for ExternalDNS. The CRDs must be installed by the user. Once installed, ExternalDNS will be configured at the next cluster reconcile. + GatewayApi *bool `json:"gatewayApi,omitempty"` + // Array of domain filters for ExternalDNS, e.g., *.runs.onstackit.cloud. Zones []string `json:"zones,omitempty"` AdditionalProperties map[string]interface{} } @@ -71,6 +73,38 @@ func (o *DNS) SetEnabled(v bool) { o.Enabled = v } +// GetGatewayApi returns the GatewayApi field value if set, zero value otherwise. +func (o *DNS) GetGatewayApi() bool { + if o == nil || IsNil(o.GatewayApi) { + var ret bool + return ret + } + return *o.GatewayApi +} + +// GetGatewayApiOk returns a tuple with the GatewayApi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DNS) GetGatewayApiOk() (*bool, bool) { + if o == nil || IsNil(o.GatewayApi) { + return nil, false + } + return o.GatewayApi, true +} + +// HasGatewayApi returns a boolean if a field has been set. +func (o *DNS) HasGatewayApi() bool { + if o != nil && !IsNil(o.GatewayApi) { + return true + } + + return false +} + +// SetGatewayApi gets a reference to the given bool and assigns it to the GatewayApi field. +func (o *DNS) SetGatewayApi(v bool) { + o.GatewayApi = &v +} + // GetZones returns the Zones field value if set, zero value otherwise. func (o *DNS) GetZones() []string { if o == nil || IsNil(o.Zones) { @@ -114,6 +148,9 @@ func (o DNS) MarshalJSON() ([]byte, error) { func (o DNS) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["enabled"] = o.Enabled + if !IsNil(o.GatewayApi) { + toSerialize["gatewayApi"] = o.GatewayApi + } if !IsNil(o.Zones) { toSerialize["zones"] = o.Zones } @@ -161,6 +198,7 @@ func (o *DNS) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "enabled") + delete(additionalProperties, "gatewayApi") delete(additionalProperties, "zones") o.AdditionalProperties = additionalProperties } diff --git a/services/ske/v2api/model_list_provider_options_version_state_parameter.go b/services/ske/v2api/model_list_provider_options_version_state_parameter.go new file mode 100644 index 000000000..6f85c487b --- /dev/null +++ b/services/ske/v2api/model_list_provider_options_version_state_parameter.go @@ -0,0 +1,111 @@ +/* +STACKIT Kubernetes Engine API + +The SKE API provides endpoints to create, update or delete clusters within STACKIT projects and to trigger further cluster management tasks. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListProviderOptionsVersionStateParameter the model 'ListProviderOptionsVersionStateParameter' +type ListProviderOptionsVersionStateParameter string + +// List of ListProviderOptions_versionState_parameter +const ( + LISTPROVIDEROPTIONSVERSIONSTATEPARAMETER_SUPPORTED ListProviderOptionsVersionStateParameter = "SUPPORTED" + LISTPROVIDEROPTIONSVERSIONSTATEPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListProviderOptionsVersionStateParameter = "unknown_default_open_api" +) + +// All allowed values of ListProviderOptionsVersionStateParameter enum +var AllowedListProviderOptionsVersionStateParameterEnumValues = []ListProviderOptionsVersionStateParameter{ + "SUPPORTED", + "unknown_default_open_api", +} + +func (v *ListProviderOptionsVersionStateParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListProviderOptionsVersionStateParameter(value) + for _, existing := range AllowedListProviderOptionsVersionStateParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTPROVIDEROPTIONSVERSIONSTATEPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListProviderOptionsVersionStateParameterFromValue returns a pointer to a valid ListProviderOptionsVersionStateParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListProviderOptionsVersionStateParameterFromValue(v string) (*ListProviderOptionsVersionStateParameter, error) { + ev := ListProviderOptionsVersionStateParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListProviderOptionsVersionStateParameter: valid values are %v", v, AllowedListProviderOptionsVersionStateParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListProviderOptionsVersionStateParameter) IsValid() bool { + for _, existing := range AllowedListProviderOptionsVersionStateParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListProviderOptions_versionState_parameter value +func (v ListProviderOptionsVersionStateParameter) Ptr() *ListProviderOptionsVersionStateParameter { + return &v +} + +type NullableListProviderOptionsVersionStateParameter struct { + value *ListProviderOptionsVersionStateParameter + isSet bool +} + +func (v NullableListProviderOptionsVersionStateParameter) Get() *ListProviderOptionsVersionStateParameter { + return v.value +} + +func (v *NullableListProviderOptionsVersionStateParameter) Set(val *ListProviderOptionsVersionStateParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListProviderOptionsVersionStateParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListProviderOptionsVersionStateParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListProviderOptionsVersionStateParameter(val *ListProviderOptionsVersionStateParameter) *NullableListProviderOptionsVersionStateParameter { + return &NullableListProviderOptionsVersionStateParameter{value: val, isSet: true} +} + +func (v NullableListProviderOptionsVersionStateParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListProviderOptionsVersionStateParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/ske/v2api/model_name_of_the_cri_library.go b/services/ske/v2api/model_name_of_the_cri_library.go new file mode 100644 index 000000000..d8006d530 --- /dev/null +++ b/services/ske/v2api/model_name_of_the_cri_library.go @@ -0,0 +1,111 @@ +/* +STACKIT Kubernetes Engine API + +The SKE API provides endpoints to create, update or delete clusters within STACKIT projects and to trigger further cluster management tasks. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// NameOfTheCriLibrary the model 'NameOfTheCriLibrary' +type NameOfTheCriLibrary string + +// List of Name_of_the_cri_library +const ( + NAMEOFTHECRILIBRARY_CONTAINERD NameOfTheCriLibrary = "containerd" + NAMEOFTHECRILIBRARY_UNKNOWN_DEFAULT_OPEN_API NameOfTheCriLibrary = "unknown_default_open_api" +) + +// All allowed values of NameOfTheCriLibrary enum +var AllowedNameOfTheCriLibraryEnumValues = []NameOfTheCriLibrary{ + "containerd", + "unknown_default_open_api", +} + +func (v *NameOfTheCriLibrary) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NameOfTheCriLibrary(value) + for _, existing := range AllowedNameOfTheCriLibraryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = NAMEOFTHECRILIBRARY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewNameOfTheCriLibraryFromValue returns a pointer to a valid NameOfTheCriLibrary +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewNameOfTheCriLibraryFromValue(v string) (*NameOfTheCriLibrary, error) { + ev := NameOfTheCriLibrary(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for NameOfTheCriLibrary: valid values are %v", v, AllowedNameOfTheCriLibraryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v NameOfTheCriLibrary) IsValid() bool { + for _, existing := range AllowedNameOfTheCriLibraryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Name_of_the_cri_library value +func (v NameOfTheCriLibrary) Ptr() *NameOfTheCriLibrary { + return &v +} + +type NullableNameOfTheCriLibrary struct { + value *NameOfTheCriLibrary + isSet bool +} + +func (v NullableNameOfTheCriLibrary) Get() *NameOfTheCriLibrary { + return v.value +} + +func (v *NullableNameOfTheCriLibrary) Set(val *NameOfTheCriLibrary) { + v.value = val + v.isSet = true +} + +func (v NullableNameOfTheCriLibrary) IsSet() bool { + return v.isSet +} + +func (v *NullableNameOfTheCriLibrary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNameOfTheCriLibrary(val *NameOfTheCriLibrary) *NullableNameOfTheCriLibrary { + return &NullableNameOfTheCriLibrary{value: val, isSet: true} +} + +func (v NullableNameOfTheCriLibrary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNameOfTheCriLibrary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/ske/v2api/model_runtime_error.go b/services/ske/v2api/model_runtime_error.go index 53aa604bd..e3db7af96 100644 --- a/services/ske/v2api/model_runtime_error.go +++ b/services/ske/v2api/model_runtime_error.go @@ -19,10 +19,9 @@ var _ MappedNullable = &RuntimeError{} // RuntimeError struct for RuntimeError type RuntimeError struct { - // - Code: `SKE_UNSPECIFIED` Message: \"An error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_TMP_AUTH_ERROR` Message: \"Authentication failed. This is a temporary error. Please wait while the system recovers.\" - Code: `SKE_QUOTA_EXCEEDED` Message: \"Your project's resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster.\" - Code: `SKE_OBSERVABILITY_INSTANCE_NOT_FOUND` Message: \"The provided Observability instance could not be found.\" - Code: `SKE_RATE_LIMITS` Message: \"While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers.\" - Code: `SKE_INFRA_ERROR` Message: \"An error occurred with the underlying infrastructure. Please open a support ticket if this error persists.\" - Code: `SKE_REMAINING_RESOURCES` Message: \"There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them.\" - Code: `SKE_CONFIGURATION_PROBLEM` Message: \"A configuration error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_UNREADY_NODES` Message: \"Not all worker nodes are ready. Please open a support ticket if this error persists.\" - Code: `SKE_API_SERVER_ERROR` Message: \"The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists.\" - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: \"The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone.\" - Code *string `json:"code,omitempty"` - Details *string `json:"details,omitempty"` - Message *string `json:"message,omitempty"` + Code *RuntimeErrorCode `json:"code,omitempty"` + Details *string `json:"details,omitempty"` + Message *string `json:"message,omitempty"` AdditionalProperties map[string]interface{} } @@ -46,9 +45,9 @@ func NewRuntimeErrorWithDefaults() *RuntimeError { } // GetCode returns the Code field value if set, zero value otherwise. -func (o *RuntimeError) GetCode() string { +func (o *RuntimeError) GetCode() RuntimeErrorCode { if o == nil || IsNil(o.Code) { - var ret string + var ret RuntimeErrorCode return ret } return *o.Code @@ -56,7 +55,7 @@ func (o *RuntimeError) GetCode() string { // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RuntimeError) GetCodeOk() (*string, bool) { +func (o *RuntimeError) GetCodeOk() (*RuntimeErrorCode, bool) { if o == nil || IsNil(o.Code) { return nil, false } @@ -72,8 +71,8 @@ func (o *RuntimeError) HasCode() bool { return false } -// SetCode gets a reference to the given string and assigns it to the Code field. -func (o *RuntimeError) SetCode(v string) { +// SetCode gets a reference to the given RuntimeErrorCode and assigns it to the Code field. +func (o *RuntimeError) SetCode(v RuntimeErrorCode) { o.Code = &v } diff --git a/services/ske/v2api/model_runtime_error_code.go b/services/ske/v2api/model_runtime_error_code.go new file mode 100644 index 000000000..259c48dd2 --- /dev/null +++ b/services/ske/v2api/model_runtime_error_code.go @@ -0,0 +1,131 @@ +/* +STACKIT Kubernetes Engine API + +The SKE API provides endpoints to create, update or delete clusters within STACKIT projects and to trigger further cluster management tasks. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// RuntimeErrorCode - Code: `SKE_UNSPECIFIED` Message: \"An error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_TMP_AUTH_ERROR` Message: \"Authentication failed. This is a temporary error. Please wait while the system recovers.\" - Code: `SKE_QUOTA_EXCEEDED` Message: \"Your project's resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster.\" - Code: `SKE_OBSERVABILITY_INSTANCE_NOT_FOUND` Message: \"The provided Observability instance could not be found.\" - Code: `SKE_RATE_LIMITS` Message: \"While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers.\" - Code: `SKE_INFRA_ERROR` Message: \"An error occurred with the underlying infrastructure. Please open a support ticket if this error persists.\" - Code: `SKE_REMAINING_RESOURCES` Message: \"There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them.\" - Code: `SKE_CONFIGURATION_PROBLEM` Message: \"A configuration error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_UNREADY_NODES` Message: \"Not all worker nodes are ready. Please open a support ticket if this error persists.\" - Code: `SKE_API_SERVER_ERROR` Message: \"The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists.\" - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: \"The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone.\" +type RuntimeErrorCode string + +// List of RuntimeError_code +const ( + RUNTIMEERRORCODE_SKE_UNSPECIFIED RuntimeErrorCode = "SKE_UNSPECIFIED" + RUNTIMEERRORCODE_SKE_TMP_AUTH_ERROR RuntimeErrorCode = "SKE_TMP_AUTH_ERROR" + RUNTIMEERRORCODE_SKE_QUOTA_EXCEEDED RuntimeErrorCode = "SKE_QUOTA_EXCEEDED" + RUNTIMEERRORCODE_SKE_OBSERVABILITY_INSTANCE_NOT_FOUND RuntimeErrorCode = "SKE_OBSERVABILITY_INSTANCE_NOT_FOUND" + RUNTIMEERRORCODE_SKE_RATE_LIMITS RuntimeErrorCode = "SKE_RATE_LIMITS" + RUNTIMEERRORCODE_SKE_INFRA_ERROR RuntimeErrorCode = "SKE_INFRA_ERROR" + RUNTIMEERRORCODE_SKE_REMAINING_RESOURCES RuntimeErrorCode = "SKE_REMAINING_RESOURCES" + RUNTIMEERRORCODE_SKE_CONFIGURATION_PROBLEM RuntimeErrorCode = "SKE_CONFIGURATION_PROBLEM" + RUNTIMEERRORCODE_SKE_UNREADY_NODES RuntimeErrorCode = "SKE_UNREADY_NODES" + RUNTIMEERRORCODE_SKE_API_SERVER_ERROR RuntimeErrorCode = "SKE_API_SERVER_ERROR" + RUNTIMEERRORCODE_SKE_DNS_ZONE_NOT_FOUND RuntimeErrorCode = "SKE_DNS_ZONE_NOT_FOUND" + RUNTIMEERRORCODE_UNKNOWN_DEFAULT_OPEN_API RuntimeErrorCode = "unknown_default_open_api" +) + +// All allowed values of RuntimeErrorCode enum +var AllowedRuntimeErrorCodeEnumValues = []RuntimeErrorCode{ + "SKE_UNSPECIFIED", + "SKE_TMP_AUTH_ERROR", + "SKE_QUOTA_EXCEEDED", + "SKE_OBSERVABILITY_INSTANCE_NOT_FOUND", + "SKE_RATE_LIMITS", + "SKE_INFRA_ERROR", + "SKE_REMAINING_RESOURCES", + "SKE_CONFIGURATION_PROBLEM", + "SKE_UNREADY_NODES", + "SKE_API_SERVER_ERROR", + "SKE_DNS_ZONE_NOT_FOUND", + "unknown_default_open_api", +} + +func (v *RuntimeErrorCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RuntimeErrorCode(value) + for _, existing := range AllowedRuntimeErrorCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = RUNTIMEERRORCODE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewRuntimeErrorCodeFromValue returns a pointer to a valid RuntimeErrorCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRuntimeErrorCodeFromValue(v string) (*RuntimeErrorCode, error) { + ev := RuntimeErrorCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RuntimeErrorCode: valid values are %v", v, AllowedRuntimeErrorCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RuntimeErrorCode) IsValid() bool { + for _, existing := range AllowedRuntimeErrorCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RuntimeError_code value +func (v RuntimeErrorCode) Ptr() *RuntimeErrorCode { + return &v +} + +type NullableRuntimeErrorCode struct { + value *RuntimeErrorCode + isSet bool +} + +func (v NullableRuntimeErrorCode) Get() *RuntimeErrorCode { + return v.value +} + +func (v *NullableRuntimeErrorCode) Set(val *RuntimeErrorCode) { + v.value = val + v.isSet = true +} + +func (v NullableRuntimeErrorCode) IsSet() bool { + return v.isSet +} + +func (v *NullableRuntimeErrorCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRuntimeErrorCode(val *RuntimeErrorCode) *NullableRuntimeErrorCode { + return &NullableRuntimeErrorCode{value: val, isSet: true} +} + +func (v NullableRuntimeErrorCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRuntimeErrorCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/ske/v2api/model_taint.go b/services/ske/v2api/model_taint.go index e8bb03bf9..e1acf269f 100644 --- a/services/ske/v2api/model_taint.go +++ b/services/ske/v2api/model_taint.go @@ -20,9 +20,9 @@ var _ MappedNullable = &Taint{} // Taint struct for Taint type Taint struct { - Effect string `json:"effect"` - Key string `json:"key"` - Value *string `json:"value,omitempty"` + Effect TaintEffect `json:"effect"` + Key string `json:"key"` + Value *string `json:"value,omitempty"` AdditionalProperties map[string]interface{} } @@ -32,7 +32,7 @@ type _Taint Taint // 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 NewTaint(effect string, key string) *Taint { +func NewTaint(effect TaintEffect, key string) *Taint { this := Taint{} this.Effect = effect this.Key = key @@ -48,9 +48,9 @@ func NewTaintWithDefaults() *Taint { } // GetEffect returns the Effect field value -func (o *Taint) GetEffect() string { +func (o *Taint) GetEffect() TaintEffect { if o == nil { - var ret string + var ret TaintEffect return ret } @@ -59,7 +59,7 @@ func (o *Taint) GetEffect() string { // GetEffectOk returns a tuple with the Effect field value // and a boolean to check if the value has been set. -func (o *Taint) GetEffectOk() (*string, bool) { +func (o *Taint) GetEffectOk() (*TaintEffect, bool) { if o == nil { return nil, false } @@ -67,7 +67,7 @@ func (o *Taint) GetEffectOk() (*string, bool) { } // SetEffect sets field value -func (o *Taint) SetEffect(v string) { +func (o *Taint) SetEffect(v TaintEffect) { o.Effect = v } diff --git a/services/ske/v2api/model_taint_effect.go b/services/ske/v2api/model_taint_effect.go new file mode 100644 index 000000000..1547aac2f --- /dev/null +++ b/services/ske/v2api/model_taint_effect.go @@ -0,0 +1,115 @@ +/* +STACKIT Kubernetes Engine API + +The SKE API provides endpoints to create, update or delete clusters within STACKIT projects and to trigger further cluster management tasks. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// TaintEffect the model 'TaintEffect' +type TaintEffect string + +// List of Taint_effect +const ( + TAINTEFFECT_NO_SCHEDULE TaintEffect = "NoSchedule" + TAINTEFFECT_PREFER_NO_SCHEDULE TaintEffect = "PreferNoSchedule" + TAINTEFFECT_NO_EXECUTE TaintEffect = "NoExecute" + TAINTEFFECT_UNKNOWN_DEFAULT_OPEN_API TaintEffect = "unknown_default_open_api" +) + +// All allowed values of TaintEffect enum +var AllowedTaintEffectEnumValues = []TaintEffect{ + "NoSchedule", + "PreferNoSchedule", + "NoExecute", + "unknown_default_open_api", +} + +func (v *TaintEffect) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TaintEffect(value) + for _, existing := range AllowedTaintEffectEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TAINTEFFECT_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTaintEffectFromValue returns a pointer to a valid TaintEffect +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTaintEffectFromValue(v string) (*TaintEffect, error) { + ev := TaintEffect(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TaintEffect: valid values are %v", v, AllowedTaintEffectEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TaintEffect) IsValid() bool { + for _, existing := range AllowedTaintEffectEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Taint_effect value +func (v TaintEffect) Ptr() *TaintEffect { + return &v +} + +type NullableTaintEffect struct { + value *TaintEffect + isSet bool +} + +func (v NullableTaintEffect) Get() *TaintEffect { + return v.value +} + +func (v *NullableTaintEffect) Set(val *TaintEffect) { + v.value = val + v.isSet = true +} + +func (v NullableTaintEffect) IsSet() bool { + return v.isSet +} + +func (v *NullableTaintEffect) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaintEffect(val *TaintEffect) *NullableTaintEffect { + return &NullableTaintEffect{value: val, isSet: true} +} + +func (v NullableTaintEffect) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaintEffect) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From f785157081ce03053a481831ec8c827842e0d711 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 14:37:04 +0200 Subject: [PATCH 52/66] chore(ske): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/ske/CHANGELOG.md | 3 +++ services/ske/VERSION | 2 +- services/ske/v2api/wait/wait.go | 10 +++++----- services/ske/v2api/wait/wait_test.go | 4 ++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfc94217c..1267647b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -476,6 +476,8 @@ - **Dependencies:** Bump STACKIT SDK core module to `v0.26.0` - [v1.14.0](services/ske/CHANGELOG.md#v1140) - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully.` + - [v1.15.0](services/ske/CHANGELOG.md#v1150) + - **Feature:** Introduce enums for various attributes - `sqlserverflex`: - [v1.6.3](services/sqlserverflex/CHANGELOG.md#v163) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/ske/CHANGELOG.md b/services/ske/CHANGELOG.md index d95b1385b..e589bf199 100644 --- a/services/ske/CHANGELOG.md +++ b/services/ske/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.15.0 +- **Feature:** Introduce enums for various attributes + ## v1.14.0 - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. diff --git a/services/ske/VERSION b/services/ske/VERSION index 79f9beba8..440ddd8f1 100644 --- a/services/ske/VERSION +++ b/services/ske/VERSION @@ -1 +1 @@ -v1.14.0 +v1.15.0 diff --git a/services/ske/v2api/wait/wait.go b/services/ske/v2api/wait/wait.go index 8e53f29d0..2328528b5 100644 --- a/services/ske/v2api/wait/wait.go +++ b/services/ske/v2api/wait/wait.go @@ -31,7 +31,7 @@ func CreateOrUpdateClusterWaitHandler(ctx context.Context, a ske.DefaultAPI, pro // The state "STATE_UNHEALTHY" (aka "Impaired" in the portal) could be temporarily occur during cluster creation and the system is recovering usually, so it is not considered as a failed state here. // -- alignment meeting with SKE team on 4.8.23 // The exception is when providing an invalid argus instance id, in that case the cluster will stay as "Impaired" until the SKE team solves it, but it is still usable. - if state == ske.CLUSTERSTATUSSTATE_STATE_UNHEALTHY && s.Status.Error != nil && s.Status.Error.Message != nil && *s.Status.Error.Code == RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND { + if state == ske.CLUSTERSTATUSSTATE_STATE_UNHEALTHY && s.Status.Error != nil && s.Status.Error.Message != nil && *s.Status.Error.Code == ske.RUNTIMEERRORCODE_SKE_OBSERVABILITY_INSTANCE_NOT_FOUND { return true, s, nil } @@ -170,11 +170,11 @@ func StartCredentialsRotationWaitHandler(ctx context.Context, a ske.DefaultAPI, } state := *s.Status.CredentialsRotation.Phase - if state == CREDENTIALSROTATIONSTATEPHASE_PREPARED { + if state == ske.CREDENTIALSROTATIONSTATEPHASE_PREPARED { return true, s, nil } - if state == CREDENTIALSROTATIONSTATEPHASE_PREPARING { + if state == ske.CREDENTIALSROTATIONSTATEPHASE_PREPARING { return false, nil, nil } @@ -194,11 +194,11 @@ func CompleteCredentialsRotationWaitHandler(ctx context.Context, a ske.DefaultAP } state := *s.Status.CredentialsRotation.Phase - if state == CREDENTIALSROTATIONSTATEPHASE_COMPLETED { + if state == ske.CREDENTIALSROTATIONSTATEPHASE_COMPLETED { return true, s, nil } - if state == CREDENTIALSROTATIONSTATEPHASE_COMPLETING { + if state == ske.CREDENTIALSROTATIONSTATEPHASE_COMPLETING { return false, nil, nil } diff --git a/services/ske/v2api/wait/wait_test.go b/services/ske/v2api/wait/wait_test.go index fb7b60fc9..29dd38751 100644 --- a/services/ske/v2api/wait/wait_test.go +++ b/services/ske/v2api/wait/wait_test.go @@ -40,7 +40,7 @@ func newAPIMock(settings mockSettings) ske.DefaultAPI { Status: &ske.ClusterStatus{ Aggregated: &rs, Error: &ske.RuntimeError{ - Code: utils.Ptr(RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND), + Code: utils.Ptr(ske.RUNTIMEERRORCODE_SKE_OBSERVABILITY_INSTANCE_NOT_FOUND), Message: utils.Ptr("invalid argus instance"), }, }, @@ -143,7 +143,7 @@ func TestCreateOrUpdateClusterWaitHandler(t *testing.T) { if tt.invalidArgusInstance { wantRes.Status.Error = &ske.RuntimeError{ - Code: utils.Ptr(RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND), + Code: utils.Ptr(ske.RUNTIMEERRORCODE_SKE_OBSERVABILITY_INSTANCE_NOT_FOUND), Message: utils.Ptr("invalid argus instance"), } } From 9b7c955e6c772183e2762c00c63c22adac69d5d6 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 14:39:41 +0200 Subject: [PATCH 53/66] refac(sqlserverflex): introduce inline enums --- services/sqlserverflex/v2api/api_default.go | 168 +++++++++--------- .../sqlserverflex/v2api/api_default_mock.go | 56 +++--- .../model_create_database_region_parameter.go | 114 ++++++++++++ .../model_create_instance_region_parameter.go | 114 ++++++++++++ .../model_create_user_region_parameter.go | 114 ++++++++++++ .../model_delete_database_region_parameter.go | 114 ++++++++++++ .../model_delete_instance_region_parameter.go | 114 ++++++++++++ .../model_delete_user_region_parameter.go | 114 ++++++++++++ .../model_get_backup_region_parameter.go | 114 ++++++++++++ .../model_get_database_region_parameter.go | 114 ++++++++++++ .../model_get_instance_region_parameter.go | 114 ++++++++++++ .../v2api/model_get_user_region_parameter.go | 114 ++++++++++++ .../model_list_backups_region_parameter.go | 114 ++++++++++++ .../model_list_collations_region_parameter.go | 114 ++++++++++++ ...del_list_compatibility_region_parameter.go | 114 ++++++++++++ .../model_list_databases_region_parameter.go | 114 ++++++++++++ .../model_list_flavors_region_parameter.go | 114 ++++++++++++ .../model_list_instances_region_parameter.go | 114 ++++++++++++ .../model_list_metrics_region_parameter.go | 114 ++++++++++++ ...odel_list_restore_jobs_region_parameter.go | 114 ++++++++++++ .../model_list_roles_region_parameter.go | 114 ++++++++++++ .../model_list_storages_region_parameter.go | 114 ++++++++++++ .../model_list_users_region_parameter.go | 114 ++++++++++++ .../model_list_versions_region_parameter.go | 114 ++++++++++++ ...artial_update_instance_region_parameter.go | 114 ++++++++++++ .../model_reset_user_region_parameter.go | 114 ++++++++++++ ...odel_terminate_project_region_parameter.go | 114 ++++++++++++ ...rigger_database_backup_region_parameter.go | 114 ++++++++++++ ...igger_database_restore_region_parameter.go | 114 ++++++++++++ .../model_update_instance_region_parameter.go | 114 ++++++++++++ .../sqlserverflex/v3alpha1api/api_default.go | 168 +++++++++--------- .../v3alpha1api/api_default_mock.go | 56 +++--- ...el_get_flavors_request_region_parameter.go | 112 ++++++++++++ .../v3alpha1api/model_source_backup.go | 12 +- .../v3alpha1api/model_source_backup_type.go | 112 ++++++++++++ .../v3alpha1api/model_source_external_s3.go | 16 +- .../model_source_external_s3_type.go | 112 ++++++++++++ .../sqlserverflex/v3beta1api/api_default.go | 168 +++++++++--------- .../v3beta1api/api_default_mock.go | 56 +++--- ...el_get_flavors_request_region_parameter.go | 114 ++++++++++++ .../v3beta1api/model_source_backup.go | 12 +- .../v3beta1api/model_source_backup_type.go | 112 ++++++++++++ .../v3beta1api/model_source_external_s3.go | 16 +- .../model_source_external_s3_type.go | 112 ++++++++++++ 44 files changed, 4230 insertions(+), 364 deletions(-) create mode 100644 services/sqlserverflex/v2api/model_create_database_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_create_instance_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_create_user_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_delete_database_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_delete_instance_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_delete_user_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_get_backup_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_get_database_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_get_instance_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_get_user_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_backups_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_collations_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_compatibility_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_databases_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_flavors_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_instances_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_metrics_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_restore_jobs_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_roles_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_storages_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_users_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_list_versions_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_partial_update_instance_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_reset_user_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_terminate_project_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_trigger_database_backup_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_trigger_database_restore_region_parameter.go create mode 100644 services/sqlserverflex/v2api/model_update_instance_region_parameter.go create mode 100644 services/sqlserverflex/v3alpha1api/model_get_flavors_request_region_parameter.go create mode 100644 services/sqlserverflex/v3alpha1api/model_source_backup_type.go create mode 100644 services/sqlserverflex/v3alpha1api/model_source_external_s3_type.go create mode 100644 services/sqlserverflex/v3beta1api/model_get_flavors_request_region_parameter.go create mode 100644 services/sqlserverflex/v3beta1api/model_source_backup_type.go create mode 100644 services/sqlserverflex/v3beta1api/model_source_external_s3_type.go diff --git a/services/sqlserverflex/v2api/api_default.go b/services/sqlserverflex/v2api/api_default.go index 38dd2e99b..1bc2ea634 100644 --- a/services/sqlserverflex/v2api/api_default.go +++ b/services/sqlserverflex/v2api/api_default.go @@ -35,7 +35,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateDatabaseRequest */ - CreateDatabase(ctx context.Context, projectId string, instanceId string, region string) ApiCreateDatabaseRequest + CreateDatabase(ctx context.Context, projectId string, instanceId string, region CreateDatabaseRegionParameter) ApiCreateDatabaseRequest // CreateDatabaseExecute executes the request // @return CreateDatabaseResponse @@ -51,7 +51,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateInstanceRequest */ - CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest // CreateInstanceExecute executes the request // @return CreateInstanceResponse @@ -68,7 +68,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateUserRequest */ - CreateUser(ctx context.Context, projectId string, instanceId string, region string) ApiCreateUserRequest + CreateUser(ctx context.Context, projectId string, instanceId string, region CreateUserRegionParameter) ApiCreateUserRequest // CreateUserExecute executes the request // @return CreateUserResponse @@ -86,7 +86,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiDeleteDatabaseRequest */ - DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiDeleteDatabaseRequest + DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region DeleteDatabaseRegionParameter) ApiDeleteDatabaseRequest // DeleteDatabaseExecute executes the request DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error @@ -102,7 +102,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiDeleteInstanceRequest */ - DeleteInstance(ctx context.Context, projectId string, instanceId string, region string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, instanceId string, region DeleteInstanceRegionParameter) ApiDeleteInstanceRequest // DeleteInstanceExecute executes the request DeleteInstanceExecute(r ApiDeleteInstanceRequest) error @@ -119,7 +119,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiDeleteUserRequest */ - DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiDeleteUserRequest + DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region DeleteUserRegionParameter) ApiDeleteUserRequest // DeleteUserExecute executes the request DeleteUserExecute(r ApiDeleteUserRequest) error @@ -136,7 +136,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetBackupRequest */ - GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region string) ApiGetBackupRequest + GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region GetBackupRegionParameter) ApiGetBackupRequest // GetBackupExecute executes the request // @return GetBackupResponse @@ -154,7 +154,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetDatabaseRequest */ - GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiGetDatabaseRequest + GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region GetDatabaseRegionParameter) ApiGetDatabaseRequest // GetDatabaseExecute executes the request // @return GetDatabaseResponse @@ -171,7 +171,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetInstanceRequest */ - GetInstance(ctx context.Context, projectId string, instanceId string, region string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, instanceId string, region GetInstanceRegionParameter) ApiGetInstanceRequest // GetInstanceExecute executes the request // @return GetInstanceResponse @@ -189,7 +189,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetUserRequest */ - GetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiGetUserRequest + GetUser(ctx context.Context, projectId string, instanceId string, userId string, region GetUserRegionParameter) ApiGetUserRequest // GetUserExecute executes the request // @return GetUserResponse @@ -206,7 +206,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListBackupsRequest */ - ListBackups(ctx context.Context, projectId string, instanceId string, region string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, instanceId string, region ListBackupsRegionParameter) ApiListBackupsRequest // ListBackupsExecute executes the request // @return ListBackupsResponse @@ -223,7 +223,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListCollationsRequest */ - ListCollations(ctx context.Context, projectId string, instanceId string, region string) ApiListCollationsRequest + ListCollations(ctx context.Context, projectId string, instanceId string, region ListCollationsRegionParameter) ApiListCollationsRequest // ListCollationsExecute executes the request // @return ListCollationsResponse @@ -240,7 +240,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListCompatibilityRequest */ - ListCompatibility(ctx context.Context, projectId string, instanceId string, region string) ApiListCompatibilityRequest + ListCompatibility(ctx context.Context, projectId string, instanceId string, region ListCompatibilityRegionParameter) ApiListCompatibilityRequest // ListCompatibilityExecute executes the request // @return ListCompatibilityResponse @@ -257,7 +257,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListDatabasesRequest */ - ListDatabases(ctx context.Context, projectId string, instanceId string, region string) ApiListDatabasesRequest + ListDatabases(ctx context.Context, projectId string, instanceId string, region ListDatabasesRegionParameter) ApiListDatabasesRequest // ListDatabasesExecute executes the request // @return ListDatabasesResponse @@ -273,7 +273,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListFlavorsRequest */ - ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest + ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest // ListFlavorsExecute executes the request // @return ListFlavorsResponse @@ -289,7 +289,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListInstancesRequest */ - ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest // ListInstancesExecute executes the request // @return ListInstancesResponse @@ -307,7 +307,7 @@ type DefaultAPI interface { @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'. @return ApiListMetricsRequest */ - ListMetrics(ctx context.Context, projectId string, instanceId string, region string, metric string) ApiListMetricsRequest + ListMetrics(ctx context.Context, projectId string, instanceId string, region ListMetricsRegionParameter, metric string) ApiListMetricsRequest // ListMetricsExecute executes the request // @return ListMetricsResponse @@ -324,7 +324,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListRestoreJobsRequest */ - ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region string) ApiListRestoreJobsRequest + ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region ListRestoreJobsRegionParameter) ApiListRestoreJobsRequest // ListRestoreJobsExecute executes the request // @return ListRestoreJobsResponse @@ -341,7 +341,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListRolesRequest */ - ListRoles(ctx context.Context, projectId string, instanceId string, region string) ApiListRolesRequest + ListRoles(ctx context.Context, projectId string, instanceId string, region ListRolesRegionParameter) ApiListRolesRequest // ListRolesExecute executes the request // @return ListRolesResponse @@ -358,7 +358,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListStoragesRequest */ - ListStorages(ctx context.Context, projectId string, flavorId string, region string) ApiListStoragesRequest + ListStorages(ctx context.Context, projectId string, flavorId string, region ListStoragesRegionParameter) ApiListStoragesRequest // ListStoragesExecute executes the request // @return ListStoragesResponse @@ -375,7 +375,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListUsersRequest */ - ListUsers(ctx context.Context, projectId string, instanceId string, region string) ApiListUsersRequest + ListUsers(ctx context.Context, projectId string, instanceId string, region ListUsersRegionParameter) ApiListUsersRequest // ListUsersExecute executes the request // @return ListUsersResponse @@ -391,7 +391,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListVersionsRequest */ - ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest + ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest // ListVersionsExecute executes the request // @return ListVersionsResponse @@ -411,7 +411,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiPartialUpdateInstanceRequest */ - PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiPartialUpdateInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region PartialUpdateInstanceRegionParameter) ApiPartialUpdateInstanceRequest // PartialUpdateInstanceExecute executes the request // @return UpdateInstanceResponse @@ -429,7 +429,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiResetUserRequest */ - ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiResetUserRequest + ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region ResetUserRegionParameter) ApiResetUserRequest // ResetUserExecute executes the request // @return ResetUserResponse @@ -445,7 +445,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiTerminateProjectRequest */ - TerminateProject(ctx context.Context, projectId string, region string) ApiTerminateProjectRequest + TerminateProject(ctx context.Context, projectId string, region TerminateProjectRegionParameter) ApiTerminateProjectRequest // TerminateProjectExecute executes the request TerminateProjectExecute(r ApiTerminateProjectRequest) error @@ -462,7 +462,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiTriggerDatabaseBackupRequest */ - TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseBackupRequest + TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string, region TriggerDatabaseBackupRegionParameter) ApiTriggerDatabaseBackupRequest // TriggerDatabaseBackupExecute executes the request TriggerDatabaseBackupExecute(r ApiTriggerDatabaseBackupRequest) error @@ -479,7 +479,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiTriggerDatabaseRestoreRequest */ - TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseRestoreRequest + TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string, region TriggerDatabaseRestoreRegionParameter) ApiTriggerDatabaseRestoreRequest // TriggerDatabaseRestoreExecute executes the request TriggerDatabaseRestoreExecute(r ApiTriggerDatabaseRestoreRequest) error @@ -498,7 +498,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiUpdateInstanceRequest */ - UpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateInstanceRequest + UpdateInstance(ctx context.Context, projectId string, instanceId string, region UpdateInstanceRegionParameter) ApiUpdateInstanceRequest // UpdateInstanceExecute executes the request // @return UpdateInstanceResponse @@ -513,7 +513,7 @@ type ApiCreateDatabaseRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region CreateDatabaseRegionParameter createDatabasePayload *CreateDatabasePayload } @@ -538,7 +538,7 @@ Create a Database for an instance @param region The region which should be addressed @return ApiCreateDatabaseRequest */ -func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, instanceId string, region string) ApiCreateDatabaseRequest { +func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, instanceId string, region CreateDatabaseRegionParameter) ApiCreateDatabaseRequest { return ApiCreateDatabaseRequest{ ApiService: a, ctx: ctx, @@ -669,7 +669,7 @@ type ApiCreateInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region CreateInstanceRegionParameter createInstancePayload *CreateInstancePayload } @@ -693,7 +693,7 @@ Create a new instance of a sqlServerCRD database @param region The region which should be addressed @return ApiCreateInstanceRequest */ -func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ ApiService: a, ctx: ctx, @@ -823,7 +823,7 @@ type ApiCreateUserRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region CreateUserRegionParameter createUserPayload *CreateUserPayload } @@ -848,7 +848,7 @@ Create user for an instance @param region The region which should be addressed @return ApiCreateUserRequest */ -func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, instanceId string, region string) ApiCreateUserRequest { +func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, instanceId string, region CreateUserRegionParameter) ApiCreateUserRequest { return ApiCreateUserRequest{ ApiService: a, ctx: ctx, @@ -981,7 +981,7 @@ type ApiDeleteDatabaseRequest struct { projectId string instanceId string databaseName string - region string + region DeleteDatabaseRegionParameter } func (r ApiDeleteDatabaseRequest) Execute() error { @@ -1000,7 +1000,7 @@ Delete Database for an instance @param region The region which should be addressed @return ApiDeleteDatabaseRequest */ -func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiDeleteDatabaseRequest { +func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region DeleteDatabaseRegionParameter) ApiDeleteDatabaseRequest { return ApiDeleteDatabaseRequest{ ApiService: a, ctx: ctx, @@ -1116,7 +1116,7 @@ type ApiDeleteInstanceRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region DeleteInstanceRegionParameter } func (r ApiDeleteInstanceRequest) Execute() error { @@ -1134,7 +1134,7 @@ Delete available instance @param region The region which should be addressed @return ApiDeleteInstanceRequest */ -func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, instanceId string, region string) ApiDeleteInstanceRequest { +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, instanceId string, region DeleteInstanceRegionParameter) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -1249,7 +1249,7 @@ type ApiDeleteUserRequest struct { projectId string instanceId string userId string - region string + region DeleteUserRegionParameter } func (r ApiDeleteUserRequest) Execute() error { @@ -1268,7 +1268,7 @@ Delete user for an instance @param region The region which should be addressed @return ApiDeleteUserRequest */ -func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiDeleteUserRequest { +func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region DeleteUserRegionParameter) ApiDeleteUserRequest { return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, @@ -1385,7 +1385,7 @@ type ApiGetBackupRequest struct { projectId string instanceId string backupId string - region string + region GetBackupRegionParameter } func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { @@ -1404,7 +1404,7 @@ Get specific available backup @param region The region which should be addressed @return ApiGetBackupRequest */ -func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region string) ApiGetBackupRequest { +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region GetBackupRegionParameter) ApiGetBackupRequest { return ApiGetBackupRequest{ ApiService: a, ctx: ctx, @@ -1534,7 +1534,7 @@ type ApiGetDatabaseRequest struct { projectId string instanceId string databaseName string - region string + region GetDatabaseRegionParameter } func (r ApiGetDatabaseRequest) Execute() (*GetDatabaseResponse, error) { @@ -1553,7 +1553,7 @@ Get specific available database @param region The region which should be addressed @return ApiGetDatabaseRequest */ -func (a *DefaultAPIService) GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiGetDatabaseRequest { +func (a *DefaultAPIService) GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region GetDatabaseRegionParameter) ApiGetDatabaseRequest { return ApiGetDatabaseRequest{ ApiService: a, ctx: ctx, @@ -1682,7 +1682,7 @@ type ApiGetInstanceRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region GetInstanceRegionParameter } func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, error) { @@ -1700,7 +1700,7 @@ Get specific available instances @param region The region which should be addressed @return ApiGetInstanceRequest */ -func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, instanceId string, region string) ApiGetInstanceRequest { +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, instanceId string, region GetInstanceRegionParameter) ApiGetInstanceRequest { return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, @@ -1828,7 +1828,7 @@ type ApiGetUserRequest struct { projectId string instanceId string userId string - region string + region GetUserRegionParameter } func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { @@ -1847,7 +1847,7 @@ Get specific available user for an instance @param region The region which should be addressed @return ApiGetUserRequest */ -func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiGetUserRequest { +func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, instanceId string, userId string, region GetUserRegionParameter) ApiGetUserRequest { return ApiGetUserRequest{ ApiService: a, ctx: ctx, @@ -1997,7 +1997,7 @@ type ApiListBackupsRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListBackupsRegionParameter } func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { @@ -2015,7 +2015,7 @@ List all backups which are available for a specific instance @param region The region which should be addressed @return ApiListBackupsRequest */ -func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, instanceId string, region string) ApiListBackupsRequest { +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, instanceId string, region ListBackupsRegionParameter) ApiListBackupsRequest { return ApiListBackupsRequest{ ApiService: a, ctx: ctx, @@ -2142,7 +2142,7 @@ type ApiListCollationsRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListCollationsRegionParameter } func (r ApiListCollationsRequest) Execute() (*ListCollationsResponse, error) { @@ -2160,7 +2160,7 @@ Returns a list of collations @param region The region which should be addressed @return ApiListCollationsRequest */ -func (a *DefaultAPIService) ListCollations(ctx context.Context, projectId string, instanceId string, region string) ApiListCollationsRequest { +func (a *DefaultAPIService) ListCollations(ctx context.Context, projectId string, instanceId string, region ListCollationsRegionParameter) ApiListCollationsRequest { return ApiListCollationsRequest{ ApiService: a, ctx: ctx, @@ -2308,7 +2308,7 @@ type ApiListCompatibilityRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListCompatibilityRegionParameter } func (r ApiListCompatibilityRequest) Execute() (*ListCompatibilityResponse, error) { @@ -2326,7 +2326,7 @@ Returns a list of compatibility levels for creating a new database @param region The region which should be addressed @return ApiListCompatibilityRequest */ -func (a *DefaultAPIService) ListCompatibility(ctx context.Context, projectId string, instanceId string, region string) ApiListCompatibilityRequest { +func (a *DefaultAPIService) ListCompatibility(ctx context.Context, projectId string, instanceId string, region ListCompatibilityRegionParameter) ApiListCompatibilityRequest { return ApiListCompatibilityRequest{ ApiService: a, ctx: ctx, @@ -2474,7 +2474,7 @@ type ApiListDatabasesRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListDatabasesRegionParameter } func (r ApiListDatabasesRequest) Execute() (*ListDatabasesResponse, error) { @@ -2492,7 +2492,7 @@ Get list of all databases in the instance @param region The region which should be addressed @return ApiListDatabasesRequest */ -func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, instanceId string, region string) ApiListDatabasesRequest { +func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, instanceId string, region ListDatabasesRegionParameter) ApiListDatabasesRequest { return ApiListDatabasesRequest{ ApiService: a, ctx: ctx, @@ -2618,7 +2618,7 @@ type ApiListFlavorsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListFlavorsRegionParameter } func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { @@ -2635,7 +2635,7 @@ Get available flavors for a specific projectID @param region The region which should be addressed @return ApiListFlavorsRequest */ -func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { +func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest { return ApiListFlavorsRequest{ ApiService: a, ctx: ctx, @@ -2759,7 +2759,7 @@ type ApiListInstancesRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListInstancesRegionParameter } func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { @@ -2776,7 +2776,7 @@ List available instances @param region The region which should be addressed @return ApiListInstancesRequest */ -func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest { return ApiListInstancesRequest{ ApiService: a, ctx: ctx, @@ -2901,7 +2901,7 @@ type ApiListMetricsRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListMetricsRegionParameter metric string granularity *string period *string @@ -2949,7 +2949,7 @@ Returns a metric for an instance. The metric will only be for the master pod if @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'. @return ApiListMetricsRequest */ -func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, instanceId string, region string, metric string) ApiListMetricsRequest { +func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, instanceId string, region ListMetricsRegionParameter, metric string) ApiListMetricsRequest { return ApiListMetricsRequest{ ApiService: a, ctx: ctx, @@ -3101,7 +3101,7 @@ type ApiListRestoreJobsRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListRestoreJobsRegionParameter } func (r ApiListRestoreJobsRequest) Execute() (*ListRestoreJobsResponse, error) { @@ -3119,7 +3119,7 @@ List all currently running restore jobs which are available for a specific insta @param region The region which should be addressed @return ApiListRestoreJobsRequest */ -func (a *DefaultAPIService) ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region string) ApiListRestoreJobsRequest { +func (a *DefaultAPIService) ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region ListRestoreJobsRegionParameter) ApiListRestoreJobsRequest { return ApiListRestoreJobsRequest{ ApiService: a, ctx: ctx, @@ -3246,7 +3246,7 @@ type ApiListRolesRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListRolesRegionParameter } func (r ApiListRolesRequest) Execute() (*ListRolesResponse, error) { @@ -3264,7 +3264,7 @@ List available roles for an instance that can be assigned to a user @param region The region which should be addressed @return ApiListRolesRequest */ -func (a *DefaultAPIService) ListRoles(ctx context.Context, projectId string, instanceId string, region string) ApiListRolesRequest { +func (a *DefaultAPIService) ListRoles(ctx context.Context, projectId string, instanceId string, region ListRolesRegionParameter) ApiListRolesRequest { return ApiListRolesRequest{ ApiService: a, ctx: ctx, @@ -3391,7 +3391,7 @@ type ApiListStoragesRequest struct { ApiService DefaultAPI projectId string flavorId string - region string + region ListStoragesRegionParameter } func (r ApiListStoragesRequest) Execute() (*ListStoragesResponse, error) { @@ -3409,7 +3409,7 @@ Get available storages for a specific flavor @param region The region which should be addressed @return ApiListStoragesRequest */ -func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, flavorId string, region string) ApiListStoragesRequest { +func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, flavorId string, region ListStoragesRegionParameter) ApiListStoragesRequest { return ApiListStoragesRequest{ ApiService: a, ctx: ctx, @@ -3536,7 +3536,7 @@ type ApiListUsersRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region ListUsersRegionParameter } func (r ApiListUsersRequest) Execute() (*ListUsersResponse, error) { @@ -3554,7 +3554,7 @@ List available users for an instance @param region The region which should be addressed @return ApiListUsersRequest */ -func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, instanceId string, region string) ApiListUsersRequest { +func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, instanceId string, region ListUsersRegionParameter) ApiListUsersRequest { return ApiListUsersRequest{ ApiService: a, ctx: ctx, @@ -3680,7 +3680,7 @@ type ApiListVersionsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region ListVersionsRegionParameter instanceId *string } @@ -3704,7 +3704,7 @@ Get available versions for mssql database @param region The region which should be addressed @return ApiListVersionsRequest */ -func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { +func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest { return ApiListVersionsRequest{ ApiService: a, ctx: ctx, @@ -3832,7 +3832,7 @@ type ApiPartialUpdateInstanceRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region PartialUpdateInstanceRegionParameter partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -3859,7 +3859,7 @@ Update available instance of a mssql database. @param region The region which should be addressed @return ApiPartialUpdateInstanceRequest */ -func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiPartialUpdateInstanceRequest { +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region PartialUpdateInstanceRegionParameter) ApiPartialUpdateInstanceRequest { return ApiPartialUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -3992,7 +3992,7 @@ type ApiResetUserRequest struct { projectId string instanceId string userId string - region string + region ResetUserRegionParameter } func (r ApiResetUserRequest) Execute() (*ResetUserResponse, error) { @@ -4011,7 +4011,7 @@ Reset user password for a mssql instance @param region The region which should be addressed @return ApiResetUserRequest */ -func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiResetUserRequest { +func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region ResetUserRegionParameter) ApiResetUserRequest { return ApiResetUserRequest{ ApiService: a, ctx: ctx, @@ -4160,7 +4160,7 @@ type ApiTerminateProjectRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region TerminateProjectRegionParameter } func (r ApiTerminateProjectRequest) Execute() error { @@ -4177,7 +4177,7 @@ Termination is the deletion of a whole project which causes the deletion of all @param region The region which should be addressed @return ApiTerminateProjectRequest */ -func (a *DefaultAPIService) TerminateProject(ctx context.Context, projectId string, region string) ApiTerminateProjectRequest { +func (a *DefaultAPIService) TerminateProject(ctx context.Context, projectId string, region TerminateProjectRegionParameter) ApiTerminateProjectRequest { return ApiTerminateProjectRequest{ ApiService: a, ctx: ctx, @@ -4300,7 +4300,7 @@ type ApiTriggerDatabaseBackupRequest struct { projectId string instanceId string databaseName string - region string + region TriggerDatabaseBackupRegionParameter } func (r ApiTriggerDatabaseBackupRequest) Execute() error { @@ -4319,7 +4319,7 @@ Trigger backup for a specific Database @param region The region which should be addressed @return ApiTriggerDatabaseBackupRequest */ -func (a *DefaultAPIService) TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseBackupRequest { +func (a *DefaultAPIService) TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string, region TriggerDatabaseBackupRegionParameter) ApiTriggerDatabaseBackupRequest { return ApiTriggerDatabaseBackupRequest{ ApiService: a, ctx: ctx, @@ -4457,7 +4457,7 @@ type ApiTriggerDatabaseRestoreRequest struct { projectId string instanceId string databaseName string - region string + region TriggerDatabaseRestoreRegionParameter triggerDatabaseRestorePayload *TriggerDatabaseRestorePayload } @@ -4483,7 +4483,7 @@ Trigger restore for a specific Database @param region The region which should be addressed @return ApiTriggerDatabaseRestoreRequest */ -func (a *DefaultAPIService) TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseRestoreRequest { +func (a *DefaultAPIService) TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string, region TriggerDatabaseRestoreRegionParameter) ApiTriggerDatabaseRestoreRequest { return ApiTriggerDatabaseRestoreRequest{ ApiService: a, ctx: ctx, @@ -4625,7 +4625,7 @@ type ApiUpdateInstanceRequest struct { ApiService DefaultAPI projectId string instanceId string - region string + region UpdateInstanceRegionParameter updateInstancePayload *UpdateInstancePayload } @@ -4652,7 +4652,7 @@ Update available instance of a mssql database. @param region The region which should be addressed @return ApiUpdateInstanceRequest */ -func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateInstanceRequest { +func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, instanceId string, region UpdateInstanceRegionParameter) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ ApiService: a, ctx: ctx, diff --git a/services/sqlserverflex/v2api/api_default_mock.go b/services/sqlserverflex/v2api/api_default_mock.go index 82837b59b..176542912 100644 --- a/services/sqlserverflex/v2api/api_default_mock.go +++ b/services/sqlserverflex/v2api/api_default_mock.go @@ -79,7 +79,7 @@ type DefaultAPIServiceMock struct { UpdateInstanceExecuteMock *func(r ApiUpdateInstanceRequest) (*UpdateInstanceResponse, error) } -func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, instanceId string, region string) ApiCreateDatabaseRequest { +func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, instanceId string, region CreateDatabaseRegionParameter) ApiCreateDatabaseRequest { return ApiCreateDatabaseRequest{ ApiService: a, ctx: ctx, @@ -99,7 +99,7 @@ func (a DefaultAPIServiceMock) CreateDatabaseExecute(r ApiCreateDatabaseRequest) return (*a.CreateDatabaseExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, region CreateInstanceRegionParameter) ApiCreateInstanceRequest { return ApiCreateInstanceRequest{ ApiService: a, ctx: ctx, @@ -118,7 +118,7 @@ func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) return (*a.CreateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, instanceId string, region string) ApiCreateUserRequest { +func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, instanceId string, region CreateUserRegionParameter) ApiCreateUserRequest { return ApiCreateUserRequest{ ApiService: a, ctx: ctx, @@ -138,7 +138,7 @@ func (a DefaultAPIServiceMock) CreateUserExecute(r ApiCreateUserRequest) (*Creat return (*a.CreateUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiDeleteDatabaseRequest { +func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region DeleteDatabaseRegionParameter) ApiDeleteDatabaseRequest { return ApiDeleteDatabaseRequest{ ApiService: a, ctx: ctx, @@ -158,7 +158,7 @@ func (a DefaultAPIServiceMock) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) return (*a.DeleteDatabaseExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, instanceId string, region string) ApiDeleteInstanceRequest { +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, instanceId string, region DeleteInstanceRegionParameter) ApiDeleteInstanceRequest { return ApiDeleteInstanceRequest{ ApiService: a, ctx: ctx, @@ -177,7 +177,7 @@ func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) return (*a.DeleteInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiDeleteUserRequest { +func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string, region DeleteUserRegionParameter) ApiDeleteUserRequest { return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, @@ -197,7 +197,7 @@ func (a DefaultAPIServiceMock) DeleteUserExecute(r ApiDeleteUserRequest) error { return (*a.DeleteUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region string) ApiGetBackupRequest { +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string, region GetBackupRegionParameter) ApiGetBackupRequest { return ApiGetBackupRequest{ ApiService: a, ctx: ctx, @@ -218,7 +218,7 @@ func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*GetBack return (*a.GetBackupExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiGetDatabaseRequest { +func (a DefaultAPIServiceMock) GetDatabase(ctx context.Context, projectId string, instanceId string, databaseName string, region GetDatabaseRegionParameter) ApiGetDatabaseRequest { return ApiGetDatabaseRequest{ ApiService: a, ctx: ctx, @@ -239,7 +239,7 @@ func (a DefaultAPIServiceMock) GetDatabaseExecute(r ApiGetDatabaseRequest) (*Get return (*a.GetDatabaseExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, instanceId string, region string) ApiGetInstanceRequest { +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, instanceId string, region GetInstanceRegionParameter) ApiGetInstanceRequest { return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, @@ -259,7 +259,7 @@ func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Get return (*a.GetInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiGetUserRequest { +func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, instanceId string, userId string, region GetUserRegionParameter) ApiGetUserRequest { return ApiGetUserRequest{ ApiService: a, ctx: ctx, @@ -280,7 +280,7 @@ func (a DefaultAPIServiceMock) GetUserExecute(r ApiGetUserRequest) (*GetUserResp return (*a.GetUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, instanceId string, region string) ApiListBackupsRequest { +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, instanceId string, region ListBackupsRegionParameter) ApiListBackupsRequest { return ApiListBackupsRequest{ ApiService: a, ctx: ctx, @@ -300,7 +300,7 @@ func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*Lis return (*a.ListBackupsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListCollations(ctx context.Context, projectId string, instanceId string, region string) ApiListCollationsRequest { +func (a DefaultAPIServiceMock) ListCollations(ctx context.Context, projectId string, instanceId string, region ListCollationsRegionParameter) ApiListCollationsRequest { return ApiListCollationsRequest{ ApiService: a, ctx: ctx, @@ -320,7 +320,7 @@ func (a DefaultAPIServiceMock) ListCollationsExecute(r ApiListCollationsRequest) return (*a.ListCollationsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListCompatibility(ctx context.Context, projectId string, instanceId string, region string) ApiListCompatibilityRequest { +func (a DefaultAPIServiceMock) ListCompatibility(ctx context.Context, projectId string, instanceId string, region ListCompatibilityRegionParameter) ApiListCompatibilityRequest { return ApiListCompatibilityRequest{ ApiService: a, ctx: ctx, @@ -340,7 +340,7 @@ func (a DefaultAPIServiceMock) ListCompatibilityExecute(r ApiListCompatibilityRe return (*a.ListCompatibilityExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, instanceId string, region string) ApiListDatabasesRequest { +func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, instanceId string, region ListDatabasesRegionParameter) ApiListDatabasesRequest { return ApiListDatabasesRequest{ ApiService: a, ctx: ctx, @@ -360,7 +360,7 @@ func (a DefaultAPIServiceMock) ListDatabasesExecute(r ApiListDatabasesRequest) ( return (*a.ListDatabasesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { +func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string, region ListFlavorsRegionParameter) ApiListFlavorsRequest { return ApiListFlavorsRequest{ ApiService: a, ctx: ctx, @@ -379,7 +379,7 @@ func (a DefaultAPIServiceMock) ListFlavorsExecute(r ApiListFlavorsRequest) (*Lis return (*a.ListFlavorsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, region ListInstancesRegionParameter) ApiListInstancesRequest { return ApiListInstancesRequest{ ApiService: a, ctx: ctx, @@ -398,7 +398,7 @@ func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) ( return (*a.ListInstancesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, instanceId string, region string, metric string) ApiListMetricsRequest { +func (a DefaultAPIServiceMock) ListMetrics(ctx context.Context, projectId string, instanceId string, region ListMetricsRegionParameter, metric string) ApiListMetricsRequest { return ApiListMetricsRequest{ ApiService: a, ctx: ctx, @@ -419,7 +419,7 @@ func (a DefaultAPIServiceMock) ListMetricsExecute(r ApiListMetricsRequest) (*Lis return (*a.ListMetricsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region string) ApiListRestoreJobsRequest { +func (a DefaultAPIServiceMock) ListRestoreJobs(ctx context.Context, projectId string, instanceId string, region ListRestoreJobsRegionParameter) ApiListRestoreJobsRequest { return ApiListRestoreJobsRequest{ ApiService: a, ctx: ctx, @@ -439,7 +439,7 @@ func (a DefaultAPIServiceMock) ListRestoreJobsExecute(r ApiListRestoreJobsReques return (*a.ListRestoreJobsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListRoles(ctx context.Context, projectId string, instanceId string, region string) ApiListRolesRequest { +func (a DefaultAPIServiceMock) ListRoles(ctx context.Context, projectId string, instanceId string, region ListRolesRegionParameter) ApiListRolesRequest { return ApiListRolesRequest{ ApiService: a, ctx: ctx, @@ -459,7 +459,7 @@ func (a DefaultAPIServiceMock) ListRolesExecute(r ApiListRolesRequest) (*ListRol return (*a.ListRolesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, flavorId string, region string) ApiListStoragesRequest { +func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, flavorId string, region ListStoragesRegionParameter) ApiListStoragesRequest { return ApiListStoragesRequest{ ApiService: a, ctx: ctx, @@ -479,7 +479,7 @@ func (a DefaultAPIServiceMock) ListStoragesExecute(r ApiListStoragesRequest) (*L return (*a.ListStoragesExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, instanceId string, region string) ApiListUsersRequest { +func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, instanceId string, region ListUsersRegionParameter) ApiListUsersRequest { return ApiListUsersRequest{ ApiService: a, ctx: ctx, @@ -499,7 +499,7 @@ func (a DefaultAPIServiceMock) ListUsersExecute(r ApiListUsersRequest) (*ListUse return (*a.ListUsersExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { +func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region ListVersionsRegionParameter) ApiListVersionsRequest { return ApiListVersionsRequest{ ApiService: a, ctx: ctx, @@ -518,7 +518,7 @@ func (a DefaultAPIServiceMock) ListVersionsExecute(r ApiListVersionsRequest) (*L return (*a.ListVersionsExecuteMock)(r) } -func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiPartialUpdateInstanceRequest { +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string, region PartialUpdateInstanceRegionParameter) ApiPartialUpdateInstanceRequest { return ApiPartialUpdateInstanceRequest{ ApiService: a, ctx: ctx, @@ -538,7 +538,7 @@ func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateIn return (*a.PartialUpdateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region string) ApiResetUserRequest { +func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, instanceId string, userId string, region ResetUserRegionParameter) ApiResetUserRequest { return ApiResetUserRequest{ ApiService: a, ctx: ctx, @@ -559,7 +559,7 @@ func (a DefaultAPIServiceMock) ResetUserExecute(r ApiResetUserRequest) (*ResetUs return (*a.ResetUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) TerminateProject(ctx context.Context, projectId string, region string) ApiTerminateProjectRequest { +func (a DefaultAPIServiceMock) TerminateProject(ctx context.Context, projectId string, region TerminateProjectRegionParameter) ApiTerminateProjectRequest { return ApiTerminateProjectRequest{ ApiService: a, ctx: ctx, @@ -577,7 +577,7 @@ func (a DefaultAPIServiceMock) TerminateProjectExecute(r ApiTerminateProjectRequ return (*a.TerminateProjectExecuteMock)(r) } -func (a DefaultAPIServiceMock) TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseBackupRequest { +func (a DefaultAPIServiceMock) TriggerDatabaseBackup(ctx context.Context, projectId string, instanceId string, databaseName string, region TriggerDatabaseBackupRegionParameter) ApiTriggerDatabaseBackupRequest { return ApiTriggerDatabaseBackupRequest{ ApiService: a, ctx: ctx, @@ -597,7 +597,7 @@ func (a DefaultAPIServiceMock) TriggerDatabaseBackupExecute(r ApiTriggerDatabase return (*a.TriggerDatabaseBackupExecuteMock)(r) } -func (a DefaultAPIServiceMock) TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string, region string) ApiTriggerDatabaseRestoreRequest { +func (a DefaultAPIServiceMock) TriggerDatabaseRestore(ctx context.Context, projectId string, instanceId string, databaseName string, region TriggerDatabaseRestoreRegionParameter) ApiTriggerDatabaseRestoreRequest { return ApiTriggerDatabaseRestoreRequest{ ApiService: a, ctx: ctx, @@ -617,7 +617,7 @@ func (a DefaultAPIServiceMock) TriggerDatabaseRestoreExecute(r ApiTriggerDatabas return (*a.TriggerDatabaseRestoreExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, instanceId string, region string) ApiUpdateInstanceRequest { +func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, instanceId string, region UpdateInstanceRegionParameter) ApiUpdateInstanceRequest { return ApiUpdateInstanceRequest{ ApiService: a, ctx: ctx, diff --git a/services/sqlserverflex/v2api/model_create_database_region_parameter.go b/services/sqlserverflex/v2api/model_create_database_region_parameter.go new file mode 100644 index 000000000..64c3fa535 --- /dev/null +++ b/services/sqlserverflex/v2api/model_create_database_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateDatabaseRegionParameter the model 'CreateDatabaseRegionParameter' +type CreateDatabaseRegionParameter string + +// List of CreateDatabase_region_parameter +const ( + CREATEDATABASEREGIONPARAMETER_EU01 CreateDatabaseRegionParameter = "eu01" + CREATEDATABASEREGIONPARAMETER_EU02 CreateDatabaseRegionParameter = "eu02" + CREATEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateDatabaseRegionParameter = "unknown_default_open_api" +) + +// All allowed values of CreateDatabaseRegionParameter enum +var AllowedCreateDatabaseRegionParameterEnumValues = []CreateDatabaseRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *CreateDatabaseRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateDatabaseRegionParameter(value) + for _, existing := range AllowedCreateDatabaseRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateDatabaseRegionParameterFromValue returns a pointer to a valid CreateDatabaseRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateDatabaseRegionParameterFromValue(v string) (*CreateDatabaseRegionParameter, error) { + ev := CreateDatabaseRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateDatabaseRegionParameter: valid values are %v", v, AllowedCreateDatabaseRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateDatabaseRegionParameter) IsValid() bool { + for _, existing := range AllowedCreateDatabaseRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateDatabase_region_parameter value +func (v CreateDatabaseRegionParameter) Ptr() *CreateDatabaseRegionParameter { + return &v +} + +type NullableCreateDatabaseRegionParameter struct { + value *CreateDatabaseRegionParameter + isSet bool +} + +func (v NullableCreateDatabaseRegionParameter) Get() *CreateDatabaseRegionParameter { + return v.value +} + +func (v *NullableCreateDatabaseRegionParameter) Set(val *CreateDatabaseRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDatabaseRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDatabaseRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDatabaseRegionParameter(val *CreateDatabaseRegionParameter) *NullableCreateDatabaseRegionParameter { + return &NullableCreateDatabaseRegionParameter{value: val, isSet: true} +} + +func (v NullableCreateDatabaseRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDatabaseRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_create_instance_region_parameter.go b/services/sqlserverflex/v2api/model_create_instance_region_parameter.go new file mode 100644 index 000000000..636b63dac --- /dev/null +++ b/services/sqlserverflex/v2api/model_create_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateInstanceRegionParameter the model 'CreateInstanceRegionParameter' +type CreateInstanceRegionParameter string + +// List of CreateInstance_region_parameter +const ( + CREATEINSTANCEREGIONPARAMETER_EU01 CreateInstanceRegionParameter = "eu01" + CREATEINSTANCEREGIONPARAMETER_EU02 CreateInstanceRegionParameter = "eu02" + CREATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of CreateInstanceRegionParameter enum +var AllowedCreateInstanceRegionParameterEnumValues = []CreateInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *CreateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateInstanceRegionParameter(value) + for _, existing := range AllowedCreateInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateInstanceRegionParameterFromValue returns a pointer to a valid CreateInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateInstanceRegionParameterFromValue(v string) (*CreateInstanceRegionParameter, error) { + ev := CreateInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateInstanceRegionParameter: valid values are %v", v, AllowedCreateInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedCreateInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateInstance_region_parameter value +func (v CreateInstanceRegionParameter) Ptr() *CreateInstanceRegionParameter { + return &v +} + +type NullableCreateInstanceRegionParameter struct { + value *CreateInstanceRegionParameter + isSet bool +} + +func (v NullableCreateInstanceRegionParameter) Get() *CreateInstanceRegionParameter { + return v.value +} + +func (v *NullableCreateInstanceRegionParameter) Set(val *CreateInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceRegionParameter(val *CreateInstanceRegionParameter) *NullableCreateInstanceRegionParameter { + return &NullableCreateInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableCreateInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_create_user_region_parameter.go b/services/sqlserverflex/v2api/model_create_user_region_parameter.go new file mode 100644 index 000000000..3bc0beefd --- /dev/null +++ b/services/sqlserverflex/v2api/model_create_user_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateUserRegionParameter the model 'CreateUserRegionParameter' +type CreateUserRegionParameter string + +// List of CreateUser_region_parameter +const ( + CREATEUSERREGIONPARAMETER_EU01 CreateUserRegionParameter = "eu01" + CREATEUSERREGIONPARAMETER_EU02 CreateUserRegionParameter = "eu02" + CREATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API CreateUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of CreateUserRegionParameter enum +var AllowedCreateUserRegionParameterEnumValues = []CreateUserRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *CreateUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateUserRegionParameter(value) + for _, existing := range AllowedCreateUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateUserRegionParameterFromValue returns a pointer to a valid CreateUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateUserRegionParameterFromValue(v string) (*CreateUserRegionParameter, error) { + ev := CreateUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateUserRegionParameter: valid values are %v", v, AllowedCreateUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateUserRegionParameter) IsValid() bool { + for _, existing := range AllowedCreateUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateUser_region_parameter value +func (v CreateUserRegionParameter) Ptr() *CreateUserRegionParameter { + return &v +} + +type NullableCreateUserRegionParameter struct { + value *CreateUserRegionParameter + isSet bool +} + +func (v NullableCreateUserRegionParameter) Get() *CreateUserRegionParameter { + return v.value +} + +func (v *NullableCreateUserRegionParameter) Set(val *CreateUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserRegionParameter(val *CreateUserRegionParameter) *NullableCreateUserRegionParameter { + return &NullableCreateUserRegionParameter{value: val, isSet: true} +} + +func (v NullableCreateUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_delete_database_region_parameter.go b/services/sqlserverflex/v2api/model_delete_database_region_parameter.go new file mode 100644 index 000000000..82338c7b4 --- /dev/null +++ b/services/sqlserverflex/v2api/model_delete_database_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// DeleteDatabaseRegionParameter the model 'DeleteDatabaseRegionParameter' +type DeleteDatabaseRegionParameter string + +// List of DeleteDatabase_region_parameter +const ( + DELETEDATABASEREGIONPARAMETER_EU01 DeleteDatabaseRegionParameter = "eu01" + DELETEDATABASEREGIONPARAMETER_EU02 DeleteDatabaseRegionParameter = "eu02" + DELETEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteDatabaseRegionParameter = "unknown_default_open_api" +) + +// All allowed values of DeleteDatabaseRegionParameter enum +var AllowedDeleteDatabaseRegionParameterEnumValues = []DeleteDatabaseRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *DeleteDatabaseRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeleteDatabaseRegionParameter(value) + for _, existing := range AllowedDeleteDatabaseRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DELETEDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDeleteDatabaseRegionParameterFromValue returns a pointer to a valid DeleteDatabaseRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeleteDatabaseRegionParameterFromValue(v string) (*DeleteDatabaseRegionParameter, error) { + ev := DeleteDatabaseRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeleteDatabaseRegionParameter: valid values are %v", v, AllowedDeleteDatabaseRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeleteDatabaseRegionParameter) IsValid() bool { + for _, existing := range AllowedDeleteDatabaseRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteDatabase_region_parameter value +func (v DeleteDatabaseRegionParameter) Ptr() *DeleteDatabaseRegionParameter { + return &v +} + +type NullableDeleteDatabaseRegionParameter struct { + value *DeleteDatabaseRegionParameter + isSet bool +} + +func (v NullableDeleteDatabaseRegionParameter) Get() *DeleteDatabaseRegionParameter { + return v.value +} + +func (v *NullableDeleteDatabaseRegionParameter) Set(val *DeleteDatabaseRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteDatabaseRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteDatabaseRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteDatabaseRegionParameter(val *DeleteDatabaseRegionParameter) *NullableDeleteDatabaseRegionParameter { + return &NullableDeleteDatabaseRegionParameter{value: val, isSet: true} +} + +func (v NullableDeleteDatabaseRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteDatabaseRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_delete_instance_region_parameter.go b/services/sqlserverflex/v2api/model_delete_instance_region_parameter.go new file mode 100644 index 000000000..4cef2a191 --- /dev/null +++ b/services/sqlserverflex/v2api/model_delete_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// DeleteInstanceRegionParameter the model 'DeleteInstanceRegionParameter' +type DeleteInstanceRegionParameter string + +// List of DeleteInstance_region_parameter +const ( + DELETEINSTANCEREGIONPARAMETER_EU01 DeleteInstanceRegionParameter = "eu01" + DELETEINSTANCEREGIONPARAMETER_EU02 DeleteInstanceRegionParameter = "eu02" + DELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of DeleteInstanceRegionParameter enum +var AllowedDeleteInstanceRegionParameterEnumValues = []DeleteInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *DeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeleteInstanceRegionParameter(value) + for _, existing := range AllowedDeleteInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DELETEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDeleteInstanceRegionParameterFromValue returns a pointer to a valid DeleteInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeleteInstanceRegionParameterFromValue(v string) (*DeleteInstanceRegionParameter, error) { + ev := DeleteInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeleteInstanceRegionParameter: valid values are %v", v, AllowedDeleteInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeleteInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedDeleteInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteInstance_region_parameter value +func (v DeleteInstanceRegionParameter) Ptr() *DeleteInstanceRegionParameter { + return &v +} + +type NullableDeleteInstanceRegionParameter struct { + value *DeleteInstanceRegionParameter + isSet bool +} + +func (v NullableDeleteInstanceRegionParameter) Get() *DeleteInstanceRegionParameter { + return v.value +} + +func (v *NullableDeleteInstanceRegionParameter) Set(val *DeleteInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteInstanceRegionParameter(val *DeleteInstanceRegionParameter) *NullableDeleteInstanceRegionParameter { + return &NullableDeleteInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableDeleteInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_delete_user_region_parameter.go b/services/sqlserverflex/v2api/model_delete_user_region_parameter.go new file mode 100644 index 000000000..0ea264bc3 --- /dev/null +++ b/services/sqlserverflex/v2api/model_delete_user_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// DeleteUserRegionParameter the model 'DeleteUserRegionParameter' +type DeleteUserRegionParameter string + +// List of DeleteUser_region_parameter +const ( + DELETEUSERREGIONPARAMETER_EU01 DeleteUserRegionParameter = "eu01" + DELETEUSERREGIONPARAMETER_EU02 DeleteUserRegionParameter = "eu02" + DELETEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API DeleteUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of DeleteUserRegionParameter enum +var AllowedDeleteUserRegionParameterEnumValues = []DeleteUserRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *DeleteUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeleteUserRegionParameter(value) + for _, existing := range AllowedDeleteUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DELETEUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDeleteUserRegionParameterFromValue returns a pointer to a valid DeleteUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeleteUserRegionParameterFromValue(v string) (*DeleteUserRegionParameter, error) { + ev := DeleteUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeleteUserRegionParameter: valid values are %v", v, AllowedDeleteUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeleteUserRegionParameter) IsValid() bool { + for _, existing := range AllowedDeleteUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteUser_region_parameter value +func (v DeleteUserRegionParameter) Ptr() *DeleteUserRegionParameter { + return &v +} + +type NullableDeleteUserRegionParameter struct { + value *DeleteUserRegionParameter + isSet bool +} + +func (v NullableDeleteUserRegionParameter) Get() *DeleteUserRegionParameter { + return v.value +} + +func (v *NullableDeleteUserRegionParameter) Set(val *DeleteUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteUserRegionParameter(val *DeleteUserRegionParameter) *NullableDeleteUserRegionParameter { + return &NullableDeleteUserRegionParameter{value: val, isSet: true} +} + +func (v NullableDeleteUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_get_backup_region_parameter.go b/services/sqlserverflex/v2api/model_get_backup_region_parameter.go new file mode 100644 index 000000000..430b8c941 --- /dev/null +++ b/services/sqlserverflex/v2api/model_get_backup_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetBackupRegionParameter the model 'GetBackupRegionParameter' +type GetBackupRegionParameter string + +// List of GetBackup_region_parameter +const ( + GETBACKUPREGIONPARAMETER_EU01 GetBackupRegionParameter = "eu01" + GETBACKUPREGIONPARAMETER_EU02 GetBackupRegionParameter = "eu02" + GETBACKUPREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetBackupRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetBackupRegionParameter enum +var AllowedGetBackupRegionParameterEnumValues = []GetBackupRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetBackupRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetBackupRegionParameter(value) + for _, existing := range AllowedGetBackupRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETBACKUPREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetBackupRegionParameterFromValue returns a pointer to a valid GetBackupRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetBackupRegionParameterFromValue(v string) (*GetBackupRegionParameter, error) { + ev := GetBackupRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetBackupRegionParameter: valid values are %v", v, AllowedGetBackupRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetBackupRegionParameter) IsValid() bool { + for _, existing := range AllowedGetBackupRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetBackup_region_parameter value +func (v GetBackupRegionParameter) Ptr() *GetBackupRegionParameter { + return &v +} + +type NullableGetBackupRegionParameter struct { + value *GetBackupRegionParameter + isSet bool +} + +func (v NullableGetBackupRegionParameter) Get() *GetBackupRegionParameter { + return v.value +} + +func (v *NullableGetBackupRegionParameter) Set(val *GetBackupRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupRegionParameter(val *GetBackupRegionParameter) *NullableGetBackupRegionParameter { + return &NullableGetBackupRegionParameter{value: val, isSet: true} +} + +func (v NullableGetBackupRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_get_database_region_parameter.go b/services/sqlserverflex/v2api/model_get_database_region_parameter.go new file mode 100644 index 000000000..9e2ba9774 --- /dev/null +++ b/services/sqlserverflex/v2api/model_get_database_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetDatabaseRegionParameter the model 'GetDatabaseRegionParameter' +type GetDatabaseRegionParameter string + +// List of GetDatabase_region_parameter +const ( + GETDATABASEREGIONPARAMETER_EU01 GetDatabaseRegionParameter = "eu01" + GETDATABASEREGIONPARAMETER_EU02 GetDatabaseRegionParameter = "eu02" + GETDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetDatabaseRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetDatabaseRegionParameter enum +var AllowedGetDatabaseRegionParameterEnumValues = []GetDatabaseRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetDatabaseRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetDatabaseRegionParameter(value) + for _, existing := range AllowedGetDatabaseRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETDATABASEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetDatabaseRegionParameterFromValue returns a pointer to a valid GetDatabaseRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetDatabaseRegionParameterFromValue(v string) (*GetDatabaseRegionParameter, error) { + ev := GetDatabaseRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetDatabaseRegionParameter: valid values are %v", v, AllowedGetDatabaseRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetDatabaseRegionParameter) IsValid() bool { + for _, existing := range AllowedGetDatabaseRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetDatabase_region_parameter value +func (v GetDatabaseRegionParameter) Ptr() *GetDatabaseRegionParameter { + return &v +} + +type NullableGetDatabaseRegionParameter struct { + value *GetDatabaseRegionParameter + isSet bool +} + +func (v NullableGetDatabaseRegionParameter) Get() *GetDatabaseRegionParameter { + return v.value +} + +func (v *NullableGetDatabaseRegionParameter) Set(val *GetDatabaseRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetDatabaseRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetDatabaseRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetDatabaseRegionParameter(val *GetDatabaseRegionParameter) *NullableGetDatabaseRegionParameter { + return &NullableGetDatabaseRegionParameter{value: val, isSet: true} +} + +func (v NullableGetDatabaseRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetDatabaseRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_get_instance_region_parameter.go b/services/sqlserverflex/v2api/model_get_instance_region_parameter.go new file mode 100644 index 000000000..ffcb4d74c --- /dev/null +++ b/services/sqlserverflex/v2api/model_get_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetInstanceRegionParameter the model 'GetInstanceRegionParameter' +type GetInstanceRegionParameter string + +// List of GetInstance_region_parameter +const ( + GETINSTANCEREGIONPARAMETER_EU01 GetInstanceRegionParameter = "eu01" + GETINSTANCEREGIONPARAMETER_EU02 GetInstanceRegionParameter = "eu02" + GETINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetInstanceRegionParameter enum +var AllowedGetInstanceRegionParameterEnumValues = []GetInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetInstanceRegionParameter(value) + for _, existing := range AllowedGetInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetInstanceRegionParameterFromValue returns a pointer to a valid GetInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetInstanceRegionParameterFromValue(v string) (*GetInstanceRegionParameter, error) { + ev := GetInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetInstanceRegionParameter: valid values are %v", v, AllowedGetInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedGetInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetInstance_region_parameter value +func (v GetInstanceRegionParameter) Ptr() *GetInstanceRegionParameter { + return &v +} + +type NullableGetInstanceRegionParameter struct { + value *GetInstanceRegionParameter + isSet bool +} + +func (v NullableGetInstanceRegionParameter) Get() *GetInstanceRegionParameter { + return v.value +} + +func (v *NullableGetInstanceRegionParameter) Set(val *GetInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetInstanceRegionParameter(val *GetInstanceRegionParameter) *NullableGetInstanceRegionParameter { + return &NullableGetInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableGetInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_get_user_region_parameter.go b/services/sqlserverflex/v2api/model_get_user_region_parameter.go new file mode 100644 index 000000000..625699410 --- /dev/null +++ b/services/sqlserverflex/v2api/model_get_user_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// GetUserRegionParameter the model 'GetUserRegionParameter' +type GetUserRegionParameter string + +// List of GetUser_region_parameter +const ( + GETUSERREGIONPARAMETER_EU01 GetUserRegionParameter = "eu01" + GETUSERREGIONPARAMETER_EU02 GetUserRegionParameter = "eu02" + GETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetUserRegionParameter enum +var AllowedGetUserRegionParameterEnumValues = []GetUserRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetUserRegionParameter(value) + for _, existing := range AllowedGetUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetUserRegionParameterFromValue returns a pointer to a valid GetUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetUserRegionParameterFromValue(v string) (*GetUserRegionParameter, error) { + ev := GetUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetUserRegionParameter: valid values are %v", v, AllowedGetUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetUserRegionParameter) IsValid() bool { + for _, existing := range AllowedGetUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetUser_region_parameter value +func (v GetUserRegionParameter) Ptr() *GetUserRegionParameter { + return &v +} + +type NullableGetUserRegionParameter struct { + value *GetUserRegionParameter + isSet bool +} + +func (v NullableGetUserRegionParameter) Get() *GetUserRegionParameter { + return v.value +} + +func (v *NullableGetUserRegionParameter) Set(val *GetUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetUserRegionParameter(val *GetUserRegionParameter) *NullableGetUserRegionParameter { + return &NullableGetUserRegionParameter{value: val, isSet: true} +} + +func (v NullableGetUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_backups_region_parameter.go b/services/sqlserverflex/v2api/model_list_backups_region_parameter.go new file mode 100644 index 000000000..fe9939d64 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_backups_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListBackupsRegionParameter the model 'ListBackupsRegionParameter' +type ListBackupsRegionParameter string + +// List of ListBackups_region_parameter +const ( + LISTBACKUPSREGIONPARAMETER_EU01 ListBackupsRegionParameter = "eu01" + LISTBACKUPSREGIONPARAMETER_EU02 ListBackupsRegionParameter = "eu02" + LISTBACKUPSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListBackupsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListBackupsRegionParameter enum +var AllowedListBackupsRegionParameterEnumValues = []ListBackupsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListBackupsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListBackupsRegionParameter(value) + for _, existing := range AllowedListBackupsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTBACKUPSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListBackupsRegionParameterFromValue returns a pointer to a valid ListBackupsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListBackupsRegionParameterFromValue(v string) (*ListBackupsRegionParameter, error) { + ev := ListBackupsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListBackupsRegionParameter: valid values are %v", v, AllowedListBackupsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListBackupsRegionParameter) IsValid() bool { + for _, existing := range AllowedListBackupsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListBackups_region_parameter value +func (v ListBackupsRegionParameter) Ptr() *ListBackupsRegionParameter { + return &v +} + +type NullableListBackupsRegionParameter struct { + value *ListBackupsRegionParameter + isSet bool +} + +func (v NullableListBackupsRegionParameter) Get() *ListBackupsRegionParameter { + return v.value +} + +func (v *NullableListBackupsRegionParameter) Set(val *ListBackupsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsRegionParameter(val *ListBackupsRegionParameter) *NullableListBackupsRegionParameter { + return &NullableListBackupsRegionParameter{value: val, isSet: true} +} + +func (v NullableListBackupsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_collations_region_parameter.go b/services/sqlserverflex/v2api/model_list_collations_region_parameter.go new file mode 100644 index 000000000..e9fb26eac --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_collations_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListCollationsRegionParameter the model 'ListCollationsRegionParameter' +type ListCollationsRegionParameter string + +// List of ListCollations_region_parameter +const ( + LISTCOLLATIONSREGIONPARAMETER_EU01 ListCollationsRegionParameter = "eu01" + LISTCOLLATIONSREGIONPARAMETER_EU02 ListCollationsRegionParameter = "eu02" + LISTCOLLATIONSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListCollationsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListCollationsRegionParameter enum +var AllowedListCollationsRegionParameterEnumValues = []ListCollationsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListCollationsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListCollationsRegionParameter(value) + for _, existing := range AllowedListCollationsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTCOLLATIONSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListCollationsRegionParameterFromValue returns a pointer to a valid ListCollationsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListCollationsRegionParameterFromValue(v string) (*ListCollationsRegionParameter, error) { + ev := ListCollationsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListCollationsRegionParameter: valid values are %v", v, AllowedListCollationsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListCollationsRegionParameter) IsValid() bool { + for _, existing := range AllowedListCollationsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListCollations_region_parameter value +func (v ListCollationsRegionParameter) Ptr() *ListCollationsRegionParameter { + return &v +} + +type NullableListCollationsRegionParameter struct { + value *ListCollationsRegionParameter + isSet bool +} + +func (v NullableListCollationsRegionParameter) Get() *ListCollationsRegionParameter { + return v.value +} + +func (v *NullableListCollationsRegionParameter) Set(val *ListCollationsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListCollationsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListCollationsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCollationsRegionParameter(val *ListCollationsRegionParameter) *NullableListCollationsRegionParameter { + return &NullableListCollationsRegionParameter{value: val, isSet: true} +} + +func (v NullableListCollationsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCollationsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_compatibility_region_parameter.go b/services/sqlserverflex/v2api/model_list_compatibility_region_parameter.go new file mode 100644 index 000000000..66d8aa01e --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_compatibility_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListCompatibilityRegionParameter the model 'ListCompatibilityRegionParameter' +type ListCompatibilityRegionParameter string + +// List of ListCompatibility_region_parameter +const ( + LISTCOMPATIBILITYREGIONPARAMETER_EU01 ListCompatibilityRegionParameter = "eu01" + LISTCOMPATIBILITYREGIONPARAMETER_EU02 ListCompatibilityRegionParameter = "eu02" + LISTCOMPATIBILITYREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListCompatibilityRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListCompatibilityRegionParameter enum +var AllowedListCompatibilityRegionParameterEnumValues = []ListCompatibilityRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListCompatibilityRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListCompatibilityRegionParameter(value) + for _, existing := range AllowedListCompatibilityRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTCOMPATIBILITYREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListCompatibilityRegionParameterFromValue returns a pointer to a valid ListCompatibilityRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListCompatibilityRegionParameterFromValue(v string) (*ListCompatibilityRegionParameter, error) { + ev := ListCompatibilityRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListCompatibilityRegionParameter: valid values are %v", v, AllowedListCompatibilityRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListCompatibilityRegionParameter) IsValid() bool { + for _, existing := range AllowedListCompatibilityRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListCompatibility_region_parameter value +func (v ListCompatibilityRegionParameter) Ptr() *ListCompatibilityRegionParameter { + return &v +} + +type NullableListCompatibilityRegionParameter struct { + value *ListCompatibilityRegionParameter + isSet bool +} + +func (v NullableListCompatibilityRegionParameter) Get() *ListCompatibilityRegionParameter { + return v.value +} + +func (v *NullableListCompatibilityRegionParameter) Set(val *ListCompatibilityRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListCompatibilityRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListCompatibilityRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCompatibilityRegionParameter(val *ListCompatibilityRegionParameter) *NullableListCompatibilityRegionParameter { + return &NullableListCompatibilityRegionParameter{value: val, isSet: true} +} + +func (v NullableListCompatibilityRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCompatibilityRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_databases_region_parameter.go b/services/sqlserverflex/v2api/model_list_databases_region_parameter.go new file mode 100644 index 000000000..7af2ead18 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_databases_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListDatabasesRegionParameter the model 'ListDatabasesRegionParameter' +type ListDatabasesRegionParameter string + +// List of ListDatabases_region_parameter +const ( + LISTDATABASESREGIONPARAMETER_EU01 ListDatabasesRegionParameter = "eu01" + LISTDATABASESREGIONPARAMETER_EU02 ListDatabasesRegionParameter = "eu02" + LISTDATABASESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDatabasesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListDatabasesRegionParameter enum +var AllowedListDatabasesRegionParameterEnumValues = []ListDatabasesRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListDatabasesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListDatabasesRegionParameter(value) + for _, existing := range AllowedListDatabasesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTDATABASESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListDatabasesRegionParameterFromValue returns a pointer to a valid ListDatabasesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListDatabasesRegionParameterFromValue(v string) (*ListDatabasesRegionParameter, error) { + ev := ListDatabasesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListDatabasesRegionParameter: valid values are %v", v, AllowedListDatabasesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListDatabasesRegionParameter) IsValid() bool { + for _, existing := range AllowedListDatabasesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListDatabases_region_parameter value +func (v ListDatabasesRegionParameter) Ptr() *ListDatabasesRegionParameter { + return &v +} + +type NullableListDatabasesRegionParameter struct { + value *ListDatabasesRegionParameter + isSet bool +} + +func (v NullableListDatabasesRegionParameter) Get() *ListDatabasesRegionParameter { + return v.value +} + +func (v *NullableListDatabasesRegionParameter) Set(val *ListDatabasesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListDatabasesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListDatabasesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDatabasesRegionParameter(val *ListDatabasesRegionParameter) *NullableListDatabasesRegionParameter { + return &NullableListDatabasesRegionParameter{value: val, isSet: true} +} + +func (v NullableListDatabasesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDatabasesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_flavors_region_parameter.go b/services/sqlserverflex/v2api/model_list_flavors_region_parameter.go new file mode 100644 index 000000000..04e2ec12c --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_flavors_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListFlavorsRegionParameter the model 'ListFlavorsRegionParameter' +type ListFlavorsRegionParameter string + +// List of ListFlavors_region_parameter +const ( + LISTFLAVORSREGIONPARAMETER_EU01 ListFlavorsRegionParameter = "eu01" + LISTFLAVORSREGIONPARAMETER_EU02 ListFlavorsRegionParameter = "eu02" + LISTFLAVORSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListFlavorsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListFlavorsRegionParameter enum +var AllowedListFlavorsRegionParameterEnumValues = []ListFlavorsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListFlavorsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListFlavorsRegionParameter(value) + for _, existing := range AllowedListFlavorsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTFLAVORSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListFlavorsRegionParameterFromValue returns a pointer to a valid ListFlavorsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListFlavorsRegionParameterFromValue(v string) (*ListFlavorsRegionParameter, error) { + ev := ListFlavorsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListFlavorsRegionParameter: valid values are %v", v, AllowedListFlavorsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListFlavorsRegionParameter) IsValid() bool { + for _, existing := range AllowedListFlavorsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListFlavors_region_parameter value +func (v ListFlavorsRegionParameter) Ptr() *ListFlavorsRegionParameter { + return &v +} + +type NullableListFlavorsRegionParameter struct { + value *ListFlavorsRegionParameter + isSet bool +} + +func (v NullableListFlavorsRegionParameter) Get() *ListFlavorsRegionParameter { + return v.value +} + +func (v *NullableListFlavorsRegionParameter) Set(val *ListFlavorsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListFlavorsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlavorsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlavorsRegionParameter(val *ListFlavorsRegionParameter) *NullableListFlavorsRegionParameter { + return &NullableListFlavorsRegionParameter{value: val, isSet: true} +} + +func (v NullableListFlavorsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlavorsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_instances_region_parameter.go b/services/sqlserverflex/v2api/model_list_instances_region_parameter.go new file mode 100644 index 000000000..ba1d54fda --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_instances_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListInstancesRegionParameter the model 'ListInstancesRegionParameter' +type ListInstancesRegionParameter string + +// List of ListInstances_region_parameter +const ( + LISTINSTANCESREGIONPARAMETER_EU01 ListInstancesRegionParameter = "eu01" + LISTINSTANCESREGIONPARAMETER_EU02 ListInstancesRegionParameter = "eu02" + LISTINSTANCESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListInstancesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListInstancesRegionParameter enum +var AllowedListInstancesRegionParameterEnumValues = []ListInstancesRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListInstancesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListInstancesRegionParameter(value) + for _, existing := range AllowedListInstancesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTINSTANCESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListInstancesRegionParameterFromValue returns a pointer to a valid ListInstancesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListInstancesRegionParameterFromValue(v string) (*ListInstancesRegionParameter, error) { + ev := ListInstancesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListInstancesRegionParameter: valid values are %v", v, AllowedListInstancesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListInstancesRegionParameter) IsValid() bool { + for _, existing := range AllowedListInstancesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListInstances_region_parameter value +func (v ListInstancesRegionParameter) Ptr() *ListInstancesRegionParameter { + return &v +} + +type NullableListInstancesRegionParameter struct { + value *ListInstancesRegionParameter + isSet bool +} + +func (v NullableListInstancesRegionParameter) Get() *ListInstancesRegionParameter { + return v.value +} + +func (v *NullableListInstancesRegionParameter) Set(val *ListInstancesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesRegionParameter(val *ListInstancesRegionParameter) *NullableListInstancesRegionParameter { + return &NullableListInstancesRegionParameter{value: val, isSet: true} +} + +func (v NullableListInstancesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_metrics_region_parameter.go b/services/sqlserverflex/v2api/model_list_metrics_region_parameter.go new file mode 100644 index 000000000..cbe8a0b6f --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_metrics_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListMetricsRegionParameter the model 'ListMetricsRegionParameter' +type ListMetricsRegionParameter string + +// List of ListMetrics_region_parameter +const ( + LISTMETRICSREGIONPARAMETER_EU01 ListMetricsRegionParameter = "eu01" + LISTMETRICSREGIONPARAMETER_EU02 ListMetricsRegionParameter = "eu02" + LISTMETRICSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListMetricsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListMetricsRegionParameter enum +var AllowedListMetricsRegionParameterEnumValues = []ListMetricsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListMetricsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListMetricsRegionParameter(value) + for _, existing := range AllowedListMetricsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTMETRICSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListMetricsRegionParameterFromValue returns a pointer to a valid ListMetricsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListMetricsRegionParameterFromValue(v string) (*ListMetricsRegionParameter, error) { + ev := ListMetricsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListMetricsRegionParameter: valid values are %v", v, AllowedListMetricsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListMetricsRegionParameter) IsValid() bool { + for _, existing := range AllowedListMetricsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListMetrics_region_parameter value +func (v ListMetricsRegionParameter) Ptr() *ListMetricsRegionParameter { + return &v +} + +type NullableListMetricsRegionParameter struct { + value *ListMetricsRegionParameter + isSet bool +} + +func (v NullableListMetricsRegionParameter) Get() *ListMetricsRegionParameter { + return v.value +} + +func (v *NullableListMetricsRegionParameter) Set(val *ListMetricsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListMetricsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListMetricsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListMetricsRegionParameter(val *ListMetricsRegionParameter) *NullableListMetricsRegionParameter { + return &NullableListMetricsRegionParameter{value: val, isSet: true} +} + +func (v NullableListMetricsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListMetricsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_restore_jobs_region_parameter.go b/services/sqlserverflex/v2api/model_list_restore_jobs_region_parameter.go new file mode 100644 index 000000000..4f800c703 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_restore_jobs_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListRestoreJobsRegionParameter the model 'ListRestoreJobsRegionParameter' +type ListRestoreJobsRegionParameter string + +// List of ListRestoreJobs_region_parameter +const ( + LISTRESTOREJOBSREGIONPARAMETER_EU01 ListRestoreJobsRegionParameter = "eu01" + LISTRESTOREJOBSREGIONPARAMETER_EU02 ListRestoreJobsRegionParameter = "eu02" + LISTRESTOREJOBSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRestoreJobsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListRestoreJobsRegionParameter enum +var AllowedListRestoreJobsRegionParameterEnumValues = []ListRestoreJobsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListRestoreJobsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRestoreJobsRegionParameter(value) + for _, existing := range AllowedListRestoreJobsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTRESTOREJOBSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRestoreJobsRegionParameterFromValue returns a pointer to a valid ListRestoreJobsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRestoreJobsRegionParameterFromValue(v string) (*ListRestoreJobsRegionParameter, error) { + ev := ListRestoreJobsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRestoreJobsRegionParameter: valid values are %v", v, AllowedListRestoreJobsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRestoreJobsRegionParameter) IsValid() bool { + for _, existing := range AllowedListRestoreJobsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRestoreJobs_region_parameter value +func (v ListRestoreJobsRegionParameter) Ptr() *ListRestoreJobsRegionParameter { + return &v +} + +type NullableListRestoreJobsRegionParameter struct { + value *ListRestoreJobsRegionParameter + isSet bool +} + +func (v NullableListRestoreJobsRegionParameter) Get() *ListRestoreJobsRegionParameter { + return v.value +} + +func (v *NullableListRestoreJobsRegionParameter) Set(val *ListRestoreJobsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRestoreJobsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRestoreJobsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRestoreJobsRegionParameter(val *ListRestoreJobsRegionParameter) *NullableListRestoreJobsRegionParameter { + return &NullableListRestoreJobsRegionParameter{value: val, isSet: true} +} + +func (v NullableListRestoreJobsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRestoreJobsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_roles_region_parameter.go b/services/sqlserverflex/v2api/model_list_roles_region_parameter.go new file mode 100644 index 000000000..e818cc7f2 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_roles_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListRolesRegionParameter the model 'ListRolesRegionParameter' +type ListRolesRegionParameter string + +// List of ListRoles_region_parameter +const ( + LISTROLESREGIONPARAMETER_EU01 ListRolesRegionParameter = "eu01" + LISTROLESREGIONPARAMETER_EU02 ListRolesRegionParameter = "eu02" + LISTROLESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListRolesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListRolesRegionParameter enum +var AllowedListRolesRegionParameterEnumValues = []ListRolesRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListRolesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListRolesRegionParameter(value) + for _, existing := range AllowedListRolesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTROLESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListRolesRegionParameterFromValue returns a pointer to a valid ListRolesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListRolesRegionParameterFromValue(v string) (*ListRolesRegionParameter, error) { + ev := ListRolesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListRolesRegionParameter: valid values are %v", v, AllowedListRolesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListRolesRegionParameter) IsValid() bool { + for _, existing := range AllowedListRolesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListRoles_region_parameter value +func (v ListRolesRegionParameter) Ptr() *ListRolesRegionParameter { + return &v +} + +type NullableListRolesRegionParameter struct { + value *ListRolesRegionParameter + isSet bool +} + +func (v NullableListRolesRegionParameter) Get() *ListRolesRegionParameter { + return v.value +} + +func (v *NullableListRolesRegionParameter) Set(val *ListRolesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListRolesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListRolesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRolesRegionParameter(val *ListRolesRegionParameter) *NullableListRolesRegionParameter { + return &NullableListRolesRegionParameter{value: val, isSet: true} +} + +func (v NullableListRolesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRolesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_storages_region_parameter.go b/services/sqlserverflex/v2api/model_list_storages_region_parameter.go new file mode 100644 index 000000000..6208fd338 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_storages_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListStoragesRegionParameter the model 'ListStoragesRegionParameter' +type ListStoragesRegionParameter string + +// List of ListStorages_region_parameter +const ( + LISTSTORAGESREGIONPARAMETER_EU01 ListStoragesRegionParameter = "eu01" + LISTSTORAGESREGIONPARAMETER_EU02 ListStoragesRegionParameter = "eu02" + LISTSTORAGESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListStoragesRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListStoragesRegionParameter enum +var AllowedListStoragesRegionParameterEnumValues = []ListStoragesRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListStoragesRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListStoragesRegionParameter(value) + for _, existing := range AllowedListStoragesRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTSTORAGESREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListStoragesRegionParameterFromValue returns a pointer to a valid ListStoragesRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListStoragesRegionParameterFromValue(v string) (*ListStoragesRegionParameter, error) { + ev := ListStoragesRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListStoragesRegionParameter: valid values are %v", v, AllowedListStoragesRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListStoragesRegionParameter) IsValid() bool { + for _, existing := range AllowedListStoragesRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListStorages_region_parameter value +func (v ListStoragesRegionParameter) Ptr() *ListStoragesRegionParameter { + return &v +} + +type NullableListStoragesRegionParameter struct { + value *ListStoragesRegionParameter + isSet bool +} + +func (v NullableListStoragesRegionParameter) Get() *ListStoragesRegionParameter { + return v.value +} + +func (v *NullableListStoragesRegionParameter) Set(val *ListStoragesRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListStoragesRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListStoragesRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListStoragesRegionParameter(val *ListStoragesRegionParameter) *NullableListStoragesRegionParameter { + return &NullableListStoragesRegionParameter{value: val, isSet: true} +} + +func (v NullableListStoragesRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListStoragesRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_users_region_parameter.go b/services/sqlserverflex/v2api/model_list_users_region_parameter.go new file mode 100644 index 000000000..5696b1947 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_users_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListUsersRegionParameter the model 'ListUsersRegionParameter' +type ListUsersRegionParameter string + +// List of ListUsers_region_parameter +const ( + LISTUSERSREGIONPARAMETER_EU01 ListUsersRegionParameter = "eu01" + LISTUSERSREGIONPARAMETER_EU02 ListUsersRegionParameter = "eu02" + LISTUSERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListUsersRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListUsersRegionParameter enum +var AllowedListUsersRegionParameterEnumValues = []ListUsersRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListUsersRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListUsersRegionParameter(value) + for _, existing := range AllowedListUsersRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTUSERSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListUsersRegionParameterFromValue returns a pointer to a valid ListUsersRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListUsersRegionParameterFromValue(v string) (*ListUsersRegionParameter, error) { + ev := ListUsersRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListUsersRegionParameter: valid values are %v", v, AllowedListUsersRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListUsersRegionParameter) IsValid() bool { + for _, existing := range AllowedListUsersRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListUsers_region_parameter value +func (v ListUsersRegionParameter) Ptr() *ListUsersRegionParameter { + return &v +} + +type NullableListUsersRegionParameter struct { + value *ListUsersRegionParameter + isSet bool +} + +func (v NullableListUsersRegionParameter) Get() *ListUsersRegionParameter { + return v.value +} + +func (v *NullableListUsersRegionParameter) Set(val *ListUsersRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListUsersRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListUsersRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUsersRegionParameter(val *ListUsersRegionParameter) *NullableListUsersRegionParameter { + return &NullableListUsersRegionParameter{value: val, isSet: true} +} + +func (v NullableListUsersRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUsersRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_list_versions_region_parameter.go b/services/sqlserverflex/v2api/model_list_versions_region_parameter.go new file mode 100644 index 000000000..39e177000 --- /dev/null +++ b/services/sqlserverflex/v2api/model_list_versions_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ListVersionsRegionParameter the model 'ListVersionsRegionParameter' +type ListVersionsRegionParameter string + +// List of ListVersions_region_parameter +const ( + LISTVERSIONSREGIONPARAMETER_EU01 ListVersionsRegionParameter = "eu01" + LISTVERSIONSREGIONPARAMETER_EU02 ListVersionsRegionParameter = "eu02" + LISTVERSIONSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListVersionsRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ListVersionsRegionParameter enum +var AllowedListVersionsRegionParameterEnumValues = []ListVersionsRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListVersionsRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListVersionsRegionParameter(value) + for _, existing := range AllowedListVersionsRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTVERSIONSREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListVersionsRegionParameterFromValue returns a pointer to a valid ListVersionsRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListVersionsRegionParameterFromValue(v string) (*ListVersionsRegionParameter, error) { + ev := ListVersionsRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListVersionsRegionParameter: valid values are %v", v, AllowedListVersionsRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListVersionsRegionParameter) IsValid() bool { + for _, existing := range AllowedListVersionsRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListVersions_region_parameter value +func (v ListVersionsRegionParameter) Ptr() *ListVersionsRegionParameter { + return &v +} + +type NullableListVersionsRegionParameter struct { + value *ListVersionsRegionParameter + isSet bool +} + +func (v NullableListVersionsRegionParameter) Get() *ListVersionsRegionParameter { + return v.value +} + +func (v *NullableListVersionsRegionParameter) Set(val *ListVersionsRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListVersionsRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListVersionsRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListVersionsRegionParameter(val *ListVersionsRegionParameter) *NullableListVersionsRegionParameter { + return &NullableListVersionsRegionParameter{value: val, isSet: true} +} + +func (v NullableListVersionsRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListVersionsRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_partial_update_instance_region_parameter.go b/services/sqlserverflex/v2api/model_partial_update_instance_region_parameter.go new file mode 100644 index 000000000..a085e8075 --- /dev/null +++ b/services/sqlserverflex/v2api/model_partial_update_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// PartialUpdateInstanceRegionParameter the model 'PartialUpdateInstanceRegionParameter' +type PartialUpdateInstanceRegionParameter string + +// List of PartialUpdateInstance_region_parameter +const ( + PARTIALUPDATEINSTANCEREGIONPARAMETER_EU01 PartialUpdateInstanceRegionParameter = "eu01" + PARTIALUPDATEINSTANCEREGIONPARAMETER_EU02 PartialUpdateInstanceRegionParameter = "eu02" + PARTIALUPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API PartialUpdateInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of PartialUpdateInstanceRegionParameter enum +var AllowedPartialUpdateInstanceRegionParameterEnumValues = []PartialUpdateInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *PartialUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PartialUpdateInstanceRegionParameter(value) + for _, existing := range AllowedPartialUpdateInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PARTIALUPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPartialUpdateInstanceRegionParameterFromValue returns a pointer to a valid PartialUpdateInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPartialUpdateInstanceRegionParameterFromValue(v string) (*PartialUpdateInstanceRegionParameter, error) { + ev := PartialUpdateInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PartialUpdateInstanceRegionParameter: valid values are %v", v, AllowedPartialUpdateInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PartialUpdateInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedPartialUpdateInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PartialUpdateInstance_region_parameter value +func (v PartialUpdateInstanceRegionParameter) Ptr() *PartialUpdateInstanceRegionParameter { + return &v +} + +type NullablePartialUpdateInstanceRegionParameter struct { + value *PartialUpdateInstanceRegionParameter + isSet bool +} + +func (v NullablePartialUpdateInstanceRegionParameter) Get() *PartialUpdateInstanceRegionParameter { + return v.value +} + +func (v *NullablePartialUpdateInstanceRegionParameter) Set(val *PartialUpdateInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstanceRegionParameter(val *PartialUpdateInstanceRegionParameter) *NullablePartialUpdateInstanceRegionParameter { + return &NullablePartialUpdateInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_reset_user_region_parameter.go b/services/sqlserverflex/v2api/model_reset_user_region_parameter.go new file mode 100644 index 000000000..f98369b16 --- /dev/null +++ b/services/sqlserverflex/v2api/model_reset_user_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ResetUserRegionParameter the model 'ResetUserRegionParameter' +type ResetUserRegionParameter string + +// List of ResetUser_region_parameter +const ( + RESETUSERREGIONPARAMETER_EU01 ResetUserRegionParameter = "eu01" + RESETUSERREGIONPARAMETER_EU02 ResetUserRegionParameter = "eu02" + RESETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API ResetUserRegionParameter = "unknown_default_open_api" +) + +// All allowed values of ResetUserRegionParameter enum +var AllowedResetUserRegionParameterEnumValues = []ResetUserRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ResetUserRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ResetUserRegionParameter(value) + for _, existing := range AllowedResetUserRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = RESETUSERREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewResetUserRegionParameterFromValue returns a pointer to a valid ResetUserRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewResetUserRegionParameterFromValue(v string) (*ResetUserRegionParameter, error) { + ev := ResetUserRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ResetUserRegionParameter: valid values are %v", v, AllowedResetUserRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ResetUserRegionParameter) IsValid() bool { + for _, existing := range AllowedResetUserRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ResetUser_region_parameter value +func (v ResetUserRegionParameter) Ptr() *ResetUserRegionParameter { + return &v +} + +type NullableResetUserRegionParameter struct { + value *ResetUserRegionParameter + isSet bool +} + +func (v NullableResetUserRegionParameter) Get() *ResetUserRegionParameter { + return v.value +} + +func (v *NullableResetUserRegionParameter) Set(val *ResetUserRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableResetUserRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableResetUserRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResetUserRegionParameter(val *ResetUserRegionParameter) *NullableResetUserRegionParameter { + return &NullableResetUserRegionParameter{value: val, isSet: true} +} + +func (v NullableResetUserRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResetUserRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_terminate_project_region_parameter.go b/services/sqlserverflex/v2api/model_terminate_project_region_parameter.go new file mode 100644 index 000000000..b3388a612 --- /dev/null +++ b/services/sqlserverflex/v2api/model_terminate_project_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// TerminateProjectRegionParameter the model 'TerminateProjectRegionParameter' +type TerminateProjectRegionParameter string + +// List of TerminateProject_region_parameter +const ( + TERMINATEPROJECTREGIONPARAMETER_EU01 TerminateProjectRegionParameter = "eu01" + TERMINATEPROJECTREGIONPARAMETER_EU02 TerminateProjectRegionParameter = "eu02" + TERMINATEPROJECTREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API TerminateProjectRegionParameter = "unknown_default_open_api" +) + +// All allowed values of TerminateProjectRegionParameter enum +var AllowedTerminateProjectRegionParameterEnumValues = []TerminateProjectRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *TerminateProjectRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TerminateProjectRegionParameter(value) + for _, existing := range AllowedTerminateProjectRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TERMINATEPROJECTREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTerminateProjectRegionParameterFromValue returns a pointer to a valid TerminateProjectRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTerminateProjectRegionParameterFromValue(v string) (*TerminateProjectRegionParameter, error) { + ev := TerminateProjectRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TerminateProjectRegionParameter: valid values are %v", v, AllowedTerminateProjectRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TerminateProjectRegionParameter) IsValid() bool { + for _, existing := range AllowedTerminateProjectRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TerminateProject_region_parameter value +func (v TerminateProjectRegionParameter) Ptr() *TerminateProjectRegionParameter { + return &v +} + +type NullableTerminateProjectRegionParameter struct { + value *TerminateProjectRegionParameter + isSet bool +} + +func (v NullableTerminateProjectRegionParameter) Get() *TerminateProjectRegionParameter { + return v.value +} + +func (v *NullableTerminateProjectRegionParameter) Set(val *TerminateProjectRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableTerminateProjectRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableTerminateProjectRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTerminateProjectRegionParameter(val *TerminateProjectRegionParameter) *NullableTerminateProjectRegionParameter { + return &NullableTerminateProjectRegionParameter{value: val, isSet: true} +} + +func (v NullableTerminateProjectRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTerminateProjectRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_trigger_database_backup_region_parameter.go b/services/sqlserverflex/v2api/model_trigger_database_backup_region_parameter.go new file mode 100644 index 000000000..ab5099c82 --- /dev/null +++ b/services/sqlserverflex/v2api/model_trigger_database_backup_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// TriggerDatabaseBackupRegionParameter the model 'TriggerDatabaseBackupRegionParameter' +type TriggerDatabaseBackupRegionParameter string + +// List of TriggerDatabaseBackup_region_parameter +const ( + TRIGGERDATABASEBACKUPREGIONPARAMETER_EU01 TriggerDatabaseBackupRegionParameter = "eu01" + TRIGGERDATABASEBACKUPREGIONPARAMETER_EU02 TriggerDatabaseBackupRegionParameter = "eu02" + TRIGGERDATABASEBACKUPREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API TriggerDatabaseBackupRegionParameter = "unknown_default_open_api" +) + +// All allowed values of TriggerDatabaseBackupRegionParameter enum +var AllowedTriggerDatabaseBackupRegionParameterEnumValues = []TriggerDatabaseBackupRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *TriggerDatabaseBackupRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TriggerDatabaseBackupRegionParameter(value) + for _, existing := range AllowedTriggerDatabaseBackupRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TRIGGERDATABASEBACKUPREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTriggerDatabaseBackupRegionParameterFromValue returns a pointer to a valid TriggerDatabaseBackupRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTriggerDatabaseBackupRegionParameterFromValue(v string) (*TriggerDatabaseBackupRegionParameter, error) { + ev := TriggerDatabaseBackupRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TriggerDatabaseBackupRegionParameter: valid values are %v", v, AllowedTriggerDatabaseBackupRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TriggerDatabaseBackupRegionParameter) IsValid() bool { + for _, existing := range AllowedTriggerDatabaseBackupRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TriggerDatabaseBackup_region_parameter value +func (v TriggerDatabaseBackupRegionParameter) Ptr() *TriggerDatabaseBackupRegionParameter { + return &v +} + +type NullableTriggerDatabaseBackupRegionParameter struct { + value *TriggerDatabaseBackupRegionParameter + isSet bool +} + +func (v NullableTriggerDatabaseBackupRegionParameter) Get() *TriggerDatabaseBackupRegionParameter { + return v.value +} + +func (v *NullableTriggerDatabaseBackupRegionParameter) Set(val *TriggerDatabaseBackupRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerDatabaseBackupRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerDatabaseBackupRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerDatabaseBackupRegionParameter(val *TriggerDatabaseBackupRegionParameter) *NullableTriggerDatabaseBackupRegionParameter { + return &NullableTriggerDatabaseBackupRegionParameter{value: val, isSet: true} +} + +func (v NullableTriggerDatabaseBackupRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerDatabaseBackupRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_trigger_database_restore_region_parameter.go b/services/sqlserverflex/v2api/model_trigger_database_restore_region_parameter.go new file mode 100644 index 000000000..d213cd9d2 --- /dev/null +++ b/services/sqlserverflex/v2api/model_trigger_database_restore_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// TriggerDatabaseRestoreRegionParameter the model 'TriggerDatabaseRestoreRegionParameter' +type TriggerDatabaseRestoreRegionParameter string + +// List of TriggerDatabaseRestore_region_parameter +const ( + TRIGGERDATABASERESTOREREGIONPARAMETER_EU01 TriggerDatabaseRestoreRegionParameter = "eu01" + TRIGGERDATABASERESTOREREGIONPARAMETER_EU02 TriggerDatabaseRestoreRegionParameter = "eu02" + TRIGGERDATABASERESTOREREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API TriggerDatabaseRestoreRegionParameter = "unknown_default_open_api" +) + +// All allowed values of TriggerDatabaseRestoreRegionParameter enum +var AllowedTriggerDatabaseRestoreRegionParameterEnumValues = []TriggerDatabaseRestoreRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *TriggerDatabaseRestoreRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TriggerDatabaseRestoreRegionParameter(value) + for _, existing := range AllowedTriggerDatabaseRestoreRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TRIGGERDATABASERESTOREREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTriggerDatabaseRestoreRegionParameterFromValue returns a pointer to a valid TriggerDatabaseRestoreRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTriggerDatabaseRestoreRegionParameterFromValue(v string) (*TriggerDatabaseRestoreRegionParameter, error) { + ev := TriggerDatabaseRestoreRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TriggerDatabaseRestoreRegionParameter: valid values are %v", v, AllowedTriggerDatabaseRestoreRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TriggerDatabaseRestoreRegionParameter) IsValid() bool { + for _, existing := range AllowedTriggerDatabaseRestoreRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TriggerDatabaseRestore_region_parameter value +func (v TriggerDatabaseRestoreRegionParameter) Ptr() *TriggerDatabaseRestoreRegionParameter { + return &v +} + +type NullableTriggerDatabaseRestoreRegionParameter struct { + value *TriggerDatabaseRestoreRegionParameter + isSet bool +} + +func (v NullableTriggerDatabaseRestoreRegionParameter) Get() *TriggerDatabaseRestoreRegionParameter { + return v.value +} + +func (v *NullableTriggerDatabaseRestoreRegionParameter) Set(val *TriggerDatabaseRestoreRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerDatabaseRestoreRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerDatabaseRestoreRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerDatabaseRestoreRegionParameter(val *TriggerDatabaseRestoreRegionParameter) *NullableTriggerDatabaseRestoreRegionParameter { + return &NullableTriggerDatabaseRestoreRegionParameter{value: val, isSet: true} +} + +func (v NullableTriggerDatabaseRestoreRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerDatabaseRestoreRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v2api/model_update_instance_region_parameter.go b/services/sqlserverflex/v2api/model_update_instance_region_parameter.go new file mode 100644 index 000000000..c8cd0267b --- /dev/null +++ b/services/sqlserverflex/v2api/model_update_instance_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 2.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// UpdateInstanceRegionParameter the model 'UpdateInstanceRegionParameter' +type UpdateInstanceRegionParameter string + +// List of UpdateInstance_region_parameter +const ( + UPDATEINSTANCEREGIONPARAMETER_EU01 UpdateInstanceRegionParameter = "eu01" + UPDATEINSTANCEREGIONPARAMETER_EU02 UpdateInstanceRegionParameter = "eu02" + UPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API UpdateInstanceRegionParameter = "unknown_default_open_api" +) + +// All allowed values of UpdateInstanceRegionParameter enum +var AllowedUpdateInstanceRegionParameterEnumValues = []UpdateInstanceRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *UpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateInstanceRegionParameter(value) + for _, existing := range AllowedUpdateInstanceRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = UPDATEINSTANCEREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUpdateInstanceRegionParameterFromValue returns a pointer to a valid UpdateInstanceRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateInstanceRegionParameterFromValue(v string) (*UpdateInstanceRegionParameter, error) { + ev := UpdateInstanceRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateInstanceRegionParameter: valid values are %v", v, AllowedUpdateInstanceRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateInstanceRegionParameter) IsValid() bool { + for _, existing := range AllowedUpdateInstanceRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateInstance_region_parameter value +func (v UpdateInstanceRegionParameter) Ptr() *UpdateInstanceRegionParameter { + return &v +} + +type NullableUpdateInstanceRegionParameter struct { + value *UpdateInstanceRegionParameter + isSet bool +} + +func (v NullableUpdateInstanceRegionParameter) Get() *UpdateInstanceRegionParameter { + return v.value +} + +func (v *NullableUpdateInstanceRegionParameter) Set(val *UpdateInstanceRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstanceRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstanceRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstanceRegionParameter(val *UpdateInstanceRegionParameter) *NullableUpdateInstanceRegionParameter { + return &NullableUpdateInstanceRegionParameter{value: val, isSet: true} +} + +func (v NullableUpdateInstanceRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstanceRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/api_default.go b/services/sqlserverflex/v3alpha1api/api_default.go index e45d8af2f..8d9463eae 100644 --- a/services/sqlserverflex/v3alpha1api/api_default.go +++ b/services/sqlserverflex/v3alpha1api/api_default.go @@ -35,7 +35,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiCreateDatabaseRequestRequest */ - CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest + CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest // CreateDatabaseRequestExecute executes the request // @return CreateDatabaseResponse @@ -51,7 +51,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateInstanceRequestRequest */ - CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest + CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest // CreateInstanceRequestExecute executes the request // @return CreateInstanceResponse @@ -68,7 +68,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiCreateUserRequestRequest */ - CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest + CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest // CreateUserRequestExecute executes the request // @return CreateUserResponse @@ -86,7 +86,7 @@ type DefaultAPI interface { @param databaseName The name of the database. @return ApiDeleteDatabaseRequestRequest */ - DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest + DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest // DeleteDatabaseRequestExecute executes the request DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) error @@ -102,7 +102,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiDeleteInstanceRequestRequest */ - DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest + DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest // DeleteInstanceRequestExecute executes the request DeleteInstanceRequestExecute(r ApiDeleteInstanceRequestRequest) error @@ -119,7 +119,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiDeleteUserRequestRequest */ - DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequestRequest + DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiDeleteUserRequestRequest // DeleteUserRequestExecute executes the request DeleteUserRequestExecute(r ApiDeleteUserRequestRequest) error @@ -136,7 +136,7 @@ type DefaultAPI interface { @param backupId The ID of the backup. @return ApiGetBackupRequestRequest */ - GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequestRequest + GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int64) ApiGetBackupRequestRequest // GetBackupRequestExecute executes the request // @return GetBackupResponse @@ -153,7 +153,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiGetCollationsRequestRequest */ - GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest + GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest // GetCollationsRequestExecute executes the request // @return GetCollationsResponse @@ -171,7 +171,7 @@ type DefaultAPI interface { @param databaseName The name of the database. @return ApiGetDatabaseRequestRequest */ - GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest + GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiGetDatabaseRequestRequest // GetDatabaseRequestExecute executes the request // @return GetDatabaseResponse @@ -187,7 +187,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetFlavorsRequestRequest */ - GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest + GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest // GetFlavorsRequestExecute executes the request // @return GetFlavorsResponse @@ -204,7 +204,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiGetInstanceRequestRequest */ - GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest + GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest // GetInstanceRequestExecute executes the request // @return GetInstanceResponse @@ -221,7 +221,7 @@ type DefaultAPI interface { @param flavorId The id of an instance flavor. @return ApiGetStoragesRequestRequest */ - GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest + GetStoragesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, flavorId string) ApiGetStoragesRequestRequest // GetStoragesRequestExecute executes the request // @return GetStoragesResponse @@ -239,7 +239,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiGetUserRequestRequest */ - GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequestRequest + GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiGetUserRequestRequest // GetUserRequestExecute executes the request // @return GetUserResponse @@ -255,7 +255,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetVersionsRequestRequest */ - GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest + GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest // GetVersionsRequestExecute executes the request // @return GetVersionsResponse @@ -272,7 +272,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListBackupsRequestRequest */ - ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest + ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest // ListBackupsRequestExecute executes the request // @return ListBackupResponse @@ -289,7 +289,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListCompatibilitiesRequestRequest */ - ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest + ListCompatibilitiesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCompatibilitiesRequestRequest // ListCompatibilitiesRequestExecute executes the request // @return ListCompatibilityResponse @@ -306,7 +306,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListCurrentRunningRestoreJobsRequest */ - ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest + ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCurrentRunningRestoreJobsRequest // ListCurrentRunningRestoreJobsExecute executes the request // @return ListCurrentRunningRestoreJobs @@ -323,7 +323,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListDatabasesRequestRequest */ - ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest + ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest // ListDatabasesRequestExecute executes the request // @return ListDatabasesResponse @@ -339,7 +339,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListInstancesRequestRequest */ - ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest + ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest // ListInstancesRequestExecute executes the request // @return ListInstancesResponse @@ -356,7 +356,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListRolesRequestRequest */ - ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest + ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest // ListRolesRequestExecute executes the request // @return ListRolesResponse @@ -373,7 +373,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListUsersRequestRequest */ - ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest + ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest // ListUsersRequestExecute executes the request // @return ListUserResponse @@ -390,7 +390,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiProtectInstanceRequestRequest */ - ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest + ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest // ProtectInstanceRequestExecute executes the request // @return ProtectInstanceResponse @@ -408,7 +408,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiResetUserRequestRequest */ - ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserRequestRequest + ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiResetUserRequestRequest // ResetUserRequestExecute executes the request // @return ResetUserResponse @@ -428,7 +428,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiRestoreDatabaseFromBackupRequest */ - RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest + RestoreDatabaseFromBackup(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiRestoreDatabaseFromBackupRequest // RestoreDatabaseFromBackupExecute executes the request RestoreDatabaseFromBackupExecute(r ApiRestoreDatabaseFromBackupRequest) error @@ -445,7 +445,7 @@ type DefaultAPI interface { @param databaseName The name of the database. @return ApiTriggerBackupRequestRequest */ - TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest + TriggerBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerBackupRequestRequest // TriggerBackupRequestExecute executes the request TriggerBackupRequestExecute(r ApiTriggerBackupRequestRequest) error @@ -462,7 +462,7 @@ type DefaultAPI interface { @param databaseName The name of the database. @return ApiTriggerRestoreRequestRequest */ - TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest + TriggerRestoreRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest // TriggerRestoreRequestExecute executes the request TriggerRestoreRequestExecute(r ApiTriggerRestoreRequestRequest) error @@ -481,7 +481,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiUpdateInstancePartiallyRequestRequest */ - UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest + UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest // UpdateInstancePartiallyRequestExecute executes the request UpdateInstancePartiallyRequestExecute(r ApiUpdateInstancePartiallyRequestRequest) error @@ -500,7 +500,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiUpdateInstanceRequestRequest */ - UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest + UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest // UpdateInstanceRequestExecute executes the request UpdateInstanceRequestExecute(r ApiUpdateInstanceRequestRequest) error @@ -513,7 +513,7 @@ type ApiCreateDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string createDatabaseRequestPayload *CreateDatabaseRequestPayload } @@ -539,7 +539,7 @@ Create database for a user. Note: The name of a valid user must be provided in t @param instanceId The ID of the instance. @return ApiCreateDatabaseRequestRequest */ -func (a *DefaultAPIService) CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest { +func (a *DefaultAPIService) CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest { return ApiCreateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -713,7 +713,7 @@ type ApiCreateInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter createInstanceRequestPayload *CreateInstanceRequestPayload } @@ -737,7 +737,7 @@ Create a new instance of a sqlserver database instance. @param region The region which should be addressed @return ApiCreateInstanceRequestRequest */ -func (a *DefaultAPIService) CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest { +func (a *DefaultAPIService) CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest { return ApiCreateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -909,7 +909,7 @@ type ApiCreateUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string createUserRequestPayload *CreateUserRequestPayload } @@ -935,7 +935,7 @@ Create user for an instance. @param instanceId The ID of the instance. @return ApiCreateUserRequestRequest */ -func (a *DefaultAPIService) CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest { +func (a *DefaultAPIService) CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest { return ApiCreateUserRequestRequest{ ApiService: a, ctx: ctx, @@ -1120,7 +1120,7 @@ type ApiDeleteDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseName string } @@ -1141,7 +1141,7 @@ Delete database for an instance. @param databaseName The name of the database. @return ApiDeleteDatabaseRequestRequest */ -func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { +func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { return ApiDeleteDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -1288,7 +1288,7 @@ type ApiDeleteInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -1307,7 +1307,7 @@ Delete an available sqlserver instance. @param instanceId The ID of the instance. @return ApiDeleteInstanceRequestRequest */ -func (a *DefaultAPIService) DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest { +func (a *DefaultAPIService) DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest { return ApiDeleteInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -1452,7 +1452,7 @@ type ApiDeleteUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int64 } @@ -1473,7 +1473,7 @@ Delete an user from a specific instance. @param userId The ID of the user. @return ApiDeleteUserRequestRequest */ -func (a *DefaultAPIService) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequestRequest { +func (a *DefaultAPIService) DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiDeleteUserRequestRequest { return ApiDeleteUserRequestRequest{ ApiService: a, ctx: ctx, @@ -1620,7 +1620,7 @@ type ApiGetBackupRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string backupId int64 } @@ -1641,7 +1641,7 @@ Get information about a specific backup for an instance. @param backupId The ID of the backup. @return ApiGetBackupRequestRequest */ -func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequestRequest { +func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int64) ApiGetBackupRequestRequest { return ApiGetBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -1812,7 +1812,7 @@ type ApiGetCollationsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -1831,7 +1831,7 @@ Returns a list of collations for an instance @param instanceId The ID of the instance. @return ApiGetCollationsRequestRequest */ -func (a *DefaultAPIService) GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest { +func (a *DefaultAPIService) GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest { return ApiGetCollationsRequestRequest{ ApiService: a, ctx: ctx, @@ -2000,7 +2000,7 @@ type ApiGetDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseName string } @@ -2021,7 +2021,7 @@ Get specific available database @param databaseName The name of the database. @return ApiGetDatabaseRequestRequest */ -func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { +func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { return ApiGetDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -2192,7 +2192,7 @@ type ApiGetFlavorsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter page *int64 size *int64 sort *FlavorSort @@ -2230,7 +2230,7 @@ Get all available flavors for a project. @param region The region which should be addressed @return ApiGetFlavorsRequestRequest */ -func (a *DefaultAPIService) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest { +func (a *DefaultAPIService) GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest { return ApiGetFlavorsRequestRequest{ ApiService: a, ctx: ctx, @@ -2414,7 +2414,7 @@ type ApiGetInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -2433,7 +2433,7 @@ Get information about a specific available instance @param instanceId The ID of the instance. @return ApiGetInstanceRequestRequest */ -func (a *DefaultAPIService) GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest { +func (a *DefaultAPIService) GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest { return ApiGetInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -2591,7 +2591,7 @@ type ApiGetStoragesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter flavorId string } @@ -2610,7 +2610,7 @@ Get available storages for a specific flavor @param flavorId The id of an instance flavor. @return ApiGetStoragesRequestRequest */ -func (a *DefaultAPIService) GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest { +func (a *DefaultAPIService) GetStoragesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, flavorId string) ApiGetStoragesRequestRequest { return ApiGetStoragesRequestRequest{ ApiService: a, ctx: ctx, @@ -2768,7 +2768,7 @@ type ApiGetUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int64 } @@ -2789,7 +2789,7 @@ Get a specific available user for an instance. @param userId The ID of the user. @return ApiGetUserRequestRequest */ -func (a *DefaultAPIService) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequestRequest { +func (a *DefaultAPIService) GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiGetUserRequestRequest { return ApiGetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -2949,7 +2949,7 @@ type ApiGetVersionsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter } func (r ApiGetVersionsRequestRequest) Execute() (*GetVersionsResponse, error) { @@ -2966,7 +2966,7 @@ Get the sqlserver available versions for the project. @param region The region which should be addressed @return ApiGetVersionsRequestRequest */ -func (a *DefaultAPIService) GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest { +func (a *DefaultAPIService) GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest { return ApiGetVersionsRequestRequest{ ApiService: a, ctx: ctx, @@ -3133,7 +3133,7 @@ type ApiListBackupsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string page *int64 size *int64 @@ -3173,7 +3173,7 @@ List all backups which are available for a specific instance. @param instanceId The ID of the instance. @return ApiListBackupsRequestRequest */ -func (a *DefaultAPIService) ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest { +func (a *DefaultAPIService) ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest { return ApiListBackupsRequestRequest{ ApiService: a, ctx: ctx, @@ -3359,7 +3359,7 @@ type ApiListCompatibilitiesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -3378,7 +3378,7 @@ Returns a list of compatibility levels for creating a new database @param instanceId The ID of the instance. @return ApiListCompatibilitiesRequestRequest */ -func (a *DefaultAPIService) ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest { +func (a *DefaultAPIService) ListCompatibilitiesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCompatibilitiesRequestRequest { return ApiListCompatibilitiesRequestRequest{ ApiService: a, ctx: ctx, @@ -3547,7 +3547,7 @@ type ApiListCurrentRunningRestoreJobsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -3566,7 +3566,7 @@ List all currently running restore jobs which are available for a specific insta @param instanceId The ID of the instance. @return ApiListCurrentRunningRestoreJobsRequest */ -func (a *DefaultAPIService) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest { +func (a *DefaultAPIService) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCurrentRunningRestoreJobsRequest { return ApiListCurrentRunningRestoreJobsRequest{ ApiService: a, ctx: ctx, @@ -3735,7 +3735,7 @@ type ApiListDatabasesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string page *int64 size *int64 @@ -3775,7 +3775,7 @@ List available databases for an instance. @param instanceId The ID of the instance. @return ApiListDatabasesRequestRequest */ -func (a *DefaultAPIService) ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest { +func (a *DefaultAPIService) ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest { return ApiListDatabasesRequestRequest{ ApiService: a, ctx: ctx, @@ -3950,7 +3950,7 @@ type ApiListInstancesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter page *int64 size *int64 sort *InstanceSort @@ -3988,7 +3988,7 @@ List all available instances for your project. @param region The region which should be addressed @return ApiListInstancesRequestRequest */ -func (a *DefaultAPIService) ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest { +func (a *DefaultAPIService) ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest { return ApiListInstancesRequestRequest{ ApiService: a, ctx: ctx, @@ -4161,7 +4161,7 @@ type ApiListRolesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -4180,7 +4180,7 @@ List available roles for an instance that can be assigned to a user @param instanceId The ID of the instance. @return ApiListRolesRequestRequest */ -func (a *DefaultAPIService) ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest { +func (a *DefaultAPIService) ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest { return ApiListRolesRequestRequest{ ApiService: a, ctx: ctx, @@ -4349,7 +4349,7 @@ type ApiListUsersRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string page *int64 size *int64 @@ -4389,7 +4389,7 @@ List available users for an instance. @param instanceId The ID of the instance. @return ApiListUsersRequestRequest */ -func (a *DefaultAPIService) ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest { +func (a *DefaultAPIService) ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest { return ApiListUsersRequestRequest{ ApiService: a, ctx: ctx, @@ -4564,7 +4564,7 @@ type ApiProtectInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string protectInstanceRequestPayload *ProtectInstanceRequestPayload } @@ -4590,7 +4590,7 @@ Toggle the deletion protection for an instance. @param instanceId The ID of the instance. @return ApiProtectInstanceRequestRequest */ -func (a *DefaultAPIService) ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest { +func (a *DefaultAPIService) ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest { return ApiProtectInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -4775,7 +4775,7 @@ type ApiResetUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int64 } @@ -4796,7 +4796,7 @@ Reset an user from an specific instance. @param userId The ID of the user. @return ApiResetUserRequestRequest */ -func (a *DefaultAPIService) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserRequestRequest { +func (a *DefaultAPIService) ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiResetUserRequestRequest { return ApiResetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -4967,7 +4967,7 @@ type ApiRestoreDatabaseFromBackupRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string restoreDatabaseFromBackupPayload *RestoreDatabaseFromBackupPayload } @@ -4995,7 +4995,7 @@ The request body defines the source @param instanceId The ID of the instance. @return ApiRestoreDatabaseFromBackupRequest */ -func (a *DefaultAPIService) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest { +func (a *DefaultAPIService) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiRestoreDatabaseFromBackupRequest { return ApiRestoreDatabaseFromBackupRequest{ ApiService: a, ctx: ctx, @@ -5156,7 +5156,7 @@ type ApiTriggerBackupRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseName string } @@ -5177,7 +5177,7 @@ Trigger backup for a specific database @param databaseName The name of the database. @return ApiTriggerBackupRequestRequest */ -func (a *DefaultAPIService) TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { +func (a *DefaultAPIService) TriggerBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { return ApiTriggerBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -5346,7 +5346,7 @@ type ApiTriggerRestoreRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseName string triggerRestoreRequestPayload *TriggerRestoreRequestPayload @@ -5374,7 +5374,7 @@ Trigger restore for a specific Database @param databaseName The name of the database. @return ApiTriggerRestoreRequestRequest */ -func (a *DefaultAPIService) TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { +func (a *DefaultAPIService) TriggerRestoreRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { return ApiTriggerRestoreRequestRequest{ ApiService: a, ctx: ctx, @@ -5545,7 +5545,7 @@ type ApiUpdateInstancePartiallyRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string updateInstancePartiallyRequestPayload *UpdateInstancePartiallyRequestPayload } @@ -5573,7 +5573,7 @@ Update an available instance of a mssql database. No fields are required. @param instanceId The ID of the instance. @return ApiUpdateInstancePartiallyRequestRequest */ -func (a *DefaultAPIService) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest { +func (a *DefaultAPIService) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest { return ApiUpdateInstancePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -5734,7 +5734,7 @@ type ApiUpdateInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string updateInstanceRequestPayload *UpdateInstanceRequestPayload } @@ -5762,7 +5762,7 @@ UpdateInstanceRequest Update Instance @param instanceId The ID of the instance. @return ApiUpdateInstanceRequestRequest */ -func (a *DefaultAPIService) UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest { +func (a *DefaultAPIService) UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest { return ApiUpdateInstanceRequestRequest{ ApiService: a, ctx: ctx, diff --git a/services/sqlserverflex/v3alpha1api/api_default_mock.go b/services/sqlserverflex/v3alpha1api/api_default_mock.go index 318642d55..28ab6b4fa 100644 --- a/services/sqlserverflex/v3alpha1api/api_default_mock.go +++ b/services/sqlserverflex/v3alpha1api/api_default_mock.go @@ -79,7 +79,7 @@ type DefaultAPIServiceMock struct { UpdateInstanceRequestExecuteMock *func(r ApiUpdateInstanceRequestRequest) error } -func (a DefaultAPIServiceMock) CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest { +func (a DefaultAPIServiceMock) CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest { return ApiCreateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -99,7 +99,7 @@ func (a DefaultAPIServiceMock) CreateDatabaseRequestExecute(r ApiCreateDatabaseR return (*a.CreateDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest { +func (a DefaultAPIServiceMock) CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest { return ApiCreateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -118,7 +118,7 @@ func (a DefaultAPIServiceMock) CreateInstanceRequestExecute(r ApiCreateInstanceR return (*a.CreateInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest { +func (a DefaultAPIServiceMock) CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest { return ApiCreateUserRequestRequest{ ApiService: a, ctx: ctx, @@ -138,7 +138,7 @@ func (a DefaultAPIServiceMock) CreateUserRequestExecute(r ApiCreateUserRequestRe return (*a.CreateUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { +func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { return ApiDeleteDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -158,7 +158,7 @@ func (a DefaultAPIServiceMock) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseR return (*a.DeleteDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest { +func (a DefaultAPIServiceMock) DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest { return ApiDeleteInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -177,7 +177,7 @@ func (a DefaultAPIServiceMock) DeleteInstanceRequestExecute(r ApiDeleteInstanceR return (*a.DeleteInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequestRequest { +func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiDeleteUserRequestRequest { return ApiDeleteUserRequestRequest{ ApiService: a, ctx: ctx, @@ -197,7 +197,7 @@ func (a DefaultAPIServiceMock) DeleteUserRequestExecute(r ApiDeleteUserRequestRe return (*a.DeleteUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequestRequest { +func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int64) ApiGetBackupRequestRequest { return ApiGetBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -218,7 +218,7 @@ func (a DefaultAPIServiceMock) GetBackupRequestExecute(r ApiGetBackupRequestRequ return (*a.GetBackupRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest { +func (a DefaultAPIServiceMock) GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest { return ApiGetCollationsRequestRequest{ ApiService: a, ctx: ctx, @@ -238,7 +238,7 @@ func (a DefaultAPIServiceMock) GetCollationsRequestExecute(r ApiGetCollationsReq return (*a.GetCollationsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { +func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { return ApiGetDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -259,7 +259,7 @@ func (a DefaultAPIServiceMock) GetDatabaseRequestExecute(r ApiGetDatabaseRequest return (*a.GetDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest { +func (a DefaultAPIServiceMock) GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest { return ApiGetFlavorsRequestRequest{ ApiService: a, ctx: ctx, @@ -278,7 +278,7 @@ func (a DefaultAPIServiceMock) GetFlavorsRequestExecute(r ApiGetFlavorsRequestRe return (*a.GetFlavorsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest { +func (a DefaultAPIServiceMock) GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest { return ApiGetInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -298,7 +298,7 @@ func (a DefaultAPIServiceMock) GetInstanceRequestExecute(r ApiGetInstanceRequest return (*a.GetInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest { +func (a DefaultAPIServiceMock) GetStoragesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, flavorId string) ApiGetStoragesRequestRequest { return ApiGetStoragesRequestRequest{ ApiService: a, ctx: ctx, @@ -318,7 +318,7 @@ func (a DefaultAPIServiceMock) GetStoragesRequestExecute(r ApiGetStoragesRequest return (*a.GetStoragesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequestRequest { +func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiGetUserRequestRequest { return ApiGetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -339,7 +339,7 @@ func (a DefaultAPIServiceMock) GetUserRequestExecute(r ApiGetUserRequestRequest) return (*a.GetUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest { +func (a DefaultAPIServiceMock) GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest { return ApiGetVersionsRequestRequest{ ApiService: a, ctx: ctx, @@ -358,7 +358,7 @@ func (a DefaultAPIServiceMock) GetVersionsRequestExecute(r ApiGetVersionsRequest return (*a.GetVersionsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest { +func (a DefaultAPIServiceMock) ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest { return ApiListBackupsRequestRequest{ ApiService: a, ctx: ctx, @@ -378,7 +378,7 @@ func (a DefaultAPIServiceMock) ListBackupsRequestExecute(r ApiListBackupsRequest return (*a.ListBackupsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest { +func (a DefaultAPIServiceMock) ListCompatibilitiesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCompatibilitiesRequestRequest { return ApiListCompatibilitiesRequestRequest{ ApiService: a, ctx: ctx, @@ -398,7 +398,7 @@ func (a DefaultAPIServiceMock) ListCompatibilitiesRequestExecute(r ApiListCompat return (*a.ListCompatibilitiesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest { +func (a DefaultAPIServiceMock) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCurrentRunningRestoreJobsRequest { return ApiListCurrentRunningRestoreJobsRequest{ ApiService: a, ctx: ctx, @@ -418,7 +418,7 @@ func (a DefaultAPIServiceMock) ListCurrentRunningRestoreJobsExecute(r ApiListCur return (*a.ListCurrentRunningRestoreJobsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest { +func (a DefaultAPIServiceMock) ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest { return ApiListDatabasesRequestRequest{ ApiService: a, ctx: ctx, @@ -438,7 +438,7 @@ func (a DefaultAPIServiceMock) ListDatabasesRequestExecute(r ApiListDatabasesReq return (*a.ListDatabasesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest { +func (a DefaultAPIServiceMock) ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest { return ApiListInstancesRequestRequest{ ApiService: a, ctx: ctx, @@ -457,7 +457,7 @@ func (a DefaultAPIServiceMock) ListInstancesRequestExecute(r ApiListInstancesReq return (*a.ListInstancesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest { +func (a DefaultAPIServiceMock) ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest { return ApiListRolesRequestRequest{ ApiService: a, ctx: ctx, @@ -477,7 +477,7 @@ func (a DefaultAPIServiceMock) ListRolesRequestExecute(r ApiListRolesRequestRequ return (*a.ListRolesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest { +func (a DefaultAPIServiceMock) ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest { return ApiListUsersRequestRequest{ ApiService: a, ctx: ctx, @@ -497,7 +497,7 @@ func (a DefaultAPIServiceMock) ListUsersRequestExecute(r ApiListUsersRequestRequ return (*a.ListUsersRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest { +func (a DefaultAPIServiceMock) ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest { return ApiProtectInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -517,7 +517,7 @@ func (a DefaultAPIServiceMock) ProtectInstanceRequestExecute(r ApiProtectInstanc return (*a.ProtectInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserRequestRequest { +func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiResetUserRequestRequest { return ApiResetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -538,7 +538,7 @@ func (a DefaultAPIServiceMock) ResetUserRequestExecute(r ApiResetUserRequestRequ return (*a.ResetUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest { +func (a DefaultAPIServiceMock) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiRestoreDatabaseFromBackupRequest { return ApiRestoreDatabaseFromBackupRequest{ ApiService: a, ctx: ctx, @@ -557,7 +557,7 @@ func (a DefaultAPIServiceMock) RestoreDatabaseFromBackupExecute(r ApiRestoreData return (*a.RestoreDatabaseFromBackupExecuteMock)(r) } -func (a DefaultAPIServiceMock) TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { +func (a DefaultAPIServiceMock) TriggerBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { return ApiTriggerBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -577,7 +577,7 @@ func (a DefaultAPIServiceMock) TriggerBackupRequestExecute(r ApiTriggerBackupReq return (*a.TriggerBackupRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { +func (a DefaultAPIServiceMock) TriggerRestoreRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { return ApiTriggerRestoreRequestRequest{ ApiService: a, ctx: ctx, @@ -597,7 +597,7 @@ func (a DefaultAPIServiceMock) TriggerRestoreRequestExecute(r ApiTriggerRestoreR return (*a.TriggerRestoreRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest { +func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest { return ApiUpdateInstancePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -616,7 +616,7 @@ func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequestExecute(r ApiUpdate return (*a.UpdateInstancePartiallyRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest { +func (a DefaultAPIServiceMock) UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest { return ApiUpdateInstanceRequestRequest{ ApiService: a, ctx: ctx, diff --git a/services/sqlserverflex/v3alpha1api/model_get_flavors_request_region_parameter.go b/services/sqlserverflex/v3alpha1api/model_get_flavors_request_region_parameter.go new file mode 100644 index 000000000..32351c3fc --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_get_flavors_request_region_parameter.go @@ -0,0 +1,112 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// GetFlavorsRequestRegionParameter the model 'GetFlavorsRequestRegionParameter' +type GetFlavorsRequestRegionParameter string + +// List of getFlavorsRequest_region_parameter +const ( + GETFLAVORSREQUESTREGIONPARAMETER_EU01 GetFlavorsRequestRegionParameter = "eu01" + GETFLAVORSREQUESTREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetFlavorsRequestRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetFlavorsRequestRegionParameter enum +var AllowedGetFlavorsRequestRegionParameterEnumValues = []GetFlavorsRequestRegionParameter{ + "eu01", + "unknown_default_open_api", +} + +func (v *GetFlavorsRequestRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetFlavorsRequestRegionParameter(value) + for _, existing := range AllowedGetFlavorsRequestRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETFLAVORSREQUESTREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetFlavorsRequestRegionParameterFromValue returns a pointer to a valid GetFlavorsRequestRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetFlavorsRequestRegionParameterFromValue(v string) (*GetFlavorsRequestRegionParameter, error) { + ev := GetFlavorsRequestRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetFlavorsRequestRegionParameter: valid values are %v", v, AllowedGetFlavorsRequestRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetFlavorsRequestRegionParameter) IsValid() bool { + for _, existing := range AllowedGetFlavorsRequestRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to getFlavorsRequest_region_parameter value +func (v GetFlavorsRequestRegionParameter) Ptr() *GetFlavorsRequestRegionParameter { + return &v +} + +type NullableGetFlavorsRequestRegionParameter struct { + value *GetFlavorsRequestRegionParameter + isSet bool +} + +func (v NullableGetFlavorsRequestRegionParameter) Get() *GetFlavorsRequestRegionParameter { + return v.value +} + +func (v *NullableGetFlavorsRequestRegionParameter) Set(val *GetFlavorsRequestRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetFlavorsRequestRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetFlavorsRequestRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetFlavorsRequestRegionParameter(val *GetFlavorsRequestRegionParameter) *NullableGetFlavorsRequestRegionParameter { + return &NullableGetFlavorsRequestRegionParameter{value: val, isSet: true} +} + +func (v NullableGetFlavorsRequestRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetFlavorsRequestRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_source_backup.go b/services/sqlserverflex/v3alpha1api/model_source_backup.go index 612ed156c..0274030e9 100644 --- a/services/sqlserverflex/v3alpha1api/model_source_backup.go +++ b/services/sqlserverflex/v3alpha1api/model_source_backup.go @@ -21,7 +21,7 @@ var _ MappedNullable = &SourceBackup{} // SourceBackup Restore from an existing managed backup. type SourceBackup struct { - Type string `json:"type"` + Type SourceBackupType `json:"type"` AdditionalProperties map[string]interface{} } @@ -31,7 +31,7 @@ type _SourceBackup SourceBackup // 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 NewSourceBackup(types string) *SourceBackup { +func NewSourceBackup(types SourceBackupType) *SourceBackup { this := SourceBackup{} this.Type = types return &this @@ -46,9 +46,9 @@ func NewSourceBackupWithDefaults() *SourceBackup { } // GetType returns the Type field value -func (o *SourceBackup) GetType() string { +func (o *SourceBackup) GetType() SourceBackupType { if o == nil { - var ret string + var ret SourceBackupType return ret } @@ -57,7 +57,7 @@ func (o *SourceBackup) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *SourceBackup) GetTypeOk() (*string, bool) { +func (o *SourceBackup) GetTypeOk() (*SourceBackupType, bool) { if o == nil { return nil, false } @@ -65,7 +65,7 @@ func (o *SourceBackup) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *SourceBackup) SetType(v string) { +func (o *SourceBackup) SetType(v SourceBackupType) { o.Type = v } diff --git a/services/sqlserverflex/v3alpha1api/model_source_backup_type.go b/services/sqlserverflex/v3alpha1api/model_source_backup_type.go new file mode 100644 index 000000000..8431b7839 --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_source_backup_type.go @@ -0,0 +1,112 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// SourceBackupType the model 'SourceBackupType' +type SourceBackupType string + +// List of source_backup_type +const ( + SOURCEBACKUPTYPE_BACKUP SourceBackupType = "BACKUP" + SOURCEBACKUPTYPE_UNKNOWN_DEFAULT_OPEN_API SourceBackupType = "unknown_default_open_api" +) + +// All allowed values of SourceBackupType enum +var AllowedSourceBackupTypeEnumValues = []SourceBackupType{ + "BACKUP", + "unknown_default_open_api", +} + +func (v *SourceBackupType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SourceBackupType(value) + for _, existing := range AllowedSourceBackupTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SOURCEBACKUPTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewSourceBackupTypeFromValue returns a pointer to a valid SourceBackupType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSourceBackupTypeFromValue(v string) (*SourceBackupType, error) { + ev := SourceBackupType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SourceBackupType: valid values are %v", v, AllowedSourceBackupTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SourceBackupType) IsValid() bool { + for _, existing := range AllowedSourceBackupTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to source_backup_type value +func (v SourceBackupType) Ptr() *SourceBackupType { + return &v +} + +type NullableSourceBackupType struct { + value *SourceBackupType + isSet bool +} + +func (v NullableSourceBackupType) Get() *SourceBackupType { + return v.value +} + +func (v *NullableSourceBackupType) Set(val *SourceBackupType) { + v.value = val + v.isSet = true +} + +func (v NullableSourceBackupType) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceBackupType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceBackupType(val *SourceBackupType) *NullableSourceBackupType { + return &NullableSourceBackupType{value: val, isSet: true} +} + +func (v NullableSourceBackupType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceBackupType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3alpha1api/model_source_external_s3.go b/services/sqlserverflex/v3alpha1api/model_source_external_s3.go index ce64b0fa2..ad561d6c2 100644 --- a/services/sqlserverflex/v3alpha1api/model_source_external_s3.go +++ b/services/sqlserverflex/v3alpha1api/model_source_external_s3.go @@ -24,9 +24,9 @@ type SourceExternalS3 struct { // The owner of the database. DatabaseOwner string `json:"database_owner"` // Logging guid to have a complete activity log over all sub stored procedures. - LoggingGuid *string `json:"logging_guid,omitempty"` - S3Details ExternalS3 `json:"s3_details"` - Type string `json:"type"` + LoggingGuid *string `json:"logging_guid,omitempty"` + S3Details ExternalS3 `json:"s3_details"` + Type SourceExternalS3Type `json:"type"` AdditionalProperties map[string]interface{} } @@ -36,7 +36,7 @@ type _SourceExternalS3 SourceExternalS3 // 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 NewSourceExternalS3(databaseOwner string, s3Details ExternalS3, types string) *SourceExternalS3 { +func NewSourceExternalS3(databaseOwner string, s3Details ExternalS3, types SourceExternalS3Type) *SourceExternalS3 { this := SourceExternalS3{} this.DatabaseOwner = databaseOwner this.S3Details = s3Details @@ -133,9 +133,9 @@ func (o *SourceExternalS3) SetS3Details(v ExternalS3) { } // GetType returns the Type field value -func (o *SourceExternalS3) GetType() string { +func (o *SourceExternalS3) GetType() SourceExternalS3Type { if o == nil { - var ret string + var ret SourceExternalS3Type return ret } @@ -144,7 +144,7 @@ func (o *SourceExternalS3) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *SourceExternalS3) GetTypeOk() (*string, bool) { +func (o *SourceExternalS3) GetTypeOk() (*SourceExternalS3Type, bool) { if o == nil { return nil, false } @@ -152,7 +152,7 @@ func (o *SourceExternalS3) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *SourceExternalS3) SetType(v string) { +func (o *SourceExternalS3) SetType(v SourceExternalS3Type) { o.Type = v } diff --git a/services/sqlserverflex/v3alpha1api/model_source_external_s3_type.go b/services/sqlserverflex/v3alpha1api/model_source_external_s3_type.go new file mode 100644 index 000000000..a712debaf --- /dev/null +++ b/services/sqlserverflex/v3alpha1api/model_source_external_s3_type.go @@ -0,0 +1,112 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3alpha1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3alpha1api + +import ( + "encoding/json" + "fmt" +) + +// SourceExternalS3Type the model 'SourceExternalS3Type' +type SourceExternalS3Type string + +// List of source_externalS3_type +const ( + SOURCEEXTERNALS3TYPE_EXTERNAL_S3 SourceExternalS3Type = "EXTERNAL_S3" + SOURCEEXTERNALS3TYPE_UNKNOWN_DEFAULT_OPEN_API SourceExternalS3Type = "unknown_default_open_api" +) + +// All allowed values of SourceExternalS3Type enum +var AllowedSourceExternalS3TypeEnumValues = []SourceExternalS3Type{ + "EXTERNAL_S3", + "unknown_default_open_api", +} + +func (v *SourceExternalS3Type) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SourceExternalS3Type(value) + for _, existing := range AllowedSourceExternalS3TypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SOURCEEXTERNALS3TYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewSourceExternalS3TypeFromValue returns a pointer to a valid SourceExternalS3Type +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSourceExternalS3TypeFromValue(v string) (*SourceExternalS3Type, error) { + ev := SourceExternalS3Type(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SourceExternalS3Type: valid values are %v", v, AllowedSourceExternalS3TypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SourceExternalS3Type) IsValid() bool { + for _, existing := range AllowedSourceExternalS3TypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to source_externalS3_type value +func (v SourceExternalS3Type) Ptr() *SourceExternalS3Type { + return &v +} + +type NullableSourceExternalS3Type struct { + value *SourceExternalS3Type + isSet bool +} + +func (v NullableSourceExternalS3Type) Get() *SourceExternalS3Type { + return v.value +} + +func (v *NullableSourceExternalS3Type) Set(val *SourceExternalS3Type) { + v.value = val + v.isSet = true +} + +func (v NullableSourceExternalS3Type) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceExternalS3Type) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceExternalS3Type(val *SourceExternalS3Type) *NullableSourceExternalS3Type { + return &NullableSourceExternalS3Type{value: val, isSet: true} +} + +func (v NullableSourceExternalS3Type) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceExternalS3Type) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/api_default.go b/services/sqlserverflex/v3beta1api/api_default.go index 04b13242c..5b0fa9044 100644 --- a/services/sqlserverflex/v3beta1api/api_default.go +++ b/services/sqlserverflex/v3beta1api/api_default.go @@ -35,7 +35,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiCreateDatabaseRequestRequest */ - CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest + CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest // CreateDatabaseRequestExecute executes the request // @return CreateDatabaseResponse @@ -51,7 +51,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiCreateInstanceRequestRequest */ - CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest + CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest // CreateInstanceRequestExecute executes the request // @return CreateInstanceResponse @@ -68,7 +68,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiCreateUserRequestRequest */ - CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest + CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest // CreateUserRequestExecute executes the request // @return CreateUserResponse @@ -86,7 +86,7 @@ type DefaultAPI interface { @param databaseName The name of the database. @return ApiDeleteDatabaseRequestRequest */ - DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest + DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest // DeleteDatabaseRequestExecute executes the request DeleteDatabaseRequestExecute(r ApiDeleteDatabaseRequestRequest) error @@ -102,7 +102,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiDeleteInstanceRequestRequest */ - DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest + DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest // DeleteInstanceRequestExecute executes the request DeleteInstanceRequestExecute(r ApiDeleteInstanceRequestRequest) error @@ -119,7 +119,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiDeleteUserRequestRequest */ - DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequestRequest + DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiDeleteUserRequestRequest // DeleteUserRequestExecute executes the request DeleteUserRequestExecute(r ApiDeleteUserRequestRequest) error @@ -136,7 +136,7 @@ type DefaultAPI interface { @param backupId The ID of the backup. @return ApiGetBackupRequestRequest */ - GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequestRequest + GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int64) ApiGetBackupRequestRequest // GetBackupRequestExecute executes the request // @return GetBackupResponse @@ -153,7 +153,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiGetCollationsRequestRequest */ - GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest + GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest // GetCollationsRequestExecute executes the request // @return GetCollationsResponse @@ -171,7 +171,7 @@ type DefaultAPI interface { @param databaseName The name of the database. @return ApiGetDatabaseRequestRequest */ - GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest + GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiGetDatabaseRequestRequest // GetDatabaseRequestExecute executes the request // @return GetDatabaseResponse @@ -187,7 +187,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetFlavorsRequestRequest */ - GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest + GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest // GetFlavorsRequestExecute executes the request // @return GetFlavorsResponse @@ -204,7 +204,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiGetInstanceRequestRequest */ - GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest + GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest // GetInstanceRequestExecute executes the request // @return GetInstanceResponse @@ -221,7 +221,7 @@ type DefaultAPI interface { @param flavorId The id of an instance flavor. @return ApiGetStoragesRequestRequest */ - GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest + GetStoragesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, flavorId string) ApiGetStoragesRequestRequest // GetStoragesRequestExecute executes the request // @return GetStoragesResponse @@ -239,7 +239,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiGetUserRequestRequest */ - GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequestRequest + GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiGetUserRequestRequest // GetUserRequestExecute executes the request // @return GetUserResponse @@ -255,7 +255,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiGetVersionsRequestRequest */ - GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest + GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest // GetVersionsRequestExecute executes the request // @return GetVersionsResponse @@ -272,7 +272,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListBackupsRequestRequest */ - ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest + ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest // ListBackupsRequestExecute executes the request // @return ListBackupResponse @@ -289,7 +289,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListCompatibilitiesRequestRequest */ - ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest + ListCompatibilitiesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCompatibilitiesRequestRequest // ListCompatibilitiesRequestExecute executes the request // @return ListCompatibilityResponse @@ -306,7 +306,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListCurrentRunningRestoreJobsRequest */ - ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest + ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCurrentRunningRestoreJobsRequest // ListCurrentRunningRestoreJobsExecute executes the request // @return ListCurrentRunningRestoreJobs @@ -323,7 +323,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListDatabasesRequestRequest */ - ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest + ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest // ListDatabasesRequestExecute executes the request // @return ListDatabasesResponse @@ -339,7 +339,7 @@ type DefaultAPI interface { @param region The region which should be addressed @return ApiListInstancesRequestRequest */ - ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest + ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest // ListInstancesRequestExecute executes the request // @return ListInstancesResponse @@ -356,7 +356,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListRolesRequestRequest */ - ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest + ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest // ListRolesRequestExecute executes the request // @return ListRolesResponse @@ -373,7 +373,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiListUsersRequestRequest */ - ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest + ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest // ListUsersRequestExecute executes the request // @return ListUserResponse @@ -390,7 +390,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiProtectInstanceRequestRequest */ - ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest + ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest // ProtectInstanceRequestExecute executes the request // @return ProtectInstanceResponse @@ -408,7 +408,7 @@ type DefaultAPI interface { @param userId The ID of the user. @return ApiResetUserRequestRequest */ - ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserRequestRequest + ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiResetUserRequestRequest // ResetUserRequestExecute executes the request // @return ResetUserResponse @@ -428,7 +428,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiRestoreDatabaseFromBackupRequest */ - RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest + RestoreDatabaseFromBackup(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiRestoreDatabaseFromBackupRequest // RestoreDatabaseFromBackupExecute executes the request RestoreDatabaseFromBackupExecute(r ApiRestoreDatabaseFromBackupRequest) error @@ -445,7 +445,7 @@ type DefaultAPI interface { @param databaseName The name of the database. @return ApiTriggerBackupRequestRequest */ - TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest + TriggerBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerBackupRequestRequest // TriggerBackupRequestExecute executes the request TriggerBackupRequestExecute(r ApiTriggerBackupRequestRequest) error @@ -462,7 +462,7 @@ type DefaultAPI interface { @param databaseName The name of the database. @return ApiTriggerRestoreRequestRequest */ - TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest + TriggerRestoreRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest // TriggerRestoreRequestExecute executes the request TriggerRestoreRequestExecute(r ApiTriggerRestoreRequestRequest) error @@ -481,7 +481,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiUpdateInstancePartiallyRequestRequest */ - UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest + UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest // UpdateInstancePartiallyRequestExecute executes the request UpdateInstancePartiallyRequestExecute(r ApiUpdateInstancePartiallyRequestRequest) error @@ -500,7 +500,7 @@ type DefaultAPI interface { @param instanceId The ID of the instance. @return ApiUpdateInstanceRequestRequest */ - UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest + UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest // UpdateInstanceRequestExecute executes the request UpdateInstanceRequestExecute(r ApiUpdateInstanceRequestRequest) error @@ -513,7 +513,7 @@ type ApiCreateDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string createDatabaseRequestPayload *CreateDatabaseRequestPayload } @@ -539,7 +539,7 @@ Create database for a user. Note: The name of a valid user must be provided in t @param instanceId The ID of the instance. @return ApiCreateDatabaseRequestRequest */ -func (a *DefaultAPIService) CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest { +func (a *DefaultAPIService) CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest { return ApiCreateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -713,7 +713,7 @@ type ApiCreateInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter createInstanceRequestPayload *CreateInstanceRequestPayload } @@ -737,7 +737,7 @@ Create a new instance of a sqlserver database instance. @param region The region which should be addressed @return ApiCreateInstanceRequestRequest */ -func (a *DefaultAPIService) CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest { +func (a *DefaultAPIService) CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest { return ApiCreateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -909,7 +909,7 @@ type ApiCreateUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string createUserRequestPayload *CreateUserRequestPayload } @@ -935,7 +935,7 @@ Create user for an instance. @param instanceId The ID of the instance. @return ApiCreateUserRequestRequest */ -func (a *DefaultAPIService) CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest { +func (a *DefaultAPIService) CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest { return ApiCreateUserRequestRequest{ ApiService: a, ctx: ctx, @@ -1142,7 +1142,7 @@ type ApiDeleteDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseName string } @@ -1163,7 +1163,7 @@ Delete database for an instance. @param databaseName The name of the database. @return ApiDeleteDatabaseRequestRequest */ -func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { +func (a *DefaultAPIService) DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { return ApiDeleteDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -1310,7 +1310,7 @@ type ApiDeleteInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -1329,7 +1329,7 @@ Delete an available sqlserver instance. @param instanceId The ID of the instance. @return ApiDeleteInstanceRequestRequest */ -func (a *DefaultAPIService) DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest { +func (a *DefaultAPIService) DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest { return ApiDeleteInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -1474,7 +1474,7 @@ type ApiDeleteUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int64 } @@ -1495,7 +1495,7 @@ Delete an user from a specific instance. @param userId The ID of the user. @return ApiDeleteUserRequestRequest */ -func (a *DefaultAPIService) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequestRequest { +func (a *DefaultAPIService) DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiDeleteUserRequestRequest { return ApiDeleteUserRequestRequest{ ApiService: a, ctx: ctx, @@ -1664,7 +1664,7 @@ type ApiGetBackupRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string backupId int64 } @@ -1685,7 +1685,7 @@ Get information about a specific backup for an instance. @param backupId The ID of the backup. @return ApiGetBackupRequestRequest */ -func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequestRequest { +func (a *DefaultAPIService) GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int64) ApiGetBackupRequestRequest { return ApiGetBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -1856,7 +1856,7 @@ type ApiGetCollationsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -1875,7 +1875,7 @@ Returns a list of collations for an instance @param instanceId The ID of the instance. @return ApiGetCollationsRequestRequest */ -func (a *DefaultAPIService) GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest { +func (a *DefaultAPIService) GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest { return ApiGetCollationsRequestRequest{ ApiService: a, ctx: ctx, @@ -2044,7 +2044,7 @@ type ApiGetDatabaseRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseName string } @@ -2065,7 +2065,7 @@ Get specific available database @param databaseName The name of the database. @return ApiGetDatabaseRequestRequest */ -func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { +func (a *DefaultAPIService) GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { return ApiGetDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -2236,7 +2236,7 @@ type ApiGetFlavorsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter page *int64 size *int64 sort *FlavorSort @@ -2274,7 +2274,7 @@ Get all available flavors for a project. @param region The region which should be addressed @return ApiGetFlavorsRequestRequest */ -func (a *DefaultAPIService) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest { +func (a *DefaultAPIService) GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest { return ApiGetFlavorsRequestRequest{ ApiService: a, ctx: ctx, @@ -2458,7 +2458,7 @@ type ApiGetInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -2477,7 +2477,7 @@ Get information about a specific available instance @param instanceId The ID of the instance. @return ApiGetInstanceRequestRequest */ -func (a *DefaultAPIService) GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest { +func (a *DefaultAPIService) GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest { return ApiGetInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -2635,7 +2635,7 @@ type ApiGetStoragesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter flavorId string } @@ -2654,7 +2654,7 @@ Get available storages for a specific flavor @param flavorId The id of an instance flavor. @return ApiGetStoragesRequestRequest */ -func (a *DefaultAPIService) GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest { +func (a *DefaultAPIService) GetStoragesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, flavorId string) ApiGetStoragesRequestRequest { return ApiGetStoragesRequestRequest{ ApiService: a, ctx: ctx, @@ -2812,7 +2812,7 @@ type ApiGetUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int64 } @@ -2833,7 +2833,7 @@ Get a specific available user for an instance. @param userId The ID of the user. @return ApiGetUserRequestRequest */ -func (a *DefaultAPIService) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequestRequest { +func (a *DefaultAPIService) GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiGetUserRequestRequest { return ApiGetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -2993,7 +2993,7 @@ type ApiGetVersionsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter } func (r ApiGetVersionsRequestRequest) Execute() (*GetVersionsResponse, error) { @@ -3010,7 +3010,7 @@ Get the sqlserver available versions for the project. @param region The region which should be addressed @return ApiGetVersionsRequestRequest */ -func (a *DefaultAPIService) GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest { +func (a *DefaultAPIService) GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest { return ApiGetVersionsRequestRequest{ ApiService: a, ctx: ctx, @@ -3177,7 +3177,7 @@ type ApiListBackupsRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string page *int64 size *int64 @@ -3217,7 +3217,7 @@ List all backups which are available for a specific instance. @param instanceId The ID of the instance. @return ApiListBackupsRequestRequest */ -func (a *DefaultAPIService) ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest { +func (a *DefaultAPIService) ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest { return ApiListBackupsRequestRequest{ ApiService: a, ctx: ctx, @@ -3403,7 +3403,7 @@ type ApiListCompatibilitiesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -3422,7 +3422,7 @@ Returns a list of compatibility levels for creating a new database @param instanceId The ID of the instance. @return ApiListCompatibilitiesRequestRequest */ -func (a *DefaultAPIService) ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest { +func (a *DefaultAPIService) ListCompatibilitiesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCompatibilitiesRequestRequest { return ApiListCompatibilitiesRequestRequest{ ApiService: a, ctx: ctx, @@ -3591,7 +3591,7 @@ type ApiListCurrentRunningRestoreJobsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -3610,7 +3610,7 @@ List all currently running restore jobs which are available for a specific insta @param instanceId The ID of the instance. @return ApiListCurrentRunningRestoreJobsRequest */ -func (a *DefaultAPIService) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest { +func (a *DefaultAPIService) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCurrentRunningRestoreJobsRequest { return ApiListCurrentRunningRestoreJobsRequest{ ApiService: a, ctx: ctx, @@ -3779,7 +3779,7 @@ type ApiListDatabasesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string page *int64 size *int64 @@ -3819,7 +3819,7 @@ List available databases for an instance. @param instanceId The ID of the instance. @return ApiListDatabasesRequestRequest */ -func (a *DefaultAPIService) ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest { +func (a *DefaultAPIService) ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest { return ApiListDatabasesRequestRequest{ ApiService: a, ctx: ctx, @@ -3994,7 +3994,7 @@ type ApiListInstancesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter page *int64 size *int64 sort *InstanceSort @@ -4032,7 +4032,7 @@ List all available instances for your project. @param region The region which should be addressed @return ApiListInstancesRequestRequest */ -func (a *DefaultAPIService) ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest { +func (a *DefaultAPIService) ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest { return ApiListInstancesRequestRequest{ ApiService: a, ctx: ctx, @@ -4205,7 +4205,7 @@ type ApiListRolesRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string } @@ -4224,7 +4224,7 @@ List available roles for an instance that can be assigned to a user @param instanceId The ID of the instance. @return ApiListRolesRequestRequest */ -func (a *DefaultAPIService) ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest { +func (a *DefaultAPIService) ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest { return ApiListRolesRequestRequest{ ApiService: a, ctx: ctx, @@ -4404,7 +4404,7 @@ type ApiListUsersRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string page *int64 size *int64 @@ -4444,7 +4444,7 @@ List available users for an instance. @param instanceId The ID of the instance. @return ApiListUsersRequestRequest */ -func (a *DefaultAPIService) ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest { +func (a *DefaultAPIService) ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest { return ApiListUsersRequestRequest{ ApiService: a, ctx: ctx, @@ -4619,7 +4619,7 @@ type ApiProtectInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string protectInstanceRequestPayload *ProtectInstanceRequestPayload } @@ -4645,7 +4645,7 @@ Toggle the deletion protection for an instance. @param instanceId The ID of the instance. @return ApiProtectInstanceRequestRequest */ -func (a *DefaultAPIService) ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest { +func (a *DefaultAPIService) ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest { return ApiProtectInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -4830,7 +4830,7 @@ type ApiResetUserRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string userId int64 } @@ -4851,7 +4851,7 @@ Reset an user from an specific instance. @param userId The ID of the user. @return ApiResetUserRequestRequest */ -func (a *DefaultAPIService) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserRequestRequest { +func (a *DefaultAPIService) ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiResetUserRequestRequest { return ApiResetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -5044,7 +5044,7 @@ type ApiRestoreDatabaseFromBackupRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string restoreDatabaseFromBackupPayload *RestoreDatabaseFromBackupPayload } @@ -5072,7 +5072,7 @@ The request body defines the source @param instanceId The ID of the instance. @return ApiRestoreDatabaseFromBackupRequest */ -func (a *DefaultAPIService) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest { +func (a *DefaultAPIService) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiRestoreDatabaseFromBackupRequest { return ApiRestoreDatabaseFromBackupRequest{ ApiService: a, ctx: ctx, @@ -5233,7 +5233,7 @@ type ApiTriggerBackupRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseName string } @@ -5254,7 +5254,7 @@ Trigger backup for a specific database @param databaseName The name of the database. @return ApiTriggerBackupRequestRequest */ -func (a *DefaultAPIService) TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { +func (a *DefaultAPIService) TriggerBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { return ApiTriggerBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -5423,7 +5423,7 @@ type ApiTriggerRestoreRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string databaseName string triggerRestoreRequestPayload *TriggerRestoreRequestPayload @@ -5451,7 +5451,7 @@ Trigger restore for a specific Database @param databaseName The name of the database. @return ApiTriggerRestoreRequestRequest */ -func (a *DefaultAPIService) TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { +func (a *DefaultAPIService) TriggerRestoreRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { return ApiTriggerRestoreRequestRequest{ ApiService: a, ctx: ctx, @@ -5622,7 +5622,7 @@ type ApiUpdateInstancePartiallyRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string updateInstancePartiallyRequestPayload *UpdateInstancePartiallyRequestPayload } @@ -5650,7 +5650,7 @@ Update an available instance of a mssql database. No fields are required. @param instanceId The ID of the instance. @return ApiUpdateInstancePartiallyRequestRequest */ -func (a *DefaultAPIService) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest { +func (a *DefaultAPIService) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest { return ApiUpdateInstancePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -5811,7 +5811,7 @@ type ApiUpdateInstanceRequestRequest struct { ctx context.Context ApiService DefaultAPI projectId string - region string + region GetFlavorsRequestRegionParameter instanceId string updateInstanceRequestPayload *UpdateInstanceRequestPayload } @@ -5839,7 +5839,7 @@ UpdateInstanceRequest Update Instance @param instanceId The ID of the instance. @return ApiUpdateInstanceRequestRequest */ -func (a *DefaultAPIService) UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest { +func (a *DefaultAPIService) UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest { return ApiUpdateInstanceRequestRequest{ ApiService: a, ctx: ctx, diff --git a/services/sqlserverflex/v3beta1api/api_default_mock.go b/services/sqlserverflex/v3beta1api/api_default_mock.go index 65eb15e57..1a53bb84e 100644 --- a/services/sqlserverflex/v3beta1api/api_default_mock.go +++ b/services/sqlserverflex/v3beta1api/api_default_mock.go @@ -79,7 +79,7 @@ type DefaultAPIServiceMock struct { UpdateInstanceRequestExecuteMock *func(r ApiUpdateInstanceRequestRequest) error } -func (a DefaultAPIServiceMock) CreateDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequestRequest { +func (a DefaultAPIServiceMock) CreateDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateDatabaseRequestRequest { return ApiCreateDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -99,7 +99,7 @@ func (a DefaultAPIServiceMock) CreateDatabaseRequestExecute(r ApiCreateDatabaseR return (*a.CreateDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateInstanceRequest(ctx context.Context, projectId string, region string) ApiCreateInstanceRequestRequest { +func (a DefaultAPIServiceMock) CreateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiCreateInstanceRequestRequest { return ApiCreateInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -118,7 +118,7 @@ func (a DefaultAPIServiceMock) CreateInstanceRequestExecute(r ApiCreateInstanceR return (*a.CreateInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateUserRequest(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequestRequest { +func (a DefaultAPIServiceMock) CreateUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiCreateUserRequestRequest { return ApiCreateUserRequestRequest{ ApiService: a, ctx: ctx, @@ -138,7 +138,7 @@ func (a DefaultAPIServiceMock) CreateUserRequestExecute(r ApiCreateUserRequestRe return (*a.CreateUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { +func (a DefaultAPIServiceMock) DeleteDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiDeleteDatabaseRequestRequest { return ApiDeleteDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -158,7 +158,7 @@ func (a DefaultAPIServiceMock) DeleteDatabaseRequestExecute(r ApiDeleteDatabaseR return (*a.DeleteDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequestRequest { +func (a DefaultAPIServiceMock) DeleteInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiDeleteInstanceRequestRequest { return ApiDeleteInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -177,7 +177,7 @@ func (a DefaultAPIServiceMock) DeleteInstanceRequestExecute(r ApiDeleteInstanceR return (*a.DeleteInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequestRequest { +func (a DefaultAPIServiceMock) DeleteUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiDeleteUserRequestRequest { return ApiDeleteUserRequestRequest{ ApiService: a, ctx: ctx, @@ -197,7 +197,7 @@ func (a DefaultAPIServiceMock) DeleteUserRequestExecute(r ApiDeleteUserRequestRe return (*a.DeleteUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequestRequest { +func (a DefaultAPIServiceMock) GetBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, backupId int64) ApiGetBackupRequestRequest { return ApiGetBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -218,7 +218,7 @@ func (a DefaultAPIServiceMock) GetBackupRequestExecute(r ApiGetBackupRequestRequ return (*a.GetBackupRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetCollationsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequestRequest { +func (a DefaultAPIServiceMock) GetCollationsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetCollationsRequestRequest { return ApiGetCollationsRequestRequest{ ApiService: a, ctx: ctx, @@ -238,7 +238,7 @@ func (a DefaultAPIServiceMock) GetCollationsRequestExecute(r ApiGetCollationsReq return (*a.GetCollationsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { +func (a DefaultAPIServiceMock) GetDatabaseRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiGetDatabaseRequestRequest { return ApiGetDatabaseRequestRequest{ ApiService: a, ctx: ctx, @@ -259,7 +259,7 @@ func (a DefaultAPIServiceMock) GetDatabaseRequestExecute(r ApiGetDatabaseRequest return (*a.GetDatabaseRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetFlavorsRequest(ctx context.Context, projectId string, region string) ApiGetFlavorsRequestRequest { +func (a DefaultAPIServiceMock) GetFlavorsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetFlavorsRequestRequest { return ApiGetFlavorsRequestRequest{ ApiService: a, ctx: ctx, @@ -278,7 +278,7 @@ func (a DefaultAPIServiceMock) GetFlavorsRequestExecute(r ApiGetFlavorsRequestRe return (*a.GetFlavorsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequestRequest { +func (a DefaultAPIServiceMock) GetInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiGetInstanceRequestRequest { return ApiGetInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -298,7 +298,7 @@ func (a DefaultAPIServiceMock) GetInstanceRequestExecute(r ApiGetInstanceRequest return (*a.GetInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetStoragesRequest(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequestRequest { +func (a DefaultAPIServiceMock) GetStoragesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, flavorId string) ApiGetStoragesRequestRequest { return ApiGetStoragesRequestRequest{ ApiService: a, ctx: ctx, @@ -318,7 +318,7 @@ func (a DefaultAPIServiceMock) GetStoragesRequestExecute(r ApiGetStoragesRequest return (*a.GetStoragesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequestRequest { +func (a DefaultAPIServiceMock) GetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiGetUserRequestRequest { return ApiGetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -339,7 +339,7 @@ func (a DefaultAPIServiceMock) GetUserRequestExecute(r ApiGetUserRequestRequest) return (*a.GetUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetVersionsRequest(ctx context.Context, projectId string, region string) ApiGetVersionsRequestRequest { +func (a DefaultAPIServiceMock) GetVersionsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiGetVersionsRequestRequest { return ApiGetVersionsRequestRequest{ ApiService: a, ctx: ctx, @@ -358,7 +358,7 @@ func (a DefaultAPIServiceMock) GetVersionsRequestExecute(r ApiGetVersionsRequest return (*a.GetVersionsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListBackupsRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequestRequest { +func (a DefaultAPIServiceMock) ListBackupsRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListBackupsRequestRequest { return ApiListBackupsRequestRequest{ ApiService: a, ctx: ctx, @@ -378,7 +378,7 @@ func (a DefaultAPIServiceMock) ListBackupsRequestExecute(r ApiListBackupsRequest return (*a.ListBackupsRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListCompatibilitiesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequestRequest { +func (a DefaultAPIServiceMock) ListCompatibilitiesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCompatibilitiesRequestRequest { return ApiListCompatibilitiesRequestRequest{ ApiService: a, ctx: ctx, @@ -398,7 +398,7 @@ func (a DefaultAPIServiceMock) ListCompatibilitiesRequestExecute(r ApiListCompat return (*a.ListCompatibilitiesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest { +func (a DefaultAPIServiceMock) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListCurrentRunningRestoreJobsRequest { return ApiListCurrentRunningRestoreJobsRequest{ ApiService: a, ctx: ctx, @@ -418,7 +418,7 @@ func (a DefaultAPIServiceMock) ListCurrentRunningRestoreJobsExecute(r ApiListCur return (*a.ListCurrentRunningRestoreJobsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDatabasesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequestRequest { +func (a DefaultAPIServiceMock) ListDatabasesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListDatabasesRequestRequest { return ApiListDatabasesRequestRequest{ ApiService: a, ctx: ctx, @@ -438,7 +438,7 @@ func (a DefaultAPIServiceMock) ListDatabasesRequestExecute(r ApiListDatabasesReq return (*a.ListDatabasesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListInstancesRequest(ctx context.Context, projectId string, region string) ApiListInstancesRequestRequest { +func (a DefaultAPIServiceMock) ListInstancesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter) ApiListInstancesRequestRequest { return ApiListInstancesRequestRequest{ ApiService: a, ctx: ctx, @@ -457,7 +457,7 @@ func (a DefaultAPIServiceMock) ListInstancesRequestExecute(r ApiListInstancesReq return (*a.ListInstancesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListRolesRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequestRequest { +func (a DefaultAPIServiceMock) ListRolesRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListRolesRequestRequest { return ApiListRolesRequestRequest{ ApiService: a, ctx: ctx, @@ -477,7 +477,7 @@ func (a DefaultAPIServiceMock) ListRolesRequestExecute(r ApiListRolesRequestRequ return (*a.ListRolesRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListUsersRequest(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequestRequest { +func (a DefaultAPIServiceMock) ListUsersRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiListUsersRequestRequest { return ApiListUsersRequestRequest{ ApiService: a, ctx: ctx, @@ -497,7 +497,7 @@ func (a DefaultAPIServiceMock) ListUsersRequestExecute(r ApiListUsersRequestRequ return (*a.ListUsersRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ProtectInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequestRequest { +func (a DefaultAPIServiceMock) ProtectInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiProtectInstanceRequestRequest { return ApiProtectInstanceRequestRequest{ ApiService: a, ctx: ctx, @@ -517,7 +517,7 @@ func (a DefaultAPIServiceMock) ProtectInstanceRequestExecute(r ApiProtectInstanc return (*a.ProtectInstanceRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserRequestRequest { +func (a DefaultAPIServiceMock) ResetUserRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, userId int64) ApiResetUserRequestRequest { return ApiResetUserRequestRequest{ ApiService: a, ctx: ctx, @@ -538,7 +538,7 @@ func (a DefaultAPIServiceMock) ResetUserRequestExecute(r ApiResetUserRequestRequ return (*a.ResetUserRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region string, instanceId string) ApiRestoreDatabaseFromBackupRequest { +func (a DefaultAPIServiceMock) RestoreDatabaseFromBackup(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiRestoreDatabaseFromBackupRequest { return ApiRestoreDatabaseFromBackupRequest{ ApiService: a, ctx: ctx, @@ -557,7 +557,7 @@ func (a DefaultAPIServiceMock) RestoreDatabaseFromBackupExecute(r ApiRestoreData return (*a.RestoreDatabaseFromBackupExecuteMock)(r) } -func (a DefaultAPIServiceMock) TriggerBackupRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { +func (a DefaultAPIServiceMock) TriggerBackupRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerBackupRequestRequest { return ApiTriggerBackupRequestRequest{ ApiService: a, ctx: ctx, @@ -577,7 +577,7 @@ func (a DefaultAPIServiceMock) TriggerBackupRequestExecute(r ApiTriggerBackupReq return (*a.TriggerBackupRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) TriggerRestoreRequest(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { +func (a DefaultAPIServiceMock) TriggerRestoreRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string, databaseName string) ApiTriggerRestoreRequestRequest { return ApiTriggerRestoreRequestRequest{ ApiService: a, ctx: ctx, @@ -597,7 +597,7 @@ func (a DefaultAPIServiceMock) TriggerRestoreRequestExecute(r ApiTriggerRestoreR return (*a.TriggerRestoreRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequestRequest { +func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstancePartiallyRequestRequest { return ApiUpdateInstancePartiallyRequestRequest{ ApiService: a, ctx: ctx, @@ -616,7 +616,7 @@ func (a DefaultAPIServiceMock) UpdateInstancePartiallyRequestExecute(r ApiUpdate return (*a.UpdateInstancePartiallyRequestExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstanceRequest(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequestRequest { +func (a DefaultAPIServiceMock) UpdateInstanceRequest(ctx context.Context, projectId string, region GetFlavorsRequestRegionParameter, instanceId string) ApiUpdateInstanceRequestRequest { return ApiUpdateInstanceRequestRequest{ ApiService: a, ctx: ctx, diff --git a/services/sqlserverflex/v3beta1api/model_get_flavors_request_region_parameter.go b/services/sqlserverflex/v3beta1api/model_get_flavors_request_region_parameter.go new file mode 100644 index 000000000..139516f9e --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_get_flavors_request_region_parameter.go @@ -0,0 +1,114 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// GetFlavorsRequestRegionParameter the model 'GetFlavorsRequestRegionParameter' +type GetFlavorsRequestRegionParameter string + +// List of getFlavorsRequest_region_parameter +const ( + GETFLAVORSREQUESTREGIONPARAMETER_EU01 GetFlavorsRequestRegionParameter = "eu01" + GETFLAVORSREQUESTREGIONPARAMETER_EU02 GetFlavorsRequestRegionParameter = "eu02" + GETFLAVORSREQUESTREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetFlavorsRequestRegionParameter = "unknown_default_open_api" +) + +// All allowed values of GetFlavorsRequestRegionParameter enum +var AllowedGetFlavorsRequestRegionParameterEnumValues = []GetFlavorsRequestRegionParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetFlavorsRequestRegionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetFlavorsRequestRegionParameter(value) + for _, existing := range AllowedGetFlavorsRequestRegionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETFLAVORSREQUESTREGIONPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetFlavorsRequestRegionParameterFromValue returns a pointer to a valid GetFlavorsRequestRegionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetFlavorsRequestRegionParameterFromValue(v string) (*GetFlavorsRequestRegionParameter, error) { + ev := GetFlavorsRequestRegionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetFlavorsRequestRegionParameter: valid values are %v", v, AllowedGetFlavorsRequestRegionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetFlavorsRequestRegionParameter) IsValid() bool { + for _, existing := range AllowedGetFlavorsRequestRegionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to getFlavorsRequest_region_parameter value +func (v GetFlavorsRequestRegionParameter) Ptr() *GetFlavorsRequestRegionParameter { + return &v +} + +type NullableGetFlavorsRequestRegionParameter struct { + value *GetFlavorsRequestRegionParameter + isSet bool +} + +func (v NullableGetFlavorsRequestRegionParameter) Get() *GetFlavorsRequestRegionParameter { + return v.value +} + +func (v *NullableGetFlavorsRequestRegionParameter) Set(val *GetFlavorsRequestRegionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetFlavorsRequestRegionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetFlavorsRequestRegionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetFlavorsRequestRegionParameter(val *GetFlavorsRequestRegionParameter) *NullableGetFlavorsRequestRegionParameter { + return &NullableGetFlavorsRequestRegionParameter{value: val, isSet: true} +} + +func (v NullableGetFlavorsRequestRegionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetFlavorsRequestRegionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_source_backup.go b/services/sqlserverflex/v3beta1api/model_source_backup.go index 6b5b95f33..53b562228 100644 --- a/services/sqlserverflex/v3beta1api/model_source_backup.go +++ b/services/sqlserverflex/v3beta1api/model_source_backup.go @@ -21,7 +21,7 @@ var _ MappedNullable = &SourceBackup{} // SourceBackup Restore from an existing managed backup. type SourceBackup struct { - Type string `json:"type"` + Type SourceBackupType `json:"type"` AdditionalProperties map[string]interface{} } @@ -31,7 +31,7 @@ type _SourceBackup SourceBackup // 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 NewSourceBackup(types string) *SourceBackup { +func NewSourceBackup(types SourceBackupType) *SourceBackup { this := SourceBackup{} this.Type = types return &this @@ -46,9 +46,9 @@ func NewSourceBackupWithDefaults() *SourceBackup { } // GetType returns the Type field value -func (o *SourceBackup) GetType() string { +func (o *SourceBackup) GetType() SourceBackupType { if o == nil { - var ret string + var ret SourceBackupType return ret } @@ -57,7 +57,7 @@ func (o *SourceBackup) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *SourceBackup) GetTypeOk() (*string, bool) { +func (o *SourceBackup) GetTypeOk() (*SourceBackupType, bool) { if o == nil { return nil, false } @@ -65,7 +65,7 @@ func (o *SourceBackup) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *SourceBackup) SetType(v string) { +func (o *SourceBackup) SetType(v SourceBackupType) { o.Type = v } diff --git a/services/sqlserverflex/v3beta1api/model_source_backup_type.go b/services/sqlserverflex/v3beta1api/model_source_backup_type.go new file mode 100644 index 000000000..20365009b --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_source_backup_type.go @@ -0,0 +1,112 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// SourceBackupType the model 'SourceBackupType' +type SourceBackupType string + +// List of source_backup_type +const ( + SOURCEBACKUPTYPE_BACKUP SourceBackupType = "BACKUP" + SOURCEBACKUPTYPE_UNKNOWN_DEFAULT_OPEN_API SourceBackupType = "unknown_default_open_api" +) + +// All allowed values of SourceBackupType enum +var AllowedSourceBackupTypeEnumValues = []SourceBackupType{ + "BACKUP", + "unknown_default_open_api", +} + +func (v *SourceBackupType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SourceBackupType(value) + for _, existing := range AllowedSourceBackupTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SOURCEBACKUPTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewSourceBackupTypeFromValue returns a pointer to a valid SourceBackupType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSourceBackupTypeFromValue(v string) (*SourceBackupType, error) { + ev := SourceBackupType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SourceBackupType: valid values are %v", v, AllowedSourceBackupTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SourceBackupType) IsValid() bool { + for _, existing := range AllowedSourceBackupTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to source_backup_type value +func (v SourceBackupType) Ptr() *SourceBackupType { + return &v +} + +type NullableSourceBackupType struct { + value *SourceBackupType + isSet bool +} + +func (v NullableSourceBackupType) Get() *SourceBackupType { + return v.value +} + +func (v *NullableSourceBackupType) Set(val *SourceBackupType) { + v.value = val + v.isSet = true +} + +func (v NullableSourceBackupType) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceBackupType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceBackupType(val *SourceBackupType) *NullableSourceBackupType { + return &NullableSourceBackupType{value: val, isSet: true} +} + +func (v NullableSourceBackupType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceBackupType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta1api/model_source_external_s3.go b/services/sqlserverflex/v3beta1api/model_source_external_s3.go index bda476bac..b795e230d 100644 --- a/services/sqlserverflex/v3beta1api/model_source_external_s3.go +++ b/services/sqlserverflex/v3beta1api/model_source_external_s3.go @@ -24,9 +24,9 @@ type SourceExternalS3 struct { // The owner of the database. DatabaseOwner string `json:"database_owner"` // Logging guid to have a complete activity log over all sub stored procedures. - LoggingGuid *string `json:"logging_guid,omitempty"` - S3Details ExternalS3 `json:"s3_details"` - Type string `json:"type"` + LoggingGuid *string `json:"logging_guid,omitempty"` + S3Details ExternalS3 `json:"s3_details"` + Type SourceExternalS3Type `json:"type"` AdditionalProperties map[string]interface{} } @@ -36,7 +36,7 @@ type _SourceExternalS3 SourceExternalS3 // 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 NewSourceExternalS3(databaseOwner string, s3Details ExternalS3, types string) *SourceExternalS3 { +func NewSourceExternalS3(databaseOwner string, s3Details ExternalS3, types SourceExternalS3Type) *SourceExternalS3 { this := SourceExternalS3{} this.DatabaseOwner = databaseOwner this.S3Details = s3Details @@ -133,9 +133,9 @@ func (o *SourceExternalS3) SetS3Details(v ExternalS3) { } // GetType returns the Type field value -func (o *SourceExternalS3) GetType() string { +func (o *SourceExternalS3) GetType() SourceExternalS3Type { if o == nil { - var ret string + var ret SourceExternalS3Type return ret } @@ -144,7 +144,7 @@ func (o *SourceExternalS3) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *SourceExternalS3) GetTypeOk() (*string, bool) { +func (o *SourceExternalS3) GetTypeOk() (*SourceExternalS3Type, bool) { if o == nil { return nil, false } @@ -152,7 +152,7 @@ func (o *SourceExternalS3) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *SourceExternalS3) SetType(v string) { +func (o *SourceExternalS3) SetType(v SourceExternalS3Type) { o.Type = v } diff --git a/services/sqlserverflex/v3beta1api/model_source_external_s3_type.go b/services/sqlserverflex/v3beta1api/model_source_external_s3_type.go new file mode 100644 index 000000000..befac8341 --- /dev/null +++ b/services/sqlserverflex/v3beta1api/model_source_external_s3_type.go @@ -0,0 +1,112 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta1 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta1api + +import ( + "encoding/json" + "fmt" +) + +// SourceExternalS3Type the model 'SourceExternalS3Type' +type SourceExternalS3Type string + +// List of source_externalS3_type +const ( + SOURCEEXTERNALS3TYPE_EXTERNAL_S3 SourceExternalS3Type = "EXTERNAL_S3" + SOURCEEXTERNALS3TYPE_UNKNOWN_DEFAULT_OPEN_API SourceExternalS3Type = "unknown_default_open_api" +) + +// All allowed values of SourceExternalS3Type enum +var AllowedSourceExternalS3TypeEnumValues = []SourceExternalS3Type{ + "EXTERNAL_S3", + "unknown_default_open_api", +} + +func (v *SourceExternalS3Type) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SourceExternalS3Type(value) + for _, existing := range AllowedSourceExternalS3TypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = SOURCEEXTERNALS3TYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewSourceExternalS3TypeFromValue returns a pointer to a valid SourceExternalS3Type +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSourceExternalS3TypeFromValue(v string) (*SourceExternalS3Type, error) { + ev := SourceExternalS3Type(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SourceExternalS3Type: valid values are %v", v, AllowedSourceExternalS3TypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SourceExternalS3Type) IsValid() bool { + for _, existing := range AllowedSourceExternalS3TypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to source_externalS3_type value +func (v SourceExternalS3Type) Ptr() *SourceExternalS3Type { + return &v +} + +type NullableSourceExternalS3Type struct { + value *SourceExternalS3Type + isSet bool +} + +func (v NullableSourceExternalS3Type) Get() *SourceExternalS3Type { + return v.value +} + +func (v *NullableSourceExternalS3Type) Set(val *SourceExternalS3Type) { + v.value = val + v.isSet = true +} + +func (v NullableSourceExternalS3Type) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceExternalS3Type) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceExternalS3Type(val *SourceExternalS3Type) *NullableSourceExternalS3Type { + return &NullableSourceExternalS3Type{value: val, isSet: true} +} + +func (v NullableSourceExternalS3Type) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceExternalS3Type) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 85ea529ac210ccc45862d2dbcf6008af08401cd2 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 15:12:20 +0200 Subject: [PATCH 54/66] chore(sqlserverflex): fix waiters/tests/example, write changelog, bump version --- CHANGELOG.md | 2 ++ examples/sqlserverflex/sqlserverflex.go | 10 +++++----- services/sqlserverflex/CHANGELOG.md | 3 +++ services/sqlserverflex/VERSION | 2 +- services/sqlserverflex/v2api/wait/wait.go | 8 ++++---- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1267647b1..6049e5c6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -492,6 +492,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` - [v1.10.0](services/sqlserverflex/CHANGELOG.md#v1100) - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. + - [v1.11.0](services/sqlserverflex/CHANGELOG.md#v1110) + - **Feature:** Introduce enums for various attributes - `stackitmarketplace`: - [v1.17.5](services/stackitmarketplace/CHANGELOG.md#v1175) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/examples/sqlserverflex/sqlserverflex.go b/examples/sqlserverflex/sqlserverflex.go index 24bd1edca..ec36080d0 100644 --- a/examples/sqlserverflex/sqlserverflex.go +++ b/examples/sqlserverflex/sqlserverflex.go @@ -30,7 +30,7 @@ func main() { } // Get the SQLServer Flex instances for your project - getInstancesResp, err := sqlserverflexClient.DefaultAPI.ListInstances(ctx, projectId, region).Execute() + getInstancesResp, err := sqlserverflexClient.DefaultAPI.ListInstances(ctx, projectId, sqlserverflex.ListInstancesRegionParameter(region)).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ListInstances`: %v\n", err) os.Exit(1) @@ -44,13 +44,13 @@ func main() { FlavorId: flavorId, Version: utils.Ptr(version), } - instance, err := sqlserverflexClient.DefaultAPI.CreateInstance(ctx, projectId, region).CreateInstancePayload(createInstancePayload).Execute() + instance, err := sqlserverflexClient.DefaultAPI.CreateInstance(ctx, projectId, sqlserverflex.CreateInstanceRegionParameter(region)).CreateInstancePayload(createInstancePayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error creating SQL Server Flex instance: %v\n", err) } instanceId := *instance.Id - _, err = wait.CreateInstanceWaitHandler(ctx, sqlserverflexClient.DefaultAPI, projectId, instanceId, region).WaitWithContext(ctx) + _, err = wait.CreateInstanceWaitHandler(ctx, sqlserverflexClient.DefaultAPI, projectId, instanceId, sqlserverflex.GetInstanceRegionParameter(region)).WaitWithContext(ctx) if err != nil { fmt.Fprintf(os.Stderr, "Error when waiting for SQL Server Flex instance creation: %v\n", err) } @@ -58,13 +58,13 @@ func main() { fmt.Printf("Created SQL Server Flex instance \"%s\".\n", instanceId) // Delete an instance - err = sqlserverflexClient.DefaultAPI.DeleteInstance(ctx, projectId, instanceId, region).Execute() + err = sqlserverflexClient.DefaultAPI.DeleteInstance(ctx, projectId, instanceId, sqlserverflex.DeleteInstanceRegionParameter(region)).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error deleting SQL Server Flex instance: %v\n", err) } - _, err = wait.DeleteInstanceWaitHandler(ctx, sqlserverflexClient.DefaultAPI, projectId, instanceId, region).WaitWithContext(ctx) + _, err = wait.DeleteInstanceWaitHandler(ctx, sqlserverflexClient.DefaultAPI, projectId, instanceId, sqlserverflex.GetInstanceRegionParameter(region)).WaitWithContext(ctx) if err != nil { fmt.Fprintf(os.Stderr, "Error when waiting for SQL Server Flex instance deletion: %v\n", err) } diff --git a/services/sqlserverflex/CHANGELOG.md b/services/sqlserverflex/CHANGELOG.md index 4d43882f8..707bbfd3a 100644 --- a/services/sqlserverflex/CHANGELOG.md +++ b/services/sqlserverflex/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.11.0 +- **Feature:** Introduce enums for various attributes + ## v1.10.0 - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. diff --git a/services/sqlserverflex/VERSION b/services/sqlserverflex/VERSION index e1e35526c..285cea5d1 100644 --- a/services/sqlserverflex/VERSION +++ b/services/sqlserverflex/VERSION @@ -1 +1 @@ -v1.10.0 \ No newline at end of file +v1.11.0 \ No newline at end of file diff --git a/services/sqlserverflex/v2api/wait/wait.go b/services/sqlserverflex/v2api/wait/wait.go index 01747d844..389b0d83a 100644 --- a/services/sqlserverflex/v2api/wait/wait.go +++ b/services/sqlserverflex/v2api/wait/wait.go @@ -22,7 +22,7 @@ const ( ) // CreateInstanceWaitHandler will wait for instance creation -func CreateInstanceWaitHandler(ctx context.Context, a sqlserverflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[sqlserverflex.GetInstanceResponse] { +func CreateInstanceWaitHandler(ctx context.Context, a sqlserverflex.DefaultAPI, projectId, instanceId string, region sqlserverflex.GetInstanceRegionParameter) *wait.AsyncActionHandler[sqlserverflex.GetInstanceResponse] { handler := wait.New(func() (waitFinished bool, response *sqlserverflex.GetInstanceResponse, err error) { s, err := a.GetInstance(ctx, projectId, instanceId, region).Execute() if err != nil { @@ -46,7 +46,7 @@ func CreateInstanceWaitHandler(ctx context.Context, a sqlserverflex.DefaultAPI, } // UpdateInstanceWaitHandler will wait for instance update -func UpdateInstanceWaitHandler(ctx context.Context, a sqlserverflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[sqlserverflex.GetInstanceResponse] { +func UpdateInstanceWaitHandler(ctx context.Context, a sqlserverflex.DefaultAPI, projectId, instanceId string, region sqlserverflex.GetInstanceRegionParameter) *wait.AsyncActionHandler[sqlserverflex.GetInstanceResponse] { handler := wait.New(func() (waitFinished bool, response *sqlserverflex.GetInstanceResponse, err error) { s, err := a.GetInstance(ctx, projectId, instanceId, region).Execute() if err != nil { @@ -70,12 +70,12 @@ func UpdateInstanceWaitHandler(ctx context.Context, a sqlserverflex.DefaultAPI, } // PartialUpdateInstanceWaitHandler will wait for instance update -func PartialUpdateInstanceWaitHandler(ctx context.Context, a sqlserverflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[sqlserverflex.GetInstanceResponse] { +func PartialUpdateInstanceWaitHandler(ctx context.Context, a sqlserverflex.DefaultAPI, projectId, instanceId string, region sqlserverflex.GetInstanceRegionParameter) *wait.AsyncActionHandler[sqlserverflex.GetInstanceResponse] { return UpdateInstanceWaitHandler(ctx, a, projectId, instanceId, region) } // DeleteInstanceWaitHandler will wait for instance deletion -func DeleteInstanceWaitHandler(ctx context.Context, a sqlserverflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[struct{}] { +func DeleteInstanceWaitHandler(ctx context.Context, a sqlserverflex.DefaultAPI, projectId, instanceId string, region sqlserverflex.GetInstanceRegionParameter) *wait.AsyncActionHandler[struct{}] { handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { _, err = a.GetInstance(ctx, projectId, instanceId, region).Execute() if err == nil { From 1899709ccc46447cd61735b51889e735282c863e Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 15:47:28 +0200 Subject: [PATCH 55/66] fixup missing changes --- services/logme/v1api/wait/wait.go | 20 ++++++++++---------- services/mariadb/VERSION | 2 +- services/mariadb/v1api/wait/wait.go | 20 ++++++++++---------- services/mariadb/v1api/wait/wait_test.go | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/services/logme/v1api/wait/wait.go b/services/logme/v1api/wait/wait.go index df39df331..d3c56b46a 100644 --- a/services/logme/v1api/wait/wait.go +++ b/services/logme/v1api/wait/wait.go @@ -24,9 +24,9 @@ const ( // CreateInstanceWaitHandler will wait for instance creation func CreateInstanceWaitHandler(ctx context.Context, client logme.DefaultAPI, projectId, instanceId string) *wait.AsyncActionHandler[logme.Instance] { - waitConfig := wait.WaiterHelper[logme.Instance, string]{ + waitConfig := wait.WaiterHelper[logme.Instance, logme.InstanceStatus]{ FetchInstance: client.GetInstance(ctx, projectId, instanceId).Execute, - GetState: func(response *logme.Instance) (string, error) { + GetState: func(response *logme.Instance) (logme.InstanceStatus, error) { if response == nil { return "", errors.New("empty response") } @@ -35,8 +35,8 @@ func CreateInstanceWaitHandler(ctx context.Context, client logme.DefaultAPI, pro } return *response.Status, nil }, - ActiveState: []string{INSTANCESTATUS_ACTIVE}, - ErrorState: []string{INSTANCESTATUS_FAILED}, + ActiveState: []logme.InstanceStatus{logme.INSTANCESTATUS_ACTIVE}, + ErrorState: []logme.InstanceStatus{logme.INSTANCESTATUS_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -46,9 +46,9 @@ func CreateInstanceWaitHandler(ctx context.Context, client logme.DefaultAPI, pro // PartialUpdateInstanceWaitHandler will wait for instance update func PartialUpdateInstanceWaitHandler(ctx context.Context, client logme.DefaultAPI, projectId, instanceId string) *wait.AsyncActionHandler[logme.Instance] { - waitConfig := wait.WaiterHelper[logme.Instance, string]{ + waitConfig := wait.WaiterHelper[logme.Instance, logme.InstanceStatus]{ FetchInstance: client.GetInstance(ctx, projectId, instanceId).Execute, - GetState: func(response *logme.Instance) (string, error) { + GetState: func(response *logme.Instance) (logme.InstanceStatus, error) { if response == nil { return "", errors.New("empty response") } @@ -57,8 +57,8 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, client logme.DefaultA } return *response.Status, nil }, - ActiveState: []string{INSTANCESTATUS_ACTIVE}, - ErrorState: []string{INSTANCESTATUS_FAILED}, + ActiveState: []logme.InstanceStatus{logme.INSTANCESTATUS_ACTIVE}, + ErrorState: []logme.InstanceStatus{logme.INSTANCESTATUS_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -74,10 +74,10 @@ func DeleteInstanceWaitHandler(ctx context.Context, a logme.DefaultAPI, projectI if s.Status == nil { return false, nil, fmt.Errorf("delete failed for instance with id %s. The response is not valid: The status is missing", instanceId) } - if *s.Status != INSTANCESTATUS_DELETING { + if *s.Status != logme.INSTANCESTATUS_DELETING { return false, nil, nil } - if *s.Status == INSTANCESTATUS_ACTIVE { + if *s.Status == logme.INSTANCESTATUS_ACTIVE { if strings.Contains(s.LastOperation.Description, "DeleteFailed") || strings.Contains(s.LastOperation.Description, "failed") { return true, nil, fmt.Errorf("instance was deleted successfully but has errors: %s", s.LastOperation.Description) } diff --git a/services/mariadb/VERSION b/services/mariadb/VERSION index 5bc296535..29e939cda 100644 --- a/services/mariadb/VERSION +++ b/services/mariadb/VERSION @@ -1 +1 @@ -v0.29.0 \ No newline at end of file +v0.30.0 \ No newline at end of file diff --git a/services/mariadb/v1api/wait/wait.go b/services/mariadb/v1api/wait/wait.go index ae95d85b4..0c94051e9 100644 --- a/services/mariadb/v1api/wait/wait.go +++ b/services/mariadb/v1api/wait/wait.go @@ -24,16 +24,16 @@ const ( // CreateInstanceWaitHandler will wait for instance creation func CreateInstanceWaitHandler(ctx context.Context, a mariadb.DefaultAPI, projectId, instanceId string) *wait.AsyncActionHandler[mariadb.Instance] { - waitConfig := wait.WaiterHelper[mariadb.Instance, string]{ + waitConfig := wait.WaiterHelper[mariadb.Instance, mariadb.InstanceStatus]{ FetchInstance: a.GetInstance(ctx, projectId, instanceId).Execute, - GetState: func(s *mariadb.Instance) (string, error) { + GetState: func(s *mariadb.Instance) (mariadb.InstanceStatus, error) { if s == nil || s.Status == nil { return "", errors.New("response or status is nil") } return *s.Status, nil }, - ActiveState: []string{INSTANCESTATUS_ACTIVE}, - ErrorState: []string{INSTANCESTATUS_FAILED}, + ActiveState: []mariadb.InstanceStatus{mariadb.INSTANCESTATUS_ACTIVE}, + ErrorState: []mariadb.InstanceStatus{mariadb.INSTANCESTATUS_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -43,16 +43,16 @@ func CreateInstanceWaitHandler(ctx context.Context, a mariadb.DefaultAPI, projec // PartialUpdateInstanceWaitHandler will wait for instance update func PartialUpdateInstanceWaitHandler(ctx context.Context, a mariadb.DefaultAPI, projectId, instanceId string) *wait.AsyncActionHandler[mariadb.Instance] { - waitConfig := wait.WaiterHelper[mariadb.Instance, string]{ + waitConfig := wait.WaiterHelper[mariadb.Instance, mariadb.InstanceStatus]{ FetchInstance: a.GetInstance(ctx, projectId, instanceId).Execute, - GetState: func(s *mariadb.Instance) (string, error) { + GetState: func(s *mariadb.Instance) (mariadb.InstanceStatus, error) { if s == nil || s.Status == nil { return "", errors.New("response or status is nil") } return *s.Status, nil }, - ActiveState: []string{INSTANCESTATUS_ACTIVE}, - ErrorState: []string{INSTANCESTATUS_FAILED}, + ActiveState: []mariadb.InstanceStatus{mariadb.INSTANCESTATUS_ACTIVE}, + ErrorState: []mariadb.InstanceStatus{mariadb.INSTANCESTATUS_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -68,10 +68,10 @@ func DeleteInstanceWaitHandler(ctx context.Context, a mariadb.DefaultAPI, projec if s.Status == nil { return false, nil, fmt.Errorf("delete failed for instance with id %s. The response is not valid: The status is missing", instanceId) } - if *s.Status != INSTANCESTATUS_DELETING { + if *s.Status != mariadb.INSTANCESTATUS_DELETING { return false, nil, nil } - if *s.Status == INSTANCESTATUS_ACTIVE { + if *s.Status == mariadb.INSTANCESTATUS_ACTIVE { if strings.Contains(s.LastOperation.Description, "DeleteFailed") || strings.Contains(s.LastOperation.Description, "failed") { return true, nil, fmt.Errorf("instance was deleted successfully but has errors: %s", s.LastOperation.Description) } diff --git a/services/mariadb/v1api/wait/wait_test.go b/services/mariadb/v1api/wait/wait_test.go index 0b266d0e6..3803a6c03 100644 --- a/services/mariadb/v1api/wait/wait_test.go +++ b/services/mariadb/v1api/wait/wait_test.go @@ -37,7 +37,7 @@ func newAPIMock(settings *mockSettings) mariadb.DefaultAPI { StatusCode: 500, } } - if settings.instanceResourceOperation != nil && *settings.instanceResourceOperation == deleteOperation && settings.instanceResourceState != nil && *settings.instanceResourceState == INSTANCESTATUS_ACTIVE { + if settings.instanceResourceOperation != nil && *settings.instanceResourceOperation == deleteOperation && settings.instanceResourceState != nil && *settings.instanceResourceState == mariadb.INSTANCESTATUS_ACTIVE { if settings.instanceDeletionSucceedsWithErrors { return &mariadb.Instance{ InstanceId: &settings.instanceResourceId, From 78549334cd92fd8af79377d015348a474f1d463b Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Wed, 20 May 2026 15:55:59 +0200 Subject: [PATCH 56/66] fix(dremio): example --- examples/dremio/dremio.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/dremio/dremio.go b/examples/dremio/dremio.go index d44f3f5ce..1aee6cf46 100644 --- a/examples/dremio/dremio.go +++ b/examples/dremio/dremio.go @@ -13,13 +13,13 @@ import ( ) func main() { - region := "eu01" // Region where the resources will be created - projectId := "PROJECT_ID" // Your STACKIT project ID + region := dremio.LISTDREMIOINSTANCESREGIONIDPARAMETER_EU01 // Region where the resources will be created + projectId := "PROJECT_ID" // Your STACKIT project ID ctx := context.Background() dremioClient, err := dremio.NewAPIClient( - config.WithRegion(region), + config.WithRegion(string(region)), ) if err != nil { fmt.Fprintf(os.Stderr, "[Dremio] Creating API client: %v\n", err) From b791ebbac815bdc4467f39901dad6b12cefc4740 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Thu, 21 May 2026 13:36:58 +0200 Subject: [PATCH 57/66] fix(api): deprecate unused waiter constants - replace string literals to references to enum value - add deprecation notice - add go:fix inline annotation to enable automatic fixing --- services/alb/v2api/wait/wait.go | 22 +++-- services/dns/v1api/wait/wait.go | 74 ++++++++++++----- services/dremio/v1alphaapi/wait/wait/wait.go | 18 +++-- services/edge/v1beta1api/wait/wait.go | 16 +++- services/intake/v1betaapi/wait/wait.go | 44 +++++++--- services/kms/v1api/wait/wait.go | 80 ++++++++++++++----- services/loadbalancer/v2api/wait/wait.go | 20 +++-- services/logme/v1api/wait/wait.go | 24 ++++-- services/mariadb/v1api/wait/wait.go | 24 ++++-- services/modelserving/v1api/wait/wait.go | 16 +++- services/mongodbflex/v2api/wait/wait.go | 20 +++-- services/observability/v1api/wait/wait.go | 36 ++++++--- services/opensearch/v1api/wait/wait.go | 36 ++++++--- services/rabbitmq/v1api/wait/wait.go | 36 ++++++--- services/redis/v1api/wait/wait.go | 36 ++++++--- services/redis/v1api/wait/wait_test.go | 2 +- services/serviceenablement/v2api/wait/wait.go | 16 +++- services/ske/v2api/wait/wait.go | 26 ++++-- 18 files changed, 406 insertions(+), 140 deletions(-) diff --git a/services/alb/v2api/wait/wait.go b/services/alb/v2api/wait/wait.go index 23e38358b..07d6b3771 100644 --- a/services/alb/v2api/wait/wait.go +++ b/services/alb/v2api/wait/wait.go @@ -10,11 +10,21 @@ import ( ) const ( - LOADBALANCERSTATUS_UNSPECIFIED = "STATUS_UNSPECIFIED" - LOADBALANCERSTATUS_PENDING = "STATUS_PENDING" - LOADBALANCERSTATUS_READY = "STATUS_READY" - LOADBALANCERSTATUS_ERROR = "STATUS_ERROR" - LOADBALANCERSTATUS_TERMINATING = "STATUS_TERMINATING" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + LOADBALANCERSTATUS_UNSPECIFIED = alb.LOADBALANCERSTATUS_STATUS_UNSPECIFIED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + LOADBALANCERSTATUS_PENDING = alb.LOADBALANCERSTATUS_STATUS_PENDING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + LOADBALANCERSTATUS_READY = alb.LOADBALANCERSTATUS_STATUS_READY + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + LOADBALANCERSTATUS_ERROR = alb.LOADBALANCERSTATUS_STATUS_ERROR + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + LOADBALANCERSTATUS_TERMINATING = alb.LOADBALANCERSTATUS_STATUS_TERMINATING ) func CreateOrUpdateLoadbalancerWaitHandler(ctx context.Context, client alb.DefaultAPI, projectId, region, name string) *wait.AsyncActionHandler[alb.LoadBalancer] { @@ -51,7 +61,7 @@ func DeleteLoadbalancerWaitHandler(ctx context.Context, client alb.DefaultAPI, p return *response.Status, nil }, ActiveState: []alb.LoadBalancerStatus{}, - ErrorState: []alb.LoadBalancerStatus{LOADBALANCERSTATUS_ERROR}, + ErrorState: []alb.LoadBalancerStatus{alb.LOADBALANCERSTATUS_STATUS_ERROR}, } handler := wait.New(waitConfig.Wait()) diff --git a/services/dns/v1api/wait/wait.go b/services/dns/v1api/wait/wait.go index 4bb18b831..755563228 100644 --- a/services/dns/v1api/wait/wait.go +++ b/services/dns/v1api/wait/wait.go @@ -11,25 +11,61 @@ import ( ) const ( - ZONESTATE_CREATING = "CREATING" - ZONESTATE_CREATE_SUCCEEDED = "CREATE_SUCCEEDED" - ZONESTATE_CREATE_FAILED = "CREATE_FAILED" - ZONESTATE_DELETING = "DELETING" - ZONESTATE_DELETE_SUCCEEDED = "DELETE_SUCCEEDED" - ZONESTATE_DELETE_FAILED = "DELETE_FAILED" - ZONESTATE_UPDATING = "UPDATING" - ZONESTATE_UPDATE_SUCCEEDED = "UPDATE_SUCCEEDED" - ZONESTATE_UPDATE_FAILED = "UPDATE_FAILED" - - RECORDSETSTATE_CREATING = "CREATING" - RECORDSETSTATE_CREATE_SUCCEEDED = "CREATE_SUCCEEDED" - RECORDSETSTATE_CREATE_FAILED = "CREATE_FAILED" - RECORDSETSTATE_DELETING = "DELETING" - RECORDSETSTATE_DELETE_SUCCEEDED = "DELETE_SUCCEEDED" - RECORDSETSTATE_DELETE_FAILED = "DELETE_FAILED" - RECORDSETSTATE_UPDATING = "UPDATING" - RECORDSETSTATE_UPDATE_SUCCEEDED = "UPDATE_SUCCEEDED" - RECORDSETSTATE_UPDATE_FAILED = "UPDATE_FAILED" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + ZONESTATE_CREATING = dns.ZONESTATE_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + ZONESTATE_CREATE_SUCCEEDED = dns.ZONESTATE_CREATE_SUCCEEDED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + ZONESTATE_CREATE_FAILED = dns.ZONESTATE_CREATE_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + ZONESTATE_DELETING = dns.ZONESTATE_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + ZONESTATE_DELETE_SUCCEEDED = dns.ZONESTATE_DELETE_SUCCEEDED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + ZONESTATE_DELETE_FAILED = dns.ZONESTATE_DELETE_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + ZONESTATE_UPDATING = dns.ZONESTATE_UPDATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + ZONESTATE_UPDATE_SUCCEEDED = dns.ZONESTATE_UPDATE_SUCCEEDED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + ZONESTATE_UPDATE_FAILED = dns.ZONESTATE_UPDATE_FAILED + + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + RECORDSETSTATE_CREATING = dns.RECORDSETSTATE_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + RECORDSETSTATE_CREATE_SUCCEEDED = dns.RECORDSETSTATE_CREATE_SUCCEEDED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + RECORDSETSTATE_CREATE_FAILED = dns.RECORDSETSTATE_CREATE_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + RECORDSETSTATE_DELETING = dns.RECORDSETSTATE_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + RECORDSETSTATE_DELETE_SUCCEEDED = dns.RECORDSETSTATE_DELETE_SUCCEEDED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + RECORDSETSTATE_DELETE_FAILED = dns.RECORDSETSTATE_DELETE_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + RECORDSETSTATE_UPDATING = dns.RECORDSETSTATE_UPDATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + RECORDSETSTATE_UPDATE_SUCCEEDED = dns.RECORDSETSTATE_UPDATE_SUCCEEDED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + RECORDSETSTATE_UPDATE_FAILED = dns.RECORDSETSTATE_CREATE_FAILED ) // CreateZoneWaitHandler will wait for zone creation diff --git a/services/dremio/v1alphaapi/wait/wait/wait.go b/services/dremio/v1alphaapi/wait/wait/wait.go index c363b0483..5443cb447 100644 --- a/services/dremio/v1alphaapi/wait/wait/wait.go +++ b/services/dremio/v1alphaapi/wait/wait/wait.go @@ -11,11 +11,19 @@ import ( ) const ( - DREMIOSTATE_ACTIVE = "active" - DREMIOSTATE_ERROR = "error" - - DREMIOUSERSTATE_ACTIVE = "active" - DREMIOUSERSTATE_ERROR = "error" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + DREMIOSTATE_ACTIVE = dremio.DREMIORESPONSESTATE_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + DREMIOSTATE_ERROR = dremio.DREMIORESPONSESTATE_ERROR + + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + DREMIOUSERSTATE_ACTIVE = dremio.DREMIOUSERRESPONSESTATE_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + DREMIOUSERSTATE_ERROR = dremio.DREMIOUSERRESPONSESTATE_ERROR ) // CreateDremioWaitHandler will wait for the creation of a Dremio instance diff --git a/services/edge/v1beta1api/wait/wait.go b/services/edge/v1beta1api/wait/wait.go index 36881f179..804819fee 100644 --- a/services/edge/v1beta1api/wait/wait.go +++ b/services/edge/v1beta1api/wait/wait.go @@ -15,10 +15,18 @@ import ( const timeoutMinutes time.Duration = 10 const ( - INSTANCESTATUS_ERROR = "error" - INSTANCESTATUS_RECONCILING = "reconciling" - INSTANCESTATUS_ACTIVE = "active" - INSTANCESTATUS_DELETING = "deleting" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_ERROR = edge.INSTANCESTATUS_ERROR + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_RECONCILING = edge.INSTANCESTATUS_RECONCILING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_ACTIVE = edge.INSTANCESTATUS_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_DELETING = edge.INSTANCESTATUS_DELETING ) var ( diff --git a/services/intake/v1betaapi/wait/wait.go b/services/intake/v1betaapi/wait/wait.go index 34303c1a2..c781f0471 100644 --- a/services/intake/v1betaapi/wait/wait.go +++ b/services/intake/v1betaapi/wait/wait.go @@ -13,18 +13,38 @@ import ( ) const ( - INTAKERESPONSESTATE_RECONCILING = "reconciling" - INTAKERESPONSESTATE_ACTIVE = "active" - INTAKERESPONSESTATE_DELETING = "deleting" - INTAKERESPONSESTATE_FAILED = "failed" - - INTAKERUNNERRESPONSESTATE_RECONCILING = "reconciling" - INTAKERUNNERRESPONSESTATE_ACTIVE = "active" - INTAKERUNNERRESPONSESTATE_DELETING = "deleting" - - INTAKEUSERRESPONSESTATE_RECONCILING = "reconciling" - INTAKEUSERRESPONSESTATE_ACTIVE = "active" - INTAKEUSERRESPONSESTATE_DELETING = "deleting" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INTAKERESPONSESTATE_RECONCILING = intake.INTAKERESPONSESTATE_RECONCILING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INTAKERESPONSESTATE_ACTIVE = intake.INTAKERESPONSESTATE_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INTAKERESPONSESTATE_DELETING = intake.INTAKERESPONSESTATE_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INTAKERESPONSESTATE_FAILED = intake.INTAKERESPONSESTATE_FAILED + + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INTAKERUNNERRESPONSESTATE_RECONCILING = intake.INTAKERUNNERRESPONSESTATE_RECONCILING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INTAKERUNNERRESPONSESTATE_ACTIVE = intake.INTAKERUNNERRESPONSESTATE_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INTAKERUNNERRESPONSESTATE_DELETING = intake.INTAKERUNNERRESPONSESTATE_DELETING + + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INTAKEUSERRESPONSESTATE_RECONCILING = intake.INTAKEUSERRESPONSESTATE_RECONCILING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INTAKEUSERRESPONSESTATE_ACTIVE = intake.INTAKEUSERRESPONSESTATE_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INTAKEUSERRESPONSESTATE_DELETING = intake.INTAKEUSERRESPONSESTATE_DELETING ) func CreateOrUpdateIntakeRunnerWaitHandler(ctx context.Context, a intake.DefaultAPI, projectId string, region intake.ListIntakeRunnersRegionIdParameter, intakeRunnerId string) *wait.AsyncActionHandler[intake.IntakeRunnerResponse] { diff --git a/services/kms/v1api/wait/wait.go b/services/kms/v1api/wait/wait.go index 6d0330220..03eb452f4 100644 --- a/services/kms/v1api/wait/wait.go +++ b/services/kms/v1api/wait/wait.go @@ -11,29 +11,69 @@ import ( ) const ( - VERSIONSTATE_ACTIVE = "active" - VERSIONSTATE_CREATING = "creating" - VERSIONSTATE_KEY_MATERIAL_INVALID = "key_material_invalid" - VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE = "key_material_unavailable" - VERSIONSTATE_DISABLED = "disabled" - VERSIONSTATE_DESTROYED = "destroyed" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + VERSIONSTATE_ACTIVE = kms.VERSIONSTATE_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + VERSIONSTATE_CREATING = kms.VERSIONSTATE_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + VERSIONSTATE_KEY_MATERIAL_INVALID = kms.VERSIONSTATE_KEY_MATERIAL_INVALID + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE = kms.VERSIONSTATE_KEY_MATERIAL_UNAVAILABLE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + VERSIONSTATE_DISABLED = kms.VERSIONSTATE_DISABLED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + VERSIONSTATE_DESTROYED = kms.VERSIONSTATE_DESTROYED - KEYRINGSTATE_CREATING = "creating" - KEYRINGSTATE_ACTIVE = "active" - KEYRINGSTATE_DELETED = "deleted" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + KEYRINGSTATE_CREATING = kms.KEYRINGSTATE_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + KEYRINGSTATE_ACTIVE = kms.KEYRINGSTATE_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + KEYRINGSTATE_DELETED = kms.KEYRINGSTATE_DELETED - WRAPPINGKEYSTATE_ACTIVE = "active" - WRAPPINGKEYSTATE_CREATING = "creating" - WRAPPINGKEYSTATE_EXPIRED = "expired" - WRAPPINGKEYSTATE_DELETED = "deleted" - WRAPPINGKEYSTATE_KEY_MATERIAL_UNAVAILABLE = "key_material_unavailable" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + WRAPPINGKEYSTATE_ACTIVE = kms.WRAPPINGKEYSTATE_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + WRAPPINGKEYSTATE_CREATING = kms.WRAPPINGKEYSTATE_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + WRAPPINGKEYSTATE_EXPIRED = kms.WRAPPINGKEYSTATE_EXPIRED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + WRAPPINGKEYSTATE_DELETED = kms.WRAPPINGKEYSTATE_DELETED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + WRAPPINGKEYSTATE_KEY_MATERIAL_UNAVAILABLE = kms.WRAPPINGKEYSTATE_KEY_MATERIAL_UNAVAILABLE - KEYSTATE_ACTIVE = "active" - KEYSTATE_DELETED = "deleted" - KEYSTATE_NOT_AVAILABLE = "not_available" - KEYSTATE_ERRORS_EXIST = "errors_exist" - KEYSTATE_CREATING = "creating" - KEYSTATE_NO_VERSION = "no_version" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + KEYSTATE_ACTIVE = kms.KEYSTATE_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + KEYSTATE_DELETED = kms.KEYSTATE_DELETED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + KEYSTATE_NOT_AVAILABLE = kms.KEYSTATE_NOT_AVAILABLE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + KEYSTATE_ERRORS_EXIST = kms.KEYSTATE_ERRORS_EXIST + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + KEYSTATE_CREATING = kms.KEYSTATE_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + KEYSTATE_NO_VERSION = kms.KEYSTATE_NO_VERSION ) func CreateKeyRingWaitHandler(ctx context.Context, client kms.DefaultAPI, projectId string, region kms.ListKeyRingsRegionIdParameter, keyRingId string) *wait.AsyncActionHandler[kms.KeyRing] { diff --git a/services/loadbalancer/v2api/wait/wait.go b/services/loadbalancer/v2api/wait/wait.go index 2abee6365..95c0d7fd9 100644 --- a/services/loadbalancer/v2api/wait/wait.go +++ b/services/loadbalancer/v2api/wait/wait.go @@ -13,11 +13,21 @@ import ( // Load balancer instance status const ( - LOADBALANCERSTATUS_UNSPECIFIED = "STATUS_UNSPECIFIED" - LOADBALANCERSTATUS_PENDING = "STATUS_PENDING" - LOADBALANCERSTATUS_READY = "STATUS_READY" - LOADBALANCERSTATUS_ERROR = "STATUS_ERROR" - LOADBALANCERSTATUS_TERMINATING = "STATUS_TERMINATING" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + LOADBALANCERSTATUS_UNSPECIFIED = loadbalancer.LOADBALANCERSTATUS_STATUS_UNSPECIFIED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + LOADBALANCERSTATUS_PENDING = loadbalancer.LOADBALANCERSTATUS_STATUS_PENDING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + LOADBALANCERSTATUS_READY = loadbalancer.LOADBALANCERSTATUS_STATUS_READY + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + LOADBALANCERSTATUS_ERROR = loadbalancer.LOADBALANCERSTATUS_STATUS_ERROR + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + LOADBALANCERSTATUS_TERMINATING = loadbalancer.LOADBALANCERSTATUS_STATUS_TERMINATING ) // CreateLoadBalancerWaitHandler will wait for load balancer creation diff --git a/services/logme/v1api/wait/wait.go b/services/logme/v1api/wait/wait.go index d3c56b46a..9740227bf 100644 --- a/services/logme/v1api/wait/wait.go +++ b/services/logme/v1api/wait/wait.go @@ -14,12 +14,24 @@ import ( ) const ( - INSTANCESTATUS_ACTIVE = "active" - INSTANCESTATUS_FAILED = "failed" - INSTANCESTATUS_STOPPED = "stopped" - INSTANCESTATUS_CREATING = "creating" - INSTANCESTATUS_DELETING = "deleting" - INSTANCESTATUS_UPDATING = "updating" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_ACTIVE = logme.INSTANCESTATUS_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_FAILED = logme.INSTANCESTATUS_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_STOPPED = logme.INSTANCESTATUS_STOPPED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_CREATING = logme.INSTANCESTATUS_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_DELETING = logme.INSTANCESTATUS_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_UPDATING = logme.INSTANCESTATUS_UPDATING ) // CreateInstanceWaitHandler will wait for instance creation diff --git a/services/mariadb/v1api/wait/wait.go b/services/mariadb/v1api/wait/wait.go index 0c94051e9..53015f0d2 100644 --- a/services/mariadb/v1api/wait/wait.go +++ b/services/mariadb/v1api/wait/wait.go @@ -14,12 +14,24 @@ import ( ) const ( - INSTANCESTATUS_ACTIVE = "active" - INSTANCESTATUS_FAILED = "failed" - INSTANCESTATUS_STOPPED = "stopped" - INSTANCESTATUS_CREATING = "creating" - INSTANCESTATUS_DELETING = "deleting" - INSTANCESTATUS_UPDATING = "updating" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_ACTIVE = mariadb.INSTANCESTATUS_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_FAILED = mariadb.INSTANCESTATUS_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_STOPPED = mariadb.INSTANCESTATUS_STOPPED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_CREATING = mariadb.INSTANCESTATUS_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_DELETING = mariadb.INSTANCESTATUS_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_UPDATING = mariadb.INSTANCESTATUS_UPDATING ) // CreateInstanceWaitHandler will wait for instance creation diff --git a/services/modelserving/v1api/wait/wait.go b/services/modelserving/v1api/wait/wait.go index 5d168580c..a54bf0baf 100644 --- a/services/modelserving/v1api/wait/wait.go +++ b/services/modelserving/v1api/wait/wait.go @@ -10,10 +10,18 @@ import ( ) const ( - TOKENSTATE_CREATING = "creating" - TOKENSTATE_ACTIVE = "active" - TOKENSTATE_DELETING = "deleting" - TOKENSTATE_INACTIVE = "inactive" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + TOKENSTATE_CREATING = modelserving.TOKENSTATE_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + TOKENSTATE_ACTIVE = modelserving.TOKENSTATE_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + TOKENSTATE_DELETING = modelserving.TOKENSTATE_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + TOKENSTATE_INACTIVE = modelserving.TOKENSTATE_INACTIVE ) func CreateModelServingWaitHandler(ctx context.Context, a modelserving.DefaultAPI, region, projectId, tokenId string) *wait.AsyncActionHandler[modelserving.GetTokenResponse] { diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index bf16be24f..0af354153 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -13,11 +13,21 @@ import ( ) const ( - INSTANCESTATUS_READY = "READY" - INSTANCESTATUS_PENDING = "PENDING" - INSTANCESTATUS_PROCESSING = "PROCESSING" - INSTANCESTATUS_FAILED = "FAILED" - INSTANCESTATUS_UNKNOWN = "UNKNOWN" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_READY = mongodbflex.INSTANCESTATUS_READY + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_PENDING = mongodbflex.INSTANCESTATUS_PENDING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_PROCESSING = mongodbflex.INSTANCESTATUS_PROCESSING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_FAILED = mongodbflex.INSTANCESTATUS_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_UNKNOWN = mongodbflex.INSTANCESTATUS_UNKNOWN RestoreJobProcessing = "IN_PROGRESS" RestoreJobFinished = "FINISHED" diff --git a/services/observability/v1api/wait/wait.go b/services/observability/v1api/wait/wait.go index 2885ad5c5..75f5d795b 100644 --- a/services/observability/v1api/wait/wait.go +++ b/services/observability/v1api/wait/wait.go @@ -10,15 +10,33 @@ import ( ) const ( - GETINSTANCERESPONSESTATUS_CREATING = "CREATING" - GETINSTANCERESPONSESTATUS_CREATE_SUCCEEDED = "CREATE_SUCCEEDED" - GETINSTANCERESPONSESTATUS_CREATE_FAILED = "CREATE_FAILED" - GETINSTANCERESPONSESTATUS_DELETING = "DELETING" - GETINSTANCERESPONSESTATUS_DELETE_SUCCEEDED = "DELETE_SUCCEEDED" - GETINSTANCERESPONSESTATUS_DELETE_FAILED = "DELETE_FAILED" - GETINSTANCERESPONSESTATUS_UPDATING = "UPDATING" - GETINSTANCERESPONSESTATUS_UPDATE_SUCCEEDED = "UPDATE_SUCCEEDED" - GETINSTANCERESPONSESTATUS_UPDATE_FAILED = "UPDATE_FAILED" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + GETINSTANCERESPONSESTATUS_CREATING = observability.STATUS_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + GETINSTANCERESPONSESTATUS_CREATE_SUCCEEDED = observability.STATUS_CREATE_SUCCEEDED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + GETINSTANCERESPONSESTATUS_CREATE_FAILED = observability.STATUS_CREATE_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + GETINSTANCERESPONSESTATUS_DELETING = observability.STATUS_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + GETINSTANCERESPONSESTATUS_DELETE_SUCCEEDED = observability.STATUS_DELETE_SUCCEEDED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + GETINSTANCERESPONSESTATUS_DELETE_FAILED = observability.STATUS_DELETE_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + GETINSTANCERESPONSESTATUS_UPDATING = observability.STATUS_UPDATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + GETINSTANCERESPONSESTATUS_UPDATE_SUCCEEDED = observability.STATUS_UPDATE_SUCCEEDED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + GETINSTANCERESPONSESTATUS_UPDATE_FAILED = observability.STATUS_UPDATE_FAILED ) // CreateInstanceWaitHandler will wait for instance creation diff --git a/services/opensearch/v1api/wait/wait.go b/services/opensearch/v1api/wait/wait.go index 793b276be..a443dd59a 100644 --- a/services/opensearch/v1api/wait/wait.go +++ b/services/opensearch/v1api/wait/wait.go @@ -13,16 +13,34 @@ import ( ) const ( - INSTANCESTATUS_ACTIVE = "active" - INSTANCESTATUS_FAILED = "failed" - INSTANCESTATUS_STOPPED = "stopped" - INSTANCESTATUS_CREATING = "creating" - INSTANCESTATUS_DELETING = "deleting" - INSTANCESTATUS_UPDATING = "updating" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_ACTIVE = opensearch.INSTANCESTATUS_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_FAILED = opensearch.INSTANCESTATUS_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_STOPPED = opensearch.INSTANCESTATUS_STOPPED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_CREATING = opensearch.INSTANCESTATUS_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_DELETING = opensearch.INSTANCESTATUS_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_UPDATING = opensearch.INSTANCESTATUS_UPDATING - INSTANCELASTOPERATIONTYPE_CREATE = "create" - INSTANCELASTOPERATIONTYPE_UPDATE = "update" - INSTANCELASTOPERATIONTYPE_DELETE = "delete" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCELASTOPERATIONTYPE_CREATE = opensearch.INSTANCELASTOPERATIONTYPE_CREATE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCELASTOPERATIONTYPE_UPDATE = opensearch.INSTANCELASTOPERATIONTYPE_UPDATE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCELASTOPERATIONTYPE_DELETE = opensearch.INSTANCELASTOPERATIONTYPE_DELETE ) // CreateInstanceWaitHandler will wait for instance creation diff --git a/services/rabbitmq/v1api/wait/wait.go b/services/rabbitmq/v1api/wait/wait.go index ddeebce92..4c08f4a0a 100644 --- a/services/rabbitmq/v1api/wait/wait.go +++ b/services/rabbitmq/v1api/wait/wait.go @@ -13,16 +13,34 @@ import ( ) const ( - INSTANCESTATUS_ACTIVE = "active" - INSTANCESTATUS_FAILED = "failed" - INSTANCESTATUS_STOPPED = "stopped" - INSTANCESTATUS_CREATING = "creating" - INSTANCESTATUS_DELETING = "deleting" - INSTANCESTATUS_UPDATING = "updating" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_ACTIVE = rabbitmq.INSTANCESTATUS_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_FAILED = rabbitmq.INSTANCESTATUS_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_STOPPED = rabbitmq.INSTANCESTATUS_STOPPED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_CREATING = rabbitmq.INSTANCESTATUS_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_DELETING = rabbitmq.INSTANCESTATUS_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_UPDATING = rabbitmq.INSTANCESTATUS_UPDATING - INSTANCELASTOPERATIONTYPE_CREATE = "create" - INSTANCELASTOPERATIONTYPE_UPDATE = "update" - INSTANCELASTOPERATIONTYPE_DELETE = "delete" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCELASTOPERATIONTYPE_CREATE = rabbitmq.INSTANCELASTOPERATIONTYPE_CREATE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCELASTOPERATIONTYPE_UPDATE = rabbitmq.INSTANCELASTOPERATIONTYPE_UPDATE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCELASTOPERATIONTYPE_DELETE = rabbitmq.INSTANCELASTOPERATIONTYPE_DELETE ) // CreateInstanceWaitHandler will wait for instance creation diff --git a/services/redis/v1api/wait/wait.go b/services/redis/v1api/wait/wait.go index 56825b4e9..9039e20f1 100644 --- a/services/redis/v1api/wait/wait.go +++ b/services/redis/v1api/wait/wait.go @@ -13,16 +13,34 @@ import ( ) const ( - INSTANCESTATUS_ACTIVE = "active" - INSTANCESTATUS_FAILED = "failed" - INSTANCESTATUS_STOPPED = "stopped" - INSTANCESTATUS_CREATING = "creating" - INSTANCESTATUS_DELETING = "deleting" - INSTANCESTATUS_UPDATING = "updating" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_ACTIVE = redis.INSTANCESTATUS_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_FAILED = redis.INSTANCESTATUS_FAILED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_STOPPED = redis.INSTANCESTATUS_STOPPED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_CREATING = redis.INSTANCESTATUS_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_DELETING = redis.INSTANCESTATUS_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATUS_UPDATING = redis.INSTANCESTATUS_UPDATING - INSTANCELASTOPERATIONTYPE_CREATE = "create" - INSTANCELASTOPERATIONTYPE_UPDATE = "update" - INSTANCELASTOPERATIONTYPE_DELETE = "delete" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCELASTOPERATIONTYPE_CREATE = redis.INSTANCELASTOPERATIONTYPE_CREATE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCELASTOPERATIONTYPE_UPDATE = redis.INSTANCELASTOPERATIONTYPE_UPDATE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCELASTOPERATIONTYPE_DELETE = redis.INSTANCELASTOPERATIONTYPE_DELETE ) // CreateInstanceWaitHandler will wait for instance creation diff --git a/services/redis/v1api/wait/wait_test.go b/services/redis/v1api/wait/wait_test.go index fbd9144f6..b9333a9a5 100644 --- a/services/redis/v1api/wait/wait_test.go +++ b/services/redis/v1api/wait/wait_test.go @@ -264,7 +264,7 @@ func TestDeleteInstanceWaitHandler(t *testing.T) { instanceGetFails: tt.getFails, instanceDeletionSucceedsWithErrors: tt.deleteSucceeedsWithErrors, instanceResourceId: instanceId, - instanceResourceOperation: INSTANCELASTOPERATIONTYPE_DELETE, + instanceResourceOperation: redis.INSTANCELASTOPERATIONTYPE_DELETE, instanceResourceDescription: tt.resourceDescription, instanceResourceState: tt.resourceState, }) diff --git a/services/serviceenablement/v2api/wait/wait.go b/services/serviceenablement/v2api/wait/wait.go index e691086bf..74ce5ae6c 100644 --- a/services/serviceenablement/v2api/wait/wait.go +++ b/services/serviceenablement/v2api/wait/wait.go @@ -10,10 +10,18 @@ import ( ) const ( - SERVICESTATUSSTATE_ENABLED = "ENABLED" - SERVICESTATUSSTATE_ENABLING = "ENABLING" - SERVICESTATUSSTATE_DISABLED = "DISABLED" - SERVICESTATUSSTATE_DISABLING = "DISABLING" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + SERVICESTATUSSTATE_ENABLED = serviceenablement.SERVICESTATUSSTATE_ENABLED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + SERVICESTATUSSTATE_ENABLING = serviceenablement.SERVICESTATUSSTATE_ENABLING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + SERVICESTATUSSTATE_DISABLED = serviceenablement.SERVICESTATUSSTATE_DISABLED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + SERVICESTATUSSTATE_DISABLING = serviceenablement.SERVICESTATUSSTATE_DISABLING ) func EnableServiceWaitHandler(ctx context.Context, a serviceenablement.DefaultAPI, region, projectId, serviceId string) *wait.AsyncActionHandler[serviceenablement.ServiceStatus] { diff --git a/services/ske/v2api/wait/wait.go b/services/ske/v2api/wait/wait.go index 2328528b5..fa46dc32b 100644 --- a/services/ske/v2api/wait/wait.go +++ b/services/ske/v2api/wait/wait.go @@ -10,13 +10,25 @@ import ( ) const ( - CREDENTIALSROTATIONSTATEPHASE_NEVER = "NEVER" - CREDENTIALSROTATIONSTATEPHASE_PREPARING = "PREPARING" - CREDENTIALSROTATIONSTATEPHASE_PREPARED = "PREPARED" - CREDENTIALSROTATIONSTATEPHASE_COMPLETING = "COMPLETING" - CREDENTIALSROTATIONSTATEPHASE_COMPLETED = "COMPLETED" - - RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND = "SKE_OBSERVABILITY_INSTANCE_NOT_FOUND" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + CREDENTIALSROTATIONSTATEPHASE_NEVER = ske.CREDENTIALSROTATIONSTATEPHASE_NEVER + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + CREDENTIALSROTATIONSTATEPHASE_PREPARING = ske.CREDENTIALSROTATIONSTATEPHASE_PREPARING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + CREDENTIALSROTATIONSTATEPHASE_PREPARED = ske.CREDENTIALSROTATIONSTATEPHASE_PREPARED + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + CREDENTIALSROTATIONSTATEPHASE_COMPLETING = ske.CREDENTIALSROTATIONSTATEPHASE_COMPLETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + CREDENTIALSROTATIONSTATEPHASE_COMPLETED = ske.CREDENTIALSROTATIONSTATEPHASE_COMPLETED + + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND = ske.RUNTIMEERRORCODE_SKE_OBSERVABILITY_INSTANCE_NOT_FOUND ) // CreateOrUpdateClusterWaitHandler will wait for cluster creation or update From 41666af15f7f2218e9e05e7f6235b925d1976618 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Fri, 22 May 2026 12:03:07 +0200 Subject: [PATCH 58/66] refac(git): introduce inline enums --- .../model_create_instance_payload.go | 14 +- .../model_create_instance_payload_flavor.go | 114 ++++++++++++++++ .../git/v1betaapi/model_feature_toggle.go | 13 +- ...ture_toggle_default_email_notifications.go | 118 +++++++++++++++++ services/git/v1betaapi/model_flavor.go | 13 +- .../v1betaapi/model_flavor_availability.go | 118 +++++++++++++++++ services/git/v1betaapi/model_instance.go | 15 +-- .../git/v1betaapi/model_instance_state.go | 122 ++++++++++++++++++ .../git/v1betaapi/model_patch_operation.go | 13 +- .../git/v1betaapi/model_patch_operation_op.go | 114 ++++++++++++++++ 10 files changed, 618 insertions(+), 36 deletions(-) create mode 100644 services/git/v1betaapi/model_create_instance_payload_flavor.go create mode 100644 services/git/v1betaapi/model_feature_toggle_default_email_notifications.go create mode 100644 services/git/v1betaapi/model_flavor_availability.go create mode 100644 services/git/v1betaapi/model_instance_state.go create mode 100644 services/git/v1betaapi/model_patch_operation_op.go diff --git a/services/git/v1betaapi/model_create_instance_payload.go b/services/git/v1betaapi/model_create_instance_payload.go index 11026403f..5270b6bd4 100644 --- a/services/git/v1betaapi/model_create_instance_payload.go +++ b/services/git/v1betaapi/model_create_instance_payload.go @@ -22,8 +22,8 @@ var _ MappedNullable = &CreateInstancePayload{} // CreateInstancePayload Request a STACKIT Git instance to be created with these properties. type CreateInstancePayload struct { // A list of CIDR network addresses that are allowed to access the instance. - Acl []string `json:"acl,omitempty"` - Flavor *string `json:"flavor,omitempty"` + Acl []string `json:"acl,omitempty"` + Flavor *CreateInstancePayloadFlavor `json:"flavor,omitempty"` // A user chosen name to distinguish multiple STACKIT Git instances. Name string `json:"name" validate:"regexp=^[a-z]([a-z0-9\\\\-]){0,30}[a-z0-9]+$"` AdditionalProperties map[string]interface{} @@ -82,9 +82,9 @@ func (o *CreateInstancePayload) SetAcl(v []string) { } // GetFlavor returns the Flavor field value if set, zero value otherwise. -func (o *CreateInstancePayload) GetFlavor() string { +func (o *CreateInstancePayload) GetFlavor() CreateInstancePayloadFlavor { if o == nil || IsNil(o.Flavor) { - var ret string + var ret CreateInstancePayloadFlavor return ret } return *o.Flavor @@ -92,7 +92,7 @@ func (o *CreateInstancePayload) GetFlavor() string { // GetFlavorOk returns a tuple with the Flavor field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetFlavorOk() (*string, bool) { +func (o *CreateInstancePayload) GetFlavorOk() (*CreateInstancePayloadFlavor, bool) { if o == nil || IsNil(o.Flavor) { return nil, false } @@ -108,8 +108,8 @@ func (o *CreateInstancePayload) HasFlavor() bool { return false } -// SetFlavor gets a reference to the given string and assigns it to the Flavor field. -func (o *CreateInstancePayload) SetFlavor(v string) { +// SetFlavor gets a reference to the given CreateInstancePayloadFlavor and assigns it to the Flavor field. +func (o *CreateInstancePayload) SetFlavor(v CreateInstancePayloadFlavor) { o.Flavor = &v } diff --git a/services/git/v1betaapi/model_create_instance_payload_flavor.go b/services/git/v1betaapi/model_create_instance_payload_flavor.go new file mode 100644 index 000000000..957601a9a --- /dev/null +++ b/services/git/v1betaapi/model_create_instance_payload_flavor.go @@ -0,0 +1,114 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// CreateInstancePayloadFlavor the model 'CreateInstancePayloadFlavor' +type CreateInstancePayloadFlavor string + +// List of CreateInstancePayload_flavor +const ( + CREATEINSTANCEPAYLOADFLAVOR_GIT_10 CreateInstancePayloadFlavor = "git-10" + CREATEINSTANCEPAYLOADFLAVOR_GIT_100 CreateInstancePayloadFlavor = "git-100" + CREATEINSTANCEPAYLOADFLAVOR_UNKNOWN_DEFAULT_OPEN_API CreateInstancePayloadFlavor = "unknown_default_open_api" +) + +// All allowed values of CreateInstancePayloadFlavor enum +var AllowedCreateInstancePayloadFlavorEnumValues = []CreateInstancePayloadFlavor{ + "git-10", + "git-100", + "unknown_default_open_api", +} + +func (v *CreateInstancePayloadFlavor) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateInstancePayloadFlavor(value) + for _, existing := range AllowedCreateInstancePayloadFlavorEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEINSTANCEPAYLOADFLAVOR_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateInstancePayloadFlavorFromValue returns a pointer to a valid CreateInstancePayloadFlavor +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateInstancePayloadFlavorFromValue(v string) (*CreateInstancePayloadFlavor, error) { + ev := CreateInstancePayloadFlavor(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateInstancePayloadFlavor: valid values are %v", v, AllowedCreateInstancePayloadFlavorEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateInstancePayloadFlavor) IsValid() bool { + for _, existing := range AllowedCreateInstancePayloadFlavorEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateInstancePayload_flavor value +func (v CreateInstancePayloadFlavor) Ptr() *CreateInstancePayloadFlavor { + return &v +} + +type NullableCreateInstancePayloadFlavor struct { + value *CreateInstancePayloadFlavor + isSet bool +} + +func (v NullableCreateInstancePayloadFlavor) Get() *CreateInstancePayloadFlavor { + return v.value +} + +func (v *NullableCreateInstancePayloadFlavor) Set(val *CreateInstancePayloadFlavor) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayloadFlavor) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayloadFlavor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayloadFlavor(val *CreateInstancePayloadFlavor) *NullableCreateInstancePayloadFlavor { + return &NullableCreateInstancePayloadFlavor{value: val, isSet: true} +} + +func (v NullableCreateInstancePayloadFlavor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayloadFlavor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_feature_toggle.go b/services/git/v1betaapi/model_feature_toggle.go index c233e5617..f1a63dbaa 100644 --- a/services/git/v1betaapi/model_feature_toggle.go +++ b/services/git/v1betaapi/model_feature_toggle.go @@ -20,8 +20,7 @@ var _ MappedNullable = &FeatureToggle{} // FeatureToggle Feature toggles for the instance. type FeatureToggle struct { - // Default email notifications. - DefaultEmailNotifications NullableString `json:"default_email_notifications,omitempty"` + DefaultEmailNotifications NullableFeatureToggleDefaultEmailNotifications `json:"default_email_notifications,omitempty"` // Enable commit signatures. EnableCommitSignatures NullableBool `json:"enable_commit_signatures,omitempty"` // Enable local login. @@ -49,9 +48,9 @@ func NewFeatureToggleWithDefaults() *FeatureToggle { } // GetDefaultEmailNotifications returns the DefaultEmailNotifications field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *FeatureToggle) GetDefaultEmailNotifications() string { +func (o *FeatureToggle) GetDefaultEmailNotifications() FeatureToggleDefaultEmailNotifications { if o == nil || IsNil(o.DefaultEmailNotifications.Get()) { - var ret string + var ret FeatureToggleDefaultEmailNotifications return ret } return *o.DefaultEmailNotifications.Get() @@ -60,7 +59,7 @@ func (o *FeatureToggle) GetDefaultEmailNotifications() string { // GetDefaultEmailNotificationsOk returns a tuple with the DefaultEmailNotifications field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *FeatureToggle) GetDefaultEmailNotificationsOk() (*string, bool) { +func (o *FeatureToggle) GetDefaultEmailNotificationsOk() (*FeatureToggleDefaultEmailNotifications, bool) { if o == nil { return nil, false } @@ -76,8 +75,8 @@ func (o *FeatureToggle) HasDefaultEmailNotifications() bool { return false } -// SetDefaultEmailNotifications gets a reference to the given NullableString and assigns it to the DefaultEmailNotifications field. -func (o *FeatureToggle) SetDefaultEmailNotifications(v string) { +// SetDefaultEmailNotifications gets a reference to the given NullableFeatureToggleDefaultEmailNotifications and assigns it to the DefaultEmailNotifications field. +func (o *FeatureToggle) SetDefaultEmailNotifications(v FeatureToggleDefaultEmailNotifications) { o.DefaultEmailNotifications.Set(&v) } diff --git a/services/git/v1betaapi/model_feature_toggle_default_email_notifications.go b/services/git/v1betaapi/model_feature_toggle_default_email_notifications.go new file mode 100644 index 000000000..e29a09250 --- /dev/null +++ b/services/git/v1betaapi/model_feature_toggle_default_email_notifications.go @@ -0,0 +1,118 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// FeatureToggleDefaultEmailNotifications Default email notifications. +type FeatureToggleDefaultEmailNotifications string + +// List of FeatureToggle_default_email_notifications +const ( + FEATURETOGGLEDEFAULTEMAILNOTIFICATIONS_ENABLED FeatureToggleDefaultEmailNotifications = "enabled" + FEATURETOGGLEDEFAULTEMAILNOTIFICATIONS_DISABLED FeatureToggleDefaultEmailNotifications = "disabled" + FEATURETOGGLEDEFAULTEMAILNOTIFICATIONS_ONMENTION FeatureToggleDefaultEmailNotifications = "onmention" + FEATURETOGGLEDEFAULTEMAILNOTIFICATIONS_ANDYOUROWN FeatureToggleDefaultEmailNotifications = "andyourown" + FEATURETOGGLEDEFAULTEMAILNOTIFICATIONS_UNKNOWN_DEFAULT_OPEN_API FeatureToggleDefaultEmailNotifications = "unknown_default_open_api" +) + +// All allowed values of FeatureToggleDefaultEmailNotifications enum +var AllowedFeatureToggleDefaultEmailNotificationsEnumValues = []FeatureToggleDefaultEmailNotifications{ + "enabled", + "disabled", + "onmention", + "andyourown", + "unknown_default_open_api", +} + +func (v *FeatureToggleDefaultEmailNotifications) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FeatureToggleDefaultEmailNotifications(value) + for _, existing := range AllowedFeatureToggleDefaultEmailNotificationsEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = FEATURETOGGLEDEFAULTEMAILNOTIFICATIONS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewFeatureToggleDefaultEmailNotificationsFromValue returns a pointer to a valid FeatureToggleDefaultEmailNotifications +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFeatureToggleDefaultEmailNotificationsFromValue(v string) (*FeatureToggleDefaultEmailNotifications, error) { + ev := FeatureToggleDefaultEmailNotifications(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FeatureToggleDefaultEmailNotifications: valid values are %v", v, AllowedFeatureToggleDefaultEmailNotificationsEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FeatureToggleDefaultEmailNotifications) IsValid() bool { + for _, existing := range AllowedFeatureToggleDefaultEmailNotificationsEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FeatureToggle_default_email_notifications value +func (v FeatureToggleDefaultEmailNotifications) Ptr() *FeatureToggleDefaultEmailNotifications { + return &v +} + +type NullableFeatureToggleDefaultEmailNotifications struct { + value *FeatureToggleDefaultEmailNotifications + isSet bool +} + +func (v NullableFeatureToggleDefaultEmailNotifications) Get() *FeatureToggleDefaultEmailNotifications { + return v.value +} + +func (v *NullableFeatureToggleDefaultEmailNotifications) Set(val *FeatureToggleDefaultEmailNotifications) { + v.value = val + v.isSet = true +} + +func (v NullableFeatureToggleDefaultEmailNotifications) IsSet() bool { + return v.isSet +} + +func (v *NullableFeatureToggleDefaultEmailNotifications) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFeatureToggleDefaultEmailNotifications(val *FeatureToggleDefaultEmailNotifications) *NullableFeatureToggleDefaultEmailNotifications { + return &NullableFeatureToggleDefaultEmailNotifications{value: val, isSet: true} +} + +func (v NullableFeatureToggleDefaultEmailNotifications) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFeatureToggleDefaultEmailNotifications) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_flavor.go b/services/git/v1betaapi/model_flavor.go index 09f5628c1..6a6429f02 100644 --- a/services/git/v1betaapi/model_flavor.go +++ b/services/git/v1betaapi/model_flavor.go @@ -21,8 +21,7 @@ var _ MappedNullable = &Flavor{} // Flavor Describes a STACKIT Git Flavor. type Flavor struct { - // Defines the flavor availability. - Availability string `json:"availability"` + Availability FlavorAvailability `json:"availability"` // Flavor description. Description string `json:"description"` // The display name that will be shown in the Portal. @@ -40,7 +39,7 @@ type _Flavor Flavor // 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 NewFlavor(availability string, description string, displayName string, id string, sku string) *Flavor { +func NewFlavor(availability FlavorAvailability, description string, displayName string, id string, sku string) *Flavor { this := Flavor{} this.Availability = availability this.Description = description @@ -59,9 +58,9 @@ func NewFlavorWithDefaults() *Flavor { } // GetAvailability returns the Availability field value -func (o *Flavor) GetAvailability() string { +func (o *Flavor) GetAvailability() FlavorAvailability { if o == nil { - var ret string + var ret FlavorAvailability return ret } @@ -70,7 +69,7 @@ func (o *Flavor) GetAvailability() string { // GetAvailabilityOk returns a tuple with the Availability field value // and a boolean to check if the value has been set. -func (o *Flavor) GetAvailabilityOk() (*string, bool) { +func (o *Flavor) GetAvailabilityOk() (*FlavorAvailability, bool) { if o == nil { return nil, false } @@ -78,7 +77,7 @@ func (o *Flavor) GetAvailabilityOk() (*string, bool) { } // SetAvailability sets field value -func (o *Flavor) SetAvailability(v string) { +func (o *Flavor) SetAvailability(v FlavorAvailability) { o.Availability = v } diff --git a/services/git/v1betaapi/model_flavor_availability.go b/services/git/v1betaapi/model_flavor_availability.go new file mode 100644 index 000000000..ec0b62772 --- /dev/null +++ b/services/git/v1betaapi/model_flavor_availability.go @@ -0,0 +1,118 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// FlavorAvailability Defines the flavor availability. +type FlavorAvailability string + +// List of Flavor_availability +const ( + FLAVORAVAILABILITY_AVAILABLE FlavorAvailability = "available" + FLAVORAVAILABILITY_UNAVAILABLE FlavorAvailability = "unavailable" + FLAVORAVAILABILITY_INTERNAL FlavorAvailability = "internal" + FLAVORAVAILABILITY_DEPRECATED FlavorAvailability = "deprecated" + FLAVORAVAILABILITY_UNKNOWN_DEFAULT_OPEN_API FlavorAvailability = "unknown_default_open_api" +) + +// All allowed values of FlavorAvailability enum +var AllowedFlavorAvailabilityEnumValues = []FlavorAvailability{ + "available", + "unavailable", + "internal", + "deprecated", + "unknown_default_open_api", +} + +func (v *FlavorAvailability) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FlavorAvailability(value) + for _, existing := range AllowedFlavorAvailabilityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = FLAVORAVAILABILITY_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewFlavorAvailabilityFromValue returns a pointer to a valid FlavorAvailability +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFlavorAvailabilityFromValue(v string) (*FlavorAvailability, error) { + ev := FlavorAvailability(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FlavorAvailability: valid values are %v", v, AllowedFlavorAvailabilityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FlavorAvailability) IsValid() bool { + for _, existing := range AllowedFlavorAvailabilityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Flavor_availability value +func (v FlavorAvailability) Ptr() *FlavorAvailability { + return &v +} + +type NullableFlavorAvailability struct { + value *FlavorAvailability + isSet bool +} + +func (v NullableFlavorAvailability) Get() *FlavorAvailability { + return v.value +} + +func (v *NullableFlavorAvailability) Set(val *FlavorAvailability) { + v.value = val + v.isSet = true +} + +func (v NullableFlavorAvailability) IsSet() bool { + return v.isSet +} + +func (v *NullableFlavorAvailability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlavorAvailability(val *FlavorAvailability) *NullableFlavorAvailability { + return &NullableFlavorAvailability{value: val, isSet: true} +} + +func (v NullableFlavorAvailability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlavorAvailability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_instance.go b/services/git/v1betaapi/model_instance.go index e19fa9a0e..c58adccc1 100644 --- a/services/git/v1betaapi/model_instance.go +++ b/services/git/v1betaapi/model_instance.go @@ -36,9 +36,8 @@ type Instance struct { // A auto generated unique id which identifies the STACKIT Git instances. Id string `json:"id"` // A user chosen name to distinguish multiple STACKIT Git instances. - Name string `json:"name"` - // The current state of the STACKIT Git instance. - State string `json:"state"` + Name string `json:"name"` + State InstanceState `json:"state"` // The URL for reaching the STACKIT Git instance. Url string `json:"url"` // The current version of STACKIT Git deployed to the instance. @@ -52,7 +51,7 @@ type _Instance Instance // 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 NewInstance(acl []string, consumedDisk string, consumedObjectStorage string, created time.Time, featureToggle FeatureToggle, flavor string, id string, name string, state string, url string, version string) *Instance { +func NewInstance(acl []string, consumedDisk string, consumedObjectStorage string, created time.Time, featureToggle FeatureToggle, flavor string, id string, name string, state InstanceState, url string, version string) *Instance { this := Instance{} this.Acl = acl this.ConsumedDisk = consumedDisk @@ -269,9 +268,9 @@ func (o *Instance) SetName(v string) { } // GetState returns the State field value -func (o *Instance) GetState() string { +func (o *Instance) GetState() InstanceState { if o == nil { - var ret string + var ret InstanceState return ret } @@ -280,7 +279,7 @@ func (o *Instance) GetState() string { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *Instance) GetStateOk() (*string, bool) { +func (o *Instance) GetStateOk() (*InstanceState, bool) { if o == nil { return nil, false } @@ -288,7 +287,7 @@ func (o *Instance) GetStateOk() (*string, bool) { } // SetState sets field value -func (o *Instance) SetState(v string) { +func (o *Instance) SetState(v InstanceState) { o.State = v } diff --git a/services/git/v1betaapi/model_instance_state.go b/services/git/v1betaapi/model_instance_state.go new file mode 100644 index 000000000..d65f4d082 --- /dev/null +++ b/services/git/v1betaapi/model_instance_state.go @@ -0,0 +1,122 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// InstanceState The current state of the STACKIT Git instance. +type InstanceState string + +// List of Instance_state +const ( + INSTANCESTATE_CREATING InstanceState = "Creating" + INSTANCESTATE_WAITING_FOR_RESOURCES InstanceState = "WaitingForResources" + INSTANCESTATE_UPDATING InstanceState = "Updating" + INSTANCESTATE_DELETING InstanceState = "Deleting" + INSTANCESTATE_READY InstanceState = "Ready" + INSTANCESTATE_ERROR InstanceState = "Error" + INSTANCESTATE_UNKNOWN_DEFAULT_OPEN_API InstanceState = "unknown_default_open_api" +) + +// All allowed values of InstanceState enum +var AllowedInstanceStateEnumValues = []InstanceState{ + "Creating", + "WaitingForResources", + "Updating", + "Deleting", + "Ready", + "Error", + "unknown_default_open_api", +} + +func (v *InstanceState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceState(value) + for _, existing := range AllowedInstanceStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceStateFromValue returns a pointer to a valid InstanceState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceStateFromValue(v string) (*InstanceState, error) { + ev := InstanceState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceState: valid values are %v", v, AllowedInstanceStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceState) IsValid() bool { + for _, existing := range AllowedInstanceStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Instance_state value +func (v InstanceState) Ptr() *InstanceState { + return &v +} + +type NullableInstanceState struct { + value *InstanceState + isSet bool +} + +func (v NullableInstanceState) Get() *InstanceState { + return v.value +} + +func (v *NullableInstanceState) Set(val *InstanceState) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceState) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceState(val *InstanceState) *NullableInstanceState { + return &NullableInstanceState{value: val, isSet: true} +} + +func (v NullableInstanceState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_patch_operation.go b/services/git/v1betaapi/model_patch_operation.go index 2803a699a..4e0704417 100644 --- a/services/git/v1betaapi/model_patch_operation.go +++ b/services/git/v1betaapi/model_patch_operation.go @@ -21,8 +21,7 @@ var _ MappedNullable = &PatchOperation{} // PatchOperation Request a STACKIT Git instance to be patch with these properties. type PatchOperation struct { - // The patch operation to perform. - Op string `json:"op"` + Op PatchOperationOp `json:"op"` // An RFC6901 JSON Pointer to the target location. Path string `json:"path"` // The value to be used for 'add' and 'remove' operations. @@ -36,7 +35,7 @@ type _PatchOperation PatchOperation // 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 NewPatchOperation(op string, path string) *PatchOperation { +func NewPatchOperation(op PatchOperationOp, path string) *PatchOperation { this := PatchOperation{} this.Op = op this.Path = path @@ -52,9 +51,9 @@ func NewPatchOperationWithDefaults() *PatchOperation { } // GetOp returns the Op field value -func (o *PatchOperation) GetOp() string { +func (o *PatchOperation) GetOp() PatchOperationOp { if o == nil { - var ret string + var ret PatchOperationOp return ret } @@ -63,7 +62,7 @@ func (o *PatchOperation) GetOp() string { // GetOpOk returns a tuple with the Op field value // and a boolean to check if the value has been set. -func (o *PatchOperation) GetOpOk() (*string, bool) { +func (o *PatchOperation) GetOpOk() (*PatchOperationOp, bool) { if o == nil { return nil, false } @@ -71,7 +70,7 @@ func (o *PatchOperation) GetOpOk() (*string, bool) { } // SetOp sets field value -func (o *PatchOperation) SetOp(v string) { +func (o *PatchOperation) SetOp(v PatchOperationOp) { o.Op = v } diff --git a/services/git/v1betaapi/model_patch_operation_op.go b/services/git/v1betaapi/model_patch_operation_op.go new file mode 100644 index 000000000..d3f230b70 --- /dev/null +++ b/services/git/v1betaapi/model_patch_operation_op.go @@ -0,0 +1,114 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// PatchOperationOp The patch operation to perform. +type PatchOperationOp string + +// List of PatchOperation_op +const ( + PATCHOPERATIONOP_ADD PatchOperationOp = "add" + PATCHOPERATIONOP_REMOVE PatchOperationOp = "remove" + PATCHOPERATIONOP_UNKNOWN_DEFAULT_OPEN_API PatchOperationOp = "unknown_default_open_api" +) + +// All allowed values of PatchOperationOp enum +var AllowedPatchOperationOpEnumValues = []PatchOperationOp{ + "add", + "remove", + "unknown_default_open_api", +} + +func (v *PatchOperationOp) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PatchOperationOp(value) + for _, existing := range AllowedPatchOperationOpEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PATCHOPERATIONOP_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPatchOperationOpFromValue returns a pointer to a valid PatchOperationOp +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPatchOperationOpFromValue(v string) (*PatchOperationOp, error) { + ev := PatchOperationOp(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PatchOperationOp: valid values are %v", v, AllowedPatchOperationOpEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PatchOperationOp) IsValid() bool { + for _, existing := range AllowedPatchOperationOpEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PatchOperation_op value +func (v PatchOperationOp) Ptr() *PatchOperationOp { + return &v +} + +type NullablePatchOperationOp struct { + value *PatchOperationOp + isSet bool +} + +func (v NullablePatchOperationOp) Get() *PatchOperationOp { + return v.value +} + +func (v *NullablePatchOperationOp) Set(val *PatchOperationOp) { + v.value = val + v.isSet = true +} + +func (v NullablePatchOperationOp) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchOperationOp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchOperationOp(val *PatchOperationOp) *NullablePatchOperationOp { + return &NullablePatchOperationOp{value: val, isSet: true} +} + +func (v NullablePatchOperationOp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchOperationOp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From c2c88088619819d1343f22a3bb36d4376002bd0e Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Fri, 22 May 2026 12:12:00 +0200 Subject: [PATCH 59/66] chore(git): fix waiters/tests, write changelog, bump version --- CHANGELOG.md | 2 ++ services/git/CHANGELOG.md | 3 ++ services/git/VERSION | 2 +- services/git/v1betaapi/wait/wait.go | 40 +++++++++++++++--------- services/git/v1betaapi/wait/wait_test.go | 11 ++++--- 5 files changed, 38 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62916e355..fac1ce5b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -146,6 +146,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` - [v0.13.0](services/git/CHANGELOG.md#v0130) - `v1betaapi`: **Improvement**: Use new `WaiterHandler` struct in the Git WaitHandler + - [v0.14.0](services/git/CHANGELOG.md#v0140) + - **Feature:** Introduce enums for various attributes - `iaas`: - [v1.9.1](services/iaas/CHANGELOG.md#v191) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/git/CHANGELOG.md b/services/git/CHANGELOG.md index d9b121c0b..7e621be80 100644 --- a/services/git/CHANGELOG.md +++ b/services/git/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.14.0 +- **Feature:** Introduce enums for various attributes + ## v0.13.0 - `v1betaapi`: **Improvement**: Use new `WaiterHandler` struct in the Git WaitHandler diff --git a/services/git/VERSION b/services/git/VERSION index 6ddc06173..045d7384f 100644 --- a/services/git/VERSION +++ b/services/git/VERSION @@ -1 +1 @@ -v0.13.0 \ No newline at end of file +v0.14.0 \ No newline at end of file diff --git a/services/git/v1betaapi/wait/wait.go b/services/git/v1betaapi/wait/wait.go index 3e91f854a..6f8a45178 100644 --- a/services/git/v1betaapi/wait/wait.go +++ b/services/git/v1betaapi/wait/wait.go @@ -11,25 +11,37 @@ import ( ) const ( - INSTANCESTATE_CREATING = "Creating" - INSTANCESTATE_WAITING_FOR_RESOURCES = "WaitingForResources" - INSTANCESTATE_UPDATING = "Updating" - INSTANCESTATE_DELETING = "Deleting" - INSTANCESTATE_READY = "Ready" - INSTANCESTATE_ERROR = "Error" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATE_CREATING = git.INSTANCESTATE_CREATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATE_WAITING_FOR_RESOURCES = git.INSTANCESTATE_WAITING_FOR_RESOURCES + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATE_UPDATING = git.INSTANCESTATE_UPDATING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATE_DELETING = git.INSTANCESTATE_DELETING + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATE_READY = git.INSTANCESTATE_READY + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + INSTANCESTATE_ERROR = git.INSTANCESTATE_ERROR ) func CreateGitInstanceWaitHandler(ctx context.Context, client git.DefaultAPI, projectId, instanceId string) *wait.AsyncActionHandler[git.Instance] { - waitConfig := wait.WaiterHelper[git.Instance, string]{ + waitConfig := wait.WaiterHelper[git.Instance, git.InstanceState]{ FetchInstance: client.GetInstance(ctx, projectId, instanceId).Execute, - GetState: func(instance *git.Instance) (string, error) { + GetState: func(instance *git.Instance) (git.InstanceState, error) { if instance == nil { return "", errors.New("empty response") } return instance.State, nil }, - ActiveState: []string{INSTANCESTATE_READY}, - ErrorState: []string{INSTANCESTATE_ERROR}, + ActiveState: []git.InstanceState{git.INSTANCESTATE_READY}, + ErrorState: []git.InstanceState{git.INSTANCESTATE_ERROR}, } handler := wait.New(waitConfig.Wait()) handler.SetTimeout(10 * time.Minute) @@ -37,16 +49,16 @@ func CreateGitInstanceWaitHandler(ctx context.Context, client git.DefaultAPI, pr } func DeleteGitInstanceWaitHandler(ctx context.Context, client git.DefaultAPI, projectId, instanceId string) *wait.AsyncActionHandler[git.Instance] { - waitConfig := wait.WaiterHelper[git.Instance, string]{ + waitConfig := wait.WaiterHelper[git.Instance, git.InstanceState]{ FetchInstance: client.GetInstance(ctx, projectId, instanceId).Execute, - GetState: func(instance *git.Instance) (string, error) { + GetState: func(instance *git.Instance) (git.InstanceState, error) { if instance == nil { return "", errors.New("empty response") } return instance.State, nil }, - ActiveState: []string{}, - ErrorState: []string{INSTANCESTATE_ERROR}, + ActiveState: []git.InstanceState{}, + ErrorState: []git.InstanceState{git.INSTANCESTATE_ERROR}, DeleteHttpErrorStatusCodes: []int{http.StatusNotFound}, } handler := wait.New(waitConfig.Wait()) diff --git a/services/git/v1betaapi/wait/wait_test.go b/services/git/v1betaapi/wait/wait_test.go index ddfe4ae4d..2568aee2b 100644 --- a/services/git/v1betaapi/wait/wait_test.go +++ b/services/git/v1betaapi/wait/wait_test.go @@ -8,6 +8,7 @@ import ( "time" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/google/uuid" "github.com/stackitcloud/stackit-sdk-go/core/oapierror" @@ -68,7 +69,7 @@ func TestCreateGitInstanceWaitHandler(t *testing.T) { Created: time.Now(), Id: INSTANCE_ID, Name: "instance-test", - State: INSTANCESTATE_READY, + State: git.INSTANCESTATE_READY, Url: "https://testing.git.onstackit.cloud", Version: "v1.6.0", }, @@ -85,7 +86,7 @@ func TestCreateGitInstanceWaitHandler(t *testing.T) { Created: time.Now(), Id: INSTANCE_ID, Name: "instance-test", - State: INSTANCESTATE_READY, + State: git.INSTANCESTATE_READY, Url: "https://testing.git.onstackit.cloud", Version: "v1.6.0", }, @@ -102,7 +103,7 @@ func TestCreateGitInstanceWaitHandler(t *testing.T) { Created: time.Now(), Id: INSTANCE_ID, Name: "instance-test", - State: INSTANCESTATE_ERROR, + State: git.INSTANCESTATE_ERROR, Url: "https://testing.git.onstackit.cloud", Version: "v1.6.0", }, @@ -175,7 +176,7 @@ func TestCreateGitInstanceWaitHandler(t *testing.T) { t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) } - if !cmp.Equal(response, instanceWanted, cmp.AllowUnexported(git.NullableString{}, git.NullableBool{})) { + if !cmp.Equal(response, instanceWanted, cmp.AllowUnexported(git.NullableString{}, git.NullableBool{}), cmpopts.EquateComparable(git.NullableFeatureToggleDefaultEmailNotifications{})) { t.Fatalf("handler gotRes = %v, want %v", response, instanceWanted) } }) @@ -208,7 +209,7 @@ func TestDeleteGitInstanceWaitHandler(t *testing.T) { Created: time.Now(), Id: INSTANCE_ID, Name: "instance-test", - State: INSTANCESTATE_READY, + State: git.INSTANCESTATE_READY, Url: "https://testing.git.onstackit.cloud", Version: "v1.6.0", }, From 66a0dd146f7c3f43c31897c6eb4e79f6ecda83e5 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Fri, 22 May 2026 12:22:31 +0200 Subject: [PATCH 60/66] fix(ske): revert API changes due to faulty version lock --- services/ske/v1api/model_cluster_error.go | 2 +- services/ske/v2api/model_cluster_error.go | 2 +- services/ske/v2api/model_dns.go | 40 +---------------------- 3 files changed, 3 insertions(+), 41 deletions(-) diff --git a/services/ske/v1api/model_cluster_error.go b/services/ske/v1api/model_cluster_error.go index cd1796d6b..b1a1abf90 100644 --- a/services/ske/v1api/model_cluster_error.go +++ b/services/ske/v1api/model_cluster_error.go @@ -19,7 +19,7 @@ var _ MappedNullable = &ClusterError{} // ClusterError struct for ClusterError type ClusterError struct { - // Possible values: `\"SKE_INFRA_SNA_NETWORK_NOT_FOUND\"`, `\"SKE_INFRA_SNA_NETWORK_NO_ROUTER\"`, `\"SKE_NODE_NO_VALID_HOST_FOUND\"`, `\"SKE_NODE_MISCONFIGURED_PDB\"`, `\"SKE_NODE_MACHINE_TYPE_NOT_FOUND\"`, `\"SKE_NETWORK_NO_DNS_CONFIGURED\"`, `\"SKE_NETWORK_NO_AVAILABLE_IPS\"`, `\"SKE_NODE_MEMORY_PRESSURE\"`, `\"SKE_NODE_DISK_PRESSURE\"`, `\"SKE_NODE_PID_PRESSURE\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_READY\"`, `\"SKE_DNS_ZONE_NOT_FOUND\"`, `\"SKE_SNA_DOES_NOT_SUPPORT_SERVICE_ROUTES\"`, `\"SKE_FETCHING_ERRORS_NOT_POSSIBLE\"` + // Possible values: `\"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND\"`, `\"SKE_DNS_ZONE_NOT_FOUND\"`, `\"SKE_NODE_NO_VALID_HOST_FOUND\"`, `\"SKE_NODE_MISCONFIGURED_PDB\"`, `\"SKE_NODE_MACHINE_TYPE_NOT_FOUND\"`, `\"SKE_INFRA_SNA_NETWORK_NOT_FOUND\"`, `\"SKE_FETCHING_ERRORS_NOT_POSSIBLE\"` Code *string `json:"code,omitempty"` Message *string `json:"message,omitempty"` AdditionalProperties map[string]interface{} diff --git a/services/ske/v2api/model_cluster_error.go b/services/ske/v2api/model_cluster_error.go index bd58c34f3..3ffd1b1e6 100644 --- a/services/ske/v2api/model_cluster_error.go +++ b/services/ske/v2api/model_cluster_error.go @@ -19,7 +19,7 @@ var _ MappedNullable = &ClusterError{} // ClusterError struct for ClusterError type ClusterError struct { - // Possible values: `\"SKE_INFRA_SNA_NETWORK_NOT_FOUND\"`, `\"SKE_INFRA_SNA_NETWORK_NO_ROUTER\"`, `\"SKE_NODE_NO_VALID_HOST_FOUND\"`, `\"SKE_NODE_MISCONFIGURED_PDB\"`, `\"SKE_NODE_MACHINE_TYPE_NOT_FOUND\"`, `\"SKE_NETWORK_NO_DNS_CONFIGURED\"`, `\"SKE_NETWORK_NO_AVAILABLE_IPS\"`, `\"SKE_NODE_MEMORY_PRESSURE\"`, `\"SKE_NODE_DISK_PRESSURE\"`, `\"SKE_NODE_PID_PRESSURE\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_READY\"`, `\"SKE_DNS_ZONE_NOT_FOUND\"`, `\"SKE_SNA_DOES_NOT_SUPPORT_SERVICE_ROUTES\"`, `\"SKE_FETCHING_ERRORS_NOT_POSSIBLE\"` + // Possible values: `\"SKE_INFRA_SNA_NETWORK_NOT_FOUND\"`, `\"SKE_INFRA_SNA_NETWORK_NO_ROUTER\"`, `\"SKE_NODE_NO_VALID_HOST_FOUND\"`, `\"SKE_NODE_MISCONFIGURED_PDB\"`, `\"SKE_NODE_MACHINE_TYPE_NOT_FOUND\"`, `\"SKE_NETWORK_NO_DNS_CONFIGURED\"`, `\"SKE_NETWORK_NO_AVAILABLE_IPS\"`, `\"SKE_NODE_MEMORY_PRESSURE\"`, `\"SKE_NODE_DISK_PRESSURE\"`, `\"SKE_NODE_PID_PRESSURE\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND\"`, `\"SKE_OBSERVABILITY_INSTANCE_NOT_READY\"`, `\"SKE_DNS_ZONE_NOT_FOUND\"`, `\"SKE_FETCHING_ERRORS_NOT_POSSIBLE\"` Code *string `json:"code,omitempty"` Message *string `json:"message,omitempty"` AdditionalProperties map[string]interface{} diff --git a/services/ske/v2api/model_dns.go b/services/ske/v2api/model_dns.go index 472ee5315..cc4030123 100644 --- a/services/ske/v2api/model_dns.go +++ b/services/ske/v2api/model_dns.go @@ -22,9 +22,7 @@ var _ MappedNullable = &DNS{} type DNS struct { // Enables the dns extension. Enabled bool `json:"enabled"` - // Enables Gateway API support for ExternalDNS. The CRDs must be installed by the user. Once installed, ExternalDNS will be configured at the next cluster reconcile. - GatewayApi *bool `json:"gatewayApi,omitempty"` - // Array of domain filters for ExternalDNS, e.g., *.runs.onstackit.cloud. + // Array of domain filters for externalDNS, e.g., *.runs.onstackit.cloud. Zones []string `json:"zones,omitempty"` AdditionalProperties map[string]interface{} } @@ -73,38 +71,6 @@ func (o *DNS) SetEnabled(v bool) { o.Enabled = v } -// GetGatewayApi returns the GatewayApi field value if set, zero value otherwise. -func (o *DNS) GetGatewayApi() bool { - if o == nil || IsNil(o.GatewayApi) { - var ret bool - return ret - } - return *o.GatewayApi -} - -// GetGatewayApiOk returns a tuple with the GatewayApi field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DNS) GetGatewayApiOk() (*bool, bool) { - if o == nil || IsNil(o.GatewayApi) { - return nil, false - } - return o.GatewayApi, true -} - -// HasGatewayApi returns a boolean if a field has been set. -func (o *DNS) HasGatewayApi() bool { - if o != nil && !IsNil(o.GatewayApi) { - return true - } - - return false -} - -// SetGatewayApi gets a reference to the given bool and assigns it to the GatewayApi field. -func (o *DNS) SetGatewayApi(v bool) { - o.GatewayApi = &v -} - // GetZones returns the Zones field value if set, zero value otherwise. func (o *DNS) GetZones() []string { if o == nil || IsNil(o.Zones) { @@ -148,9 +114,6 @@ func (o DNS) MarshalJSON() ([]byte, error) { func (o DNS) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["enabled"] = o.Enabled - if !IsNil(o.GatewayApi) { - toSerialize["gatewayApi"] = o.GatewayApi - } if !IsNil(o.Zones) { toSerialize["zones"] = o.Zones } @@ -198,7 +161,6 @@ func (o *DNS) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "enabled") - delete(additionalProperties, "gatewayApi") delete(additionalProperties, "zones") o.AdditionalProperties = additionalProperties } From 461f84b62ef0c2bd174283054c3b525437b3ee96 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Fri, 22 May 2026 12:24:54 +0200 Subject: [PATCH 61/66] refac(telemetrylink): introduce inline enums --- .../telemetrylink/v1betaapi/api_default.go | 72 +++++------ .../v1betaapi/api_default_mock.go | 24 ++-- ...lder_telemetry_link_region_id_parameter.go | 113 +++++++++++++++++ .../model_telemetry_link_response.go | 26 ++-- ...model_telemetry_link_response_region_id.go | 113 +++++++++++++++++ .../model_telemetry_link_response_status.go | 119 ++++++++++++++++++ 6 files changed, 405 insertions(+), 62 deletions(-) create mode 100644 services/telemetrylink/v1betaapi/model_get_folder_telemetry_link_region_id_parameter.go create mode 100644 services/telemetrylink/v1betaapi/model_telemetry_link_response_region_id.go create mode 100644 services/telemetrylink/v1betaapi/model_telemetry_link_response_status.go diff --git a/services/telemetrylink/v1betaapi/api_default.go b/services/telemetrylink/v1betaapi/api_default.go index 6ad37ac5c..a83a94c83 100644 --- a/services/telemetrylink/v1betaapi/api_default.go +++ b/services/telemetrylink/v1betaapi/api_default.go @@ -33,7 +33,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiCreateOrUpdateFolderTelemetryLinkRequest */ - CreateOrUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiCreateOrUpdateFolderTelemetryLinkRequest + CreateOrUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiCreateOrUpdateFolderTelemetryLinkRequest // CreateOrUpdateFolderTelemetryLinkExecute executes the request // @return TelemetryLinkResponse @@ -49,7 +49,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiCreateOrUpdateOrganizationTelemetryLinkRequest */ - CreateOrUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiCreateOrUpdateOrganizationTelemetryLinkRequest + CreateOrUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiCreateOrUpdateOrganizationTelemetryLinkRequest // CreateOrUpdateOrganizationTelemetryLinkExecute executes the request // @return TelemetryLinkResponse @@ -65,7 +65,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiCreateOrUpdateProjectTelemetryLinkRequest */ - CreateOrUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiCreateOrUpdateProjectTelemetryLinkRequest + CreateOrUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiCreateOrUpdateProjectTelemetryLinkRequest // CreateOrUpdateProjectTelemetryLinkExecute executes the request // @return TelemetryLinkResponse @@ -81,7 +81,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiDeleteFolderTelemetryLinkRequest */ - DeleteFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiDeleteFolderTelemetryLinkRequest + DeleteFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiDeleteFolderTelemetryLinkRequest // DeleteFolderTelemetryLinkExecute executes the request DeleteFolderTelemetryLinkExecute(r ApiDeleteFolderTelemetryLinkRequest) error @@ -96,7 +96,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiDeleteOrganizationTelemetryLinkRequest */ - DeleteOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiDeleteOrganizationTelemetryLinkRequest + DeleteOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiDeleteOrganizationTelemetryLinkRequest // DeleteOrganizationTelemetryLinkExecute executes the request DeleteOrganizationTelemetryLinkExecute(r ApiDeleteOrganizationTelemetryLinkRequest) error @@ -111,7 +111,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiDeleteProjectTelemetryLinkRequest */ - DeleteProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiDeleteProjectTelemetryLinkRequest + DeleteProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiDeleteProjectTelemetryLinkRequest // DeleteProjectTelemetryLinkExecute executes the request DeleteProjectTelemetryLinkExecute(r ApiDeleteProjectTelemetryLinkRequest) error @@ -126,7 +126,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiGetFolderTelemetryLinkRequest */ - GetFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiGetFolderTelemetryLinkRequest + GetFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiGetFolderTelemetryLinkRequest // GetFolderTelemetryLinkExecute executes the request // @return TelemetryLinkResponse @@ -142,7 +142,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiGetOrganizationTelemetryLinkRequest */ - GetOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiGetOrganizationTelemetryLinkRequest + GetOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiGetOrganizationTelemetryLinkRequest // GetOrganizationTelemetryLinkExecute executes the request // @return TelemetryLinkResponse @@ -158,7 +158,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiGetProjectTelemetryLinkRequest */ - GetProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiGetProjectTelemetryLinkRequest + GetProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiGetProjectTelemetryLinkRequest // GetProjectTelemetryLinkExecute executes the request // @return TelemetryLinkResponse @@ -174,7 +174,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiPartialUpdateFolderTelemetryLinkRequest */ - PartialUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiPartialUpdateFolderTelemetryLinkRequest + PartialUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiPartialUpdateFolderTelemetryLinkRequest // PartialUpdateFolderTelemetryLinkExecute executes the request // @return TelemetryLinkResponse @@ -190,7 +190,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiPartialUpdateOrganizationTelemetryLinkRequest */ - PartialUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiPartialUpdateOrganizationTelemetryLinkRequest + PartialUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiPartialUpdateOrganizationTelemetryLinkRequest // PartialUpdateOrganizationTelemetryLinkExecute executes the request // @return TelemetryLinkResponse @@ -206,7 +206,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiPartialUpdateProjectTelemetryLinkRequest */ - PartialUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiPartialUpdateProjectTelemetryLinkRequest + PartialUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiPartialUpdateProjectTelemetryLinkRequest // PartialUpdateProjectTelemetryLinkExecute executes the request // @return TelemetryLinkResponse @@ -220,7 +220,7 @@ type ApiCreateOrUpdateFolderTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI folderId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter createOrUpdateFolderTelemetryLinkPayload *CreateOrUpdateFolderTelemetryLinkPayload } @@ -243,7 +243,7 @@ Creates or updates the given Telemetry Link within the folder. @param regionId The STACKIT region name the resource is located in. @return ApiCreateOrUpdateFolderTelemetryLinkRequest */ -func (a *DefaultAPIService) CreateOrUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiCreateOrUpdateFolderTelemetryLinkRequest { +func (a *DefaultAPIService) CreateOrUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiCreateOrUpdateFolderTelemetryLinkRequest { return ApiCreateOrUpdateFolderTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -383,7 +383,7 @@ type ApiCreateOrUpdateOrganizationTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI organizationId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter createOrUpdateOrganizationTelemetryLinkPayload *CreateOrUpdateOrganizationTelemetryLinkPayload } @@ -406,7 +406,7 @@ Creates or updates the given Telemetry Link within the organization. @param regionId The STACKIT region name the resource is located in. @return ApiCreateOrUpdateOrganizationTelemetryLinkRequest */ -func (a *DefaultAPIService) CreateOrUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiCreateOrUpdateOrganizationTelemetryLinkRequest { +func (a *DefaultAPIService) CreateOrUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiCreateOrUpdateOrganizationTelemetryLinkRequest { return ApiCreateOrUpdateOrganizationTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -546,7 +546,7 @@ type ApiCreateOrUpdateProjectTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter createOrUpdateProjectTelemetryLinkPayload *CreateOrUpdateProjectTelemetryLinkPayload } @@ -569,7 +569,7 @@ Creates or updates the given Telemetry Link within the project. @param regionId The STACKIT region name the resource is located in. @return ApiCreateOrUpdateProjectTelemetryLinkRequest */ -func (a *DefaultAPIService) CreateOrUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiCreateOrUpdateProjectTelemetryLinkRequest { +func (a *DefaultAPIService) CreateOrUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiCreateOrUpdateProjectTelemetryLinkRequest { return ApiCreateOrUpdateProjectTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -709,7 +709,7 @@ type ApiDeleteFolderTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI folderId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter } func (r ApiDeleteFolderTelemetryLinkRequest) Execute() error { @@ -726,7 +726,7 @@ Deletes the given Telemetry Link within the folder. @param regionId The STACKIT region name the resource is located in. @return ApiDeleteFolderTelemetryLinkRequest */ -func (a *DefaultAPIService) DeleteFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiDeleteFolderTelemetryLinkRequest { +func (a *DefaultAPIService) DeleteFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiDeleteFolderTelemetryLinkRequest { return ApiDeleteFolderTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -848,7 +848,7 @@ type ApiDeleteOrganizationTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI organizationId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter } func (r ApiDeleteOrganizationTelemetryLinkRequest) Execute() error { @@ -865,7 +865,7 @@ Deletes the given Telemetry Link within the organization. @param regionId The STACKIT region name the resource is located in. @return ApiDeleteOrganizationTelemetryLinkRequest */ -func (a *DefaultAPIService) DeleteOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiDeleteOrganizationTelemetryLinkRequest { +func (a *DefaultAPIService) DeleteOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiDeleteOrganizationTelemetryLinkRequest { return ApiDeleteOrganizationTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -987,7 +987,7 @@ type ApiDeleteProjectTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter } func (r ApiDeleteProjectTelemetryLinkRequest) Execute() error { @@ -1004,7 +1004,7 @@ Deletes the given Telemetry Link within the project. @param regionId The STACKIT region name the resource is located in. @return ApiDeleteProjectTelemetryLinkRequest */ -func (a *DefaultAPIService) DeleteProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiDeleteProjectTelemetryLinkRequest { +func (a *DefaultAPIService) DeleteProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiDeleteProjectTelemetryLinkRequest { return ApiDeleteProjectTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -1126,7 +1126,7 @@ type ApiGetFolderTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI folderId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter } func (r ApiGetFolderTelemetryLinkRequest) Execute() (*TelemetryLinkResponse, error) { @@ -1143,7 +1143,7 @@ Returns the details for the given Telemetry Link within the folder. @param regionId The STACKIT region name the resource is located in. @return ApiGetFolderTelemetryLinkRequest */ -func (a *DefaultAPIService) GetFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiGetFolderTelemetryLinkRequest { +func (a *DefaultAPIService) GetFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiGetFolderTelemetryLinkRequest { return ApiGetFolderTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -1267,7 +1267,7 @@ type ApiGetOrganizationTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI organizationId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter } func (r ApiGetOrganizationTelemetryLinkRequest) Execute() (*TelemetryLinkResponse, error) { @@ -1284,7 +1284,7 @@ Returns the details for the given Telemetry Link within the organization. @param regionId The STACKIT region name the resource is located in. @return ApiGetOrganizationTelemetryLinkRequest */ -func (a *DefaultAPIService) GetOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiGetOrganizationTelemetryLinkRequest { +func (a *DefaultAPIService) GetOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiGetOrganizationTelemetryLinkRequest { return ApiGetOrganizationTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -1408,7 +1408,7 @@ type ApiGetProjectTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter } func (r ApiGetProjectTelemetryLinkRequest) Execute() (*TelemetryLinkResponse, error) { @@ -1425,7 +1425,7 @@ Returns the details for the given Telemetry Link within the project. @param regionId The STACKIT region name the resource is located in. @return ApiGetProjectTelemetryLinkRequest */ -func (a *DefaultAPIService) GetProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiGetProjectTelemetryLinkRequest { +func (a *DefaultAPIService) GetProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiGetProjectTelemetryLinkRequest { return ApiGetProjectTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -1549,7 +1549,7 @@ type ApiPartialUpdateFolderTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI folderId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter partialUpdateFolderTelemetryLinkPayload *PartialUpdateFolderTelemetryLinkPayload } @@ -1572,7 +1572,7 @@ Patches the given Telemetry Link within the folder. @param regionId The STACKIT region name the resource is located in. @return ApiPartialUpdateFolderTelemetryLinkRequest */ -func (a *DefaultAPIService) PartialUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiPartialUpdateFolderTelemetryLinkRequest { +func (a *DefaultAPIService) PartialUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiPartialUpdateFolderTelemetryLinkRequest { return ApiPartialUpdateFolderTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -1712,7 +1712,7 @@ type ApiPartialUpdateOrganizationTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI organizationId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter partialUpdateOrganizationTelemetryLinkPayload *PartialUpdateOrganizationTelemetryLinkPayload } @@ -1735,7 +1735,7 @@ Patches the given Telemetry Link within the organization. @param regionId The STACKIT region name the resource is located in. @return ApiPartialUpdateOrganizationTelemetryLinkRequest */ -func (a *DefaultAPIService) PartialUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiPartialUpdateOrganizationTelemetryLinkRequest { +func (a *DefaultAPIService) PartialUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiPartialUpdateOrganizationTelemetryLinkRequest { return ApiPartialUpdateOrganizationTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -1875,7 +1875,7 @@ type ApiPartialUpdateProjectTelemetryLinkRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId GetFolderTelemetryLinkRegionIdParameter partialUpdateProjectTelemetryLinkPayload *PartialUpdateProjectTelemetryLinkPayload } @@ -1898,7 +1898,7 @@ Patches the given Telemetry Link within the project. @param regionId The STACKIT region name the resource is located in. @return ApiPartialUpdateProjectTelemetryLinkRequest */ -func (a *DefaultAPIService) PartialUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiPartialUpdateProjectTelemetryLinkRequest { +func (a *DefaultAPIService) PartialUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiPartialUpdateProjectTelemetryLinkRequest { return ApiPartialUpdateProjectTelemetryLinkRequest{ ApiService: a, ctx: ctx, diff --git a/services/telemetrylink/v1betaapi/api_default_mock.go b/services/telemetrylink/v1betaapi/api_default_mock.go index f6fcd1890..e8dd64946 100644 --- a/services/telemetrylink/v1betaapi/api_default_mock.go +++ b/services/telemetrylink/v1betaapi/api_default_mock.go @@ -46,7 +46,7 @@ type DefaultAPIServiceMock struct { PartialUpdateProjectTelemetryLinkExecuteMock *func(r ApiPartialUpdateProjectTelemetryLinkRequest) (*TelemetryLinkResponse, error) } -func (a DefaultAPIServiceMock) CreateOrUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiCreateOrUpdateFolderTelemetryLinkRequest { +func (a DefaultAPIServiceMock) CreateOrUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiCreateOrUpdateFolderTelemetryLinkRequest { return ApiCreateOrUpdateFolderTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -65,7 +65,7 @@ func (a DefaultAPIServiceMock) CreateOrUpdateFolderTelemetryLinkExecute(r ApiCre return (*a.CreateOrUpdateFolderTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateOrUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiCreateOrUpdateOrganizationTelemetryLinkRequest { +func (a DefaultAPIServiceMock) CreateOrUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiCreateOrUpdateOrganizationTelemetryLinkRequest { return ApiCreateOrUpdateOrganizationTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -84,7 +84,7 @@ func (a DefaultAPIServiceMock) CreateOrUpdateOrganizationTelemetryLinkExecute(r return (*a.CreateOrUpdateOrganizationTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateOrUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiCreateOrUpdateProjectTelemetryLinkRequest { +func (a DefaultAPIServiceMock) CreateOrUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiCreateOrUpdateProjectTelemetryLinkRequest { return ApiCreateOrUpdateProjectTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -103,7 +103,7 @@ func (a DefaultAPIServiceMock) CreateOrUpdateProjectTelemetryLinkExecute(r ApiCr return (*a.CreateOrUpdateProjectTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiDeleteFolderTelemetryLinkRequest { +func (a DefaultAPIServiceMock) DeleteFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiDeleteFolderTelemetryLinkRequest { return ApiDeleteFolderTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -121,7 +121,7 @@ func (a DefaultAPIServiceMock) DeleteFolderTelemetryLinkExecute(r ApiDeleteFolde return (*a.DeleteFolderTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiDeleteOrganizationTelemetryLinkRequest { +func (a DefaultAPIServiceMock) DeleteOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiDeleteOrganizationTelemetryLinkRequest { return ApiDeleteOrganizationTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -139,7 +139,7 @@ func (a DefaultAPIServiceMock) DeleteOrganizationTelemetryLinkExecute(r ApiDelet return (*a.DeleteOrganizationTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiDeleteProjectTelemetryLinkRequest { +func (a DefaultAPIServiceMock) DeleteProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiDeleteProjectTelemetryLinkRequest { return ApiDeleteProjectTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -157,7 +157,7 @@ func (a DefaultAPIServiceMock) DeleteProjectTelemetryLinkExecute(r ApiDeleteProj return (*a.DeleteProjectTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiGetFolderTelemetryLinkRequest { +func (a DefaultAPIServiceMock) GetFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiGetFolderTelemetryLinkRequest { return ApiGetFolderTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -176,7 +176,7 @@ func (a DefaultAPIServiceMock) GetFolderTelemetryLinkExecute(r ApiGetFolderTelem return (*a.GetFolderTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiGetOrganizationTelemetryLinkRequest { +func (a DefaultAPIServiceMock) GetOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiGetOrganizationTelemetryLinkRequest { return ApiGetOrganizationTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -195,7 +195,7 @@ func (a DefaultAPIServiceMock) GetOrganizationTelemetryLinkExecute(r ApiGetOrgan return (*a.GetOrganizationTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiGetProjectTelemetryLinkRequest { +func (a DefaultAPIServiceMock) GetProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiGetProjectTelemetryLinkRequest { return ApiGetProjectTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -214,7 +214,7 @@ func (a DefaultAPIServiceMock) GetProjectTelemetryLinkExecute(r ApiGetProjectTel return (*a.GetProjectTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) PartialUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId string) ApiPartialUpdateFolderTelemetryLinkRequest { +func (a DefaultAPIServiceMock) PartialUpdateFolderTelemetryLink(ctx context.Context, folderId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiPartialUpdateFolderTelemetryLinkRequest { return ApiPartialUpdateFolderTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -233,7 +233,7 @@ func (a DefaultAPIServiceMock) PartialUpdateFolderTelemetryLinkExecute(r ApiPart return (*a.PartialUpdateFolderTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) PartialUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId string) ApiPartialUpdateOrganizationTelemetryLinkRequest { +func (a DefaultAPIServiceMock) PartialUpdateOrganizationTelemetryLink(ctx context.Context, organizationId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiPartialUpdateOrganizationTelemetryLinkRequest { return ApiPartialUpdateOrganizationTelemetryLinkRequest{ ApiService: a, ctx: ctx, @@ -252,7 +252,7 @@ func (a DefaultAPIServiceMock) PartialUpdateOrganizationTelemetryLinkExecute(r A return (*a.PartialUpdateOrganizationTelemetryLinkExecuteMock)(r) } -func (a DefaultAPIServiceMock) PartialUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId string) ApiPartialUpdateProjectTelemetryLinkRequest { +func (a DefaultAPIServiceMock) PartialUpdateProjectTelemetryLink(ctx context.Context, projectId string, regionId GetFolderTelemetryLinkRegionIdParameter) ApiPartialUpdateProjectTelemetryLinkRequest { return ApiPartialUpdateProjectTelemetryLinkRequest{ ApiService: a, ctx: ctx, diff --git a/services/telemetrylink/v1betaapi/model_get_folder_telemetry_link_region_id_parameter.go b/services/telemetrylink/v1betaapi/model_get_folder_telemetry_link_region_id_parameter.go new file mode 100644 index 000000000..8bb6eb2b6 --- /dev/null +++ b/services/telemetrylink/v1betaapi/model_get_folder_telemetry_link_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Telemetry Link API + +This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// GetFolderTelemetryLinkRegionIdParameter the model 'GetFolderTelemetryLinkRegionIdParameter' +type GetFolderTelemetryLinkRegionIdParameter string + +// List of get_folder_telemetry_link_regionId_parameter +const ( + GETFOLDERTELEMETRYLINKREGIONIDPARAMETER_EU01 GetFolderTelemetryLinkRegionIdParameter = "eu01" + GETFOLDERTELEMETRYLINKREGIONIDPARAMETER_EU02 GetFolderTelemetryLinkRegionIdParameter = "eu02" + GETFOLDERTELEMETRYLINKREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetFolderTelemetryLinkRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of GetFolderTelemetryLinkRegionIdParameter enum +var AllowedGetFolderTelemetryLinkRegionIdParameterEnumValues = []GetFolderTelemetryLinkRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *GetFolderTelemetryLinkRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetFolderTelemetryLinkRegionIdParameter(value) + for _, existing := range AllowedGetFolderTelemetryLinkRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = GETFOLDERTELEMETRYLINKREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewGetFolderTelemetryLinkRegionIdParameterFromValue returns a pointer to a valid GetFolderTelemetryLinkRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetFolderTelemetryLinkRegionIdParameterFromValue(v string) (*GetFolderTelemetryLinkRegionIdParameter, error) { + ev := GetFolderTelemetryLinkRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetFolderTelemetryLinkRegionIdParameter: valid values are %v", v, AllowedGetFolderTelemetryLinkRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetFolderTelemetryLinkRegionIdParameter) IsValid() bool { + for _, existing := range AllowedGetFolderTelemetryLinkRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to get_folder_telemetry_link_regionId_parameter value +func (v GetFolderTelemetryLinkRegionIdParameter) Ptr() *GetFolderTelemetryLinkRegionIdParameter { + return &v +} + +type NullableGetFolderTelemetryLinkRegionIdParameter struct { + value *GetFolderTelemetryLinkRegionIdParameter + isSet bool +} + +func (v NullableGetFolderTelemetryLinkRegionIdParameter) Get() *GetFolderTelemetryLinkRegionIdParameter { + return v.value +} + +func (v *NullableGetFolderTelemetryLinkRegionIdParameter) Set(val *GetFolderTelemetryLinkRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableGetFolderTelemetryLinkRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableGetFolderTelemetryLinkRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetFolderTelemetryLinkRegionIdParameter(val *GetFolderTelemetryLinkRegionIdParameter) *NullableGetFolderTelemetryLinkRegionIdParameter { + return &NullableGetFolderTelemetryLinkRegionIdParameter{value: val, isSet: true} +} + +func (v NullableGetFolderTelemetryLinkRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetFolderTelemetryLinkRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/telemetrylink/v1betaapi/model_telemetry_link_response.go b/services/telemetrylink/v1betaapi/model_telemetry_link_response.go index e314d0cbf..7c433d655 100644 --- a/services/telemetrylink/v1betaapi/model_telemetry_link_response.go +++ b/services/telemetrylink/v1betaapi/model_telemetry_link_response.go @@ -32,11 +32,9 @@ type TelemetryLinkResponse struct { // Indicates whether routing through the link to a telemetry-router is active. Enabled bool `json:"enabled"` // A auto generated unique id which identifies the resource. - Id string `json:"id"` - // The STACKIT region name the resource is located in. - RegionId string `json:"regionId"` - // The current state of the link. - Status string `json:"status"` + Id string `json:"id"` + RegionId TelemetryLinkResponseRegionId `json:"regionId"` + Status TelemetryLinkResponseStatus `json:"status"` // The ID of the telemetry-router to route the telemetry data. TelemetryRouterId string `json:"telemetryRouterId"` AdditionalProperties map[string]interface{} @@ -48,7 +46,7 @@ type _TelemetryLinkResponse TelemetryLinkResponse // 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 NewTelemetryLinkResponse(createTime time.Time, displayName string, enabled bool, id string, regionId string, status string, telemetryRouterId string) *TelemetryLinkResponse { +func NewTelemetryLinkResponse(createTime time.Time, displayName string, enabled bool, id string, regionId TelemetryLinkResponseRegionId, status TelemetryLinkResponseStatus, telemetryRouterId string) *TelemetryLinkResponse { this := TelemetryLinkResponse{} this.CreateTime = createTime this.DisplayName = displayName @@ -229,9 +227,9 @@ func (o *TelemetryLinkResponse) SetId(v string) { } // GetRegionId returns the RegionId field value -func (o *TelemetryLinkResponse) GetRegionId() string { +func (o *TelemetryLinkResponse) GetRegionId() TelemetryLinkResponseRegionId { if o == nil { - var ret string + var ret TelemetryLinkResponseRegionId return ret } @@ -240,7 +238,7 @@ func (o *TelemetryLinkResponse) GetRegionId() string { // GetRegionIdOk returns a tuple with the RegionId field value // and a boolean to check if the value has been set. -func (o *TelemetryLinkResponse) GetRegionIdOk() (*string, bool) { +func (o *TelemetryLinkResponse) GetRegionIdOk() (*TelemetryLinkResponseRegionId, bool) { if o == nil { return nil, false } @@ -248,14 +246,14 @@ func (o *TelemetryLinkResponse) GetRegionIdOk() (*string, bool) { } // SetRegionId sets field value -func (o *TelemetryLinkResponse) SetRegionId(v string) { +func (o *TelemetryLinkResponse) SetRegionId(v TelemetryLinkResponseRegionId) { o.RegionId = v } // GetStatus returns the Status field value -func (o *TelemetryLinkResponse) GetStatus() string { +func (o *TelemetryLinkResponse) GetStatus() TelemetryLinkResponseStatus { if o == nil { - var ret string + var ret TelemetryLinkResponseStatus return ret } @@ -264,7 +262,7 @@ func (o *TelemetryLinkResponse) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *TelemetryLinkResponse) GetStatusOk() (*string, bool) { +func (o *TelemetryLinkResponse) GetStatusOk() (*TelemetryLinkResponseStatus, bool) { if o == nil { return nil, false } @@ -272,7 +270,7 @@ func (o *TelemetryLinkResponse) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *TelemetryLinkResponse) SetStatus(v string) { +func (o *TelemetryLinkResponse) SetStatus(v TelemetryLinkResponseStatus) { o.Status = v } diff --git a/services/telemetrylink/v1betaapi/model_telemetry_link_response_region_id.go b/services/telemetrylink/v1betaapi/model_telemetry_link_response_region_id.go new file mode 100644 index 000000000..1223299a4 --- /dev/null +++ b/services/telemetrylink/v1betaapi/model_telemetry_link_response_region_id.go @@ -0,0 +1,113 @@ +/* +STACKIT Telemetry Link API + +This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// TelemetryLinkResponseRegionId The STACKIT region name the resource is located in. +type TelemetryLinkResponseRegionId string + +// List of telemetryLinkResponse_regionId +const ( + TELEMETRYLINKRESPONSEREGIONID_EU01 TelemetryLinkResponseRegionId = "eu01" + TELEMETRYLINKRESPONSEREGIONID_EU02 TelemetryLinkResponseRegionId = "eu02" + TELEMETRYLINKRESPONSEREGIONID_UNKNOWN_DEFAULT_OPEN_API TelemetryLinkResponseRegionId = "unknown_default_open_api" +) + +// All allowed values of TelemetryLinkResponseRegionId enum +var AllowedTelemetryLinkResponseRegionIdEnumValues = []TelemetryLinkResponseRegionId{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *TelemetryLinkResponseRegionId) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TelemetryLinkResponseRegionId(value) + for _, existing := range AllowedTelemetryLinkResponseRegionIdEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TELEMETRYLINKRESPONSEREGIONID_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTelemetryLinkResponseRegionIdFromValue returns a pointer to a valid TelemetryLinkResponseRegionId +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTelemetryLinkResponseRegionIdFromValue(v string) (*TelemetryLinkResponseRegionId, error) { + ev := TelemetryLinkResponseRegionId(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TelemetryLinkResponseRegionId: valid values are %v", v, AllowedTelemetryLinkResponseRegionIdEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TelemetryLinkResponseRegionId) IsValid() bool { + for _, existing := range AllowedTelemetryLinkResponseRegionIdEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to telemetryLinkResponse_regionId value +func (v TelemetryLinkResponseRegionId) Ptr() *TelemetryLinkResponseRegionId { + return &v +} + +type NullableTelemetryLinkResponseRegionId struct { + value *TelemetryLinkResponseRegionId + isSet bool +} + +func (v NullableTelemetryLinkResponseRegionId) Get() *TelemetryLinkResponseRegionId { + return v.value +} + +func (v *NullableTelemetryLinkResponseRegionId) Set(val *TelemetryLinkResponseRegionId) { + v.value = val + v.isSet = true +} + +func (v NullableTelemetryLinkResponseRegionId) IsSet() bool { + return v.isSet +} + +func (v *NullableTelemetryLinkResponseRegionId) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelemetryLinkResponseRegionId(val *TelemetryLinkResponseRegionId) *NullableTelemetryLinkResponseRegionId { + return &NullableTelemetryLinkResponseRegionId{value: val, isSet: true} +} + +func (v NullableTelemetryLinkResponseRegionId) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelemetryLinkResponseRegionId) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/telemetrylink/v1betaapi/model_telemetry_link_response_status.go b/services/telemetrylink/v1betaapi/model_telemetry_link_response_status.go new file mode 100644 index 000000000..31e53ce5f --- /dev/null +++ b/services/telemetrylink/v1betaapi/model_telemetry_link_response_status.go @@ -0,0 +1,119 @@ +/* +STACKIT Telemetry Link API + +This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// TelemetryLinkResponseStatus The current state of the link. +type TelemetryLinkResponseStatus string + +// List of telemetryLinkResponse_status +const ( + TELEMETRYLINKRESPONSESTATUS_ACTIVE TelemetryLinkResponseStatus = "active" + TELEMETRYLINKRESPONSESTATUS_INACTIVE TelemetryLinkResponseStatus = "inactive" + TELEMETRYLINKRESPONSESTATUS_FAILED TelemetryLinkResponseStatus = "failed" + TELEMETRYLINKRESPONSESTATUS_RECONCILING TelemetryLinkResponseStatus = "reconciling" + TELEMETRYLINKRESPONSESTATUS_DELETING TelemetryLinkResponseStatus = "deleting" + TELEMETRYLINKRESPONSESTATUS_UNKNOWN_DEFAULT_OPEN_API TelemetryLinkResponseStatus = "unknown_default_open_api" +) + +// All allowed values of TelemetryLinkResponseStatus enum +var AllowedTelemetryLinkResponseStatusEnumValues = []TelemetryLinkResponseStatus{ + "active", + "inactive", + "failed", + "reconciling", + "deleting", + "unknown_default_open_api", +} + +func (v *TelemetryLinkResponseStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TelemetryLinkResponseStatus(value) + for _, existing := range AllowedTelemetryLinkResponseStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TELEMETRYLINKRESPONSESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTelemetryLinkResponseStatusFromValue returns a pointer to a valid TelemetryLinkResponseStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTelemetryLinkResponseStatusFromValue(v string) (*TelemetryLinkResponseStatus, error) { + ev := TelemetryLinkResponseStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TelemetryLinkResponseStatus: valid values are %v", v, AllowedTelemetryLinkResponseStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TelemetryLinkResponseStatus) IsValid() bool { + for _, existing := range AllowedTelemetryLinkResponseStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to telemetryLinkResponse_status value +func (v TelemetryLinkResponseStatus) Ptr() *TelemetryLinkResponseStatus { + return &v +} + +type NullableTelemetryLinkResponseStatus struct { + value *TelemetryLinkResponseStatus + isSet bool +} + +func (v NullableTelemetryLinkResponseStatus) Get() *TelemetryLinkResponseStatus { + return v.value +} + +func (v *NullableTelemetryLinkResponseStatus) Set(val *TelemetryLinkResponseStatus) { + v.value = val + v.isSet = true +} + +func (v NullableTelemetryLinkResponseStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableTelemetryLinkResponseStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelemetryLinkResponseStatus(val *TelemetryLinkResponseStatus) *NullableTelemetryLinkResponseStatus { + return &NullableTelemetryLinkResponseStatus{value: val, isSet: true} +} + +func (v NullableTelemetryLinkResponseStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelemetryLinkResponseStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 7815cdaa7dc1962c6f287496c08159f27b827ab3 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Fri, 22 May 2026 12:37:02 +0200 Subject: [PATCH 62/66] chore(telemetrylink): fix waiters/tests/examples, write changelog, bump version --- CHANGELOG.md | 2 + examples/telemetrylink/telemetrylink.go | 2 +- services/telemetrylink/CHANGELOG.md | 3 + services/telemetrylink/VERSION | 2 +- services/telemetrylink/v1betaapi/wait/wait.go | 70 ++++++++++--------- .../telemetrylink/v1betaapi/wait/wait_test.go | 32 ++++----- 6 files changed, 59 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fac1ce5b9..e303085be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -540,6 +540,8 @@ - **New**: API for STACKIT Telemetry Link - [v0.1.1](services/telemetrylink/CHANGELOG.md#v011) - **Improvement**: Use new `WaiterHandler` struct in the TelemetryLink WaitHandler + - [v0.2.0](services/telemetrylink/CHANGELOG.md#v020) + - **Feature:** Introduce enums for various attributes - `vpn`: - [v0.4.2](services/vpn/CHANGELOG.md#v042) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/examples/telemetrylink/telemetrylink.go b/examples/telemetrylink/telemetrylink.go index 2ccaa8e7c..882235f17 100644 --- a/examples/telemetrylink/telemetrylink.go +++ b/examples/telemetrylink/telemetrylink.go @@ -15,7 +15,7 @@ func main() { organizationId := "ORGANIZATION_ID" // the uuid of your STACKIT organization folderId := "FOLDER_ID" // the uuid of your STACKIT folder projectId := "PROJECT_ID" // the uuid of your STACKIT project - regionId := "eu01" + regionId := telemetrylink.GETFOLDERTELEMETRYLINKREGIONIDPARAMETER_EU01 telemetryRouterId := "TELEMETRY_ROUTER_ID" // the uuid of your STACKIT TelemetryRouter telemetryRouterAccessToken := "TELEMETRY_ROUTER_ACCESS_TOKEN" // the access token of your TelemetryRouter diff --git a/services/telemetrylink/CHANGELOG.md b/services/telemetrylink/CHANGELOG.md index 645bee64f..aa254cd2f 100644 --- a/services/telemetrylink/CHANGELOG.md +++ b/services/telemetrylink/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.2.0 +- **Feature:** Introduce enums for various attributes + ## v0.1.1 - **Improvement**: Use new `WaiterHandler` struct in the TelemetryLink WaitHandler diff --git a/services/telemetrylink/VERSION b/services/telemetrylink/VERSION index a1c2c6a9f..81fd7ba08 100644 --- a/services/telemetrylink/VERSION +++ b/services/telemetrylink/VERSION @@ -1 +1 @@ -v0.1.1 \ No newline at end of file +v0.2.0 \ No newline at end of file diff --git a/services/telemetrylink/v1betaapi/wait/wait.go b/services/telemetrylink/v1betaapi/wait/wait.go index 09ade4047..4699334a0 100644 --- a/services/telemetrylink/v1betaapi/wait/wait.go +++ b/services/telemetrylink/v1betaapi/wait/wait.go @@ -11,20 +11,22 @@ import ( ) const ( - TELEMETRYLINK_ACTIVE = "active" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + TELEMETRYLINK_ACTIVE = telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE ) // CreateOrUpdateOrganizationTelemetryLinkWaitHandler will wait for organization TelemetryLink creation or update -func CreateOrUpdateOrganizationTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, organizationId, region string) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { - waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, string]{ +func CreateOrUpdateOrganizationTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, organizationId string, region telemetrylink.GetFolderTelemetryLinkRegionIdParameter) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { + waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, telemetrylink.TelemetryLinkResponseStatus]{ FetchInstance: a.GetOrganizationTelemetryLink(ctx, organizationId, region).Execute, - GetState: func(d *telemetrylink.TelemetryLinkResponse) (string, error) { + GetState: func(d *telemetrylink.TelemetryLinkResponse) (telemetrylink.TelemetryLinkResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{TELEMETRYLINK_ACTIVE}, + ActiveState: []telemetrylink.TelemetryLinkResponseStatus{telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -33,16 +35,16 @@ func CreateOrUpdateOrganizationTelemetryLinkWaitHandler(ctx context.Context, a t } // PartialUpdateOrganizationTelemetryLinkWaitHandler will wait for organization TelemetryLink partial update -func PartialUpdateOrganizationTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, organizationId, region string) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { - waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, string]{ +func PartialUpdateOrganizationTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, organizationId string, region telemetrylink.GetFolderTelemetryLinkRegionIdParameter) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { + waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, telemetrylink.TelemetryLinkResponseStatus]{ FetchInstance: a.GetOrganizationTelemetryLink(ctx, organizationId, region).Execute, - GetState: func(d *telemetrylink.TelemetryLinkResponse) (string, error) { + GetState: func(d *telemetrylink.TelemetryLinkResponse) (telemetrylink.TelemetryLinkResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{TELEMETRYLINK_ACTIVE}, + ActiveState: []telemetrylink.TelemetryLinkResponseStatus{telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -51,10 +53,10 @@ func PartialUpdateOrganizationTelemetryLinkWaitHandler(ctx context.Context, a te } // DeleteOrganizationTelemetryLinkWaitHandler will wait for organization TelemetryLink deletion -func DeleteOrganizationTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, organizationId, region string) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { - waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, string]{ +func DeleteOrganizationTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, organizationId string, region telemetrylink.GetFolderTelemetryLinkRegionIdParameter) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { + waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, telemetrylink.TelemetryLinkResponseStatus]{ FetchInstance: a.GetOrganizationTelemetryLink(ctx, organizationId, region).Execute, - GetState: func(d *telemetrylink.TelemetryLinkResponse) (string, error) { + GetState: func(d *telemetrylink.TelemetryLinkResponse) (telemetrylink.TelemetryLinkResponseStatus, error) { if d == nil { return "", errors.New("empty response") } @@ -69,16 +71,16 @@ func DeleteOrganizationTelemetryLinkWaitHandler(ctx context.Context, a telemetry } // CreateOrUpdateFolderTelemetryLinkWaitHandler will wait for folder TelemetryLink creation or update -func CreateOrUpdateFolderTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, folderId, region string) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { - waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, string]{ +func CreateOrUpdateFolderTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, folderId string, region telemetrylink.GetFolderTelemetryLinkRegionIdParameter) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { + waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, telemetrylink.TelemetryLinkResponseStatus]{ FetchInstance: a.GetFolderTelemetryLink(ctx, folderId, region).Execute, - GetState: func(d *telemetrylink.TelemetryLinkResponse) (string, error) { + GetState: func(d *telemetrylink.TelemetryLinkResponse) (telemetrylink.TelemetryLinkResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{TELEMETRYLINK_ACTIVE}, + ActiveState: []telemetrylink.TelemetryLinkResponseStatus{telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -87,16 +89,16 @@ func CreateOrUpdateFolderTelemetryLinkWaitHandler(ctx context.Context, a telemet } // PartialUpdateFolderTelemetryLinkWaitHandler will wait for folder TelemetryLink partial update -func PartialUpdateFolderTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, folderId, region string) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { - waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, string]{ +func PartialUpdateFolderTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, folderId string, region telemetrylink.GetFolderTelemetryLinkRegionIdParameter) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { + waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, telemetrylink.TelemetryLinkResponseStatus]{ FetchInstance: a.GetFolderTelemetryLink(ctx, folderId, region).Execute, - GetState: func(d *telemetrylink.TelemetryLinkResponse) (string, error) { + GetState: func(d *telemetrylink.TelemetryLinkResponse) (telemetrylink.TelemetryLinkResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{TELEMETRYLINK_ACTIVE}, + ActiveState: []telemetrylink.TelemetryLinkResponseStatus{telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -105,10 +107,10 @@ func PartialUpdateFolderTelemetryLinkWaitHandler(ctx context.Context, a telemetr } // DeleteFolderTelemetryLinkWaitHandler will wait for folder TelemetryLink deletion -func DeleteFolderTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, folderId, region string) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { - waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, string]{ +func DeleteFolderTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, folderId string, region telemetrylink.GetFolderTelemetryLinkRegionIdParameter) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { + waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, telemetrylink.TelemetryLinkResponseStatus]{ FetchInstance: a.GetFolderTelemetryLink(ctx, folderId, region).Execute, - GetState: func(d *telemetrylink.TelemetryLinkResponse) (string, error) { + GetState: func(d *telemetrylink.TelemetryLinkResponse) (telemetrylink.TelemetryLinkResponseStatus, error) { if d == nil { return "", errors.New("empty response") } @@ -123,16 +125,16 @@ func DeleteFolderTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.D } // CreateOrUpdateProjectTelemetryLinkWaitHandler will wait for project TelemetryLink creation or update -func CreateOrUpdateProjectTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, projectId, region string) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { - waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, string]{ +func CreateOrUpdateProjectTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, projectId string, region telemetrylink.GetFolderTelemetryLinkRegionIdParameter) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { + waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, telemetrylink.TelemetryLinkResponseStatus]{ FetchInstance: a.GetProjectTelemetryLink(ctx, projectId, region).Execute, - GetState: func(d *telemetrylink.TelemetryLinkResponse) (string, error) { + GetState: func(d *telemetrylink.TelemetryLinkResponse) (telemetrylink.TelemetryLinkResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{TELEMETRYLINK_ACTIVE}, + ActiveState: []telemetrylink.TelemetryLinkResponseStatus{telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -141,16 +143,16 @@ func CreateOrUpdateProjectTelemetryLinkWaitHandler(ctx context.Context, a teleme } // PartialUpdateProjectTelemetryLinkWaitHandler will wait for project TelemetryLink partial update -func PartialUpdateProjectTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, projectId, region string) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { - waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, string]{ +func PartialUpdateProjectTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, projectId string, region telemetrylink.GetFolderTelemetryLinkRegionIdParameter) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { + waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, telemetrylink.TelemetryLinkResponseStatus]{ FetchInstance: a.GetProjectTelemetryLink(ctx, projectId, region).Execute, - GetState: func(d *telemetrylink.TelemetryLinkResponse) (string, error) { + GetState: func(d *telemetrylink.TelemetryLinkResponse) (telemetrylink.TelemetryLinkResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{TELEMETRYLINK_ACTIVE}, + ActiveState: []telemetrylink.TelemetryLinkResponseStatus{telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -159,10 +161,10 @@ func PartialUpdateProjectTelemetryLinkWaitHandler(ctx context.Context, a telemet } // DeleteProjectTelemetryLinkWaitHandler will wait for project TelemetryLink deletion -func DeleteProjectTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, projectId, region string) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { - waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, string]{ +func DeleteProjectTelemetryLinkWaitHandler(ctx context.Context, a telemetrylink.DefaultAPI, projectId string, region telemetrylink.GetFolderTelemetryLinkRegionIdParameter) *wait.AsyncActionHandler[telemetrylink.TelemetryLinkResponse] { + waitConfig := wait.WaiterHelper[telemetrylink.TelemetryLinkResponse, telemetrylink.TelemetryLinkResponseStatus]{ FetchInstance: a.GetProjectTelemetryLink(ctx, projectId, region).Execute, - GetState: func(d *telemetrylink.TelemetryLinkResponse) (string, error) { + GetState: func(d *telemetrylink.TelemetryLinkResponse) (telemetrylink.TelemetryLinkResponseStatus, error) { if d == nil { return "", errors.New("empty response") } diff --git a/services/telemetrylink/v1betaapi/wait/wait_test.go b/services/telemetrylink/v1betaapi/wait/wait_test.go index ae1abdc18..895faca68 100644 --- a/services/telemetrylink/v1betaapi/wait/wait_test.go +++ b/services/telemetrylink/v1betaapi/wait/wait_test.go @@ -15,7 +15,7 @@ import ( type mockSettings struct { getFails bool notFound bool - resourceState string + resourceState telemetrylink.TelemetryLinkResponseStatus } func newAPIMock(settings mockSettings) telemetrylink.DefaultAPI { @@ -78,14 +78,14 @@ func TestCreateOrUpdateOrganizationTelemetryLinkWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetrylink.TelemetryLinkResponseStatus wantErr bool wantResp bool }{ { desc: "create_or_update_succeeded", getFails: false, - resourceState: TELEMETRYLINK_ACTIVE, + resourceState: telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -138,14 +138,14 @@ func TestPartialUpdateOrganizationTelemetryLinkWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetrylink.TelemetryLinkResponseStatus wantErr bool wantResp bool }{ { desc: "create_or_update_succeeded", getFails: false, - resourceState: TELEMETRYLINK_ACTIVE, + resourceState: telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -199,7 +199,7 @@ func TestDeleteOrganizationTelemetryLinkWaitHandler(t *testing.T) { desc string getFails bool notFound bool - resourceState string + resourceState telemetrylink.TelemetryLinkResponseStatus wantErr bool wantResp bool }{ @@ -265,14 +265,14 @@ func TestCreateOrUpdateFolderTelemetryLinkWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetrylink.TelemetryLinkResponseStatus wantErr bool wantResp bool }{ { desc: "create_or_update_succeeded", getFails: false, - resourceState: TELEMETRYLINK_ACTIVE, + resourceState: telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -325,14 +325,14 @@ func TestPartialUpdateFolderTelemetryLinkWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetrylink.TelemetryLinkResponseStatus wantErr bool wantResp bool }{ { desc: "create_or_update_succeeded", getFails: false, - resourceState: TELEMETRYLINK_ACTIVE, + resourceState: telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -386,7 +386,7 @@ func TestDeleteFolderTelemetryLinkWaitHandler(t *testing.T) { desc string getFails bool notFound bool - resourceState string + resourceState telemetrylink.TelemetryLinkResponseStatus wantErr bool wantResp bool }{ @@ -452,14 +452,14 @@ func TestCreateOrUpdateProjectTelemetryLinkWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetrylink.TelemetryLinkResponseStatus wantErr bool wantResp bool }{ { desc: "create_or_update_succeeded", getFails: false, - resourceState: TELEMETRYLINK_ACTIVE, + resourceState: telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -512,14 +512,14 @@ func TestPartialUpdateProjectTelemetryLinkWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetrylink.TelemetryLinkResponseStatus wantErr bool wantResp bool }{ { desc: "create_or_update_succeeded", getFails: false, - resourceState: TELEMETRYLINK_ACTIVE, + resourceState: telemetrylink.TELEMETRYLINKRESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -573,7 +573,7 @@ func TestDeleteProjectTelemetryLinkWaitHandler(t *testing.T) { desc string getFails bool notFound bool - resourceState string + resourceState telemetrylink.TelemetryLinkResponseStatus wantErr bool wantResp bool }{ From 94377d53e8bf07c73b730a6bfd7d1e3909c835ae Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Fri, 22 May 2026 12:38:05 +0200 Subject: [PATCH 63/66] refac(telemetryrouter): introduce inline enums --- .../telemetryrouter/v1betaapi/api_default.go | 90 +++++++------- .../v1betaapi/api_default_mock.go | 30 ++--- .../model_access_token_base_response.go | 14 +-- ...model_access_token_base_response_status.go | 115 ++++++++++++++++++ .../model_create_access_token_response.go | 14 +-- .../v1betaapi/model_destination_response.go | 28 ++--- ...el_destination_response_credential_type.go | 115 ++++++++++++++++++ .../model_destination_response_status.go | 115 ++++++++++++++++++ .../model_get_access_token_response.go | 14 +-- ...t_telemetry_routers_region_id_parameter.go | 113 +++++++++++++++++ .../model_telemetry_router_response.go | 15 ++- .../model_telemetry_router_response_status.go | 115 ++++++++++++++++++ .../model_update_access_token_response.go | 14 +-- 13 files changed, 681 insertions(+), 111 deletions(-) create mode 100644 services/telemetryrouter/v1betaapi/model_access_token_base_response_status.go create mode 100644 services/telemetryrouter/v1betaapi/model_destination_response_credential_type.go create mode 100644 services/telemetryrouter/v1betaapi/model_destination_response_status.go create mode 100644 services/telemetryrouter/v1betaapi/model_list_telemetry_routers_region_id_parameter.go create mode 100644 services/telemetryrouter/v1betaapi/model_telemetry_router_response_status.go diff --git a/services/telemetryrouter/v1betaapi/api_default.go b/services/telemetryrouter/v1betaapi/api_default.go index e5402e405..d96eecdf2 100644 --- a/services/telemetryrouter/v1betaapi/api_default.go +++ b/services/telemetryrouter/v1betaapi/api_default.go @@ -34,7 +34,7 @@ type DefaultAPI interface { @param telemetryRouterId The Telemetry Router UUID. @return ApiCreateAccessTokenRequest */ - CreateAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiCreateAccessTokenRequest + CreateAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiCreateAccessTokenRequest // CreateAccessTokenExecute executes the request // @return CreateAccessTokenResponse @@ -51,7 +51,7 @@ type DefaultAPI interface { @param telemetryRouterId The Telemetry Router UUID. @return ApiCreateDestinationRequest */ - CreateDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiCreateDestinationRequest + CreateDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiCreateDestinationRequest // CreateDestinationExecute executes the request // @return DestinationResponse @@ -67,7 +67,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiCreateTelemetryRouterRequest */ - CreateTelemetryRouter(ctx context.Context, projectId string, regionId string) ApiCreateTelemetryRouterRequest + CreateTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter) ApiCreateTelemetryRouterRequest // CreateTelemetryRouterExecute executes the request // @return TelemetryRouterResponse @@ -85,7 +85,7 @@ type DefaultAPI interface { @param accessTokenId The Access Token UUID. @return ApiDeleteAccessTokenRequest */ - DeleteAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiDeleteAccessTokenRequest + DeleteAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, accessTokenId string) ApiDeleteAccessTokenRequest // DeleteAccessTokenExecute executes the request DeleteAccessTokenExecute(r ApiDeleteAccessTokenRequest) error @@ -102,7 +102,7 @@ type DefaultAPI interface { @param destinationId The Destination UUID. @return ApiDeleteDestinationRequest */ - DeleteDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiDeleteDestinationRequest + DeleteDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, destinationId string) ApiDeleteDestinationRequest // DeleteDestinationExecute executes the request DeleteDestinationExecute(r ApiDeleteDestinationRequest) error @@ -118,7 +118,7 @@ type DefaultAPI interface { @param telemetryRouterId The Telemetry Router UUID. @return ApiDeleteTelemetryRouterRequest */ - DeleteTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiDeleteTelemetryRouterRequest + DeleteTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiDeleteTelemetryRouterRequest // DeleteTelemetryRouterExecute executes the request DeleteTelemetryRouterExecute(r ApiDeleteTelemetryRouterRequest) error @@ -135,7 +135,7 @@ type DefaultAPI interface { @param accessTokenId The Access Token UUID. @return ApiGetAccessTokenRequest */ - GetAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiGetAccessTokenRequest + GetAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, accessTokenId string) ApiGetAccessTokenRequest // GetAccessTokenExecute executes the request // @return GetAccessTokenResponse @@ -153,7 +153,7 @@ type DefaultAPI interface { @param destinationId The Destination UUID. @return ApiGetDestinationRequest */ - GetDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiGetDestinationRequest + GetDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, destinationId string) ApiGetDestinationRequest // GetDestinationExecute executes the request // @return DestinationResponse @@ -170,7 +170,7 @@ type DefaultAPI interface { @param telemetryRouterId The Telemetry Router UUID. @return ApiGetTelemetryRouterRequest */ - GetTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiGetTelemetryRouterRequest + GetTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiGetTelemetryRouterRequest // GetTelemetryRouterExecute executes the request // @return TelemetryRouterResponse @@ -187,7 +187,7 @@ type DefaultAPI interface { @param telemetryRouterId The Telemetry Router UUID. @return ApiListAccessTokensRequest */ - ListAccessTokens(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiListAccessTokensRequest + ListAccessTokens(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiListAccessTokensRequest // ListAccessTokensExecute executes the request // @return ListAccessTokensResponse @@ -204,7 +204,7 @@ type DefaultAPI interface { @param telemetryRouterId The Telemetry Router UUID. @return ApiListDestinationsRequest */ - ListDestinations(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiListDestinationsRequest + ListDestinations(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiListDestinationsRequest // ListDestinationsExecute executes the request // @return ListDestinationsResponse @@ -220,7 +220,7 @@ type DefaultAPI interface { @param regionId The STACKIT region name the resource is located in. @return ApiListTelemetryRoutersRequest */ - ListTelemetryRouters(ctx context.Context, projectId string, regionId string) ApiListTelemetryRoutersRequest + ListTelemetryRouters(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter) ApiListTelemetryRoutersRequest // ListTelemetryRoutersExecute executes the request // @return ListTelemetryRoutersResponse @@ -238,7 +238,7 @@ type DefaultAPI interface { @param accessTokenId The Access Token UUID. @return ApiUpdateAccessTokenRequest */ - UpdateAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiUpdateAccessTokenRequest + UpdateAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, accessTokenId string) ApiUpdateAccessTokenRequest // UpdateAccessTokenExecute executes the request // @return UpdateAccessTokenResponse @@ -256,7 +256,7 @@ type DefaultAPI interface { @param destinationId The Destination UUID. @return ApiUpdateDestinationRequest */ - UpdateDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiUpdateDestinationRequest + UpdateDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, destinationId string) ApiUpdateDestinationRequest // UpdateDestinationExecute executes the request // @return DestinationResponse @@ -273,7 +273,7 @@ type DefaultAPI interface { @param telemetryRouterId The Telemetry Router UUID. @return ApiUpdateTelemetryRouterRequest */ - UpdateTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiUpdateTelemetryRouterRequest + UpdateTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiUpdateTelemetryRouterRequest // UpdateTelemetryRouterExecute executes the request // @return TelemetryRouterResponse @@ -287,7 +287,7 @@ type ApiCreateAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string createAccessTokenPayload *CreateAccessTokenPayload } @@ -312,7 +312,7 @@ Create a new access token for the given Telemetry Router. @param telemetryRouterId The Telemetry Router UUID. @return ApiCreateAccessTokenRequest */ -func (a *DefaultAPIService) CreateAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiCreateAccessTokenRequest { +func (a *DefaultAPIService) CreateAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiCreateAccessTokenRequest { return ApiCreateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -454,7 +454,7 @@ type ApiCreateDestinationRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string createDestinationPayload *CreateDestinationPayload } @@ -479,7 +479,7 @@ Creates a new Destination within the project. @param telemetryRouterId The Telemetry Router UUID. @return ApiCreateDestinationRequest */ -func (a *DefaultAPIService) CreateDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiCreateDestinationRequest { +func (a *DefaultAPIService) CreateDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiCreateDestinationRequest { return ApiCreateDestinationRequest{ ApiService: a, ctx: ctx, @@ -621,7 +621,7 @@ type ApiCreateTelemetryRouterRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter createTelemetryRouterPayload *CreateTelemetryRouterPayload } @@ -644,7 +644,7 @@ Creates the new Telemetry Router within the project. @param regionId The STACKIT region name the resource is located in. @return ApiCreateTelemetryRouterRequest */ -func (a *DefaultAPIService) CreateTelemetryRouter(ctx context.Context, projectId string, regionId string) ApiCreateTelemetryRouterRequest { +func (a *DefaultAPIService) CreateTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter) ApiCreateTelemetryRouterRequest { return ApiCreateTelemetryRouterRequest{ ApiService: a, ctx: ctx, @@ -784,7 +784,7 @@ type ApiDeleteAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string accessTokenId string } @@ -805,7 +805,7 @@ Delete an access token for the given Telemetry Router by its ID. @param accessTokenId The Access Token UUID. @return ApiDeleteAccessTokenRequest */ -func (a *DefaultAPIService) DeleteAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiDeleteAccessTokenRequest { +func (a *DefaultAPIService) DeleteAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, accessTokenId string) ApiDeleteAccessTokenRequest { return ApiDeleteAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -931,7 +931,7 @@ type ApiDeleteDestinationRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string destinationId string } @@ -952,7 +952,7 @@ Deletes the given Destination. @param destinationId The Destination UUID. @return ApiDeleteDestinationRequest */ -func (a *DefaultAPIService) DeleteDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiDeleteDestinationRequest { +func (a *DefaultAPIService) DeleteDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, destinationId string) ApiDeleteDestinationRequest { return ApiDeleteDestinationRequest{ ApiService: a, ctx: ctx, @@ -1078,7 +1078,7 @@ type ApiDeleteTelemetryRouterRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string force *bool } @@ -1104,7 +1104,7 @@ Deletes the given Telemetry Router. @param telemetryRouterId The Telemetry Router UUID. @return ApiDeleteTelemetryRouterRequest */ -func (a *DefaultAPIService) DeleteTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiDeleteTelemetryRouterRequest { +func (a *DefaultAPIService) DeleteTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiDeleteTelemetryRouterRequest { return ApiDeleteTelemetryRouterRequest{ ApiService: a, ctx: ctx, @@ -1235,7 +1235,7 @@ type ApiGetAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string accessTokenId string } @@ -1256,7 +1256,7 @@ Get an access token for the given Telemetry Router by its ID. @param accessTokenId The Access Token UUID. @return ApiGetAccessTokenRequest */ -func (a *DefaultAPIService) GetAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiGetAccessTokenRequest { +func (a *DefaultAPIService) GetAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, accessTokenId string) ApiGetAccessTokenRequest { return ApiGetAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -1395,7 +1395,7 @@ type ApiGetDestinationRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string destinationId string } @@ -1416,7 +1416,7 @@ Returns the details for the given destination. @param destinationId The Destination UUID. @return ApiGetDestinationRequest */ -func (a *DefaultAPIService) GetDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiGetDestinationRequest { +func (a *DefaultAPIService) GetDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, destinationId string) ApiGetDestinationRequest { return ApiGetDestinationRequest{ ApiService: a, ctx: ctx, @@ -1544,7 +1544,7 @@ type ApiGetTelemetryRouterRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string } @@ -1563,7 +1563,7 @@ Returns the details for the given Telemetry Router. @param telemetryRouterId The Telemetry Router UUID. @return ApiGetTelemetryRouterRequest */ -func (a *DefaultAPIService) GetTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiGetTelemetryRouterRequest { +func (a *DefaultAPIService) GetTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiGetTelemetryRouterRequest { return ApiGetTelemetryRouterRequest{ ApiService: a, ctx: ctx, @@ -1700,7 +1700,7 @@ type ApiListAccessTokensRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string pageToken *string pageSize *int32 @@ -1733,7 +1733,7 @@ Get all access tokens for a telemetry router. @param telemetryRouterId The Telemetry Router UUID. @return ApiListAccessTokensRequest */ -func (a *DefaultAPIService) ListAccessTokens(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiListAccessTokensRequest { +func (a *DefaultAPIService) ListAccessTokens(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiListAccessTokensRequest { return ApiListAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -1880,7 +1880,7 @@ type ApiListDestinationsRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string pageToken *string pageSize *int32 @@ -1913,7 +1913,7 @@ Returns a list of all destinations of a specific Telemetry Router within a proje @param telemetryRouterId The Telemetry Router UUID. @return ApiListDestinationsRequest */ -func (a *DefaultAPIService) ListDestinations(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiListDestinationsRequest { +func (a *DefaultAPIService) ListDestinations(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiListDestinationsRequest { return ApiListDestinationsRequest{ ApiService: a, ctx: ctx, @@ -2049,7 +2049,7 @@ type ApiListTelemetryRoutersRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter pageToken *string pageSize *int32 } @@ -2080,7 +2080,7 @@ Returns a list of all Telemetry Routers within the project. @param regionId The STACKIT region name the resource is located in. @return ApiListTelemetryRoutersRequest */ -func (a *DefaultAPIService) ListTelemetryRouters(ctx context.Context, projectId string, regionId string) ApiListTelemetryRoutersRequest { +func (a *DefaultAPIService) ListTelemetryRouters(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter) ApiListTelemetryRoutersRequest { return ApiListTelemetryRoutersRequest{ ApiService: a, ctx: ctx, @@ -2214,7 +2214,7 @@ type ApiUpdateAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string accessTokenId string updateAccessTokenPayload *UpdateAccessTokenPayload @@ -2241,7 +2241,7 @@ Update an existing access token for the given Telemetry Router by its ID. @param accessTokenId The Access Token UUID. @return ApiUpdateAccessTokenRequest */ -func (a *DefaultAPIService) UpdateAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiUpdateAccessTokenRequest { +func (a *DefaultAPIService) UpdateAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, accessTokenId string) ApiUpdateAccessTokenRequest { return ApiUpdateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -2385,7 +2385,7 @@ type ApiUpdateDestinationRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string destinationId string updateDestinationPayload *UpdateDestinationPayload @@ -2412,7 +2412,7 @@ Updates the given destination. @param destinationId The Destination UUID. @return ApiUpdateDestinationRequest */ -func (a *DefaultAPIService) UpdateDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiUpdateDestinationRequest { +func (a *DefaultAPIService) UpdateDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, destinationId string) ApiUpdateDestinationRequest { return ApiUpdateDestinationRequest{ ApiService: a, ctx: ctx, @@ -2556,7 +2556,7 @@ type ApiUpdateTelemetryRouterRequest struct { ctx context.Context ApiService DefaultAPI projectId string - regionId string + regionId ListTelemetryRoutersRegionIdParameter telemetryRouterId string updateTelemetryRouterPayload *UpdateTelemetryRouterPayload } @@ -2581,7 +2581,7 @@ Updates the given Telemetry Router. @param telemetryRouterId The Telemetry Router UUID. @return ApiUpdateTelemetryRouterRequest */ -func (a *DefaultAPIService) UpdateTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiUpdateTelemetryRouterRequest { +func (a *DefaultAPIService) UpdateTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiUpdateTelemetryRouterRequest { return ApiUpdateTelemetryRouterRequest{ ApiService: a, ctx: ctx, diff --git a/services/telemetryrouter/v1betaapi/api_default_mock.go b/services/telemetryrouter/v1betaapi/api_default_mock.go index aa5c11d5c..894786bd9 100644 --- a/services/telemetryrouter/v1betaapi/api_default_mock.go +++ b/services/telemetryrouter/v1betaapi/api_default_mock.go @@ -52,7 +52,7 @@ type DefaultAPIServiceMock struct { UpdateTelemetryRouterExecuteMock *func(r ApiUpdateTelemetryRouterRequest) (*TelemetryRouterResponse, error) } -func (a DefaultAPIServiceMock) CreateAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiCreateAccessTokenRequest { +func (a DefaultAPIServiceMock) CreateAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiCreateAccessTokenRequest { return ApiCreateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -72,7 +72,7 @@ func (a DefaultAPIServiceMock) CreateAccessTokenExecute(r ApiCreateAccessTokenRe return (*a.CreateAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiCreateDestinationRequest { +func (a DefaultAPIServiceMock) CreateDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiCreateDestinationRequest { return ApiCreateDestinationRequest{ ApiService: a, ctx: ctx, @@ -92,7 +92,7 @@ func (a DefaultAPIServiceMock) CreateDestinationExecute(r ApiCreateDestinationRe return (*a.CreateDestinationExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateTelemetryRouter(ctx context.Context, projectId string, regionId string) ApiCreateTelemetryRouterRequest { +func (a DefaultAPIServiceMock) CreateTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter) ApiCreateTelemetryRouterRequest { return ApiCreateTelemetryRouterRequest{ ApiService: a, ctx: ctx, @@ -111,7 +111,7 @@ func (a DefaultAPIServiceMock) CreateTelemetryRouterExecute(r ApiCreateTelemetry return (*a.CreateTelemetryRouterExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiDeleteAccessTokenRequest { +func (a DefaultAPIServiceMock) DeleteAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, accessTokenId string) ApiDeleteAccessTokenRequest { return ApiDeleteAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -131,7 +131,7 @@ func (a DefaultAPIServiceMock) DeleteAccessTokenExecute(r ApiDeleteAccessTokenRe return (*a.DeleteAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiDeleteDestinationRequest { +func (a DefaultAPIServiceMock) DeleteDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, destinationId string) ApiDeleteDestinationRequest { return ApiDeleteDestinationRequest{ ApiService: a, ctx: ctx, @@ -151,7 +151,7 @@ func (a DefaultAPIServiceMock) DeleteDestinationExecute(r ApiDeleteDestinationRe return (*a.DeleteDestinationExecuteMock)(r) } -func (a DefaultAPIServiceMock) DeleteTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiDeleteTelemetryRouterRequest { +func (a DefaultAPIServiceMock) DeleteTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiDeleteTelemetryRouterRequest { return ApiDeleteTelemetryRouterRequest{ ApiService: a, ctx: ctx, @@ -170,7 +170,7 @@ func (a DefaultAPIServiceMock) DeleteTelemetryRouterExecute(r ApiDeleteTelemetry return (*a.DeleteTelemetryRouterExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiGetAccessTokenRequest { +func (a DefaultAPIServiceMock) GetAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, accessTokenId string) ApiGetAccessTokenRequest { return ApiGetAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -191,7 +191,7 @@ func (a DefaultAPIServiceMock) GetAccessTokenExecute(r ApiGetAccessTokenRequest) return (*a.GetAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiGetDestinationRequest { +func (a DefaultAPIServiceMock) GetDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, destinationId string) ApiGetDestinationRequest { return ApiGetDestinationRequest{ ApiService: a, ctx: ctx, @@ -212,7 +212,7 @@ func (a DefaultAPIServiceMock) GetDestinationExecute(r ApiGetDestinationRequest) return (*a.GetDestinationExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiGetTelemetryRouterRequest { +func (a DefaultAPIServiceMock) GetTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiGetTelemetryRouterRequest { return ApiGetTelemetryRouterRequest{ ApiService: a, ctx: ctx, @@ -232,7 +232,7 @@ func (a DefaultAPIServiceMock) GetTelemetryRouterExecute(r ApiGetTelemetryRouter return (*a.GetTelemetryRouterExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListAccessTokens(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiListAccessTokensRequest { +func (a DefaultAPIServiceMock) ListAccessTokens(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiListAccessTokensRequest { return ApiListAccessTokensRequest{ ApiService: a, ctx: ctx, @@ -252,7 +252,7 @@ func (a DefaultAPIServiceMock) ListAccessTokensExecute(r ApiListAccessTokensRequ return (*a.ListAccessTokensExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListDestinations(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiListDestinationsRequest { +func (a DefaultAPIServiceMock) ListDestinations(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiListDestinationsRequest { return ApiListDestinationsRequest{ ApiService: a, ctx: ctx, @@ -272,7 +272,7 @@ func (a DefaultAPIServiceMock) ListDestinationsExecute(r ApiListDestinationsRequ return (*a.ListDestinationsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListTelemetryRouters(ctx context.Context, projectId string, regionId string) ApiListTelemetryRoutersRequest { +func (a DefaultAPIServiceMock) ListTelemetryRouters(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter) ApiListTelemetryRoutersRequest { return ApiListTelemetryRoutersRequest{ ApiService: a, ctx: ctx, @@ -291,7 +291,7 @@ func (a DefaultAPIServiceMock) ListTelemetryRoutersExecute(r ApiListTelemetryRou return (*a.ListTelemetryRoutersExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiUpdateAccessTokenRequest { +func (a DefaultAPIServiceMock) UpdateAccessToken(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, accessTokenId string) ApiUpdateAccessTokenRequest { return ApiUpdateAccessTokenRequest{ ApiService: a, ctx: ctx, @@ -312,7 +312,7 @@ func (a DefaultAPIServiceMock) UpdateAccessTokenExecute(r ApiUpdateAccessTokenRe return (*a.UpdateAccessTokenExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiUpdateDestinationRequest { +func (a DefaultAPIServiceMock) UpdateDestination(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string, destinationId string) ApiUpdateDestinationRequest { return ApiUpdateDestinationRequest{ ApiService: a, ctx: ctx, @@ -333,7 +333,7 @@ func (a DefaultAPIServiceMock) UpdateDestinationExecute(r ApiUpdateDestinationRe return (*a.UpdateDestinationExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiUpdateTelemetryRouterRequest { +func (a DefaultAPIServiceMock) UpdateTelemetryRouter(ctx context.Context, projectId string, regionId ListTelemetryRoutersRegionIdParameter, telemetryRouterId string) ApiUpdateTelemetryRouterRequest { return ApiUpdateTelemetryRouterRequest{ ApiService: a, ctx: ctx, diff --git a/services/telemetryrouter/v1betaapi/model_access_token_base_response.go b/services/telemetryrouter/v1betaapi/model_access_token_base_response.go index cb74d1086..535c02702 100644 --- a/services/telemetryrouter/v1betaapi/model_access_token_base_response.go +++ b/services/telemetryrouter/v1betaapi/model_access_token_base_response.go @@ -30,8 +30,8 @@ type AccessTokenBaseResponse struct { // The date and time until the access token is valid to (inclusively). ExpirationTime NullableTime `json:"expirationTime,omitempty"` // An auto generated unique id which identifies the access token. - Id string `json:"id"` - Status string `json:"status"` + Id string `json:"id"` + Status AccessTokenBaseResponseStatus `json:"status"` AdditionalProperties map[string]interface{} } @@ -41,7 +41,7 @@ type _AccessTokenBaseResponse AccessTokenBaseResponse // 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 NewAccessTokenBaseResponse(creatorId string, displayName string, id string, status string) *AccessTokenBaseResponse { +func NewAccessTokenBaseResponse(creatorId string, displayName string, id string, status AccessTokenBaseResponseStatus) *AccessTokenBaseResponse { this := AccessTokenBaseResponse{} this.CreatorId = creatorId this.DisplayName = displayName @@ -206,9 +206,9 @@ func (o *AccessTokenBaseResponse) SetId(v string) { } // GetStatus returns the Status field value -func (o *AccessTokenBaseResponse) GetStatus() string { +func (o *AccessTokenBaseResponse) GetStatus() AccessTokenBaseResponseStatus { if o == nil { - var ret string + var ret AccessTokenBaseResponseStatus return ret } @@ -217,7 +217,7 @@ func (o *AccessTokenBaseResponse) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *AccessTokenBaseResponse) GetStatusOk() (*string, bool) { +func (o *AccessTokenBaseResponse) GetStatusOk() (*AccessTokenBaseResponseStatus, bool) { if o == nil { return nil, false } @@ -225,7 +225,7 @@ func (o *AccessTokenBaseResponse) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *AccessTokenBaseResponse) SetStatus(v string) { +func (o *AccessTokenBaseResponse) SetStatus(v AccessTokenBaseResponseStatus) { o.Status = v } diff --git a/services/telemetryrouter/v1betaapi/model_access_token_base_response_status.go b/services/telemetryrouter/v1betaapi/model_access_token_base_response_status.go new file mode 100644 index 000000000..fd18e8e52 --- /dev/null +++ b/services/telemetryrouter/v1betaapi/model_access_token_base_response_status.go @@ -0,0 +1,115 @@ +/* +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// AccessTokenBaseResponseStatus the model 'AccessTokenBaseResponseStatus' +type AccessTokenBaseResponseStatus string + +// List of accessTokenBaseResponse_status +const ( + ACCESSTOKENBASERESPONSESTATUS_ACTIVE AccessTokenBaseResponseStatus = "active" + ACCESSTOKENBASERESPONSESTATUS_EXPIRED AccessTokenBaseResponseStatus = "expired" + ACCESSTOKENBASERESPONSESTATUS_DELETING AccessTokenBaseResponseStatus = "deleting" + ACCESSTOKENBASERESPONSESTATUS_UNKNOWN_DEFAULT_OPEN_API AccessTokenBaseResponseStatus = "unknown_default_open_api" +) + +// All allowed values of AccessTokenBaseResponseStatus enum +var AllowedAccessTokenBaseResponseStatusEnumValues = []AccessTokenBaseResponseStatus{ + "active", + "expired", + "deleting", + "unknown_default_open_api", +} + +func (v *AccessTokenBaseResponseStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AccessTokenBaseResponseStatus(value) + for _, existing := range AllowedAccessTokenBaseResponseStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ACCESSTOKENBASERESPONSESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAccessTokenBaseResponseStatusFromValue returns a pointer to a valid AccessTokenBaseResponseStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAccessTokenBaseResponseStatusFromValue(v string) (*AccessTokenBaseResponseStatus, error) { + ev := AccessTokenBaseResponseStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AccessTokenBaseResponseStatus: valid values are %v", v, AllowedAccessTokenBaseResponseStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AccessTokenBaseResponseStatus) IsValid() bool { + for _, existing := range AllowedAccessTokenBaseResponseStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to accessTokenBaseResponse_status value +func (v AccessTokenBaseResponseStatus) Ptr() *AccessTokenBaseResponseStatus { + return &v +} + +type NullableAccessTokenBaseResponseStatus struct { + value *AccessTokenBaseResponseStatus + isSet bool +} + +func (v NullableAccessTokenBaseResponseStatus) Get() *AccessTokenBaseResponseStatus { + return v.value +} + +func (v *NullableAccessTokenBaseResponseStatus) Set(val *AccessTokenBaseResponseStatus) { + v.value = val + v.isSet = true +} + +func (v NullableAccessTokenBaseResponseStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessTokenBaseResponseStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessTokenBaseResponseStatus(val *AccessTokenBaseResponseStatus) *NullableAccessTokenBaseResponseStatus { + return &NullableAccessTokenBaseResponseStatus{value: val, isSet: true} +} + +func (v NullableAccessTokenBaseResponseStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessTokenBaseResponseStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/telemetryrouter/v1betaapi/model_create_access_token_response.go b/services/telemetryrouter/v1betaapi/model_create_access_token_response.go index 29868b8b7..a48a05d17 100644 --- a/services/telemetryrouter/v1betaapi/model_create_access_token_response.go +++ b/services/telemetryrouter/v1betaapi/model_create_access_token_response.go @@ -30,8 +30,8 @@ type CreateAccessTokenResponse struct { // The date and time until the access token is valid to (inclusively). ExpirationTime NullableTime `json:"expirationTime,omitempty"` // An auto generated unique id which identifies the access token. - Id string `json:"id"` - Status string `json:"status"` + Id string `json:"id"` + Status AccessTokenBaseResponseStatus `json:"status"` // The generated access token. AccessToken string `json:"accessToken"` AdditionalProperties map[string]interface{} @@ -43,7 +43,7 @@ type _CreateAccessTokenResponse CreateAccessTokenResponse // 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 NewCreateAccessTokenResponse(creatorId string, displayName string, id string, status string, accessToken string) *CreateAccessTokenResponse { +func NewCreateAccessTokenResponse(creatorId string, displayName string, id string, status AccessTokenBaseResponseStatus, accessToken string) *CreateAccessTokenResponse { this := CreateAccessTokenResponse{} this.CreatorId = creatorId this.DisplayName = displayName @@ -209,9 +209,9 @@ func (o *CreateAccessTokenResponse) SetId(v string) { } // GetStatus returns the Status field value -func (o *CreateAccessTokenResponse) GetStatus() string { +func (o *CreateAccessTokenResponse) GetStatus() AccessTokenBaseResponseStatus { if o == nil { - var ret string + var ret AccessTokenBaseResponseStatus return ret } @@ -220,7 +220,7 @@ func (o *CreateAccessTokenResponse) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *CreateAccessTokenResponse) GetStatusOk() (*string, bool) { +func (o *CreateAccessTokenResponse) GetStatusOk() (*AccessTokenBaseResponseStatus, bool) { if o == nil { return nil, false } @@ -228,7 +228,7 @@ func (o *CreateAccessTokenResponse) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *CreateAccessTokenResponse) SetStatus(v string) { +func (o *CreateAccessTokenResponse) SetStatus(v AccessTokenBaseResponseStatus) { o.Status = v } diff --git a/services/telemetryrouter/v1betaapi/model_destination_response.go b/services/telemetryrouter/v1betaapi/model_destination_response.go index 14bc021a2..1101ef2bf 100644 --- a/services/telemetryrouter/v1betaapi/model_destination_response.go +++ b/services/telemetryrouter/v1betaapi/model_destination_response.go @@ -23,17 +23,15 @@ var _ MappedNullable = &DestinationResponse{} type DestinationResponse struct { Config DestinationConfig `json:"config"` // The point in time the resource was created. - CreationTime time.Time `json:"creationTime"` - // The credential type for the resource. - CredentialType string `json:"credentialType"` + CreationTime time.Time `json:"creationTime"` + CredentialType DestinationResponseCredentialType `json:"credentialType"` // The description is a longer text chosen by the user to provide more context for the resource. Description *string `json:"description,omitempty"` // The display name is a short name chosen by the user to identify the resource. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\\\-]*$"` // A auto generated unique id which identifies the resource. - Id string `json:"id"` - // The current status of the resource. - Status string `json:"status"` + Id string `json:"id"` + Status DestinationResponseStatus `json:"status"` AdditionalProperties map[string]interface{} } @@ -43,7 +41,7 @@ type _DestinationResponse DestinationResponse // 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 NewDestinationResponse(config DestinationConfig, creationTime time.Time, credentialType string, displayName string, id string, status string) *DestinationResponse { +func NewDestinationResponse(config DestinationConfig, creationTime time.Time, credentialType DestinationResponseCredentialType, displayName string, id string, status DestinationResponseStatus) *DestinationResponse { this := DestinationResponse{} this.Config = config this.CreationTime = creationTime @@ -111,9 +109,9 @@ func (o *DestinationResponse) SetCreationTime(v time.Time) { } // GetCredentialType returns the CredentialType field value -func (o *DestinationResponse) GetCredentialType() string { +func (o *DestinationResponse) GetCredentialType() DestinationResponseCredentialType { if o == nil { - var ret string + var ret DestinationResponseCredentialType return ret } @@ -122,7 +120,7 @@ func (o *DestinationResponse) GetCredentialType() string { // GetCredentialTypeOk returns a tuple with the CredentialType field value // and a boolean to check if the value has been set. -func (o *DestinationResponse) GetCredentialTypeOk() (*string, bool) { +func (o *DestinationResponse) GetCredentialTypeOk() (*DestinationResponseCredentialType, bool) { if o == nil { return nil, false } @@ -130,7 +128,7 @@ func (o *DestinationResponse) GetCredentialTypeOk() (*string, bool) { } // SetCredentialType sets field value -func (o *DestinationResponse) SetCredentialType(v string) { +func (o *DestinationResponse) SetCredentialType(v DestinationResponseCredentialType) { o.CredentialType = v } @@ -215,9 +213,9 @@ func (o *DestinationResponse) SetId(v string) { } // GetStatus returns the Status field value -func (o *DestinationResponse) GetStatus() string { +func (o *DestinationResponse) GetStatus() DestinationResponseStatus { if o == nil { - var ret string + var ret DestinationResponseStatus return ret } @@ -226,7 +224,7 @@ func (o *DestinationResponse) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *DestinationResponse) GetStatusOk() (*string, bool) { +func (o *DestinationResponse) GetStatusOk() (*DestinationResponseStatus, bool) { if o == nil { return nil, false } @@ -234,7 +232,7 @@ func (o *DestinationResponse) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *DestinationResponse) SetStatus(v string) { +func (o *DestinationResponse) SetStatus(v DestinationResponseStatus) { o.Status = v } diff --git a/services/telemetryrouter/v1betaapi/model_destination_response_credential_type.go b/services/telemetryrouter/v1betaapi/model_destination_response_credential_type.go new file mode 100644 index 000000000..d8950268c --- /dev/null +++ b/services/telemetryrouter/v1betaapi/model_destination_response_credential_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// DestinationResponseCredentialType The credential type for the resource. +type DestinationResponseCredentialType string + +// List of destinationResponse_credentialType +const ( + DESTINATIONRESPONSECREDENTIALTYPE_BEARER_TOKEN DestinationResponseCredentialType = "bearerToken" + DESTINATIONRESPONSECREDENTIALTYPE_BASIC_AUTH DestinationResponseCredentialType = "basicAuth" + DESTINATIONRESPONSECREDENTIALTYPE_ACCESS_KEY DestinationResponseCredentialType = "accessKey" + DESTINATIONRESPONSECREDENTIALTYPE_UNKNOWN_DEFAULT_OPEN_API DestinationResponseCredentialType = "unknown_default_open_api" +) + +// All allowed values of DestinationResponseCredentialType enum +var AllowedDestinationResponseCredentialTypeEnumValues = []DestinationResponseCredentialType{ + "bearerToken", + "basicAuth", + "accessKey", + "unknown_default_open_api", +} + +func (v *DestinationResponseCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DestinationResponseCredentialType(value) + for _, existing := range AllowedDestinationResponseCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DESTINATIONRESPONSECREDENTIALTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDestinationResponseCredentialTypeFromValue returns a pointer to a valid DestinationResponseCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDestinationResponseCredentialTypeFromValue(v string) (*DestinationResponseCredentialType, error) { + ev := DestinationResponseCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DestinationResponseCredentialType: valid values are %v", v, AllowedDestinationResponseCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DestinationResponseCredentialType) IsValid() bool { + for _, existing := range AllowedDestinationResponseCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to destinationResponse_credentialType value +func (v DestinationResponseCredentialType) Ptr() *DestinationResponseCredentialType { + return &v +} + +type NullableDestinationResponseCredentialType struct { + value *DestinationResponseCredentialType + isSet bool +} + +func (v NullableDestinationResponseCredentialType) Get() *DestinationResponseCredentialType { + return v.value +} + +func (v *NullableDestinationResponseCredentialType) Set(val *DestinationResponseCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableDestinationResponseCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableDestinationResponseCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDestinationResponseCredentialType(val *DestinationResponseCredentialType) *NullableDestinationResponseCredentialType { + return &NullableDestinationResponseCredentialType{value: val, isSet: true} +} + +func (v NullableDestinationResponseCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDestinationResponseCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/telemetryrouter/v1betaapi/model_destination_response_status.go b/services/telemetryrouter/v1betaapi/model_destination_response_status.go new file mode 100644 index 000000000..305ee2ca8 --- /dev/null +++ b/services/telemetryrouter/v1betaapi/model_destination_response_status.go @@ -0,0 +1,115 @@ +/* +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// DestinationResponseStatus The current status of the resource. +type DestinationResponseStatus string + +// List of destinationResponse_status +const ( + DESTINATIONRESPONSESTATUS_RECONCILING DestinationResponseStatus = "reconciling" + DESTINATIONRESPONSESTATUS_ACTIVE DestinationResponseStatus = "active" + DESTINATIONRESPONSESTATUS_DELETING DestinationResponseStatus = "deleting" + DESTINATIONRESPONSESTATUS_UNKNOWN_DEFAULT_OPEN_API DestinationResponseStatus = "unknown_default_open_api" +) + +// All allowed values of DestinationResponseStatus enum +var AllowedDestinationResponseStatusEnumValues = []DestinationResponseStatus{ + "reconciling", + "active", + "deleting", + "unknown_default_open_api", +} + +func (v *DestinationResponseStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DestinationResponseStatus(value) + for _, existing := range AllowedDestinationResponseStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DESTINATIONRESPONSESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDestinationResponseStatusFromValue returns a pointer to a valid DestinationResponseStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDestinationResponseStatusFromValue(v string) (*DestinationResponseStatus, error) { + ev := DestinationResponseStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DestinationResponseStatus: valid values are %v", v, AllowedDestinationResponseStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DestinationResponseStatus) IsValid() bool { + for _, existing := range AllowedDestinationResponseStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to destinationResponse_status value +func (v DestinationResponseStatus) Ptr() *DestinationResponseStatus { + return &v +} + +type NullableDestinationResponseStatus struct { + value *DestinationResponseStatus + isSet bool +} + +func (v NullableDestinationResponseStatus) Get() *DestinationResponseStatus { + return v.value +} + +func (v *NullableDestinationResponseStatus) Set(val *DestinationResponseStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDestinationResponseStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDestinationResponseStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDestinationResponseStatus(val *DestinationResponseStatus) *NullableDestinationResponseStatus { + return &NullableDestinationResponseStatus{value: val, isSet: true} +} + +func (v NullableDestinationResponseStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDestinationResponseStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/telemetryrouter/v1betaapi/model_get_access_token_response.go b/services/telemetryrouter/v1betaapi/model_get_access_token_response.go index f1fe8c30c..3d0abe091 100644 --- a/services/telemetryrouter/v1betaapi/model_get_access_token_response.go +++ b/services/telemetryrouter/v1betaapi/model_get_access_token_response.go @@ -30,8 +30,8 @@ type GetAccessTokenResponse struct { // The date and time until the access token is valid to (inclusively). ExpirationTime NullableTime `json:"expirationTime,omitempty"` // An auto generated unique id which identifies the access token. - Id string `json:"id"` - Status string `json:"status"` + Id string `json:"id"` + Status AccessTokenBaseResponseStatus `json:"status"` AdditionalProperties map[string]interface{} } @@ -41,7 +41,7 @@ type _GetAccessTokenResponse GetAccessTokenResponse // 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 NewGetAccessTokenResponse(creatorId string, displayName string, id string, status string) *GetAccessTokenResponse { +func NewGetAccessTokenResponse(creatorId string, displayName string, id string, status AccessTokenBaseResponseStatus) *GetAccessTokenResponse { this := GetAccessTokenResponse{} this.CreatorId = creatorId this.DisplayName = displayName @@ -206,9 +206,9 @@ func (o *GetAccessTokenResponse) SetId(v string) { } // GetStatus returns the Status field value -func (o *GetAccessTokenResponse) GetStatus() string { +func (o *GetAccessTokenResponse) GetStatus() AccessTokenBaseResponseStatus { if o == nil { - var ret string + var ret AccessTokenBaseResponseStatus return ret } @@ -217,7 +217,7 @@ func (o *GetAccessTokenResponse) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *GetAccessTokenResponse) GetStatusOk() (*string, bool) { +func (o *GetAccessTokenResponse) GetStatusOk() (*AccessTokenBaseResponseStatus, bool) { if o == nil { return nil, false } @@ -225,7 +225,7 @@ func (o *GetAccessTokenResponse) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *GetAccessTokenResponse) SetStatus(v string) { +func (o *GetAccessTokenResponse) SetStatus(v AccessTokenBaseResponseStatus) { o.Status = v } diff --git a/services/telemetryrouter/v1betaapi/model_list_telemetry_routers_region_id_parameter.go b/services/telemetryrouter/v1betaapi/model_list_telemetry_routers_region_id_parameter.go new file mode 100644 index 000000000..fb108c3d8 --- /dev/null +++ b/services/telemetryrouter/v1betaapi/model_list_telemetry_routers_region_id_parameter.go @@ -0,0 +1,113 @@ +/* +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ListTelemetryRoutersRegionIdParameter the model 'ListTelemetryRoutersRegionIdParameter' +type ListTelemetryRoutersRegionIdParameter string + +// List of list_telemetry_routers_regionId_parameter +const ( + LISTTELEMETRYROUTERSREGIONIDPARAMETER_EU01 ListTelemetryRoutersRegionIdParameter = "eu01" + LISTTELEMETRYROUTERSREGIONIDPARAMETER_EU02 ListTelemetryRoutersRegionIdParameter = "eu02" + LISTTELEMETRYROUTERSREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListTelemetryRoutersRegionIdParameter = "unknown_default_open_api" +) + +// All allowed values of ListTelemetryRoutersRegionIdParameter enum +var AllowedListTelemetryRoutersRegionIdParameterEnumValues = []ListTelemetryRoutersRegionIdParameter{ + "eu01", + "eu02", + "unknown_default_open_api", +} + +func (v *ListTelemetryRoutersRegionIdParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ListTelemetryRoutersRegionIdParameter(value) + for _, existing := range AllowedListTelemetryRoutersRegionIdParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LISTTELEMETRYROUTERSREGIONIDPARAMETER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewListTelemetryRoutersRegionIdParameterFromValue returns a pointer to a valid ListTelemetryRoutersRegionIdParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewListTelemetryRoutersRegionIdParameterFromValue(v string) (*ListTelemetryRoutersRegionIdParameter, error) { + ev := ListTelemetryRoutersRegionIdParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ListTelemetryRoutersRegionIdParameter: valid values are %v", v, AllowedListTelemetryRoutersRegionIdParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ListTelemetryRoutersRegionIdParameter) IsValid() bool { + for _, existing := range AllowedListTelemetryRoutersRegionIdParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to list_telemetry_routers_regionId_parameter value +func (v ListTelemetryRoutersRegionIdParameter) Ptr() *ListTelemetryRoutersRegionIdParameter { + return &v +} + +type NullableListTelemetryRoutersRegionIdParameter struct { + value *ListTelemetryRoutersRegionIdParameter + isSet bool +} + +func (v NullableListTelemetryRoutersRegionIdParameter) Get() *ListTelemetryRoutersRegionIdParameter { + return v.value +} + +func (v *NullableListTelemetryRoutersRegionIdParameter) Set(val *ListTelemetryRoutersRegionIdParameter) { + v.value = val + v.isSet = true +} + +func (v NullableListTelemetryRoutersRegionIdParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableListTelemetryRoutersRegionIdParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListTelemetryRoutersRegionIdParameter(val *ListTelemetryRoutersRegionIdParameter) *NullableListTelemetryRoutersRegionIdParameter { + return &NullableListTelemetryRoutersRegionIdParameter{value: val, isSet: true} +} + +func (v NullableListTelemetryRoutersRegionIdParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListTelemetryRoutersRegionIdParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/telemetryrouter/v1betaapi/model_telemetry_router_response.go b/services/telemetryrouter/v1betaapi/model_telemetry_router_response.go index 759f0023f..06d180568 100644 --- a/services/telemetryrouter/v1betaapi/model_telemetry_router_response.go +++ b/services/telemetryrouter/v1betaapi/model_telemetry_router_response.go @@ -29,9 +29,8 @@ type TelemetryRouterResponse struct { DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\\\-]*$"` Filter *ConfigFilter `json:"filter,omitempty"` // A auto generated unique id which identifies the resource. - Id string `json:"id"` - // The current status of the resource. - Status string `json:"status"` + Id string `json:"id"` + Status TelemetryRouterResponseStatus `json:"status"` // The URI for reaching the resource. Uri string `json:"uri"` AdditionalProperties map[string]interface{} @@ -43,7 +42,7 @@ type _TelemetryRouterResponse TelemetryRouterResponse // 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 NewTelemetryRouterResponse(creationTime time.Time, displayName string, id string, status string, uri string) *TelemetryRouterResponse { +func NewTelemetryRouterResponse(creationTime time.Time, displayName string, id string, status TelemetryRouterResponseStatus, uri string) *TelemetryRouterResponse { this := TelemetryRouterResponse{} this.CreationTime = creationTime this.DisplayName = displayName @@ -198,9 +197,9 @@ func (o *TelemetryRouterResponse) SetId(v string) { } // GetStatus returns the Status field value -func (o *TelemetryRouterResponse) GetStatus() string { +func (o *TelemetryRouterResponse) GetStatus() TelemetryRouterResponseStatus { if o == nil { - var ret string + var ret TelemetryRouterResponseStatus return ret } @@ -209,7 +208,7 @@ func (o *TelemetryRouterResponse) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *TelemetryRouterResponse) GetStatusOk() (*string, bool) { +func (o *TelemetryRouterResponse) GetStatusOk() (*TelemetryRouterResponseStatus, bool) { if o == nil { return nil, false } @@ -217,7 +216,7 @@ func (o *TelemetryRouterResponse) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *TelemetryRouterResponse) SetStatus(v string) { +func (o *TelemetryRouterResponse) SetStatus(v TelemetryRouterResponseStatus) { o.Status = v } diff --git a/services/telemetryrouter/v1betaapi/model_telemetry_router_response_status.go b/services/telemetryrouter/v1betaapi/model_telemetry_router_response_status.go new file mode 100644 index 000000000..046f1aa93 --- /dev/null +++ b/services/telemetryrouter/v1betaapi/model_telemetry_router_response_status.go @@ -0,0 +1,115 @@ +/* +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// TelemetryRouterResponseStatus The current status of the resource. +type TelemetryRouterResponseStatus string + +// List of telemetryRouterResponse_status +const ( + TELEMETRYROUTERRESPONSESTATUS_RECONCILING TelemetryRouterResponseStatus = "reconciling" + TELEMETRYROUTERRESPONSESTATUS_ACTIVE TelemetryRouterResponseStatus = "active" + TELEMETRYROUTERRESPONSESTATUS_DELETING TelemetryRouterResponseStatus = "deleting" + TELEMETRYROUTERRESPONSESTATUS_UNKNOWN_DEFAULT_OPEN_API TelemetryRouterResponseStatus = "unknown_default_open_api" +) + +// All allowed values of TelemetryRouterResponseStatus enum +var AllowedTelemetryRouterResponseStatusEnumValues = []TelemetryRouterResponseStatus{ + "reconciling", + "active", + "deleting", + "unknown_default_open_api", +} + +func (v *TelemetryRouterResponseStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TelemetryRouterResponseStatus(value) + for _, existing := range AllowedTelemetryRouterResponseStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TELEMETRYROUTERRESPONSESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTelemetryRouterResponseStatusFromValue returns a pointer to a valid TelemetryRouterResponseStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTelemetryRouterResponseStatusFromValue(v string) (*TelemetryRouterResponseStatus, error) { + ev := TelemetryRouterResponseStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TelemetryRouterResponseStatus: valid values are %v", v, AllowedTelemetryRouterResponseStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TelemetryRouterResponseStatus) IsValid() bool { + for _, existing := range AllowedTelemetryRouterResponseStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to telemetryRouterResponse_status value +func (v TelemetryRouterResponseStatus) Ptr() *TelemetryRouterResponseStatus { + return &v +} + +type NullableTelemetryRouterResponseStatus struct { + value *TelemetryRouterResponseStatus + isSet bool +} + +func (v NullableTelemetryRouterResponseStatus) Get() *TelemetryRouterResponseStatus { + return v.value +} + +func (v *NullableTelemetryRouterResponseStatus) Set(val *TelemetryRouterResponseStatus) { + v.value = val + v.isSet = true +} + +func (v NullableTelemetryRouterResponseStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableTelemetryRouterResponseStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelemetryRouterResponseStatus(val *TelemetryRouterResponseStatus) *NullableTelemetryRouterResponseStatus { + return &NullableTelemetryRouterResponseStatus{value: val, isSet: true} +} + +func (v NullableTelemetryRouterResponseStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelemetryRouterResponseStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/telemetryrouter/v1betaapi/model_update_access_token_response.go b/services/telemetryrouter/v1betaapi/model_update_access_token_response.go index a0ab9c366..5496beb98 100644 --- a/services/telemetryrouter/v1betaapi/model_update_access_token_response.go +++ b/services/telemetryrouter/v1betaapi/model_update_access_token_response.go @@ -30,8 +30,8 @@ type UpdateAccessTokenResponse struct { // The date and time until the access token is valid to (inclusively). ExpirationTime NullableTime `json:"expirationTime,omitempty"` // An auto generated unique id which identifies the access token. - Id string `json:"id"` - Status string `json:"status"` + Id string `json:"id"` + Status AccessTokenBaseResponseStatus `json:"status"` AdditionalProperties map[string]interface{} } @@ -41,7 +41,7 @@ type _UpdateAccessTokenResponse UpdateAccessTokenResponse // 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 NewUpdateAccessTokenResponse(creatorId string, displayName string, id string, status string) *UpdateAccessTokenResponse { +func NewUpdateAccessTokenResponse(creatorId string, displayName string, id string, status AccessTokenBaseResponseStatus) *UpdateAccessTokenResponse { this := UpdateAccessTokenResponse{} this.CreatorId = creatorId this.DisplayName = displayName @@ -206,9 +206,9 @@ func (o *UpdateAccessTokenResponse) SetId(v string) { } // GetStatus returns the Status field value -func (o *UpdateAccessTokenResponse) GetStatus() string { +func (o *UpdateAccessTokenResponse) GetStatus() AccessTokenBaseResponseStatus { if o == nil { - var ret string + var ret AccessTokenBaseResponseStatus return ret } @@ -217,7 +217,7 @@ func (o *UpdateAccessTokenResponse) GetStatus() string { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *UpdateAccessTokenResponse) GetStatusOk() (*string, bool) { +func (o *UpdateAccessTokenResponse) GetStatusOk() (*AccessTokenBaseResponseStatus, bool) { if o == nil { return nil, false } @@ -225,7 +225,7 @@ func (o *UpdateAccessTokenResponse) GetStatusOk() (*string, bool) { } // SetStatus sets field value -func (o *UpdateAccessTokenResponse) SetStatus(v string) { +func (o *UpdateAccessTokenResponse) SetStatus(v AccessTokenBaseResponseStatus) { o.Status = v } From 68a90836d656dfe19752fa6800d60aa97247d137 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Fri, 22 May 2026 12:50:51 +0200 Subject: [PATCH 64/66] chore(telemetryrouter): fix waiters/tests/examples --- CHANGELOG.md | 2 + examples/telemetryrouter/telemetryrouter.go | 2 +- services/telemetryrouter/CHANGELOG.md | 3 + services/telemetryrouter/VERSION | 2 +- .../telemetryrouter/v1betaapi/wait/wait.go | 78 ++++++++++--------- .../v1betaapi/wait/wait_test.go | 50 ++++++------ 6 files changed, 74 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e303085be..b58756606 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -535,6 +535,8 @@ - **Feature:** Added `_UNKNOWN_DEFAULT_OPEN_API` fallback value to all enums to handle unknown API values gracefully. - [v0.2.1](services/telemetryrouter/CHANGELOG.md#v021) - **Improvement**: Use new `WaiterHandler` struct in the TelemetryRouter WaitHandler + - [v0.3.0](services/telemetryrouter/CHANGELOG.md#v030) + - **Feature:** Introduce enums for various attributes - `telemetrylink`: - [v0.1.0](services/telemetrylink/CHANGELOG.md#v010) - **New**: API for STACKIT Telemetry Link diff --git a/examples/telemetryrouter/telemetryrouter.go b/examples/telemetryrouter/telemetryrouter.go index 14d5cfcf6..fc2009d66 100644 --- a/examples/telemetryrouter/telemetryrouter.go +++ b/examples/telemetryrouter/telemetryrouter.go @@ -13,7 +13,7 @@ func main() { ctx := context.Background() projectId := "PROJECT_ID" // the uuid of your STACKIT project - regionId := "eu01" + regionId := telemetryrouter.ListTelemetryRoutersRegionIdParameter("eu01") client, err := telemetryrouter.NewAPIClient() if err != nil { diff --git a/services/telemetryrouter/CHANGELOG.md b/services/telemetryrouter/CHANGELOG.md index 979e84f8f..f9fa1d757 100644 --- a/services/telemetryrouter/CHANGELOG.md +++ b/services/telemetryrouter/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.3.0 +- **Feature:** Introduce enums for various attributes + ## v0.2.1 - **Improvement**: Use new `WaiterHandler` struct in the TelemetryRouter WaitHandler diff --git a/services/telemetryrouter/VERSION b/services/telemetryrouter/VERSION index eac0a1441..d4dfa5639 100644 --- a/services/telemetryrouter/VERSION +++ b/services/telemetryrouter/VERSION @@ -1 +1 @@ -v0.2.1 \ No newline at end of file +v0.3.0 \ No newline at end of file diff --git a/services/telemetryrouter/v1betaapi/wait/wait.go b/services/telemetryrouter/v1betaapi/wait/wait.go index 9eb5861f6..33e8fc977 100644 --- a/services/telemetryrouter/v1betaapi/wait/wait.go +++ b/services/telemetryrouter/v1betaapi/wait/wait.go @@ -11,22 +11,28 @@ import ( ) const ( - TELEMETRYROUTER_ACTIVE = "active" - DESTINATION_ACTIVE = "active" - ACCESSTOKEN_ACTIVE = "active" + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + TELEMETRYROUTER_ACTIVE = telemetryrouter.TELEMETRYROUTERRESPONSESTATUS_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + DESTINATION_ACTIVE = telemetryrouter.DESTINATIONRESPONSESTATUS_ACTIVE + // Deprecated: symbol is not used anymore, use the packages enum instead, will be removed 2026-12, use `go fix` for automatic fixing + //go:fix inline + ACCESSTOKEN_ACTIVE = telemetryrouter.ACCESSTOKENBASERESPONSESTATUS_ACTIVE ) // CreateTelemetryRouterWaitHandler will wait for TelemetryRouter creation -func CreateTelemetryRouterWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId, regionId, instanceId string) *wait.AsyncActionHandler[telemetryrouter.TelemetryRouterResponse] { - waitConfig := wait.WaiterHelper[telemetryrouter.TelemetryRouterResponse, string]{ +func CreateTelemetryRouterWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId string, regionId telemetryrouter.ListTelemetryRoutersRegionIdParameter, instanceId string) *wait.AsyncActionHandler[telemetryrouter.TelemetryRouterResponse] { + waitConfig := wait.WaiterHelper[telemetryrouter.TelemetryRouterResponse, telemetryrouter.TelemetryRouterResponseStatus]{ FetchInstance: a.GetTelemetryRouter(ctx, projectId, regionId, instanceId).Execute, - GetState: func(d *telemetryrouter.TelemetryRouterResponse) (string, error) { + GetState: func(d *telemetryrouter.TelemetryRouterResponse) (telemetryrouter.TelemetryRouterResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{TELEMETRYROUTER_ACTIVE}, + ActiveState: []telemetryrouter.TelemetryRouterResponseStatus{telemetryrouter.TELEMETRYROUTERRESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -35,16 +41,16 @@ func CreateTelemetryRouterWaitHandler(ctx context.Context, a telemetryrouter.Def } // UpdateTelemetryRouterWaitHandler will wait for TelemetryRouter update -func UpdateTelemetryRouterWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId, regionId, instanceId string) *wait.AsyncActionHandler[telemetryrouter.TelemetryRouterResponse] { - waitConfig := wait.WaiterHelper[telemetryrouter.TelemetryRouterResponse, string]{ +func UpdateTelemetryRouterWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId string, regionId telemetryrouter.ListTelemetryRoutersRegionIdParameter, instanceId string) *wait.AsyncActionHandler[telemetryrouter.TelemetryRouterResponse] { + waitConfig := wait.WaiterHelper[telemetryrouter.TelemetryRouterResponse, telemetryrouter.TelemetryRouterResponseStatus]{ FetchInstance: a.GetTelemetryRouter(ctx, projectId, regionId, instanceId).Execute, - GetState: func(d *telemetryrouter.TelemetryRouterResponse) (string, error) { + GetState: func(d *telemetryrouter.TelemetryRouterResponse) (telemetryrouter.TelemetryRouterResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{TELEMETRYROUTER_ACTIVE}, + ActiveState: []telemetryrouter.TelemetryRouterResponseStatus{telemetryrouter.TELEMETRYROUTERRESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -53,10 +59,10 @@ func UpdateTelemetryRouterWaitHandler(ctx context.Context, a telemetryrouter.Def } // DeleteTelemetryRouterWaitHandler will wait for TelemetryRouter deletion -func DeleteTelemetryRouterWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId, regionId, instanceId string) *wait.AsyncActionHandler[telemetryrouter.TelemetryRouterResponse] { - waitConfig := wait.WaiterHelper[telemetryrouter.TelemetryRouterResponse, string]{ +func DeleteTelemetryRouterWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId string, regionId telemetryrouter.ListTelemetryRoutersRegionIdParameter, instanceId string) *wait.AsyncActionHandler[telemetryrouter.TelemetryRouterResponse] { + waitConfig := wait.WaiterHelper[telemetryrouter.TelemetryRouterResponse, telemetryrouter.TelemetryRouterResponseStatus]{ FetchInstance: a.GetTelemetryRouter(ctx, projectId, regionId, instanceId).Execute, - GetState: func(d *telemetryrouter.TelemetryRouterResponse) (string, error) { + GetState: func(d *telemetryrouter.TelemetryRouterResponse) (telemetryrouter.TelemetryRouterResponseStatus, error) { if d == nil { return "", errors.New("empty response") } @@ -71,16 +77,16 @@ func DeleteTelemetryRouterWaitHandler(ctx context.Context, a telemetryrouter.Def } // CreateDestinationWaitHandler will wait for Destination creation -func CreateDestinationWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId, regionId, instanceId, destinationId string) *wait.AsyncActionHandler[telemetryrouter.DestinationResponse] { - waitConfig := wait.WaiterHelper[telemetryrouter.DestinationResponse, string]{ +func CreateDestinationWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId string, regionId telemetryrouter.ListTelemetryRoutersRegionIdParameter, instanceId, destinationId string) *wait.AsyncActionHandler[telemetryrouter.DestinationResponse] { + waitConfig := wait.WaiterHelper[telemetryrouter.DestinationResponse, telemetryrouter.DestinationResponseStatus]{ FetchInstance: a.GetDestination(ctx, projectId, regionId, instanceId, destinationId).Execute, - GetState: func(d *telemetryrouter.DestinationResponse) (string, error) { + GetState: func(d *telemetryrouter.DestinationResponse) (telemetryrouter.DestinationResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{DESTINATION_ACTIVE}, + ActiveState: []telemetryrouter.DestinationResponseStatus{telemetryrouter.DESTINATIONRESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -89,16 +95,16 @@ func CreateDestinationWaitHandler(ctx context.Context, a telemetryrouter.Default } // UpdateDestinationWaitHandler will wait for Destination update -func UpdateDestinationWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId, regionId, instanceId, destinationId string) *wait.AsyncActionHandler[telemetryrouter.DestinationResponse] { - waitConfig := wait.WaiterHelper[telemetryrouter.DestinationResponse, string]{ +func UpdateDestinationWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId string, regionId telemetryrouter.ListTelemetryRoutersRegionIdParameter, instanceId, destinationId string) *wait.AsyncActionHandler[telemetryrouter.DestinationResponse] { + waitConfig := wait.WaiterHelper[telemetryrouter.DestinationResponse, telemetryrouter.DestinationResponseStatus]{ FetchInstance: a.GetDestination(ctx, projectId, regionId, instanceId, destinationId).Execute, - GetState: func(d *telemetryrouter.DestinationResponse) (string, error) { + GetState: func(d *telemetryrouter.DestinationResponse) (telemetryrouter.DestinationResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{DESTINATION_ACTIVE}, + ActiveState: []telemetryrouter.DestinationResponseStatus{telemetryrouter.DESTINATIONRESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -107,10 +113,10 @@ func UpdateDestinationWaitHandler(ctx context.Context, a telemetryrouter.Default } // DeleteDestinationWaitHandler will wait for Destination deletion -func DeleteDestinationWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId, regionId, instanceId, destinationId string) *wait.AsyncActionHandler[telemetryrouter.DestinationResponse] { - waitConfig := wait.WaiterHelper[telemetryrouter.DestinationResponse, string]{ +func DeleteDestinationWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId string, regionId telemetryrouter.ListTelemetryRoutersRegionIdParameter, instanceId, destinationId string) *wait.AsyncActionHandler[telemetryrouter.DestinationResponse] { + waitConfig := wait.WaiterHelper[telemetryrouter.DestinationResponse, telemetryrouter.DestinationResponseStatus]{ FetchInstance: a.GetDestination(ctx, projectId, regionId, instanceId, destinationId).Execute, - GetState: func(d *telemetryrouter.DestinationResponse) (string, error) { + GetState: func(d *telemetryrouter.DestinationResponse) (telemetryrouter.DestinationResponseStatus, error) { if d == nil { return "", errors.New("empty response") } @@ -125,16 +131,16 @@ func DeleteDestinationWaitHandler(ctx context.Context, a telemetryrouter.Default } // CreateAccessTokenWaitHandler will wait for AccessToken creation -func CreateAccessTokenWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId, regionId, instanceId, accessTokenId string) *wait.AsyncActionHandler[telemetryrouter.GetAccessTokenResponse] { - waitConfig := wait.WaiterHelper[telemetryrouter.GetAccessTokenResponse, string]{ +func CreateAccessTokenWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId string, regionId telemetryrouter.ListTelemetryRoutersRegionIdParameter, instanceId, accessTokenId string) *wait.AsyncActionHandler[telemetryrouter.GetAccessTokenResponse] { + waitConfig := wait.WaiterHelper[telemetryrouter.GetAccessTokenResponse, telemetryrouter.AccessTokenBaseResponseStatus]{ FetchInstance: a.GetAccessToken(ctx, projectId, regionId, instanceId, accessTokenId).Execute, - GetState: func(d *telemetryrouter.GetAccessTokenResponse) (string, error) { + GetState: func(d *telemetryrouter.GetAccessTokenResponse) (telemetryrouter.AccessTokenBaseResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{ACCESSTOKEN_ACTIVE}, + ActiveState: []telemetryrouter.AccessTokenBaseResponseStatus{telemetryrouter.ACCESSTOKENBASERESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -143,16 +149,16 @@ func CreateAccessTokenWaitHandler(ctx context.Context, a telemetryrouter.Default } // UpdateAccessTokenWaitHandler will wait for AccessToken update -func UpdateAccessTokenWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId, regionId, instanceId, accessTokenId string) *wait.AsyncActionHandler[telemetryrouter.GetAccessTokenResponse] { - waitConfig := wait.WaiterHelper[telemetryrouter.GetAccessTokenResponse, string]{ +func UpdateAccessTokenWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId string, regionId telemetryrouter.ListTelemetryRoutersRegionIdParameter, instanceId, accessTokenId string) *wait.AsyncActionHandler[telemetryrouter.GetAccessTokenResponse] { + waitConfig := wait.WaiterHelper[telemetryrouter.GetAccessTokenResponse, telemetryrouter.AccessTokenBaseResponseStatus]{ FetchInstance: a.GetAccessToken(ctx, projectId, regionId, instanceId, accessTokenId).Execute, - GetState: func(d *telemetryrouter.GetAccessTokenResponse) (string, error) { + GetState: func(d *telemetryrouter.GetAccessTokenResponse) (telemetryrouter.AccessTokenBaseResponseStatus, error) { if d == nil { return "", errors.New("empty response") } return d.Status, nil }, - ActiveState: []string{ACCESSTOKEN_ACTIVE}, + ActiveState: []telemetryrouter.AccessTokenBaseResponseStatus{telemetryrouter.ACCESSTOKENBASERESPONSESTATUS_ACTIVE}, } handler := wait.New(waitConfig.Wait()) @@ -161,10 +167,10 @@ func UpdateAccessTokenWaitHandler(ctx context.Context, a telemetryrouter.Default } // DeleteAccessTokenWaitHandler will wait for AccessToken deletion -func DeleteAccessTokenWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId, regionId, instanceId, accessTokenId string) *wait.AsyncActionHandler[telemetryrouter.GetAccessTokenResponse] { - waitConfig := wait.WaiterHelper[telemetryrouter.GetAccessTokenResponse, string]{ +func DeleteAccessTokenWaitHandler(ctx context.Context, a telemetryrouter.DefaultAPI, projectId string, regionId telemetryrouter.ListTelemetryRoutersRegionIdParameter, instanceId, accessTokenId string) *wait.AsyncActionHandler[telemetryrouter.GetAccessTokenResponse] { + waitConfig := wait.WaiterHelper[telemetryrouter.GetAccessTokenResponse, telemetryrouter.AccessTokenBaseResponseStatus]{ FetchInstance: a.GetAccessToken(ctx, projectId, regionId, instanceId, accessTokenId).Execute, - GetState: func(d *telemetryrouter.GetAccessTokenResponse) (string, error) { + GetState: func(d *telemetryrouter.GetAccessTokenResponse) (telemetryrouter.AccessTokenBaseResponseStatus, error) { if d == nil { return "", errors.New("empty response") } diff --git a/services/telemetryrouter/v1betaapi/wait/wait_test.go b/services/telemetryrouter/v1betaapi/wait/wait_test.go index 02e1d578f..af5636669 100644 --- a/services/telemetryrouter/v1betaapi/wait/wait_test.go +++ b/services/telemetryrouter/v1betaapi/wait/wait_test.go @@ -29,7 +29,7 @@ func newAPIMock(settings mockSettings) telemetryrouter.DefaultAPI { return &telemetryrouter.TelemetryRouterResponse{ Id: "trid", - Status: settings.resourceState, + Status: telemetryrouter.TelemetryRouterResponseStatus(settings.resourceState), }, nil }), GetDestinationExecuteMock: utils.Ptr(func(_ telemetryrouter.ApiGetDestinationRequest) (*telemetryrouter.DestinationResponse, error) { @@ -41,7 +41,7 @@ func newAPIMock(settings mockSettings) telemetryrouter.DefaultAPI { return &telemetryrouter.DestinationResponse{ Id: "did", - Status: settings.resourceState, + Status: telemetryrouter.DestinationResponseStatus(settings.resourceState), }, nil }), GetAccessTokenExecuteMock: utils.Ptr(func(_ telemetryrouter.ApiGetAccessTokenRequest) (*telemetryrouter.GetAccessTokenResponse, error) { @@ -54,7 +54,7 @@ func newAPIMock(settings mockSettings) telemetryrouter.DefaultAPI { return &telemetryrouter.GetAccessTokenResponse{ Id: "atid", ExpirationTime: telemetryrouter.NullableTime{}, - Status: settings.resourceState, + Status: telemetryrouter.AccessTokenBaseResponseStatus(settings.resourceState), }, nil }), } @@ -64,14 +64,14 @@ func TestCreateTelemetryRouterWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetryrouter.TelemetryRouterResponseStatus wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: TELEMETRYROUTER_ACTIVE, + resourceState: telemetryrouter.TELEMETRYROUTERRESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -95,7 +95,7 @@ func TestCreateTelemetryRouterWaitHandler(t *testing.T) { synctest.Test(t, func(t *testing.T) { apiClient := newAPIMock(mockSettings{ getFails: tt.getFails, - resourceState: tt.resourceState, + resourceState: string(tt.resourceState), }) var wantRes *telemetryrouter.TelemetryRouterResponse @@ -125,14 +125,14 @@ func TestUpdateTelemetryRouterWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetryrouter.TelemetryRouterResponseStatus wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: TELEMETRYROUTER_ACTIVE, + resourceState: telemetryrouter.TELEMETRYROUTERRESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -156,7 +156,7 @@ func TestUpdateTelemetryRouterWaitHandler(t *testing.T) { synctest.Test(t, func(t *testing.T) { apiClient := newAPIMock(mockSettings{ getFails: tt.getFails, - resourceState: tt.resourceState, + resourceState: string(tt.resourceState), }) var wantRes *telemetryrouter.TelemetryRouterResponse @@ -186,7 +186,7 @@ func TestDeleteTelemetryRouterWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetryrouter.TelemetryRouterResponseStatus wantErr bool wantResp bool }{ @@ -245,14 +245,14 @@ func TestCreateDestinationWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetryrouter.DestinationResponseStatus wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: DESTINATION_ACTIVE, + resourceState: telemetryrouter.DESTINATIONRESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -276,7 +276,7 @@ func TestCreateDestinationWaitHandler(t *testing.T) { synctest.Test(t, func(t *testing.T) { apiClient := newAPIMock(mockSettings{ getFails: tt.getFails, - resourceState: tt.resourceState, + resourceState: string(tt.resourceState), }) var wantRes *telemetryrouter.DestinationResponse @@ -306,14 +306,14 @@ func TestUpdateDestinationWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetryrouter.DestinationResponseStatus wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: DESTINATION_ACTIVE, + resourceState: telemetryrouter.DESTINATIONRESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -337,7 +337,7 @@ func TestUpdateDestinationWaitHandler(t *testing.T) { synctest.Test(t, func(t *testing.T) { apiClient := newAPIMock(mockSettings{ getFails: tt.getFails, - resourceState: tt.resourceState, + resourceState: string(tt.resourceState), }) var wantRes *telemetryrouter.DestinationResponse @@ -367,7 +367,7 @@ func TestDeleteDestinationWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetryrouter.DestinationResponseStatus wantErr bool wantResp bool }{ @@ -426,14 +426,14 @@ func TestCreateAccessTokenWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetryrouter.AccessTokenBaseResponseStatus wantErr bool wantResp bool }{ { desc: "create_succeeded", getFails: false, - resourceState: ACCESSTOKEN_ACTIVE, + resourceState: telemetryrouter.ACCESSTOKENBASERESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -457,7 +457,7 @@ func TestCreateAccessTokenWaitHandler(t *testing.T) { synctest.Test(t, func(t *testing.T) { apiClient := newAPIMock(mockSettings{ getFails: tt.getFails, - resourceState: tt.resourceState, + resourceState: string(tt.resourceState), }) var wantRes *telemetryrouter.GetAccessTokenResponse @@ -487,14 +487,14 @@ func TestUpdateAccessTokenWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetryrouter.AccessTokenBaseResponseStatus wantErr bool wantResp bool }{ { desc: "update_succeeded", getFails: false, - resourceState: ACCESSTOKEN_ACTIVE, + resourceState: telemetryrouter.ACCESSTOKENBASERESPONSESTATUS_ACTIVE, wantErr: false, wantResp: true, }, @@ -518,7 +518,7 @@ func TestUpdateAccessTokenWaitHandler(t *testing.T) { synctest.Test(t, func(t *testing.T) { apiClient := newAPIMock(mockSettings{ getFails: tt.getFails, - resourceState: tt.resourceState, + resourceState: string(tt.resourceState), }) var wantRes *telemetryrouter.GetAccessTokenResponse @@ -548,7 +548,7 @@ func TestDeleteAccessTokenWaitHandler(t *testing.T) { tests := []struct { desc string getFails bool - resourceState string + resourceState telemetryrouter.AccessTokenBaseResponseStatus wantErr bool wantResp bool }{ @@ -572,7 +572,7 @@ func TestDeleteAccessTokenWaitHandler(t *testing.T) { synctest.Test(t, func(t *testing.T) { apiClient := newAPIMock(mockSettings{ getFails: tt.getFails, - resourceState: tt.resourceState, + resourceState: string(tt.resourceState), }) var wantRes *telemetryrouter.GetAccessTokenResponse From a82184cbd74b2601ad7f42640f6c53018f27300a Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Fri, 22 May 2026 12:52:33 +0200 Subject: [PATCH 65/66] refac(vpn): introduce inline enums --- .../vpn/v1alpha1api/model_api_error_detail.go | 15 ++- .../model_api_error_detail_reason.go | 113 +++++++++++++++++ services/vpn/v1alpha1api/model_phase.go | 34 ++--- .../model_phase_dh_groups_inner.go | 119 ++++++++++++++++++ ...model_phase_encryption_algorithms_inner.go | 115 +++++++++++++++++ .../model_phase_integrity_algorithms_inner.go | 115 +++++++++++++++++ .../model_tunnel_configuration_phase1.go | 34 ++--- .../model_tunnel_configuration_phase2.go | 70 +++++------ ..._configuration_phase2_all_of_dpd_action.go | 113 +++++++++++++++++ ...onfiguration_phase2_all_of_start_action.go | 113 +++++++++++++++++ .../vpn/v1alpha1api/model_tunnel_status.go | 18 +-- .../v1alpha1api/model_tunnel_status_name.go | 113 +++++++++++++++++ services/vpn/v1alpha1api/model_vpn_tunnels.go | 12 +- .../vpn/v1alpha1api/model_vpn_tunnels_name.go | 113 +++++++++++++++++ services/vpn/v1api/model_api_error_detail.go | 15 ++- .../v1api/model_api_error_detail_reason.go | 113 +++++++++++++++++ services/vpn/v1api/model_phase.go | 34 ++--- .../vpn/v1api/model_phase_dh_groups_inner.go | 119 ++++++++++++++++++ ...model_phase_encryption_algorithms_inner.go | 115 +++++++++++++++++ .../model_phase_integrity_algorithms_inner.go | 115 +++++++++++++++++ .../model_tunnel_configuration_phase1.go | 34 ++--- .../model_tunnel_configuration_phase2.go | 70 +++++------ ..._configuration_phase2_all_of_dpd_action.go | 113 +++++++++++++++++ ...onfiguration_phase2_all_of_start_action.go | 113 +++++++++++++++++ services/vpn/v1api/model_tunnel_status.go | 18 +-- .../vpn/v1api/model_tunnel_status_name.go | 113 +++++++++++++++++ services/vpn/v1api/model_vpn_tunnels.go | 12 +- services/vpn/v1api/model_vpn_tunnels_name.go | 113 +++++++++++++++++ .../vpn/v1beta1api/model_api_error_detail.go | 15 ++- .../model_api_error_detail_reason.go | 113 +++++++++++++++++ services/vpn/v1beta1api/model_phase.go | 34 ++--- .../v1beta1api/model_phase_dh_groups_inner.go | 119 ++++++++++++++++++ ...model_phase_encryption_algorithms_inner.go | 115 +++++++++++++++++ .../model_phase_integrity_algorithms_inner.go | 115 +++++++++++++++++ .../model_tunnel_configuration_phase1.go | 34 ++--- .../model_tunnel_configuration_phase2.go | 70 +++++------ ..._configuration_phase2_all_of_dpd_action.go | 113 +++++++++++++++++ ...onfiguration_phase2_all_of_start_action.go | 113 +++++++++++++++++ .../vpn/v1beta1api/model_tunnel_status.go | 18 +-- .../v1beta1api/model_tunnel_status_name.go | 113 +++++++++++++++++ services/vpn/v1beta1api/model_vpn_tunnels.go | 12 +- .../vpn/v1beta1api/model_vpn_tunnels_name.go | 113 +++++++++++++++++ 42 files changed, 3012 insertions(+), 279 deletions(-) create mode 100644 services/vpn/v1alpha1api/model_api_error_detail_reason.go create mode 100644 services/vpn/v1alpha1api/model_phase_dh_groups_inner.go create mode 100644 services/vpn/v1alpha1api/model_phase_encryption_algorithms_inner.go create mode 100644 services/vpn/v1alpha1api/model_phase_integrity_algorithms_inner.go create mode 100644 services/vpn/v1alpha1api/model_tunnel_configuration_phase2_all_of_dpd_action.go create mode 100644 services/vpn/v1alpha1api/model_tunnel_configuration_phase2_all_of_start_action.go create mode 100644 services/vpn/v1alpha1api/model_tunnel_status_name.go create mode 100644 services/vpn/v1alpha1api/model_vpn_tunnels_name.go create mode 100644 services/vpn/v1api/model_api_error_detail_reason.go create mode 100644 services/vpn/v1api/model_phase_dh_groups_inner.go create mode 100644 services/vpn/v1api/model_phase_encryption_algorithms_inner.go create mode 100644 services/vpn/v1api/model_phase_integrity_algorithms_inner.go create mode 100644 services/vpn/v1api/model_tunnel_configuration_phase2_all_of_dpd_action.go create mode 100644 services/vpn/v1api/model_tunnel_configuration_phase2_all_of_start_action.go create mode 100644 services/vpn/v1api/model_tunnel_status_name.go create mode 100644 services/vpn/v1api/model_vpn_tunnels_name.go create mode 100644 services/vpn/v1beta1api/model_api_error_detail_reason.go create mode 100644 services/vpn/v1beta1api/model_phase_dh_groups_inner.go create mode 100644 services/vpn/v1beta1api/model_phase_encryption_algorithms_inner.go create mode 100644 services/vpn/v1beta1api/model_phase_integrity_algorithms_inner.go create mode 100644 services/vpn/v1beta1api/model_tunnel_configuration_phase2_all_of_dpd_action.go create mode 100644 services/vpn/v1beta1api/model_tunnel_configuration_phase2_all_of_start_action.go create mode 100644 services/vpn/v1beta1api/model_tunnel_status_name.go create mode 100644 services/vpn/v1beta1api/model_vpn_tunnels_name.go diff --git a/services/vpn/v1alpha1api/model_api_error_detail.go b/services/vpn/v1alpha1api/model_api_error_detail.go index f4b58e0e1..37baf47c4 100644 --- a/services/vpn/v1alpha1api/model_api_error_detail.go +++ b/services/vpn/v1alpha1api/model_api_error_detail.go @@ -23,9 +23,8 @@ type APIErrorDetail struct { // The domain of the error source. Domain string `json:"domain"` // Metadata contains more information. For bad requests this would be field information. - Metadata map[string]interface{} `json:"metadata,omitempty"` - // The reason why the error occurs. - Reason string `json:"reason"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Reason APIErrorDetailReason `json:"reason"` AdditionalProperties map[string]interface{} } @@ -35,7 +34,7 @@ type _APIErrorDetail APIErrorDetail // 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 NewAPIErrorDetail(domain string, reason string) *APIErrorDetail { +func NewAPIErrorDetail(domain string, reason APIErrorDetailReason) *APIErrorDetail { this := APIErrorDetail{} this.Domain = domain this.Reason = reason @@ -109,9 +108,9 @@ func (o *APIErrorDetail) SetMetadata(v map[string]interface{}) { } // GetReason returns the Reason field value -func (o *APIErrorDetail) GetReason() string { +func (o *APIErrorDetail) GetReason() APIErrorDetailReason { if o == nil { - var ret string + var ret APIErrorDetailReason return ret } @@ -120,7 +119,7 @@ func (o *APIErrorDetail) GetReason() string { // GetReasonOk returns a tuple with the Reason field value // and a boolean to check if the value has been set. -func (o *APIErrorDetail) GetReasonOk() (*string, bool) { +func (o *APIErrorDetail) GetReasonOk() (*APIErrorDetailReason, bool) { if o == nil { return nil, false } @@ -128,7 +127,7 @@ func (o *APIErrorDetail) GetReasonOk() (*string, bool) { } // SetReason sets field value -func (o *APIErrorDetail) SetReason(v string) { +func (o *APIErrorDetail) SetReason(v APIErrorDetailReason) { o.Reason = v } diff --git a/services/vpn/v1alpha1api/model_api_error_detail_reason.go b/services/vpn/v1alpha1api/model_api_error_detail_reason.go new file mode 100644 index 000000000..b84338f0e --- /dev/null +++ b/services/vpn/v1alpha1api/model_api_error_detail_reason.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alpha1api + +import ( + "encoding/json" + "fmt" +) + +// APIErrorDetailReason The reason why the error occurs. +type APIErrorDetailReason string + +// List of APIErrorDetail_reason +const ( + APIERRORDETAILREASON_INVALID_FIELD APIErrorDetailReason = "INVALID_FIELD" + APIERRORDETAILREASON_INVALID_PATH_PARAMETER APIErrorDetailReason = "INVALID_PATH_PARAMETER" + APIERRORDETAILREASON_UNKNOWN_DEFAULT_OPEN_API APIErrorDetailReason = "unknown_default_open_api" +) + +// All allowed values of APIErrorDetailReason enum +var AllowedAPIErrorDetailReasonEnumValues = []APIErrorDetailReason{ + "INVALID_FIELD", + "INVALID_PATH_PARAMETER", + "unknown_default_open_api", +} + +func (v *APIErrorDetailReason) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := APIErrorDetailReason(value) + for _, existing := range AllowedAPIErrorDetailReasonEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = APIERRORDETAILREASON_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAPIErrorDetailReasonFromValue returns a pointer to a valid APIErrorDetailReason +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAPIErrorDetailReasonFromValue(v string) (*APIErrorDetailReason, error) { + ev := APIErrorDetailReason(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for APIErrorDetailReason: valid values are %v", v, AllowedAPIErrorDetailReasonEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v APIErrorDetailReason) IsValid() bool { + for _, existing := range AllowedAPIErrorDetailReasonEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to APIErrorDetail_reason value +func (v APIErrorDetailReason) Ptr() *APIErrorDetailReason { + return &v +} + +type NullableAPIErrorDetailReason struct { + value *APIErrorDetailReason + isSet bool +} + +func (v NullableAPIErrorDetailReason) Get() *APIErrorDetailReason { + return v.value +} + +func (v *NullableAPIErrorDetailReason) Set(val *APIErrorDetailReason) { + v.value = val + v.isSet = true +} + +func (v NullableAPIErrorDetailReason) IsSet() bool { + return v.isSet +} + +func (v *NullableAPIErrorDetailReason) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAPIErrorDetailReason(val *APIErrorDetailReason) *NullableAPIErrorDetailReason { + return &NullableAPIErrorDetailReason{value: val, isSet: true} +} + +func (v NullableAPIErrorDetailReason) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAPIErrorDetailReason) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1alpha1api/model_phase.go b/services/vpn/v1alpha1api/model_phase.go index 289499ae0..d6a627265 100644 --- a/services/vpn/v1alpha1api/model_phase.go +++ b/services/vpn/v1alpha1api/model_phase.go @@ -21,9 +21,9 @@ var _ MappedNullable = &Phase{} // Phase struct for Phase type Phase struct { // The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. - DhGroups []string `json:"dhGroups,omitempty"` - EncryptionAlgorithms []string `json:"encryptionAlgorithms"` - IntegrityAlgorithms []string `json:"integrityAlgorithms"` + DhGroups []PhaseDhGroupsInner `json:"dhGroups,omitempty"` + EncryptionAlgorithms []PhaseEncryptionAlgorithmsInner `json:"encryptionAlgorithms"` + IntegrityAlgorithms []PhaseIntegrityAlgorithmsInner `json:"integrityAlgorithms"` AdditionalProperties map[string]interface{} } @@ -33,7 +33,7 @@ type _Phase Phase // 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 NewPhase(encryptionAlgorithms []string, integrityAlgorithms []string) *Phase { +func NewPhase(encryptionAlgorithms []PhaseEncryptionAlgorithmsInner, integrityAlgorithms []PhaseIntegrityAlgorithmsInner) *Phase { this := Phase{} this.EncryptionAlgorithms = encryptionAlgorithms this.IntegrityAlgorithms = integrityAlgorithms @@ -49,9 +49,9 @@ func NewPhaseWithDefaults() *Phase { } // GetDhGroups returns the DhGroups field value if set, zero value otherwise. -func (o *Phase) GetDhGroups() []string { +func (o *Phase) GetDhGroups() []PhaseDhGroupsInner { if o == nil || IsNil(o.DhGroups) { - var ret []string + var ret []PhaseDhGroupsInner return ret } return o.DhGroups @@ -59,7 +59,7 @@ func (o *Phase) GetDhGroups() []string { // GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Phase) GetDhGroupsOk() ([]string, bool) { +func (o *Phase) GetDhGroupsOk() ([]PhaseDhGroupsInner, bool) { if o == nil || IsNil(o.DhGroups) { return nil, false } @@ -75,15 +75,15 @@ func (o *Phase) HasDhGroups() bool { return false } -// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field. -func (o *Phase) SetDhGroups(v []string) { +// SetDhGroups gets a reference to the given []PhaseDhGroupsInner and assigns it to the DhGroups field. +func (o *Phase) SetDhGroups(v []PhaseDhGroupsInner) { o.DhGroups = v } // GetEncryptionAlgorithms returns the EncryptionAlgorithms field value -func (o *Phase) GetEncryptionAlgorithms() []string { +func (o *Phase) GetEncryptionAlgorithms() []PhaseEncryptionAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseEncryptionAlgorithmsInner return ret } @@ -92,7 +92,7 @@ func (o *Phase) GetEncryptionAlgorithms() []string { // GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value // and a boolean to check if the value has been set. -func (o *Phase) GetEncryptionAlgorithmsOk() ([]string, bool) { +func (o *Phase) GetEncryptionAlgorithmsOk() ([]PhaseEncryptionAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -100,14 +100,14 @@ func (o *Phase) GetEncryptionAlgorithmsOk() ([]string, bool) { } // SetEncryptionAlgorithms sets field value -func (o *Phase) SetEncryptionAlgorithms(v []string) { +func (o *Phase) SetEncryptionAlgorithms(v []PhaseEncryptionAlgorithmsInner) { o.EncryptionAlgorithms = v } // GetIntegrityAlgorithms returns the IntegrityAlgorithms field value -func (o *Phase) GetIntegrityAlgorithms() []string { +func (o *Phase) GetIntegrityAlgorithms() []PhaseIntegrityAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseIntegrityAlgorithmsInner return ret } @@ -116,7 +116,7 @@ func (o *Phase) GetIntegrityAlgorithms() []string { // GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value // and a boolean to check if the value has been set. -func (o *Phase) GetIntegrityAlgorithmsOk() ([]string, bool) { +func (o *Phase) GetIntegrityAlgorithmsOk() ([]PhaseIntegrityAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -124,7 +124,7 @@ func (o *Phase) GetIntegrityAlgorithmsOk() ([]string, bool) { } // SetIntegrityAlgorithms sets field value -func (o *Phase) SetIntegrityAlgorithms(v []string) { +func (o *Phase) SetIntegrityAlgorithms(v []PhaseIntegrityAlgorithmsInner) { o.IntegrityAlgorithms = v } diff --git a/services/vpn/v1alpha1api/model_phase_dh_groups_inner.go b/services/vpn/v1alpha1api/model_phase_dh_groups_inner.go new file mode 100644 index 000000000..c68aca9f0 --- /dev/null +++ b/services/vpn/v1alpha1api/model_phase_dh_groups_inner.go @@ -0,0 +1,119 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alpha1api + +import ( + "encoding/json" + "fmt" +) + +// PhaseDhGroupsInner the model 'PhaseDhGroupsInner' +type PhaseDhGroupsInner string + +// List of Phase_dhGroups_inner +const ( + PHASEDHGROUPSINNER_MODP1024 PhaseDhGroupsInner = "modp1024" + PHASEDHGROUPSINNER_MODP2048 PhaseDhGroupsInner = "modp2048" + PHASEDHGROUPSINNER_ECP256 PhaseDhGroupsInner = "ecp256" + PHASEDHGROUPSINNER_ECP384 PhaseDhGroupsInner = "ecp384" + PHASEDHGROUPSINNER_MODP2048S256 PhaseDhGroupsInner = "modp2048s256" + PHASEDHGROUPSINNER_UNKNOWN_DEFAULT_OPEN_API PhaseDhGroupsInner = "unknown_default_open_api" +) + +// All allowed values of PhaseDhGroupsInner enum +var AllowedPhaseDhGroupsInnerEnumValues = []PhaseDhGroupsInner{ + "modp1024", + "modp2048", + "ecp256", + "ecp384", + "modp2048s256", + "unknown_default_open_api", +} + +func (v *PhaseDhGroupsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PhaseDhGroupsInner(value) + for _, existing := range AllowedPhaseDhGroupsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PHASEDHGROUPSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPhaseDhGroupsInnerFromValue returns a pointer to a valid PhaseDhGroupsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPhaseDhGroupsInnerFromValue(v string) (*PhaseDhGroupsInner, error) { + ev := PhaseDhGroupsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PhaseDhGroupsInner: valid values are %v", v, AllowedPhaseDhGroupsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PhaseDhGroupsInner) IsValid() bool { + for _, existing := range AllowedPhaseDhGroupsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Phase_dhGroups_inner value +func (v PhaseDhGroupsInner) Ptr() *PhaseDhGroupsInner { + return &v +} + +type NullablePhaseDhGroupsInner struct { + value *PhaseDhGroupsInner + isSet bool +} + +func (v NullablePhaseDhGroupsInner) Get() *PhaseDhGroupsInner { + return v.value +} + +func (v *NullablePhaseDhGroupsInner) Set(val *PhaseDhGroupsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePhaseDhGroupsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePhaseDhGroupsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhaseDhGroupsInner(val *PhaseDhGroupsInner) *NullablePhaseDhGroupsInner { + return &NullablePhaseDhGroupsInner{value: val, isSet: true} +} + +func (v NullablePhaseDhGroupsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhaseDhGroupsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1alpha1api/model_phase_encryption_algorithms_inner.go b/services/vpn/v1alpha1api/model_phase_encryption_algorithms_inner.go new file mode 100644 index 000000000..6a45ca6a3 --- /dev/null +++ b/services/vpn/v1alpha1api/model_phase_encryption_algorithms_inner.go @@ -0,0 +1,115 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alpha1api + +import ( + "encoding/json" + "fmt" +) + +// PhaseEncryptionAlgorithmsInner the model 'PhaseEncryptionAlgorithmsInner' +type PhaseEncryptionAlgorithmsInner string + +// List of Phase_encryptionAlgorithms_inner +const ( + PHASEENCRYPTIONALGORITHMSINNER_AES256 PhaseEncryptionAlgorithmsInner = "aes256" + PHASEENCRYPTIONALGORITHMSINNER_AES128GCM16 PhaseEncryptionAlgorithmsInner = "aes128gcm16" + PHASEENCRYPTIONALGORITHMSINNER_AES256GCM16 PhaseEncryptionAlgorithmsInner = "aes256gcm16" + PHASEENCRYPTIONALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API PhaseEncryptionAlgorithmsInner = "unknown_default_open_api" +) + +// All allowed values of PhaseEncryptionAlgorithmsInner enum +var AllowedPhaseEncryptionAlgorithmsInnerEnumValues = []PhaseEncryptionAlgorithmsInner{ + "aes256", + "aes128gcm16", + "aes256gcm16", + "unknown_default_open_api", +} + +func (v *PhaseEncryptionAlgorithmsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PhaseEncryptionAlgorithmsInner(value) + for _, existing := range AllowedPhaseEncryptionAlgorithmsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PHASEENCRYPTIONALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPhaseEncryptionAlgorithmsInnerFromValue returns a pointer to a valid PhaseEncryptionAlgorithmsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPhaseEncryptionAlgorithmsInnerFromValue(v string) (*PhaseEncryptionAlgorithmsInner, error) { + ev := PhaseEncryptionAlgorithmsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PhaseEncryptionAlgorithmsInner: valid values are %v", v, AllowedPhaseEncryptionAlgorithmsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PhaseEncryptionAlgorithmsInner) IsValid() bool { + for _, existing := range AllowedPhaseEncryptionAlgorithmsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Phase_encryptionAlgorithms_inner value +func (v PhaseEncryptionAlgorithmsInner) Ptr() *PhaseEncryptionAlgorithmsInner { + return &v +} + +type NullablePhaseEncryptionAlgorithmsInner struct { + value *PhaseEncryptionAlgorithmsInner + isSet bool +} + +func (v NullablePhaseEncryptionAlgorithmsInner) Get() *PhaseEncryptionAlgorithmsInner { + return v.value +} + +func (v *NullablePhaseEncryptionAlgorithmsInner) Set(val *PhaseEncryptionAlgorithmsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePhaseEncryptionAlgorithmsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePhaseEncryptionAlgorithmsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhaseEncryptionAlgorithmsInner(val *PhaseEncryptionAlgorithmsInner) *NullablePhaseEncryptionAlgorithmsInner { + return &NullablePhaseEncryptionAlgorithmsInner{value: val, isSet: true} +} + +func (v NullablePhaseEncryptionAlgorithmsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhaseEncryptionAlgorithmsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1alpha1api/model_phase_integrity_algorithms_inner.go b/services/vpn/v1alpha1api/model_phase_integrity_algorithms_inner.go new file mode 100644 index 000000000..f0ac519bc --- /dev/null +++ b/services/vpn/v1alpha1api/model_phase_integrity_algorithms_inner.go @@ -0,0 +1,115 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alpha1api + +import ( + "encoding/json" + "fmt" +) + +// PhaseIntegrityAlgorithmsInner the model 'PhaseIntegrityAlgorithmsInner' +type PhaseIntegrityAlgorithmsInner string + +// List of Phase_integrityAlgorithms_inner +const ( + PHASEINTEGRITYALGORITHMSINNER_SHA1 PhaseIntegrityAlgorithmsInner = "sha1" + PHASEINTEGRITYALGORITHMSINNER_SHA2_256 PhaseIntegrityAlgorithmsInner = "sha2_256" + PHASEINTEGRITYALGORITHMSINNER_SHA2_384 PhaseIntegrityAlgorithmsInner = "sha2_384" + PHASEINTEGRITYALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API PhaseIntegrityAlgorithmsInner = "unknown_default_open_api" +) + +// All allowed values of PhaseIntegrityAlgorithmsInner enum +var AllowedPhaseIntegrityAlgorithmsInnerEnumValues = []PhaseIntegrityAlgorithmsInner{ + "sha1", + "sha2_256", + "sha2_384", + "unknown_default_open_api", +} + +func (v *PhaseIntegrityAlgorithmsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PhaseIntegrityAlgorithmsInner(value) + for _, existing := range AllowedPhaseIntegrityAlgorithmsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PHASEINTEGRITYALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPhaseIntegrityAlgorithmsInnerFromValue returns a pointer to a valid PhaseIntegrityAlgorithmsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPhaseIntegrityAlgorithmsInnerFromValue(v string) (*PhaseIntegrityAlgorithmsInner, error) { + ev := PhaseIntegrityAlgorithmsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PhaseIntegrityAlgorithmsInner: valid values are %v", v, AllowedPhaseIntegrityAlgorithmsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PhaseIntegrityAlgorithmsInner) IsValid() bool { + for _, existing := range AllowedPhaseIntegrityAlgorithmsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Phase_integrityAlgorithms_inner value +func (v PhaseIntegrityAlgorithmsInner) Ptr() *PhaseIntegrityAlgorithmsInner { + return &v +} + +type NullablePhaseIntegrityAlgorithmsInner struct { + value *PhaseIntegrityAlgorithmsInner + isSet bool +} + +func (v NullablePhaseIntegrityAlgorithmsInner) Get() *PhaseIntegrityAlgorithmsInner { + return v.value +} + +func (v *NullablePhaseIntegrityAlgorithmsInner) Set(val *PhaseIntegrityAlgorithmsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePhaseIntegrityAlgorithmsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePhaseIntegrityAlgorithmsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhaseIntegrityAlgorithmsInner(val *PhaseIntegrityAlgorithmsInner) *NullablePhaseIntegrityAlgorithmsInner { + return &NullablePhaseIntegrityAlgorithmsInner{value: val, isSet: true} +} + +func (v NullablePhaseIntegrityAlgorithmsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhaseIntegrityAlgorithmsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1alpha1api/model_tunnel_configuration_phase1.go b/services/vpn/v1alpha1api/model_tunnel_configuration_phase1.go index d70728096..cd083a69c 100644 --- a/services/vpn/v1alpha1api/model_tunnel_configuration_phase1.go +++ b/services/vpn/v1alpha1api/model_tunnel_configuration_phase1.go @@ -21,9 +21,9 @@ var _ MappedNullable = &TunnelConfigurationPhase1{} // TunnelConfigurationPhase1 struct for TunnelConfigurationPhase1 type TunnelConfigurationPhase1 struct { // The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. - DhGroups []string `json:"dhGroups,omitempty"` - EncryptionAlgorithms []string `json:"encryptionAlgorithms"` - IntegrityAlgorithms []string `json:"integrityAlgorithms"` + DhGroups []PhaseDhGroupsInner `json:"dhGroups,omitempty"` + EncryptionAlgorithms []PhaseEncryptionAlgorithmsInner `json:"encryptionAlgorithms"` + IntegrityAlgorithms []PhaseIntegrityAlgorithmsInner `json:"integrityAlgorithms"` // Time to schedule a IKE re-keying (in seconds). RekeyTime *int32 `json:"rekeyTime,omitempty"` AdditionalProperties map[string]interface{} @@ -35,7 +35,7 @@ type _TunnelConfigurationPhase1 TunnelConfigurationPhase1 // 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 NewTunnelConfigurationPhase1(encryptionAlgorithms []string, integrityAlgorithms []string) *TunnelConfigurationPhase1 { +func NewTunnelConfigurationPhase1(encryptionAlgorithms []PhaseEncryptionAlgorithmsInner, integrityAlgorithms []PhaseIntegrityAlgorithmsInner) *TunnelConfigurationPhase1 { this := TunnelConfigurationPhase1{} this.EncryptionAlgorithms = encryptionAlgorithms this.IntegrityAlgorithms = integrityAlgorithms @@ -55,9 +55,9 @@ func NewTunnelConfigurationPhase1WithDefaults() *TunnelConfigurationPhase1 { } // GetDhGroups returns the DhGroups field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase1) GetDhGroups() []string { +func (o *TunnelConfigurationPhase1) GetDhGroups() []PhaseDhGroupsInner { if o == nil || IsNil(o.DhGroups) { - var ret []string + var ret []PhaseDhGroupsInner return ret } return o.DhGroups @@ -65,7 +65,7 @@ func (o *TunnelConfigurationPhase1) GetDhGroups() []string { // GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase1) GetDhGroupsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase1) GetDhGroupsOk() ([]PhaseDhGroupsInner, bool) { if o == nil || IsNil(o.DhGroups) { return nil, false } @@ -81,15 +81,15 @@ func (o *TunnelConfigurationPhase1) HasDhGroups() bool { return false } -// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field. -func (o *TunnelConfigurationPhase1) SetDhGroups(v []string) { +// SetDhGroups gets a reference to the given []PhaseDhGroupsInner and assigns it to the DhGroups field. +func (o *TunnelConfigurationPhase1) SetDhGroups(v []PhaseDhGroupsInner) { o.DhGroups = v } // GetEncryptionAlgorithms returns the EncryptionAlgorithms field value -func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() []string { +func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() []PhaseEncryptionAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseEncryptionAlgorithmsInner return ret } @@ -98,7 +98,7 @@ func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() []string { // GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() ([]PhaseEncryptionAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -106,14 +106,14 @@ func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() ([]string, bool) } // SetEncryptionAlgorithms sets field value -func (o *TunnelConfigurationPhase1) SetEncryptionAlgorithms(v []string) { +func (o *TunnelConfigurationPhase1) SetEncryptionAlgorithms(v []PhaseEncryptionAlgorithmsInner) { o.EncryptionAlgorithms = v } // GetIntegrityAlgorithms returns the IntegrityAlgorithms field value -func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() []string { +func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() []PhaseIntegrityAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseIntegrityAlgorithmsInner return ret } @@ -122,7 +122,7 @@ func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() []string { // GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() ([]PhaseIntegrityAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -130,7 +130,7 @@ func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() ([]string, bool) } // SetIntegrityAlgorithms sets field value -func (o *TunnelConfigurationPhase1) SetIntegrityAlgorithms(v []string) { +func (o *TunnelConfigurationPhase1) SetIntegrityAlgorithms(v []PhaseIntegrityAlgorithmsInner) { o.IntegrityAlgorithms = v } diff --git a/services/vpn/v1alpha1api/model_tunnel_configuration_phase2.go b/services/vpn/v1alpha1api/model_tunnel_configuration_phase2.go index 4de651f41..fd7b8b8fe 100644 --- a/services/vpn/v1alpha1api/model_tunnel_configuration_phase2.go +++ b/services/vpn/v1alpha1api/model_tunnel_configuration_phase2.go @@ -21,15 +21,13 @@ var _ MappedNullable = &TunnelConfigurationPhase2{} // TunnelConfigurationPhase2 struct for TunnelConfigurationPhase2 type TunnelConfigurationPhase2 struct { // The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. - DhGroups []string `json:"dhGroups,omitempty"` - EncryptionAlgorithms []string `json:"encryptionAlgorithms"` - IntegrityAlgorithms []string `json:"integrityAlgorithms"` - // Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA. - DpdAction *string `json:"dpdAction,omitempty"` + DhGroups []PhaseDhGroupsInner `json:"dhGroups,omitempty"` + EncryptionAlgorithms []PhaseEncryptionAlgorithmsInner `json:"encryptionAlgorithms"` + IntegrityAlgorithms []PhaseIntegrityAlgorithmsInner `json:"integrityAlgorithms"` + DpdAction *TunnelConfigurationPhase2AllOfDpdAction `json:"dpdAction,omitempty"` // Time to schedule a Child SA re-keying (in seconds). - RekeyTime *int32 `json:"rekeyTime,omitempty"` - // Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"start\": initiates the connection actively. - StartAction *string `json:"startAction,omitempty"` + RekeyTime *int32 `json:"rekeyTime,omitempty"` + StartAction *TunnelConfigurationPhase2AllOfStartAction `json:"startAction,omitempty"` AdditionalProperties map[string]interface{} } @@ -39,15 +37,15 @@ type _TunnelConfigurationPhase2 TunnelConfigurationPhase2 // 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 NewTunnelConfigurationPhase2(encryptionAlgorithms []string, integrityAlgorithms []string) *TunnelConfigurationPhase2 { +func NewTunnelConfigurationPhase2(encryptionAlgorithms []PhaseEncryptionAlgorithmsInner, integrityAlgorithms []PhaseIntegrityAlgorithmsInner) *TunnelConfigurationPhase2 { this := TunnelConfigurationPhase2{} this.EncryptionAlgorithms = encryptionAlgorithms this.IntegrityAlgorithms = integrityAlgorithms - var dpdAction string = "restart" + var dpdAction TunnelConfigurationPhase2AllOfDpdAction = TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_RESTART this.DpdAction = &dpdAction var rekeyTime int32 = 3600 this.RekeyTime = &rekeyTime - var startAction string = "start" + var startAction TunnelConfigurationPhase2AllOfStartAction = TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_START this.StartAction = &startAction return &this } @@ -57,19 +55,19 @@ func NewTunnelConfigurationPhase2(encryptionAlgorithms []string, integrityAlgori // but it doesn't guarantee that properties required by API are set func NewTunnelConfigurationPhase2WithDefaults() *TunnelConfigurationPhase2 { this := TunnelConfigurationPhase2{} - var dpdAction string = "restart" + var dpdAction TunnelConfigurationPhase2AllOfDpdAction = TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_RESTART this.DpdAction = &dpdAction var rekeyTime int32 = 3600 this.RekeyTime = &rekeyTime - var startAction string = "start" + var startAction TunnelConfigurationPhase2AllOfStartAction = TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_START this.StartAction = &startAction return &this } // GetDhGroups returns the DhGroups field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase2) GetDhGroups() []string { +func (o *TunnelConfigurationPhase2) GetDhGroups() []PhaseDhGroupsInner { if o == nil || IsNil(o.DhGroups) { - var ret []string + var ret []PhaseDhGroupsInner return ret } return o.DhGroups @@ -77,7 +75,7 @@ func (o *TunnelConfigurationPhase2) GetDhGroups() []string { // GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetDhGroupsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase2) GetDhGroupsOk() ([]PhaseDhGroupsInner, bool) { if o == nil || IsNil(o.DhGroups) { return nil, false } @@ -93,15 +91,15 @@ func (o *TunnelConfigurationPhase2) HasDhGroups() bool { return false } -// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field. -func (o *TunnelConfigurationPhase2) SetDhGroups(v []string) { +// SetDhGroups gets a reference to the given []PhaseDhGroupsInner and assigns it to the DhGroups field. +func (o *TunnelConfigurationPhase2) SetDhGroups(v []PhaseDhGroupsInner) { o.DhGroups = v } // GetEncryptionAlgorithms returns the EncryptionAlgorithms field value -func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() []string { +func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() []PhaseEncryptionAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseEncryptionAlgorithmsInner return ret } @@ -110,7 +108,7 @@ func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() []string { // GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() ([]PhaseEncryptionAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -118,14 +116,14 @@ func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() ([]string, bool) } // SetEncryptionAlgorithms sets field value -func (o *TunnelConfigurationPhase2) SetEncryptionAlgorithms(v []string) { +func (o *TunnelConfigurationPhase2) SetEncryptionAlgorithms(v []PhaseEncryptionAlgorithmsInner) { o.EncryptionAlgorithms = v } // GetIntegrityAlgorithms returns the IntegrityAlgorithms field value -func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() []string { +func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() []PhaseIntegrityAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseIntegrityAlgorithmsInner return ret } @@ -134,7 +132,7 @@ func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() []string { // GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() ([]PhaseIntegrityAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -142,14 +140,14 @@ func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() ([]string, bool) } // SetIntegrityAlgorithms sets field value -func (o *TunnelConfigurationPhase2) SetIntegrityAlgorithms(v []string) { +func (o *TunnelConfigurationPhase2) SetIntegrityAlgorithms(v []PhaseIntegrityAlgorithmsInner) { o.IntegrityAlgorithms = v } // GetDpdAction returns the DpdAction field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase2) GetDpdAction() string { +func (o *TunnelConfigurationPhase2) GetDpdAction() TunnelConfigurationPhase2AllOfDpdAction { if o == nil || IsNil(o.DpdAction) { - var ret string + var ret TunnelConfigurationPhase2AllOfDpdAction return ret } return *o.DpdAction @@ -157,7 +155,7 @@ func (o *TunnelConfigurationPhase2) GetDpdAction() string { // GetDpdActionOk returns a tuple with the DpdAction field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetDpdActionOk() (*string, bool) { +func (o *TunnelConfigurationPhase2) GetDpdActionOk() (*TunnelConfigurationPhase2AllOfDpdAction, bool) { if o == nil || IsNil(o.DpdAction) { return nil, false } @@ -173,8 +171,8 @@ func (o *TunnelConfigurationPhase2) HasDpdAction() bool { return false } -// SetDpdAction gets a reference to the given string and assigns it to the DpdAction field. -func (o *TunnelConfigurationPhase2) SetDpdAction(v string) { +// SetDpdAction gets a reference to the given TunnelConfigurationPhase2AllOfDpdAction and assigns it to the DpdAction field. +func (o *TunnelConfigurationPhase2) SetDpdAction(v TunnelConfigurationPhase2AllOfDpdAction) { o.DpdAction = &v } @@ -211,9 +209,9 @@ func (o *TunnelConfigurationPhase2) SetRekeyTime(v int32) { } // GetStartAction returns the StartAction field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase2) GetStartAction() string { +func (o *TunnelConfigurationPhase2) GetStartAction() TunnelConfigurationPhase2AllOfStartAction { if o == nil || IsNil(o.StartAction) { - var ret string + var ret TunnelConfigurationPhase2AllOfStartAction return ret } return *o.StartAction @@ -221,7 +219,7 @@ func (o *TunnelConfigurationPhase2) GetStartAction() string { // GetStartActionOk returns a tuple with the StartAction field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetStartActionOk() (*string, bool) { +func (o *TunnelConfigurationPhase2) GetStartActionOk() (*TunnelConfigurationPhase2AllOfStartAction, bool) { if o == nil || IsNil(o.StartAction) { return nil, false } @@ -237,8 +235,8 @@ func (o *TunnelConfigurationPhase2) HasStartAction() bool { return false } -// SetStartAction gets a reference to the given string and assigns it to the StartAction field. -func (o *TunnelConfigurationPhase2) SetStartAction(v string) { +// SetStartAction gets a reference to the given TunnelConfigurationPhase2AllOfStartAction and assigns it to the StartAction field. +func (o *TunnelConfigurationPhase2) SetStartAction(v TunnelConfigurationPhase2AllOfStartAction) { o.StartAction = &v } diff --git a/services/vpn/v1alpha1api/model_tunnel_configuration_phase2_all_of_dpd_action.go b/services/vpn/v1alpha1api/model_tunnel_configuration_phase2_all_of_dpd_action.go new file mode 100644 index 000000000..58649cc6f --- /dev/null +++ b/services/vpn/v1alpha1api/model_tunnel_configuration_phase2_all_of_dpd_action.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alpha1api + +import ( + "encoding/json" + "fmt" +) + +// TunnelConfigurationPhase2AllOfDpdAction Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA. +type TunnelConfigurationPhase2AllOfDpdAction string + +// List of TunnelConfiguration_phase2_allOf_dpdAction +const ( + TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_CLEAR TunnelConfigurationPhase2AllOfDpdAction = "clear" + TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_RESTART TunnelConfigurationPhase2AllOfDpdAction = "restart" + TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_UNKNOWN_DEFAULT_OPEN_API TunnelConfigurationPhase2AllOfDpdAction = "unknown_default_open_api" +) + +// All allowed values of TunnelConfigurationPhase2AllOfDpdAction enum +var AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues = []TunnelConfigurationPhase2AllOfDpdAction{ + "clear", + "restart", + "unknown_default_open_api", +} + +func (v *TunnelConfigurationPhase2AllOfDpdAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelConfigurationPhase2AllOfDpdAction(value) + for _, existing := range AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTunnelConfigurationPhase2AllOfDpdActionFromValue returns a pointer to a valid TunnelConfigurationPhase2AllOfDpdAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelConfigurationPhase2AllOfDpdActionFromValue(v string) (*TunnelConfigurationPhase2AllOfDpdAction, error) { + ev := TunnelConfigurationPhase2AllOfDpdAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2AllOfDpdAction: valid values are %v", v, AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelConfigurationPhase2AllOfDpdAction) IsValid() bool { + for _, existing := range AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TunnelConfiguration_phase2_allOf_dpdAction value +func (v TunnelConfigurationPhase2AllOfDpdAction) Ptr() *TunnelConfigurationPhase2AllOfDpdAction { + return &v +} + +type NullableTunnelConfigurationPhase2AllOfDpdAction struct { + value *TunnelConfigurationPhase2AllOfDpdAction + isSet bool +} + +func (v NullableTunnelConfigurationPhase2AllOfDpdAction) Get() *TunnelConfigurationPhase2AllOfDpdAction { + return v.value +} + +func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) Set(val *TunnelConfigurationPhase2AllOfDpdAction) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelConfigurationPhase2AllOfDpdAction) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelConfigurationPhase2AllOfDpdAction(val *TunnelConfigurationPhase2AllOfDpdAction) *NullableTunnelConfigurationPhase2AllOfDpdAction { + return &NullableTunnelConfigurationPhase2AllOfDpdAction{value: val, isSet: true} +} + +func (v NullableTunnelConfigurationPhase2AllOfDpdAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1alpha1api/model_tunnel_configuration_phase2_all_of_start_action.go b/services/vpn/v1alpha1api/model_tunnel_configuration_phase2_all_of_start_action.go new file mode 100644 index 000000000..3f3f1f996 --- /dev/null +++ b/services/vpn/v1alpha1api/model_tunnel_configuration_phase2_all_of_start_action.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alpha1api + +import ( + "encoding/json" + "fmt" +) + +// TunnelConfigurationPhase2AllOfStartAction Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"start\": initiates the connection actively. +type TunnelConfigurationPhase2AllOfStartAction string + +// List of TunnelConfiguration_phase2_allOf_startAction +const ( + TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_NONE TunnelConfigurationPhase2AllOfStartAction = "none" + TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_START TunnelConfigurationPhase2AllOfStartAction = "start" + TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_UNKNOWN_DEFAULT_OPEN_API TunnelConfigurationPhase2AllOfStartAction = "unknown_default_open_api" +) + +// All allowed values of TunnelConfigurationPhase2AllOfStartAction enum +var AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues = []TunnelConfigurationPhase2AllOfStartAction{ + "none", + "start", + "unknown_default_open_api", +} + +func (v *TunnelConfigurationPhase2AllOfStartAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelConfigurationPhase2AllOfStartAction(value) + for _, existing := range AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTunnelConfigurationPhase2AllOfStartActionFromValue returns a pointer to a valid TunnelConfigurationPhase2AllOfStartAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelConfigurationPhase2AllOfStartActionFromValue(v string) (*TunnelConfigurationPhase2AllOfStartAction, error) { + ev := TunnelConfigurationPhase2AllOfStartAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2AllOfStartAction: valid values are %v", v, AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelConfigurationPhase2AllOfStartAction) IsValid() bool { + for _, existing := range AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TunnelConfiguration_phase2_allOf_startAction value +func (v TunnelConfigurationPhase2AllOfStartAction) Ptr() *TunnelConfigurationPhase2AllOfStartAction { + return &v +} + +type NullableTunnelConfigurationPhase2AllOfStartAction struct { + value *TunnelConfigurationPhase2AllOfStartAction + isSet bool +} + +func (v NullableTunnelConfigurationPhase2AllOfStartAction) Get() *TunnelConfigurationPhase2AllOfStartAction { + return v.value +} + +func (v *NullableTunnelConfigurationPhase2AllOfStartAction) Set(val *TunnelConfigurationPhase2AllOfStartAction) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelConfigurationPhase2AllOfStartAction) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelConfigurationPhase2AllOfStartAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelConfigurationPhase2AllOfStartAction(val *TunnelConfigurationPhase2AllOfStartAction) *NullableTunnelConfigurationPhase2AllOfStartAction { + return &NullableTunnelConfigurationPhase2AllOfStartAction{value: val, isSet: true} +} + +func (v NullableTunnelConfigurationPhase2AllOfStartAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelConfigurationPhase2AllOfStartAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1alpha1api/model_tunnel_status.go b/services/vpn/v1alpha1api/model_tunnel_status.go index 5cd41d614..3771ac09c 100644 --- a/services/vpn/v1alpha1api/model_tunnel_status.go +++ b/services/vpn/v1alpha1api/model_tunnel_status.go @@ -19,10 +19,10 @@ var _ MappedNullable = &TunnelStatus{} // TunnelStatus Describes the status of the VPN itself. type TunnelStatus struct { - Established *bool `json:"established,omitempty"` - Name *string `json:"name,omitempty"` - Phase1 *Phase1Status `json:"phase1,omitempty"` - Phase2 *Phase2Status `json:"phase2,omitempty"` + Established *bool `json:"established,omitempty"` + Name *TunnelStatusName `json:"name,omitempty"` + Phase1 *Phase1Status `json:"phase1,omitempty"` + Phase2 *Phase2Status `json:"phase2,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +78,9 @@ func (o *TunnelStatus) SetEstablished(v bool) { } // GetName returns the Name field value if set, zero value otherwise. -func (o *TunnelStatus) GetName() string { +func (o *TunnelStatus) GetName() TunnelStatusName { if o == nil || IsNil(o.Name) { - var ret string + var ret TunnelStatusName return ret } return *o.Name @@ -88,7 +88,7 @@ func (o *TunnelStatus) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelStatus) GetNameOk() (*string, bool) { +func (o *TunnelStatus) GetNameOk() (*TunnelStatusName, bool) { if o == nil || IsNil(o.Name) { return nil, false } @@ -104,8 +104,8 @@ func (o *TunnelStatus) HasName() bool { return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *TunnelStatus) SetName(v string) { +// SetName gets a reference to the given TunnelStatusName and assigns it to the Name field. +func (o *TunnelStatus) SetName(v TunnelStatusName) { o.Name = &v } diff --git a/services/vpn/v1alpha1api/model_tunnel_status_name.go b/services/vpn/v1alpha1api/model_tunnel_status_name.go new file mode 100644 index 000000000..1579c4ff6 --- /dev/null +++ b/services/vpn/v1alpha1api/model_tunnel_status_name.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alpha1api + +import ( + "encoding/json" + "fmt" +) + +// TunnelStatusName the model 'TunnelStatusName' +type TunnelStatusName string + +// List of TunnelStatus_name +const ( + TUNNELSTATUSNAME_TUNNEL1 TunnelStatusName = "tunnel1" + TUNNELSTATUSNAME_TUNNEL2 TunnelStatusName = "tunnel2" + TUNNELSTATUSNAME_UNKNOWN_DEFAULT_OPEN_API TunnelStatusName = "unknown_default_open_api" +) + +// All allowed values of TunnelStatusName enum +var AllowedTunnelStatusNameEnumValues = []TunnelStatusName{ + "tunnel1", + "tunnel2", + "unknown_default_open_api", +} + +func (v *TunnelStatusName) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelStatusName(value) + for _, existing := range AllowedTunnelStatusNameEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TUNNELSTATUSNAME_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTunnelStatusNameFromValue returns a pointer to a valid TunnelStatusName +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelStatusNameFromValue(v string) (*TunnelStatusName, error) { + ev := TunnelStatusName(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelStatusName: valid values are %v", v, AllowedTunnelStatusNameEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelStatusName) IsValid() bool { + for _, existing := range AllowedTunnelStatusNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TunnelStatus_name value +func (v TunnelStatusName) Ptr() *TunnelStatusName { + return &v +} + +type NullableTunnelStatusName struct { + value *TunnelStatusName + isSet bool +} + +func (v NullableTunnelStatusName) Get() *TunnelStatusName { + return v.value +} + +func (v *NullableTunnelStatusName) Set(val *TunnelStatusName) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelStatusName) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelStatusName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelStatusName(val *TunnelStatusName) *NullableTunnelStatusName { + return &NullableTunnelStatusName{value: val, isSet: true} +} + +func (v NullableTunnelStatusName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelStatusName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1alpha1api/model_vpn_tunnels.go b/services/vpn/v1alpha1api/model_vpn_tunnels.go index 6e3d9b20f..8c1686874 100644 --- a/services/vpn/v1alpha1api/model_vpn_tunnels.go +++ b/services/vpn/v1alpha1api/model_vpn_tunnels.go @@ -21,7 +21,7 @@ var _ MappedNullable = &VPNTunnels{} type VPNTunnels struct { BgpStatus NullableBGPStatus `json:"bgpStatus,omitempty"` InstanceState *GatewayStatus `json:"instanceState,omitempty"` - Name *string `json:"name,omitempty"` + Name *VPNTunnelsName `json:"name,omitempty"` // The public IPv4 address of this endpoint. PublicIP *string `json:"publicIP,omitempty"` AdditionalProperties map[string]interface{} @@ -122,9 +122,9 @@ func (o *VPNTunnels) SetInstanceState(v GatewayStatus) { } // GetName returns the Name field value if set, zero value otherwise. -func (o *VPNTunnels) GetName() string { +func (o *VPNTunnels) GetName() VPNTunnelsName { if o == nil || IsNil(o.Name) { - var ret string + var ret VPNTunnelsName return ret } return *o.Name @@ -132,7 +132,7 @@ func (o *VPNTunnels) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VPNTunnels) GetNameOk() (*string, bool) { +func (o *VPNTunnels) GetNameOk() (*VPNTunnelsName, bool) { if o == nil || IsNil(o.Name) { return nil, false } @@ -148,8 +148,8 @@ func (o *VPNTunnels) HasName() bool { return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *VPNTunnels) SetName(v string) { +// SetName gets a reference to the given VPNTunnelsName and assigns it to the Name field. +func (o *VPNTunnels) SetName(v VPNTunnelsName) { o.Name = &v } diff --git a/services/vpn/v1alpha1api/model_vpn_tunnels_name.go b/services/vpn/v1alpha1api/model_vpn_tunnels_name.go new file mode 100644 index 000000000..e09bf852b --- /dev/null +++ b/services/vpn/v1alpha1api/model_vpn_tunnels_name.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alpha1api + +import ( + "encoding/json" + "fmt" +) + +// VPNTunnelsName the model 'VPNTunnelsName' +type VPNTunnelsName string + +// List of VPNTunnels_name +const ( + VPNTUNNELSNAME_TUNNEL1 VPNTunnelsName = "tunnel1" + VPNTUNNELSNAME_TUNNEL2 VPNTunnelsName = "tunnel2" + VPNTUNNELSNAME_UNKNOWN_DEFAULT_OPEN_API VPNTunnelsName = "unknown_default_open_api" +) + +// All allowed values of VPNTunnelsName enum +var AllowedVPNTunnelsNameEnumValues = []VPNTunnelsName{ + "tunnel1", + "tunnel2", + "unknown_default_open_api", +} + +func (v *VPNTunnelsName) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VPNTunnelsName(value) + for _, existing := range AllowedVPNTunnelsNameEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = VPNTUNNELSNAME_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewVPNTunnelsNameFromValue returns a pointer to a valid VPNTunnelsName +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVPNTunnelsNameFromValue(v string) (*VPNTunnelsName, error) { + ev := VPNTunnelsName(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VPNTunnelsName: valid values are %v", v, AllowedVPNTunnelsNameEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VPNTunnelsName) IsValid() bool { + for _, existing := range AllowedVPNTunnelsNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VPNTunnels_name value +func (v VPNTunnelsName) Ptr() *VPNTunnelsName { + return &v +} + +type NullableVPNTunnelsName struct { + value *VPNTunnelsName + isSet bool +} + +func (v NullableVPNTunnelsName) Get() *VPNTunnelsName { + return v.value +} + +func (v *NullableVPNTunnelsName) Set(val *VPNTunnelsName) { + v.value = val + v.isSet = true +} + +func (v NullableVPNTunnelsName) IsSet() bool { + return v.isSet +} + +func (v *NullableVPNTunnelsName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVPNTunnelsName(val *VPNTunnelsName) *NullableVPNTunnelsName { + return &NullableVPNTunnelsName{value: val, isSet: true} +} + +func (v NullableVPNTunnelsName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVPNTunnelsName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1api/model_api_error_detail.go b/services/vpn/v1api/model_api_error_detail.go index 3bea6e077..bd4536adf 100644 --- a/services/vpn/v1api/model_api_error_detail.go +++ b/services/vpn/v1api/model_api_error_detail.go @@ -23,9 +23,8 @@ type APIErrorDetail struct { // The domain of the error source. Domain string `json:"domain"` // Metadata contains more information. For bad requests this would be field information. - Metadata map[string]interface{} `json:"metadata,omitempty"` - // The reason why the error occurs. - Reason string `json:"reason"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Reason APIErrorDetailReason `json:"reason"` AdditionalProperties map[string]interface{} } @@ -35,7 +34,7 @@ type _APIErrorDetail APIErrorDetail // 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 NewAPIErrorDetail(domain string, reason string) *APIErrorDetail { +func NewAPIErrorDetail(domain string, reason APIErrorDetailReason) *APIErrorDetail { this := APIErrorDetail{} this.Domain = domain this.Reason = reason @@ -109,9 +108,9 @@ func (o *APIErrorDetail) SetMetadata(v map[string]interface{}) { } // GetReason returns the Reason field value -func (o *APIErrorDetail) GetReason() string { +func (o *APIErrorDetail) GetReason() APIErrorDetailReason { if o == nil { - var ret string + var ret APIErrorDetailReason return ret } @@ -120,7 +119,7 @@ func (o *APIErrorDetail) GetReason() string { // GetReasonOk returns a tuple with the Reason field value // and a boolean to check if the value has been set. -func (o *APIErrorDetail) GetReasonOk() (*string, bool) { +func (o *APIErrorDetail) GetReasonOk() (*APIErrorDetailReason, bool) { if o == nil { return nil, false } @@ -128,7 +127,7 @@ func (o *APIErrorDetail) GetReasonOk() (*string, bool) { } // SetReason sets field value -func (o *APIErrorDetail) SetReason(v string) { +func (o *APIErrorDetail) SetReason(v APIErrorDetailReason) { o.Reason = v } diff --git a/services/vpn/v1api/model_api_error_detail_reason.go b/services/vpn/v1api/model_api_error_detail_reason.go new file mode 100644 index 000000000..c4443bb73 --- /dev/null +++ b/services/vpn/v1api/model_api_error_detail_reason.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// APIErrorDetailReason The reason why the error occurs. +type APIErrorDetailReason string + +// List of APIErrorDetail_reason +const ( + APIERRORDETAILREASON_INVALID_FIELD APIErrorDetailReason = "INVALID_FIELD" + APIERRORDETAILREASON_INVALID_PATH_PARAMETER APIErrorDetailReason = "INVALID_PATH_PARAMETER" + APIERRORDETAILREASON_UNKNOWN_DEFAULT_OPEN_API APIErrorDetailReason = "unknown_default_open_api" +) + +// All allowed values of APIErrorDetailReason enum +var AllowedAPIErrorDetailReasonEnumValues = []APIErrorDetailReason{ + "INVALID_FIELD", + "INVALID_PATH_PARAMETER", + "unknown_default_open_api", +} + +func (v *APIErrorDetailReason) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := APIErrorDetailReason(value) + for _, existing := range AllowedAPIErrorDetailReasonEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = APIERRORDETAILREASON_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAPIErrorDetailReasonFromValue returns a pointer to a valid APIErrorDetailReason +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAPIErrorDetailReasonFromValue(v string) (*APIErrorDetailReason, error) { + ev := APIErrorDetailReason(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for APIErrorDetailReason: valid values are %v", v, AllowedAPIErrorDetailReasonEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v APIErrorDetailReason) IsValid() bool { + for _, existing := range AllowedAPIErrorDetailReasonEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to APIErrorDetail_reason value +func (v APIErrorDetailReason) Ptr() *APIErrorDetailReason { + return &v +} + +type NullableAPIErrorDetailReason struct { + value *APIErrorDetailReason + isSet bool +} + +func (v NullableAPIErrorDetailReason) Get() *APIErrorDetailReason { + return v.value +} + +func (v *NullableAPIErrorDetailReason) Set(val *APIErrorDetailReason) { + v.value = val + v.isSet = true +} + +func (v NullableAPIErrorDetailReason) IsSet() bool { + return v.isSet +} + +func (v *NullableAPIErrorDetailReason) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAPIErrorDetailReason(val *APIErrorDetailReason) *NullableAPIErrorDetailReason { + return &NullableAPIErrorDetailReason{value: val, isSet: true} +} + +func (v NullableAPIErrorDetailReason) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAPIErrorDetailReason) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1api/model_phase.go b/services/vpn/v1api/model_phase.go index 2dc1dbdbb..2cc42b1c4 100644 --- a/services/vpn/v1api/model_phase.go +++ b/services/vpn/v1api/model_phase.go @@ -21,9 +21,9 @@ var _ MappedNullable = &Phase{} // Phase struct for Phase type Phase struct { // The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. - DhGroups []string `json:"dhGroups,omitempty"` - EncryptionAlgorithms []string `json:"encryptionAlgorithms"` - IntegrityAlgorithms []string `json:"integrityAlgorithms"` + DhGroups []PhaseDhGroupsInner `json:"dhGroups,omitempty"` + EncryptionAlgorithms []PhaseEncryptionAlgorithmsInner `json:"encryptionAlgorithms"` + IntegrityAlgorithms []PhaseIntegrityAlgorithmsInner `json:"integrityAlgorithms"` AdditionalProperties map[string]interface{} } @@ -33,7 +33,7 @@ type _Phase Phase // 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 NewPhase(encryptionAlgorithms []string, integrityAlgorithms []string) *Phase { +func NewPhase(encryptionAlgorithms []PhaseEncryptionAlgorithmsInner, integrityAlgorithms []PhaseIntegrityAlgorithmsInner) *Phase { this := Phase{} this.EncryptionAlgorithms = encryptionAlgorithms this.IntegrityAlgorithms = integrityAlgorithms @@ -49,9 +49,9 @@ func NewPhaseWithDefaults() *Phase { } // GetDhGroups returns the DhGroups field value if set, zero value otherwise. -func (o *Phase) GetDhGroups() []string { +func (o *Phase) GetDhGroups() []PhaseDhGroupsInner { if o == nil || IsNil(o.DhGroups) { - var ret []string + var ret []PhaseDhGroupsInner return ret } return o.DhGroups @@ -59,7 +59,7 @@ func (o *Phase) GetDhGroups() []string { // GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Phase) GetDhGroupsOk() ([]string, bool) { +func (o *Phase) GetDhGroupsOk() ([]PhaseDhGroupsInner, bool) { if o == nil || IsNil(o.DhGroups) { return nil, false } @@ -75,15 +75,15 @@ func (o *Phase) HasDhGroups() bool { return false } -// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field. -func (o *Phase) SetDhGroups(v []string) { +// SetDhGroups gets a reference to the given []PhaseDhGroupsInner and assigns it to the DhGroups field. +func (o *Phase) SetDhGroups(v []PhaseDhGroupsInner) { o.DhGroups = v } // GetEncryptionAlgorithms returns the EncryptionAlgorithms field value -func (o *Phase) GetEncryptionAlgorithms() []string { +func (o *Phase) GetEncryptionAlgorithms() []PhaseEncryptionAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseEncryptionAlgorithmsInner return ret } @@ -92,7 +92,7 @@ func (o *Phase) GetEncryptionAlgorithms() []string { // GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value // and a boolean to check if the value has been set. -func (o *Phase) GetEncryptionAlgorithmsOk() ([]string, bool) { +func (o *Phase) GetEncryptionAlgorithmsOk() ([]PhaseEncryptionAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -100,14 +100,14 @@ func (o *Phase) GetEncryptionAlgorithmsOk() ([]string, bool) { } // SetEncryptionAlgorithms sets field value -func (o *Phase) SetEncryptionAlgorithms(v []string) { +func (o *Phase) SetEncryptionAlgorithms(v []PhaseEncryptionAlgorithmsInner) { o.EncryptionAlgorithms = v } // GetIntegrityAlgorithms returns the IntegrityAlgorithms field value -func (o *Phase) GetIntegrityAlgorithms() []string { +func (o *Phase) GetIntegrityAlgorithms() []PhaseIntegrityAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseIntegrityAlgorithmsInner return ret } @@ -116,7 +116,7 @@ func (o *Phase) GetIntegrityAlgorithms() []string { // GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value // and a boolean to check if the value has been set. -func (o *Phase) GetIntegrityAlgorithmsOk() ([]string, bool) { +func (o *Phase) GetIntegrityAlgorithmsOk() ([]PhaseIntegrityAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -124,7 +124,7 @@ func (o *Phase) GetIntegrityAlgorithmsOk() ([]string, bool) { } // SetIntegrityAlgorithms sets field value -func (o *Phase) SetIntegrityAlgorithms(v []string) { +func (o *Phase) SetIntegrityAlgorithms(v []PhaseIntegrityAlgorithmsInner) { o.IntegrityAlgorithms = v } diff --git a/services/vpn/v1api/model_phase_dh_groups_inner.go b/services/vpn/v1api/model_phase_dh_groups_inner.go new file mode 100644 index 000000000..8d443c173 --- /dev/null +++ b/services/vpn/v1api/model_phase_dh_groups_inner.go @@ -0,0 +1,119 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// PhaseDhGroupsInner the model 'PhaseDhGroupsInner' +type PhaseDhGroupsInner string + +// List of Phase_dhGroups_inner +const ( + PHASEDHGROUPSINNER_MODP1024 PhaseDhGroupsInner = "modp1024" + PHASEDHGROUPSINNER_MODP2048 PhaseDhGroupsInner = "modp2048" + PHASEDHGROUPSINNER_ECP256 PhaseDhGroupsInner = "ecp256" + PHASEDHGROUPSINNER_ECP384 PhaseDhGroupsInner = "ecp384" + PHASEDHGROUPSINNER_MODP2048S256 PhaseDhGroupsInner = "modp2048s256" + PHASEDHGROUPSINNER_UNKNOWN_DEFAULT_OPEN_API PhaseDhGroupsInner = "unknown_default_open_api" +) + +// All allowed values of PhaseDhGroupsInner enum +var AllowedPhaseDhGroupsInnerEnumValues = []PhaseDhGroupsInner{ + "modp1024", + "modp2048", + "ecp256", + "ecp384", + "modp2048s256", + "unknown_default_open_api", +} + +func (v *PhaseDhGroupsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PhaseDhGroupsInner(value) + for _, existing := range AllowedPhaseDhGroupsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PHASEDHGROUPSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPhaseDhGroupsInnerFromValue returns a pointer to a valid PhaseDhGroupsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPhaseDhGroupsInnerFromValue(v string) (*PhaseDhGroupsInner, error) { + ev := PhaseDhGroupsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PhaseDhGroupsInner: valid values are %v", v, AllowedPhaseDhGroupsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PhaseDhGroupsInner) IsValid() bool { + for _, existing := range AllowedPhaseDhGroupsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Phase_dhGroups_inner value +func (v PhaseDhGroupsInner) Ptr() *PhaseDhGroupsInner { + return &v +} + +type NullablePhaseDhGroupsInner struct { + value *PhaseDhGroupsInner + isSet bool +} + +func (v NullablePhaseDhGroupsInner) Get() *PhaseDhGroupsInner { + return v.value +} + +func (v *NullablePhaseDhGroupsInner) Set(val *PhaseDhGroupsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePhaseDhGroupsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePhaseDhGroupsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhaseDhGroupsInner(val *PhaseDhGroupsInner) *NullablePhaseDhGroupsInner { + return &NullablePhaseDhGroupsInner{value: val, isSet: true} +} + +func (v NullablePhaseDhGroupsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhaseDhGroupsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1api/model_phase_encryption_algorithms_inner.go b/services/vpn/v1api/model_phase_encryption_algorithms_inner.go new file mode 100644 index 000000000..71850687b --- /dev/null +++ b/services/vpn/v1api/model_phase_encryption_algorithms_inner.go @@ -0,0 +1,115 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// PhaseEncryptionAlgorithmsInner the model 'PhaseEncryptionAlgorithmsInner' +type PhaseEncryptionAlgorithmsInner string + +// List of Phase_encryptionAlgorithms_inner +const ( + PHASEENCRYPTIONALGORITHMSINNER_AES256 PhaseEncryptionAlgorithmsInner = "aes256" + PHASEENCRYPTIONALGORITHMSINNER_AES128GCM16 PhaseEncryptionAlgorithmsInner = "aes128gcm16" + PHASEENCRYPTIONALGORITHMSINNER_AES256GCM16 PhaseEncryptionAlgorithmsInner = "aes256gcm16" + PHASEENCRYPTIONALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API PhaseEncryptionAlgorithmsInner = "unknown_default_open_api" +) + +// All allowed values of PhaseEncryptionAlgorithmsInner enum +var AllowedPhaseEncryptionAlgorithmsInnerEnumValues = []PhaseEncryptionAlgorithmsInner{ + "aes256", + "aes128gcm16", + "aes256gcm16", + "unknown_default_open_api", +} + +func (v *PhaseEncryptionAlgorithmsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PhaseEncryptionAlgorithmsInner(value) + for _, existing := range AllowedPhaseEncryptionAlgorithmsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PHASEENCRYPTIONALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPhaseEncryptionAlgorithmsInnerFromValue returns a pointer to a valid PhaseEncryptionAlgorithmsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPhaseEncryptionAlgorithmsInnerFromValue(v string) (*PhaseEncryptionAlgorithmsInner, error) { + ev := PhaseEncryptionAlgorithmsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PhaseEncryptionAlgorithmsInner: valid values are %v", v, AllowedPhaseEncryptionAlgorithmsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PhaseEncryptionAlgorithmsInner) IsValid() bool { + for _, existing := range AllowedPhaseEncryptionAlgorithmsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Phase_encryptionAlgorithms_inner value +func (v PhaseEncryptionAlgorithmsInner) Ptr() *PhaseEncryptionAlgorithmsInner { + return &v +} + +type NullablePhaseEncryptionAlgorithmsInner struct { + value *PhaseEncryptionAlgorithmsInner + isSet bool +} + +func (v NullablePhaseEncryptionAlgorithmsInner) Get() *PhaseEncryptionAlgorithmsInner { + return v.value +} + +func (v *NullablePhaseEncryptionAlgorithmsInner) Set(val *PhaseEncryptionAlgorithmsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePhaseEncryptionAlgorithmsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePhaseEncryptionAlgorithmsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhaseEncryptionAlgorithmsInner(val *PhaseEncryptionAlgorithmsInner) *NullablePhaseEncryptionAlgorithmsInner { + return &NullablePhaseEncryptionAlgorithmsInner{value: val, isSet: true} +} + +func (v NullablePhaseEncryptionAlgorithmsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhaseEncryptionAlgorithmsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1api/model_phase_integrity_algorithms_inner.go b/services/vpn/v1api/model_phase_integrity_algorithms_inner.go new file mode 100644 index 000000000..6ecbb8857 --- /dev/null +++ b/services/vpn/v1api/model_phase_integrity_algorithms_inner.go @@ -0,0 +1,115 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// PhaseIntegrityAlgorithmsInner the model 'PhaseIntegrityAlgorithmsInner' +type PhaseIntegrityAlgorithmsInner string + +// List of Phase_integrityAlgorithms_inner +const ( + PHASEINTEGRITYALGORITHMSINNER_SHA1 PhaseIntegrityAlgorithmsInner = "sha1" + PHASEINTEGRITYALGORITHMSINNER_SHA2_256 PhaseIntegrityAlgorithmsInner = "sha2_256" + PHASEINTEGRITYALGORITHMSINNER_SHA2_384 PhaseIntegrityAlgorithmsInner = "sha2_384" + PHASEINTEGRITYALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API PhaseIntegrityAlgorithmsInner = "unknown_default_open_api" +) + +// All allowed values of PhaseIntegrityAlgorithmsInner enum +var AllowedPhaseIntegrityAlgorithmsInnerEnumValues = []PhaseIntegrityAlgorithmsInner{ + "sha1", + "sha2_256", + "sha2_384", + "unknown_default_open_api", +} + +func (v *PhaseIntegrityAlgorithmsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PhaseIntegrityAlgorithmsInner(value) + for _, existing := range AllowedPhaseIntegrityAlgorithmsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PHASEINTEGRITYALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPhaseIntegrityAlgorithmsInnerFromValue returns a pointer to a valid PhaseIntegrityAlgorithmsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPhaseIntegrityAlgorithmsInnerFromValue(v string) (*PhaseIntegrityAlgorithmsInner, error) { + ev := PhaseIntegrityAlgorithmsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PhaseIntegrityAlgorithmsInner: valid values are %v", v, AllowedPhaseIntegrityAlgorithmsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PhaseIntegrityAlgorithmsInner) IsValid() bool { + for _, existing := range AllowedPhaseIntegrityAlgorithmsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Phase_integrityAlgorithms_inner value +func (v PhaseIntegrityAlgorithmsInner) Ptr() *PhaseIntegrityAlgorithmsInner { + return &v +} + +type NullablePhaseIntegrityAlgorithmsInner struct { + value *PhaseIntegrityAlgorithmsInner + isSet bool +} + +func (v NullablePhaseIntegrityAlgorithmsInner) Get() *PhaseIntegrityAlgorithmsInner { + return v.value +} + +func (v *NullablePhaseIntegrityAlgorithmsInner) Set(val *PhaseIntegrityAlgorithmsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePhaseIntegrityAlgorithmsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePhaseIntegrityAlgorithmsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhaseIntegrityAlgorithmsInner(val *PhaseIntegrityAlgorithmsInner) *NullablePhaseIntegrityAlgorithmsInner { + return &NullablePhaseIntegrityAlgorithmsInner{value: val, isSet: true} +} + +func (v NullablePhaseIntegrityAlgorithmsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhaseIntegrityAlgorithmsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1api/model_tunnel_configuration_phase1.go b/services/vpn/v1api/model_tunnel_configuration_phase1.go index e3b06c4cd..b2073c635 100644 --- a/services/vpn/v1api/model_tunnel_configuration_phase1.go +++ b/services/vpn/v1api/model_tunnel_configuration_phase1.go @@ -21,9 +21,9 @@ var _ MappedNullable = &TunnelConfigurationPhase1{} // TunnelConfigurationPhase1 struct for TunnelConfigurationPhase1 type TunnelConfigurationPhase1 struct { // The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. - DhGroups []string `json:"dhGroups,omitempty"` - EncryptionAlgorithms []string `json:"encryptionAlgorithms"` - IntegrityAlgorithms []string `json:"integrityAlgorithms"` + DhGroups []PhaseDhGroupsInner `json:"dhGroups,omitempty"` + EncryptionAlgorithms []PhaseEncryptionAlgorithmsInner `json:"encryptionAlgorithms"` + IntegrityAlgorithms []PhaseIntegrityAlgorithmsInner `json:"integrityAlgorithms"` // Time to schedule a IKE re-keying (in seconds). RekeyTime *int32 `json:"rekeyTime,omitempty"` AdditionalProperties map[string]interface{} @@ -35,7 +35,7 @@ type _TunnelConfigurationPhase1 TunnelConfigurationPhase1 // 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 NewTunnelConfigurationPhase1(encryptionAlgorithms []string, integrityAlgorithms []string) *TunnelConfigurationPhase1 { +func NewTunnelConfigurationPhase1(encryptionAlgorithms []PhaseEncryptionAlgorithmsInner, integrityAlgorithms []PhaseIntegrityAlgorithmsInner) *TunnelConfigurationPhase1 { this := TunnelConfigurationPhase1{} this.EncryptionAlgorithms = encryptionAlgorithms this.IntegrityAlgorithms = integrityAlgorithms @@ -55,9 +55,9 @@ func NewTunnelConfigurationPhase1WithDefaults() *TunnelConfigurationPhase1 { } // GetDhGroups returns the DhGroups field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase1) GetDhGroups() []string { +func (o *TunnelConfigurationPhase1) GetDhGroups() []PhaseDhGroupsInner { if o == nil || IsNil(o.DhGroups) { - var ret []string + var ret []PhaseDhGroupsInner return ret } return o.DhGroups @@ -65,7 +65,7 @@ func (o *TunnelConfigurationPhase1) GetDhGroups() []string { // GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase1) GetDhGroupsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase1) GetDhGroupsOk() ([]PhaseDhGroupsInner, bool) { if o == nil || IsNil(o.DhGroups) { return nil, false } @@ -81,15 +81,15 @@ func (o *TunnelConfigurationPhase1) HasDhGroups() bool { return false } -// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field. -func (o *TunnelConfigurationPhase1) SetDhGroups(v []string) { +// SetDhGroups gets a reference to the given []PhaseDhGroupsInner and assigns it to the DhGroups field. +func (o *TunnelConfigurationPhase1) SetDhGroups(v []PhaseDhGroupsInner) { o.DhGroups = v } // GetEncryptionAlgorithms returns the EncryptionAlgorithms field value -func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() []string { +func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() []PhaseEncryptionAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseEncryptionAlgorithmsInner return ret } @@ -98,7 +98,7 @@ func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() []string { // GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() ([]PhaseEncryptionAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -106,14 +106,14 @@ func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() ([]string, bool) } // SetEncryptionAlgorithms sets field value -func (o *TunnelConfigurationPhase1) SetEncryptionAlgorithms(v []string) { +func (o *TunnelConfigurationPhase1) SetEncryptionAlgorithms(v []PhaseEncryptionAlgorithmsInner) { o.EncryptionAlgorithms = v } // GetIntegrityAlgorithms returns the IntegrityAlgorithms field value -func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() []string { +func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() []PhaseIntegrityAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseIntegrityAlgorithmsInner return ret } @@ -122,7 +122,7 @@ func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() []string { // GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() ([]PhaseIntegrityAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -130,7 +130,7 @@ func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() ([]string, bool) } // SetIntegrityAlgorithms sets field value -func (o *TunnelConfigurationPhase1) SetIntegrityAlgorithms(v []string) { +func (o *TunnelConfigurationPhase1) SetIntegrityAlgorithms(v []PhaseIntegrityAlgorithmsInner) { o.IntegrityAlgorithms = v } diff --git a/services/vpn/v1api/model_tunnel_configuration_phase2.go b/services/vpn/v1api/model_tunnel_configuration_phase2.go index d1096c1b4..a82c997d1 100644 --- a/services/vpn/v1api/model_tunnel_configuration_phase2.go +++ b/services/vpn/v1api/model_tunnel_configuration_phase2.go @@ -21,15 +21,13 @@ var _ MappedNullable = &TunnelConfigurationPhase2{} // TunnelConfigurationPhase2 struct for TunnelConfigurationPhase2 type TunnelConfigurationPhase2 struct { // The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. - DhGroups []string `json:"dhGroups,omitempty"` - EncryptionAlgorithms []string `json:"encryptionAlgorithms"` - IntegrityAlgorithms []string `json:"integrityAlgorithms"` - // Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA. - DpdAction *string `json:"dpdAction,omitempty"` + DhGroups []PhaseDhGroupsInner `json:"dhGroups,omitempty"` + EncryptionAlgorithms []PhaseEncryptionAlgorithmsInner `json:"encryptionAlgorithms"` + IntegrityAlgorithms []PhaseIntegrityAlgorithmsInner `json:"integrityAlgorithms"` + DpdAction *TunnelConfigurationPhase2AllOfDpdAction `json:"dpdAction,omitempty"` // Time to schedule a Child SA re-keying (in seconds). - RekeyTime *int32 `json:"rekeyTime,omitempty"` - // Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"start\": initiates the connection actively. - StartAction *string `json:"startAction,omitempty"` + RekeyTime *int32 `json:"rekeyTime,omitempty"` + StartAction *TunnelConfigurationPhase2AllOfStartAction `json:"startAction,omitempty"` AdditionalProperties map[string]interface{} } @@ -39,15 +37,15 @@ type _TunnelConfigurationPhase2 TunnelConfigurationPhase2 // 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 NewTunnelConfigurationPhase2(encryptionAlgorithms []string, integrityAlgorithms []string) *TunnelConfigurationPhase2 { +func NewTunnelConfigurationPhase2(encryptionAlgorithms []PhaseEncryptionAlgorithmsInner, integrityAlgorithms []PhaseIntegrityAlgorithmsInner) *TunnelConfigurationPhase2 { this := TunnelConfigurationPhase2{} this.EncryptionAlgorithms = encryptionAlgorithms this.IntegrityAlgorithms = integrityAlgorithms - var dpdAction string = "restart" + var dpdAction TunnelConfigurationPhase2AllOfDpdAction = TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_RESTART this.DpdAction = &dpdAction var rekeyTime int32 = 3600 this.RekeyTime = &rekeyTime - var startAction string = "start" + var startAction TunnelConfigurationPhase2AllOfStartAction = TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_START this.StartAction = &startAction return &this } @@ -57,19 +55,19 @@ func NewTunnelConfigurationPhase2(encryptionAlgorithms []string, integrityAlgori // but it doesn't guarantee that properties required by API are set func NewTunnelConfigurationPhase2WithDefaults() *TunnelConfigurationPhase2 { this := TunnelConfigurationPhase2{} - var dpdAction string = "restart" + var dpdAction TunnelConfigurationPhase2AllOfDpdAction = TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_RESTART this.DpdAction = &dpdAction var rekeyTime int32 = 3600 this.RekeyTime = &rekeyTime - var startAction string = "start" + var startAction TunnelConfigurationPhase2AllOfStartAction = TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_START this.StartAction = &startAction return &this } // GetDhGroups returns the DhGroups field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase2) GetDhGroups() []string { +func (o *TunnelConfigurationPhase2) GetDhGroups() []PhaseDhGroupsInner { if o == nil || IsNil(o.DhGroups) { - var ret []string + var ret []PhaseDhGroupsInner return ret } return o.DhGroups @@ -77,7 +75,7 @@ func (o *TunnelConfigurationPhase2) GetDhGroups() []string { // GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetDhGroupsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase2) GetDhGroupsOk() ([]PhaseDhGroupsInner, bool) { if o == nil || IsNil(o.DhGroups) { return nil, false } @@ -93,15 +91,15 @@ func (o *TunnelConfigurationPhase2) HasDhGroups() bool { return false } -// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field. -func (o *TunnelConfigurationPhase2) SetDhGroups(v []string) { +// SetDhGroups gets a reference to the given []PhaseDhGroupsInner and assigns it to the DhGroups field. +func (o *TunnelConfigurationPhase2) SetDhGroups(v []PhaseDhGroupsInner) { o.DhGroups = v } // GetEncryptionAlgorithms returns the EncryptionAlgorithms field value -func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() []string { +func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() []PhaseEncryptionAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseEncryptionAlgorithmsInner return ret } @@ -110,7 +108,7 @@ func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() []string { // GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() ([]PhaseEncryptionAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -118,14 +116,14 @@ func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() ([]string, bool) } // SetEncryptionAlgorithms sets field value -func (o *TunnelConfigurationPhase2) SetEncryptionAlgorithms(v []string) { +func (o *TunnelConfigurationPhase2) SetEncryptionAlgorithms(v []PhaseEncryptionAlgorithmsInner) { o.EncryptionAlgorithms = v } // GetIntegrityAlgorithms returns the IntegrityAlgorithms field value -func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() []string { +func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() []PhaseIntegrityAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseIntegrityAlgorithmsInner return ret } @@ -134,7 +132,7 @@ func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() []string { // GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() ([]PhaseIntegrityAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -142,14 +140,14 @@ func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() ([]string, bool) } // SetIntegrityAlgorithms sets field value -func (o *TunnelConfigurationPhase2) SetIntegrityAlgorithms(v []string) { +func (o *TunnelConfigurationPhase2) SetIntegrityAlgorithms(v []PhaseIntegrityAlgorithmsInner) { o.IntegrityAlgorithms = v } // GetDpdAction returns the DpdAction field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase2) GetDpdAction() string { +func (o *TunnelConfigurationPhase2) GetDpdAction() TunnelConfigurationPhase2AllOfDpdAction { if o == nil || IsNil(o.DpdAction) { - var ret string + var ret TunnelConfigurationPhase2AllOfDpdAction return ret } return *o.DpdAction @@ -157,7 +155,7 @@ func (o *TunnelConfigurationPhase2) GetDpdAction() string { // GetDpdActionOk returns a tuple with the DpdAction field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetDpdActionOk() (*string, bool) { +func (o *TunnelConfigurationPhase2) GetDpdActionOk() (*TunnelConfigurationPhase2AllOfDpdAction, bool) { if o == nil || IsNil(o.DpdAction) { return nil, false } @@ -173,8 +171,8 @@ func (o *TunnelConfigurationPhase2) HasDpdAction() bool { return false } -// SetDpdAction gets a reference to the given string and assigns it to the DpdAction field. -func (o *TunnelConfigurationPhase2) SetDpdAction(v string) { +// SetDpdAction gets a reference to the given TunnelConfigurationPhase2AllOfDpdAction and assigns it to the DpdAction field. +func (o *TunnelConfigurationPhase2) SetDpdAction(v TunnelConfigurationPhase2AllOfDpdAction) { o.DpdAction = &v } @@ -211,9 +209,9 @@ func (o *TunnelConfigurationPhase2) SetRekeyTime(v int32) { } // GetStartAction returns the StartAction field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase2) GetStartAction() string { +func (o *TunnelConfigurationPhase2) GetStartAction() TunnelConfigurationPhase2AllOfStartAction { if o == nil || IsNil(o.StartAction) { - var ret string + var ret TunnelConfigurationPhase2AllOfStartAction return ret } return *o.StartAction @@ -221,7 +219,7 @@ func (o *TunnelConfigurationPhase2) GetStartAction() string { // GetStartActionOk returns a tuple with the StartAction field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetStartActionOk() (*string, bool) { +func (o *TunnelConfigurationPhase2) GetStartActionOk() (*TunnelConfigurationPhase2AllOfStartAction, bool) { if o == nil || IsNil(o.StartAction) { return nil, false } @@ -237,8 +235,8 @@ func (o *TunnelConfigurationPhase2) HasStartAction() bool { return false } -// SetStartAction gets a reference to the given string and assigns it to the StartAction field. -func (o *TunnelConfigurationPhase2) SetStartAction(v string) { +// SetStartAction gets a reference to the given TunnelConfigurationPhase2AllOfStartAction and assigns it to the StartAction field. +func (o *TunnelConfigurationPhase2) SetStartAction(v TunnelConfigurationPhase2AllOfStartAction) { o.StartAction = &v } diff --git a/services/vpn/v1api/model_tunnel_configuration_phase2_all_of_dpd_action.go b/services/vpn/v1api/model_tunnel_configuration_phase2_all_of_dpd_action.go new file mode 100644 index 000000000..3157e72d1 --- /dev/null +++ b/services/vpn/v1api/model_tunnel_configuration_phase2_all_of_dpd_action.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// TunnelConfigurationPhase2AllOfDpdAction Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA. +type TunnelConfigurationPhase2AllOfDpdAction string + +// List of TunnelConfiguration_phase2_allOf_dpdAction +const ( + TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_CLEAR TunnelConfigurationPhase2AllOfDpdAction = "clear" + TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_RESTART TunnelConfigurationPhase2AllOfDpdAction = "restart" + TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_UNKNOWN_DEFAULT_OPEN_API TunnelConfigurationPhase2AllOfDpdAction = "unknown_default_open_api" +) + +// All allowed values of TunnelConfigurationPhase2AllOfDpdAction enum +var AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues = []TunnelConfigurationPhase2AllOfDpdAction{ + "clear", + "restart", + "unknown_default_open_api", +} + +func (v *TunnelConfigurationPhase2AllOfDpdAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelConfigurationPhase2AllOfDpdAction(value) + for _, existing := range AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTunnelConfigurationPhase2AllOfDpdActionFromValue returns a pointer to a valid TunnelConfigurationPhase2AllOfDpdAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelConfigurationPhase2AllOfDpdActionFromValue(v string) (*TunnelConfigurationPhase2AllOfDpdAction, error) { + ev := TunnelConfigurationPhase2AllOfDpdAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2AllOfDpdAction: valid values are %v", v, AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelConfigurationPhase2AllOfDpdAction) IsValid() bool { + for _, existing := range AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TunnelConfiguration_phase2_allOf_dpdAction value +func (v TunnelConfigurationPhase2AllOfDpdAction) Ptr() *TunnelConfigurationPhase2AllOfDpdAction { + return &v +} + +type NullableTunnelConfigurationPhase2AllOfDpdAction struct { + value *TunnelConfigurationPhase2AllOfDpdAction + isSet bool +} + +func (v NullableTunnelConfigurationPhase2AllOfDpdAction) Get() *TunnelConfigurationPhase2AllOfDpdAction { + return v.value +} + +func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) Set(val *TunnelConfigurationPhase2AllOfDpdAction) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelConfigurationPhase2AllOfDpdAction) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelConfigurationPhase2AllOfDpdAction(val *TunnelConfigurationPhase2AllOfDpdAction) *NullableTunnelConfigurationPhase2AllOfDpdAction { + return &NullableTunnelConfigurationPhase2AllOfDpdAction{value: val, isSet: true} +} + +func (v NullableTunnelConfigurationPhase2AllOfDpdAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1api/model_tunnel_configuration_phase2_all_of_start_action.go b/services/vpn/v1api/model_tunnel_configuration_phase2_all_of_start_action.go new file mode 100644 index 000000000..46e20ebf0 --- /dev/null +++ b/services/vpn/v1api/model_tunnel_configuration_phase2_all_of_start_action.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// TunnelConfigurationPhase2AllOfStartAction Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"start\": initiates the connection actively. +type TunnelConfigurationPhase2AllOfStartAction string + +// List of TunnelConfiguration_phase2_allOf_startAction +const ( + TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_NONE TunnelConfigurationPhase2AllOfStartAction = "none" + TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_START TunnelConfigurationPhase2AllOfStartAction = "start" + TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_UNKNOWN_DEFAULT_OPEN_API TunnelConfigurationPhase2AllOfStartAction = "unknown_default_open_api" +) + +// All allowed values of TunnelConfigurationPhase2AllOfStartAction enum +var AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues = []TunnelConfigurationPhase2AllOfStartAction{ + "none", + "start", + "unknown_default_open_api", +} + +func (v *TunnelConfigurationPhase2AllOfStartAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelConfigurationPhase2AllOfStartAction(value) + for _, existing := range AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTunnelConfigurationPhase2AllOfStartActionFromValue returns a pointer to a valid TunnelConfigurationPhase2AllOfStartAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelConfigurationPhase2AllOfStartActionFromValue(v string) (*TunnelConfigurationPhase2AllOfStartAction, error) { + ev := TunnelConfigurationPhase2AllOfStartAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2AllOfStartAction: valid values are %v", v, AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelConfigurationPhase2AllOfStartAction) IsValid() bool { + for _, existing := range AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TunnelConfiguration_phase2_allOf_startAction value +func (v TunnelConfigurationPhase2AllOfStartAction) Ptr() *TunnelConfigurationPhase2AllOfStartAction { + return &v +} + +type NullableTunnelConfigurationPhase2AllOfStartAction struct { + value *TunnelConfigurationPhase2AllOfStartAction + isSet bool +} + +func (v NullableTunnelConfigurationPhase2AllOfStartAction) Get() *TunnelConfigurationPhase2AllOfStartAction { + return v.value +} + +func (v *NullableTunnelConfigurationPhase2AllOfStartAction) Set(val *TunnelConfigurationPhase2AllOfStartAction) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelConfigurationPhase2AllOfStartAction) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelConfigurationPhase2AllOfStartAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelConfigurationPhase2AllOfStartAction(val *TunnelConfigurationPhase2AllOfStartAction) *NullableTunnelConfigurationPhase2AllOfStartAction { + return &NullableTunnelConfigurationPhase2AllOfStartAction{value: val, isSet: true} +} + +func (v NullableTunnelConfigurationPhase2AllOfStartAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelConfigurationPhase2AllOfStartAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1api/model_tunnel_status.go b/services/vpn/v1api/model_tunnel_status.go index 084d341d8..07b25ccef 100644 --- a/services/vpn/v1api/model_tunnel_status.go +++ b/services/vpn/v1api/model_tunnel_status.go @@ -19,10 +19,10 @@ var _ MappedNullable = &TunnelStatus{} // TunnelStatus Describes the status of the VPN itself. type TunnelStatus struct { - Established *bool `json:"established,omitempty"` - Name *string `json:"name,omitempty"` - Phase1 *Phase1Status `json:"phase1,omitempty"` - Phase2 *Phase2Status `json:"phase2,omitempty"` + Established *bool `json:"established,omitempty"` + Name *TunnelStatusName `json:"name,omitempty"` + Phase1 *Phase1Status `json:"phase1,omitempty"` + Phase2 *Phase2Status `json:"phase2,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +78,9 @@ func (o *TunnelStatus) SetEstablished(v bool) { } // GetName returns the Name field value if set, zero value otherwise. -func (o *TunnelStatus) GetName() string { +func (o *TunnelStatus) GetName() TunnelStatusName { if o == nil || IsNil(o.Name) { - var ret string + var ret TunnelStatusName return ret } return *o.Name @@ -88,7 +88,7 @@ func (o *TunnelStatus) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelStatus) GetNameOk() (*string, bool) { +func (o *TunnelStatus) GetNameOk() (*TunnelStatusName, bool) { if o == nil || IsNil(o.Name) { return nil, false } @@ -104,8 +104,8 @@ func (o *TunnelStatus) HasName() bool { return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *TunnelStatus) SetName(v string) { +// SetName gets a reference to the given TunnelStatusName and assigns it to the Name field. +func (o *TunnelStatus) SetName(v TunnelStatusName) { o.Name = &v } diff --git a/services/vpn/v1api/model_tunnel_status_name.go b/services/vpn/v1api/model_tunnel_status_name.go new file mode 100644 index 000000000..1a6ff9d51 --- /dev/null +++ b/services/vpn/v1api/model_tunnel_status_name.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// TunnelStatusName the model 'TunnelStatusName' +type TunnelStatusName string + +// List of TunnelStatus_name +const ( + TUNNELSTATUSNAME_TUNNEL1 TunnelStatusName = "tunnel1" + TUNNELSTATUSNAME_TUNNEL2 TunnelStatusName = "tunnel2" + TUNNELSTATUSNAME_UNKNOWN_DEFAULT_OPEN_API TunnelStatusName = "unknown_default_open_api" +) + +// All allowed values of TunnelStatusName enum +var AllowedTunnelStatusNameEnumValues = []TunnelStatusName{ + "tunnel1", + "tunnel2", + "unknown_default_open_api", +} + +func (v *TunnelStatusName) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelStatusName(value) + for _, existing := range AllowedTunnelStatusNameEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TUNNELSTATUSNAME_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTunnelStatusNameFromValue returns a pointer to a valid TunnelStatusName +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelStatusNameFromValue(v string) (*TunnelStatusName, error) { + ev := TunnelStatusName(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelStatusName: valid values are %v", v, AllowedTunnelStatusNameEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelStatusName) IsValid() bool { + for _, existing := range AllowedTunnelStatusNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TunnelStatus_name value +func (v TunnelStatusName) Ptr() *TunnelStatusName { + return &v +} + +type NullableTunnelStatusName struct { + value *TunnelStatusName + isSet bool +} + +func (v NullableTunnelStatusName) Get() *TunnelStatusName { + return v.value +} + +func (v *NullableTunnelStatusName) Set(val *TunnelStatusName) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelStatusName) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelStatusName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelStatusName(val *TunnelStatusName) *NullableTunnelStatusName { + return &NullableTunnelStatusName{value: val, isSet: true} +} + +func (v NullableTunnelStatusName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelStatusName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1api/model_vpn_tunnels.go b/services/vpn/v1api/model_vpn_tunnels.go index e2225a69d..99d729c5c 100644 --- a/services/vpn/v1api/model_vpn_tunnels.go +++ b/services/vpn/v1api/model_vpn_tunnels.go @@ -21,7 +21,7 @@ var _ MappedNullable = &VPNTunnels{} type VPNTunnels struct { BgpStatus NullableBGPStatus `json:"bgpStatus,omitempty"` InstanceState *GatewayStatus `json:"instanceState,omitempty"` - Name *string `json:"name,omitempty"` + Name *VPNTunnelsName `json:"name,omitempty"` // The public IPv4 address of this endpoint. PublicIP *string `json:"publicIP,omitempty"` AdditionalProperties map[string]interface{} @@ -122,9 +122,9 @@ func (o *VPNTunnels) SetInstanceState(v GatewayStatus) { } // GetName returns the Name field value if set, zero value otherwise. -func (o *VPNTunnels) GetName() string { +func (o *VPNTunnels) GetName() VPNTunnelsName { if o == nil || IsNil(o.Name) { - var ret string + var ret VPNTunnelsName return ret } return *o.Name @@ -132,7 +132,7 @@ func (o *VPNTunnels) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VPNTunnels) GetNameOk() (*string, bool) { +func (o *VPNTunnels) GetNameOk() (*VPNTunnelsName, bool) { if o == nil || IsNil(o.Name) { return nil, false } @@ -148,8 +148,8 @@ func (o *VPNTunnels) HasName() bool { return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *VPNTunnels) SetName(v string) { +// SetName gets a reference to the given VPNTunnelsName and assigns it to the Name field. +func (o *VPNTunnels) SetName(v VPNTunnelsName) { o.Name = &v } diff --git a/services/vpn/v1api/model_vpn_tunnels_name.go b/services/vpn/v1api/model_vpn_tunnels_name.go new file mode 100644 index 000000000..49a678cc1 --- /dev/null +++ b/services/vpn/v1api/model_vpn_tunnels_name.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// VPNTunnelsName the model 'VPNTunnelsName' +type VPNTunnelsName string + +// List of VPNTunnels_name +const ( + VPNTUNNELSNAME_TUNNEL1 VPNTunnelsName = "tunnel1" + VPNTUNNELSNAME_TUNNEL2 VPNTunnelsName = "tunnel2" + VPNTUNNELSNAME_UNKNOWN_DEFAULT_OPEN_API VPNTunnelsName = "unknown_default_open_api" +) + +// All allowed values of VPNTunnelsName enum +var AllowedVPNTunnelsNameEnumValues = []VPNTunnelsName{ + "tunnel1", + "tunnel2", + "unknown_default_open_api", +} + +func (v *VPNTunnelsName) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VPNTunnelsName(value) + for _, existing := range AllowedVPNTunnelsNameEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = VPNTUNNELSNAME_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewVPNTunnelsNameFromValue returns a pointer to a valid VPNTunnelsName +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVPNTunnelsNameFromValue(v string) (*VPNTunnelsName, error) { + ev := VPNTunnelsName(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VPNTunnelsName: valid values are %v", v, AllowedVPNTunnelsNameEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VPNTunnelsName) IsValid() bool { + for _, existing := range AllowedVPNTunnelsNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VPNTunnels_name value +func (v VPNTunnelsName) Ptr() *VPNTunnelsName { + return &v +} + +type NullableVPNTunnelsName struct { + value *VPNTunnelsName + isSet bool +} + +func (v NullableVPNTunnelsName) Get() *VPNTunnelsName { + return v.value +} + +func (v *NullableVPNTunnelsName) Set(val *VPNTunnelsName) { + v.value = val + v.isSet = true +} + +func (v NullableVPNTunnelsName) IsSet() bool { + return v.isSet +} + +func (v *NullableVPNTunnelsName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVPNTunnelsName(val *VPNTunnelsName) *NullableVPNTunnelsName { + return &NullableVPNTunnelsName{value: val, isSet: true} +} + +func (v NullableVPNTunnelsName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVPNTunnelsName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1beta1api/model_api_error_detail.go b/services/vpn/v1beta1api/model_api_error_detail.go index ef4eed2b6..51e0017f3 100644 --- a/services/vpn/v1beta1api/model_api_error_detail.go +++ b/services/vpn/v1beta1api/model_api_error_detail.go @@ -23,9 +23,8 @@ type APIErrorDetail struct { // The domain of the error source. Domain string `json:"domain"` // Metadata contains more information. For bad requests this would be field information. - Metadata map[string]interface{} `json:"metadata,omitempty"` - // The reason why the error occurs. - Reason string `json:"reason"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Reason APIErrorDetailReason `json:"reason"` AdditionalProperties map[string]interface{} } @@ -35,7 +34,7 @@ type _APIErrorDetail APIErrorDetail // 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 NewAPIErrorDetail(domain string, reason string) *APIErrorDetail { +func NewAPIErrorDetail(domain string, reason APIErrorDetailReason) *APIErrorDetail { this := APIErrorDetail{} this.Domain = domain this.Reason = reason @@ -109,9 +108,9 @@ func (o *APIErrorDetail) SetMetadata(v map[string]interface{}) { } // GetReason returns the Reason field value -func (o *APIErrorDetail) GetReason() string { +func (o *APIErrorDetail) GetReason() APIErrorDetailReason { if o == nil { - var ret string + var ret APIErrorDetailReason return ret } @@ -120,7 +119,7 @@ func (o *APIErrorDetail) GetReason() string { // GetReasonOk returns a tuple with the Reason field value // and a boolean to check if the value has been set. -func (o *APIErrorDetail) GetReasonOk() (*string, bool) { +func (o *APIErrorDetail) GetReasonOk() (*APIErrorDetailReason, bool) { if o == nil { return nil, false } @@ -128,7 +127,7 @@ func (o *APIErrorDetail) GetReasonOk() (*string, bool) { } // SetReason sets field value -func (o *APIErrorDetail) SetReason(v string) { +func (o *APIErrorDetail) SetReason(v APIErrorDetailReason) { o.Reason = v } diff --git a/services/vpn/v1beta1api/model_api_error_detail_reason.go b/services/vpn/v1beta1api/model_api_error_detail_reason.go new file mode 100644 index 000000000..dbb2963cf --- /dev/null +++ b/services/vpn/v1beta1api/model_api_error_detail_reason.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// APIErrorDetailReason The reason why the error occurs. +type APIErrorDetailReason string + +// List of APIErrorDetail_reason +const ( + APIERRORDETAILREASON_INVALID_FIELD APIErrorDetailReason = "INVALID_FIELD" + APIERRORDETAILREASON_INVALID_PATH_PARAMETER APIErrorDetailReason = "INVALID_PATH_PARAMETER" + APIERRORDETAILREASON_UNKNOWN_DEFAULT_OPEN_API APIErrorDetailReason = "unknown_default_open_api" +) + +// All allowed values of APIErrorDetailReason enum +var AllowedAPIErrorDetailReasonEnumValues = []APIErrorDetailReason{ + "INVALID_FIELD", + "INVALID_PATH_PARAMETER", + "unknown_default_open_api", +} + +func (v *APIErrorDetailReason) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := APIErrorDetailReason(value) + for _, existing := range AllowedAPIErrorDetailReasonEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = APIERRORDETAILREASON_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewAPIErrorDetailReasonFromValue returns a pointer to a valid APIErrorDetailReason +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAPIErrorDetailReasonFromValue(v string) (*APIErrorDetailReason, error) { + ev := APIErrorDetailReason(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for APIErrorDetailReason: valid values are %v", v, AllowedAPIErrorDetailReasonEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v APIErrorDetailReason) IsValid() bool { + for _, existing := range AllowedAPIErrorDetailReasonEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to APIErrorDetail_reason value +func (v APIErrorDetailReason) Ptr() *APIErrorDetailReason { + return &v +} + +type NullableAPIErrorDetailReason struct { + value *APIErrorDetailReason + isSet bool +} + +func (v NullableAPIErrorDetailReason) Get() *APIErrorDetailReason { + return v.value +} + +func (v *NullableAPIErrorDetailReason) Set(val *APIErrorDetailReason) { + v.value = val + v.isSet = true +} + +func (v NullableAPIErrorDetailReason) IsSet() bool { + return v.isSet +} + +func (v *NullableAPIErrorDetailReason) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAPIErrorDetailReason(val *APIErrorDetailReason) *NullableAPIErrorDetailReason { + return &NullableAPIErrorDetailReason{value: val, isSet: true} +} + +func (v NullableAPIErrorDetailReason) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAPIErrorDetailReason) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1beta1api/model_phase.go b/services/vpn/v1beta1api/model_phase.go index 53dc30870..ff53a9c23 100644 --- a/services/vpn/v1beta1api/model_phase.go +++ b/services/vpn/v1beta1api/model_phase.go @@ -21,9 +21,9 @@ var _ MappedNullable = &Phase{} // Phase struct for Phase type Phase struct { // The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. - DhGroups []string `json:"dhGroups,omitempty"` - EncryptionAlgorithms []string `json:"encryptionAlgorithms"` - IntegrityAlgorithms []string `json:"integrityAlgorithms"` + DhGroups []PhaseDhGroupsInner `json:"dhGroups,omitempty"` + EncryptionAlgorithms []PhaseEncryptionAlgorithmsInner `json:"encryptionAlgorithms"` + IntegrityAlgorithms []PhaseIntegrityAlgorithmsInner `json:"integrityAlgorithms"` AdditionalProperties map[string]interface{} } @@ -33,7 +33,7 @@ type _Phase Phase // 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 NewPhase(encryptionAlgorithms []string, integrityAlgorithms []string) *Phase { +func NewPhase(encryptionAlgorithms []PhaseEncryptionAlgorithmsInner, integrityAlgorithms []PhaseIntegrityAlgorithmsInner) *Phase { this := Phase{} this.EncryptionAlgorithms = encryptionAlgorithms this.IntegrityAlgorithms = integrityAlgorithms @@ -49,9 +49,9 @@ func NewPhaseWithDefaults() *Phase { } // GetDhGroups returns the DhGroups field value if set, zero value otherwise. -func (o *Phase) GetDhGroups() []string { +func (o *Phase) GetDhGroups() []PhaseDhGroupsInner { if o == nil || IsNil(o.DhGroups) { - var ret []string + var ret []PhaseDhGroupsInner return ret } return o.DhGroups @@ -59,7 +59,7 @@ func (o *Phase) GetDhGroups() []string { // GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Phase) GetDhGroupsOk() ([]string, bool) { +func (o *Phase) GetDhGroupsOk() ([]PhaseDhGroupsInner, bool) { if o == nil || IsNil(o.DhGroups) { return nil, false } @@ -75,15 +75,15 @@ func (o *Phase) HasDhGroups() bool { return false } -// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field. -func (o *Phase) SetDhGroups(v []string) { +// SetDhGroups gets a reference to the given []PhaseDhGroupsInner and assigns it to the DhGroups field. +func (o *Phase) SetDhGroups(v []PhaseDhGroupsInner) { o.DhGroups = v } // GetEncryptionAlgorithms returns the EncryptionAlgorithms field value -func (o *Phase) GetEncryptionAlgorithms() []string { +func (o *Phase) GetEncryptionAlgorithms() []PhaseEncryptionAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseEncryptionAlgorithmsInner return ret } @@ -92,7 +92,7 @@ func (o *Phase) GetEncryptionAlgorithms() []string { // GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value // and a boolean to check if the value has been set. -func (o *Phase) GetEncryptionAlgorithmsOk() ([]string, bool) { +func (o *Phase) GetEncryptionAlgorithmsOk() ([]PhaseEncryptionAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -100,14 +100,14 @@ func (o *Phase) GetEncryptionAlgorithmsOk() ([]string, bool) { } // SetEncryptionAlgorithms sets field value -func (o *Phase) SetEncryptionAlgorithms(v []string) { +func (o *Phase) SetEncryptionAlgorithms(v []PhaseEncryptionAlgorithmsInner) { o.EncryptionAlgorithms = v } // GetIntegrityAlgorithms returns the IntegrityAlgorithms field value -func (o *Phase) GetIntegrityAlgorithms() []string { +func (o *Phase) GetIntegrityAlgorithms() []PhaseIntegrityAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseIntegrityAlgorithmsInner return ret } @@ -116,7 +116,7 @@ func (o *Phase) GetIntegrityAlgorithms() []string { // GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value // and a boolean to check if the value has been set. -func (o *Phase) GetIntegrityAlgorithmsOk() ([]string, bool) { +func (o *Phase) GetIntegrityAlgorithmsOk() ([]PhaseIntegrityAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -124,7 +124,7 @@ func (o *Phase) GetIntegrityAlgorithmsOk() ([]string, bool) { } // SetIntegrityAlgorithms sets field value -func (o *Phase) SetIntegrityAlgorithms(v []string) { +func (o *Phase) SetIntegrityAlgorithms(v []PhaseIntegrityAlgorithmsInner) { o.IntegrityAlgorithms = v } diff --git a/services/vpn/v1beta1api/model_phase_dh_groups_inner.go b/services/vpn/v1beta1api/model_phase_dh_groups_inner.go new file mode 100644 index 000000000..13c5b2e8a --- /dev/null +++ b/services/vpn/v1beta1api/model_phase_dh_groups_inner.go @@ -0,0 +1,119 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// PhaseDhGroupsInner the model 'PhaseDhGroupsInner' +type PhaseDhGroupsInner string + +// List of Phase_dhGroups_inner +const ( + PHASEDHGROUPSINNER_MODP1024 PhaseDhGroupsInner = "modp1024" + PHASEDHGROUPSINNER_MODP2048 PhaseDhGroupsInner = "modp2048" + PHASEDHGROUPSINNER_ECP256 PhaseDhGroupsInner = "ecp256" + PHASEDHGROUPSINNER_ECP384 PhaseDhGroupsInner = "ecp384" + PHASEDHGROUPSINNER_MODP2048S256 PhaseDhGroupsInner = "modp2048s256" + PHASEDHGROUPSINNER_UNKNOWN_DEFAULT_OPEN_API PhaseDhGroupsInner = "unknown_default_open_api" +) + +// All allowed values of PhaseDhGroupsInner enum +var AllowedPhaseDhGroupsInnerEnumValues = []PhaseDhGroupsInner{ + "modp1024", + "modp2048", + "ecp256", + "ecp384", + "modp2048s256", + "unknown_default_open_api", +} + +func (v *PhaseDhGroupsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PhaseDhGroupsInner(value) + for _, existing := range AllowedPhaseDhGroupsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PHASEDHGROUPSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPhaseDhGroupsInnerFromValue returns a pointer to a valid PhaseDhGroupsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPhaseDhGroupsInnerFromValue(v string) (*PhaseDhGroupsInner, error) { + ev := PhaseDhGroupsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PhaseDhGroupsInner: valid values are %v", v, AllowedPhaseDhGroupsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PhaseDhGroupsInner) IsValid() bool { + for _, existing := range AllowedPhaseDhGroupsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Phase_dhGroups_inner value +func (v PhaseDhGroupsInner) Ptr() *PhaseDhGroupsInner { + return &v +} + +type NullablePhaseDhGroupsInner struct { + value *PhaseDhGroupsInner + isSet bool +} + +func (v NullablePhaseDhGroupsInner) Get() *PhaseDhGroupsInner { + return v.value +} + +func (v *NullablePhaseDhGroupsInner) Set(val *PhaseDhGroupsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePhaseDhGroupsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePhaseDhGroupsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhaseDhGroupsInner(val *PhaseDhGroupsInner) *NullablePhaseDhGroupsInner { + return &NullablePhaseDhGroupsInner{value: val, isSet: true} +} + +func (v NullablePhaseDhGroupsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhaseDhGroupsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1beta1api/model_phase_encryption_algorithms_inner.go b/services/vpn/v1beta1api/model_phase_encryption_algorithms_inner.go new file mode 100644 index 000000000..e75f24143 --- /dev/null +++ b/services/vpn/v1beta1api/model_phase_encryption_algorithms_inner.go @@ -0,0 +1,115 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// PhaseEncryptionAlgorithmsInner the model 'PhaseEncryptionAlgorithmsInner' +type PhaseEncryptionAlgorithmsInner string + +// List of Phase_encryptionAlgorithms_inner +const ( + PHASEENCRYPTIONALGORITHMSINNER_AES256 PhaseEncryptionAlgorithmsInner = "aes256" + PHASEENCRYPTIONALGORITHMSINNER_AES128GCM16 PhaseEncryptionAlgorithmsInner = "aes128gcm16" + PHASEENCRYPTIONALGORITHMSINNER_AES256GCM16 PhaseEncryptionAlgorithmsInner = "aes256gcm16" + PHASEENCRYPTIONALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API PhaseEncryptionAlgorithmsInner = "unknown_default_open_api" +) + +// All allowed values of PhaseEncryptionAlgorithmsInner enum +var AllowedPhaseEncryptionAlgorithmsInnerEnumValues = []PhaseEncryptionAlgorithmsInner{ + "aes256", + "aes128gcm16", + "aes256gcm16", + "unknown_default_open_api", +} + +func (v *PhaseEncryptionAlgorithmsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PhaseEncryptionAlgorithmsInner(value) + for _, existing := range AllowedPhaseEncryptionAlgorithmsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PHASEENCRYPTIONALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPhaseEncryptionAlgorithmsInnerFromValue returns a pointer to a valid PhaseEncryptionAlgorithmsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPhaseEncryptionAlgorithmsInnerFromValue(v string) (*PhaseEncryptionAlgorithmsInner, error) { + ev := PhaseEncryptionAlgorithmsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PhaseEncryptionAlgorithmsInner: valid values are %v", v, AllowedPhaseEncryptionAlgorithmsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PhaseEncryptionAlgorithmsInner) IsValid() bool { + for _, existing := range AllowedPhaseEncryptionAlgorithmsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Phase_encryptionAlgorithms_inner value +func (v PhaseEncryptionAlgorithmsInner) Ptr() *PhaseEncryptionAlgorithmsInner { + return &v +} + +type NullablePhaseEncryptionAlgorithmsInner struct { + value *PhaseEncryptionAlgorithmsInner + isSet bool +} + +func (v NullablePhaseEncryptionAlgorithmsInner) Get() *PhaseEncryptionAlgorithmsInner { + return v.value +} + +func (v *NullablePhaseEncryptionAlgorithmsInner) Set(val *PhaseEncryptionAlgorithmsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePhaseEncryptionAlgorithmsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePhaseEncryptionAlgorithmsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhaseEncryptionAlgorithmsInner(val *PhaseEncryptionAlgorithmsInner) *NullablePhaseEncryptionAlgorithmsInner { + return &NullablePhaseEncryptionAlgorithmsInner{value: val, isSet: true} +} + +func (v NullablePhaseEncryptionAlgorithmsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhaseEncryptionAlgorithmsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1beta1api/model_phase_integrity_algorithms_inner.go b/services/vpn/v1beta1api/model_phase_integrity_algorithms_inner.go new file mode 100644 index 000000000..8b5999561 --- /dev/null +++ b/services/vpn/v1beta1api/model_phase_integrity_algorithms_inner.go @@ -0,0 +1,115 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// PhaseIntegrityAlgorithmsInner the model 'PhaseIntegrityAlgorithmsInner' +type PhaseIntegrityAlgorithmsInner string + +// List of Phase_integrityAlgorithms_inner +const ( + PHASEINTEGRITYALGORITHMSINNER_SHA1 PhaseIntegrityAlgorithmsInner = "sha1" + PHASEINTEGRITYALGORITHMSINNER_SHA2_256 PhaseIntegrityAlgorithmsInner = "sha2_256" + PHASEINTEGRITYALGORITHMSINNER_SHA2_384 PhaseIntegrityAlgorithmsInner = "sha2_384" + PHASEINTEGRITYALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API PhaseIntegrityAlgorithmsInner = "unknown_default_open_api" +) + +// All allowed values of PhaseIntegrityAlgorithmsInner enum +var AllowedPhaseIntegrityAlgorithmsInnerEnumValues = []PhaseIntegrityAlgorithmsInner{ + "sha1", + "sha2_256", + "sha2_384", + "unknown_default_open_api", +} + +func (v *PhaseIntegrityAlgorithmsInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PhaseIntegrityAlgorithmsInner(value) + for _, existing := range AllowedPhaseIntegrityAlgorithmsInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = PHASEINTEGRITYALGORITHMSINNER_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewPhaseIntegrityAlgorithmsInnerFromValue returns a pointer to a valid PhaseIntegrityAlgorithmsInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPhaseIntegrityAlgorithmsInnerFromValue(v string) (*PhaseIntegrityAlgorithmsInner, error) { + ev := PhaseIntegrityAlgorithmsInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PhaseIntegrityAlgorithmsInner: valid values are %v", v, AllowedPhaseIntegrityAlgorithmsInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PhaseIntegrityAlgorithmsInner) IsValid() bool { + for _, existing := range AllowedPhaseIntegrityAlgorithmsInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Phase_integrityAlgorithms_inner value +func (v PhaseIntegrityAlgorithmsInner) Ptr() *PhaseIntegrityAlgorithmsInner { + return &v +} + +type NullablePhaseIntegrityAlgorithmsInner struct { + value *PhaseIntegrityAlgorithmsInner + isSet bool +} + +func (v NullablePhaseIntegrityAlgorithmsInner) Get() *PhaseIntegrityAlgorithmsInner { + return v.value +} + +func (v *NullablePhaseIntegrityAlgorithmsInner) Set(val *PhaseIntegrityAlgorithmsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePhaseIntegrityAlgorithmsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePhaseIntegrityAlgorithmsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePhaseIntegrityAlgorithmsInner(val *PhaseIntegrityAlgorithmsInner) *NullablePhaseIntegrityAlgorithmsInner { + return &NullablePhaseIntegrityAlgorithmsInner{value: val, isSet: true} +} + +func (v NullablePhaseIntegrityAlgorithmsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePhaseIntegrityAlgorithmsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1beta1api/model_tunnel_configuration_phase1.go b/services/vpn/v1beta1api/model_tunnel_configuration_phase1.go index e09b16dd0..fdc3110e4 100644 --- a/services/vpn/v1beta1api/model_tunnel_configuration_phase1.go +++ b/services/vpn/v1beta1api/model_tunnel_configuration_phase1.go @@ -21,9 +21,9 @@ var _ MappedNullable = &TunnelConfigurationPhase1{} // TunnelConfigurationPhase1 struct for TunnelConfigurationPhase1 type TunnelConfigurationPhase1 struct { // The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. - DhGroups []string `json:"dhGroups,omitempty"` - EncryptionAlgorithms []string `json:"encryptionAlgorithms"` - IntegrityAlgorithms []string `json:"integrityAlgorithms"` + DhGroups []PhaseDhGroupsInner `json:"dhGroups,omitempty"` + EncryptionAlgorithms []PhaseEncryptionAlgorithmsInner `json:"encryptionAlgorithms"` + IntegrityAlgorithms []PhaseIntegrityAlgorithmsInner `json:"integrityAlgorithms"` // Time to schedule a IKE re-keying (in seconds). RekeyTime *int32 `json:"rekeyTime,omitempty"` AdditionalProperties map[string]interface{} @@ -35,7 +35,7 @@ type _TunnelConfigurationPhase1 TunnelConfigurationPhase1 // 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 NewTunnelConfigurationPhase1(encryptionAlgorithms []string, integrityAlgorithms []string) *TunnelConfigurationPhase1 { +func NewTunnelConfigurationPhase1(encryptionAlgorithms []PhaseEncryptionAlgorithmsInner, integrityAlgorithms []PhaseIntegrityAlgorithmsInner) *TunnelConfigurationPhase1 { this := TunnelConfigurationPhase1{} this.EncryptionAlgorithms = encryptionAlgorithms this.IntegrityAlgorithms = integrityAlgorithms @@ -55,9 +55,9 @@ func NewTunnelConfigurationPhase1WithDefaults() *TunnelConfigurationPhase1 { } // GetDhGroups returns the DhGroups field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase1) GetDhGroups() []string { +func (o *TunnelConfigurationPhase1) GetDhGroups() []PhaseDhGroupsInner { if o == nil || IsNil(o.DhGroups) { - var ret []string + var ret []PhaseDhGroupsInner return ret } return o.DhGroups @@ -65,7 +65,7 @@ func (o *TunnelConfigurationPhase1) GetDhGroups() []string { // GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase1) GetDhGroupsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase1) GetDhGroupsOk() ([]PhaseDhGroupsInner, bool) { if o == nil || IsNil(o.DhGroups) { return nil, false } @@ -81,15 +81,15 @@ func (o *TunnelConfigurationPhase1) HasDhGroups() bool { return false } -// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field. -func (o *TunnelConfigurationPhase1) SetDhGroups(v []string) { +// SetDhGroups gets a reference to the given []PhaseDhGroupsInner and assigns it to the DhGroups field. +func (o *TunnelConfigurationPhase1) SetDhGroups(v []PhaseDhGroupsInner) { o.DhGroups = v } // GetEncryptionAlgorithms returns the EncryptionAlgorithms field value -func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() []string { +func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() []PhaseEncryptionAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseEncryptionAlgorithmsInner return ret } @@ -98,7 +98,7 @@ func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() []string { // GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() ([]PhaseEncryptionAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -106,14 +106,14 @@ func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() ([]string, bool) } // SetEncryptionAlgorithms sets field value -func (o *TunnelConfigurationPhase1) SetEncryptionAlgorithms(v []string) { +func (o *TunnelConfigurationPhase1) SetEncryptionAlgorithms(v []PhaseEncryptionAlgorithmsInner) { o.EncryptionAlgorithms = v } // GetIntegrityAlgorithms returns the IntegrityAlgorithms field value -func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() []string { +func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() []PhaseIntegrityAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseIntegrityAlgorithmsInner return ret } @@ -122,7 +122,7 @@ func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() []string { // GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() ([]PhaseIntegrityAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -130,7 +130,7 @@ func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() ([]string, bool) } // SetIntegrityAlgorithms sets field value -func (o *TunnelConfigurationPhase1) SetIntegrityAlgorithms(v []string) { +func (o *TunnelConfigurationPhase1) SetIntegrityAlgorithms(v []PhaseIntegrityAlgorithmsInner) { o.IntegrityAlgorithms = v } diff --git a/services/vpn/v1beta1api/model_tunnel_configuration_phase2.go b/services/vpn/v1beta1api/model_tunnel_configuration_phase2.go index 6ab3a2299..9651153dc 100644 --- a/services/vpn/v1beta1api/model_tunnel_configuration_phase2.go +++ b/services/vpn/v1beta1api/model_tunnel_configuration_phase2.go @@ -21,15 +21,13 @@ var _ MappedNullable = &TunnelConfigurationPhase2{} // TunnelConfigurationPhase2 struct for TunnelConfigurationPhase2 type TunnelConfigurationPhase2 struct { // The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. - DhGroups []string `json:"dhGroups,omitempty"` - EncryptionAlgorithms []string `json:"encryptionAlgorithms"` - IntegrityAlgorithms []string `json:"integrityAlgorithms"` - // Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA. - DpdAction *string `json:"dpdAction,omitempty"` + DhGroups []PhaseDhGroupsInner `json:"dhGroups,omitempty"` + EncryptionAlgorithms []PhaseEncryptionAlgorithmsInner `json:"encryptionAlgorithms"` + IntegrityAlgorithms []PhaseIntegrityAlgorithmsInner `json:"integrityAlgorithms"` + DpdAction *TunnelConfigurationPhase2AllOfDpdAction `json:"dpdAction,omitempty"` // Time to schedule a Child SA re-keying (in seconds). - RekeyTime *int32 `json:"rekeyTime,omitempty"` - // Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"start\": initiates the connection actively. - StartAction *string `json:"startAction,omitempty"` + RekeyTime *int32 `json:"rekeyTime,omitempty"` + StartAction *TunnelConfigurationPhase2AllOfStartAction `json:"startAction,omitempty"` AdditionalProperties map[string]interface{} } @@ -39,15 +37,15 @@ type _TunnelConfigurationPhase2 TunnelConfigurationPhase2 // 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 NewTunnelConfigurationPhase2(encryptionAlgorithms []string, integrityAlgorithms []string) *TunnelConfigurationPhase2 { +func NewTunnelConfigurationPhase2(encryptionAlgorithms []PhaseEncryptionAlgorithmsInner, integrityAlgorithms []PhaseIntegrityAlgorithmsInner) *TunnelConfigurationPhase2 { this := TunnelConfigurationPhase2{} this.EncryptionAlgorithms = encryptionAlgorithms this.IntegrityAlgorithms = integrityAlgorithms - var dpdAction string = "restart" + var dpdAction TunnelConfigurationPhase2AllOfDpdAction = TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_RESTART this.DpdAction = &dpdAction var rekeyTime int32 = 3600 this.RekeyTime = &rekeyTime - var startAction string = "start" + var startAction TunnelConfigurationPhase2AllOfStartAction = TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_START this.StartAction = &startAction return &this } @@ -57,19 +55,19 @@ func NewTunnelConfigurationPhase2(encryptionAlgorithms []string, integrityAlgori // but it doesn't guarantee that properties required by API are set func NewTunnelConfigurationPhase2WithDefaults() *TunnelConfigurationPhase2 { this := TunnelConfigurationPhase2{} - var dpdAction string = "restart" + var dpdAction TunnelConfigurationPhase2AllOfDpdAction = TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_RESTART this.DpdAction = &dpdAction var rekeyTime int32 = 3600 this.RekeyTime = &rekeyTime - var startAction string = "start" + var startAction TunnelConfigurationPhase2AllOfStartAction = TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_START this.StartAction = &startAction return &this } // GetDhGroups returns the DhGroups field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase2) GetDhGroups() []string { +func (o *TunnelConfigurationPhase2) GetDhGroups() []PhaseDhGroupsInner { if o == nil || IsNil(o.DhGroups) { - var ret []string + var ret []PhaseDhGroupsInner return ret } return o.DhGroups @@ -77,7 +75,7 @@ func (o *TunnelConfigurationPhase2) GetDhGroups() []string { // GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetDhGroupsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase2) GetDhGroupsOk() ([]PhaseDhGroupsInner, bool) { if o == nil || IsNil(o.DhGroups) { return nil, false } @@ -93,15 +91,15 @@ func (o *TunnelConfigurationPhase2) HasDhGroups() bool { return false } -// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field. -func (o *TunnelConfigurationPhase2) SetDhGroups(v []string) { +// SetDhGroups gets a reference to the given []PhaseDhGroupsInner and assigns it to the DhGroups field. +func (o *TunnelConfigurationPhase2) SetDhGroups(v []PhaseDhGroupsInner) { o.DhGroups = v } // GetEncryptionAlgorithms returns the EncryptionAlgorithms field value -func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() []string { +func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() []PhaseEncryptionAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseEncryptionAlgorithmsInner return ret } @@ -110,7 +108,7 @@ func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() []string { // GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() ([]PhaseEncryptionAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -118,14 +116,14 @@ func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() ([]string, bool) } // SetEncryptionAlgorithms sets field value -func (o *TunnelConfigurationPhase2) SetEncryptionAlgorithms(v []string) { +func (o *TunnelConfigurationPhase2) SetEncryptionAlgorithms(v []PhaseEncryptionAlgorithmsInner) { o.EncryptionAlgorithms = v } // GetIntegrityAlgorithms returns the IntegrityAlgorithms field value -func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() []string { +func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() []PhaseIntegrityAlgorithmsInner { if o == nil { - var ret []string + var ret []PhaseIntegrityAlgorithmsInner return ret } @@ -134,7 +132,7 @@ func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() []string { // GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() ([]string, bool) { +func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() ([]PhaseIntegrityAlgorithmsInner, bool) { if o == nil { return nil, false } @@ -142,14 +140,14 @@ func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() ([]string, bool) } // SetIntegrityAlgorithms sets field value -func (o *TunnelConfigurationPhase2) SetIntegrityAlgorithms(v []string) { +func (o *TunnelConfigurationPhase2) SetIntegrityAlgorithms(v []PhaseIntegrityAlgorithmsInner) { o.IntegrityAlgorithms = v } // GetDpdAction returns the DpdAction field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase2) GetDpdAction() string { +func (o *TunnelConfigurationPhase2) GetDpdAction() TunnelConfigurationPhase2AllOfDpdAction { if o == nil || IsNil(o.DpdAction) { - var ret string + var ret TunnelConfigurationPhase2AllOfDpdAction return ret } return *o.DpdAction @@ -157,7 +155,7 @@ func (o *TunnelConfigurationPhase2) GetDpdAction() string { // GetDpdActionOk returns a tuple with the DpdAction field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetDpdActionOk() (*string, bool) { +func (o *TunnelConfigurationPhase2) GetDpdActionOk() (*TunnelConfigurationPhase2AllOfDpdAction, bool) { if o == nil || IsNil(o.DpdAction) { return nil, false } @@ -173,8 +171,8 @@ func (o *TunnelConfigurationPhase2) HasDpdAction() bool { return false } -// SetDpdAction gets a reference to the given string and assigns it to the DpdAction field. -func (o *TunnelConfigurationPhase2) SetDpdAction(v string) { +// SetDpdAction gets a reference to the given TunnelConfigurationPhase2AllOfDpdAction and assigns it to the DpdAction field. +func (o *TunnelConfigurationPhase2) SetDpdAction(v TunnelConfigurationPhase2AllOfDpdAction) { o.DpdAction = &v } @@ -211,9 +209,9 @@ func (o *TunnelConfigurationPhase2) SetRekeyTime(v int32) { } // GetStartAction returns the StartAction field value if set, zero value otherwise. -func (o *TunnelConfigurationPhase2) GetStartAction() string { +func (o *TunnelConfigurationPhase2) GetStartAction() TunnelConfigurationPhase2AllOfStartAction { if o == nil || IsNil(o.StartAction) { - var ret string + var ret TunnelConfigurationPhase2AllOfStartAction return ret } return *o.StartAction @@ -221,7 +219,7 @@ func (o *TunnelConfigurationPhase2) GetStartAction() string { // GetStartActionOk returns a tuple with the StartAction field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelConfigurationPhase2) GetStartActionOk() (*string, bool) { +func (o *TunnelConfigurationPhase2) GetStartActionOk() (*TunnelConfigurationPhase2AllOfStartAction, bool) { if o == nil || IsNil(o.StartAction) { return nil, false } @@ -237,8 +235,8 @@ func (o *TunnelConfigurationPhase2) HasStartAction() bool { return false } -// SetStartAction gets a reference to the given string and assigns it to the StartAction field. -func (o *TunnelConfigurationPhase2) SetStartAction(v string) { +// SetStartAction gets a reference to the given TunnelConfigurationPhase2AllOfStartAction and assigns it to the StartAction field. +func (o *TunnelConfigurationPhase2) SetStartAction(v TunnelConfigurationPhase2AllOfStartAction) { o.StartAction = &v } diff --git a/services/vpn/v1beta1api/model_tunnel_configuration_phase2_all_of_dpd_action.go b/services/vpn/v1beta1api/model_tunnel_configuration_phase2_all_of_dpd_action.go new file mode 100644 index 000000000..f592d7219 --- /dev/null +++ b/services/vpn/v1beta1api/model_tunnel_configuration_phase2_all_of_dpd_action.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// TunnelConfigurationPhase2AllOfDpdAction Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA. +type TunnelConfigurationPhase2AllOfDpdAction string + +// List of TunnelConfiguration_phase2_allOf_dpdAction +const ( + TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_CLEAR TunnelConfigurationPhase2AllOfDpdAction = "clear" + TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_RESTART TunnelConfigurationPhase2AllOfDpdAction = "restart" + TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_UNKNOWN_DEFAULT_OPEN_API TunnelConfigurationPhase2AllOfDpdAction = "unknown_default_open_api" +) + +// All allowed values of TunnelConfigurationPhase2AllOfDpdAction enum +var AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues = []TunnelConfigurationPhase2AllOfDpdAction{ + "clear", + "restart", + "unknown_default_open_api", +} + +func (v *TunnelConfigurationPhase2AllOfDpdAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelConfigurationPhase2AllOfDpdAction(value) + for _, existing := range AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TUNNELCONFIGURATIONPHASE2ALLOFDPDACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTunnelConfigurationPhase2AllOfDpdActionFromValue returns a pointer to a valid TunnelConfigurationPhase2AllOfDpdAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelConfigurationPhase2AllOfDpdActionFromValue(v string) (*TunnelConfigurationPhase2AllOfDpdAction, error) { + ev := TunnelConfigurationPhase2AllOfDpdAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2AllOfDpdAction: valid values are %v", v, AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelConfigurationPhase2AllOfDpdAction) IsValid() bool { + for _, existing := range AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TunnelConfiguration_phase2_allOf_dpdAction value +func (v TunnelConfigurationPhase2AllOfDpdAction) Ptr() *TunnelConfigurationPhase2AllOfDpdAction { + return &v +} + +type NullableTunnelConfigurationPhase2AllOfDpdAction struct { + value *TunnelConfigurationPhase2AllOfDpdAction + isSet bool +} + +func (v NullableTunnelConfigurationPhase2AllOfDpdAction) Get() *TunnelConfigurationPhase2AllOfDpdAction { + return v.value +} + +func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) Set(val *TunnelConfigurationPhase2AllOfDpdAction) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelConfigurationPhase2AllOfDpdAction) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelConfigurationPhase2AllOfDpdAction(val *TunnelConfigurationPhase2AllOfDpdAction) *NullableTunnelConfigurationPhase2AllOfDpdAction { + return &NullableTunnelConfigurationPhase2AllOfDpdAction{value: val, isSet: true} +} + +func (v NullableTunnelConfigurationPhase2AllOfDpdAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1beta1api/model_tunnel_configuration_phase2_all_of_start_action.go b/services/vpn/v1beta1api/model_tunnel_configuration_phase2_all_of_start_action.go new file mode 100644 index 000000000..56bfafc27 --- /dev/null +++ b/services/vpn/v1beta1api/model_tunnel_configuration_phase2_all_of_start_action.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// TunnelConfigurationPhase2AllOfStartAction Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"start\": initiates the connection actively. +type TunnelConfigurationPhase2AllOfStartAction string + +// List of TunnelConfiguration_phase2_allOf_startAction +const ( + TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_NONE TunnelConfigurationPhase2AllOfStartAction = "none" + TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_START TunnelConfigurationPhase2AllOfStartAction = "start" + TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_UNKNOWN_DEFAULT_OPEN_API TunnelConfigurationPhase2AllOfStartAction = "unknown_default_open_api" +) + +// All allowed values of TunnelConfigurationPhase2AllOfStartAction enum +var AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues = []TunnelConfigurationPhase2AllOfStartAction{ + "none", + "start", + "unknown_default_open_api", +} + +func (v *TunnelConfigurationPhase2AllOfStartAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelConfigurationPhase2AllOfStartAction(value) + for _, existing := range AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TUNNELCONFIGURATIONPHASE2ALLOFSTARTACTION_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTunnelConfigurationPhase2AllOfStartActionFromValue returns a pointer to a valid TunnelConfigurationPhase2AllOfStartAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelConfigurationPhase2AllOfStartActionFromValue(v string) (*TunnelConfigurationPhase2AllOfStartAction, error) { + ev := TunnelConfigurationPhase2AllOfStartAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2AllOfStartAction: valid values are %v", v, AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelConfigurationPhase2AllOfStartAction) IsValid() bool { + for _, existing := range AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TunnelConfiguration_phase2_allOf_startAction value +func (v TunnelConfigurationPhase2AllOfStartAction) Ptr() *TunnelConfigurationPhase2AllOfStartAction { + return &v +} + +type NullableTunnelConfigurationPhase2AllOfStartAction struct { + value *TunnelConfigurationPhase2AllOfStartAction + isSet bool +} + +func (v NullableTunnelConfigurationPhase2AllOfStartAction) Get() *TunnelConfigurationPhase2AllOfStartAction { + return v.value +} + +func (v *NullableTunnelConfigurationPhase2AllOfStartAction) Set(val *TunnelConfigurationPhase2AllOfStartAction) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelConfigurationPhase2AllOfStartAction) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelConfigurationPhase2AllOfStartAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelConfigurationPhase2AllOfStartAction(val *TunnelConfigurationPhase2AllOfStartAction) *NullableTunnelConfigurationPhase2AllOfStartAction { + return &NullableTunnelConfigurationPhase2AllOfStartAction{value: val, isSet: true} +} + +func (v NullableTunnelConfigurationPhase2AllOfStartAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelConfigurationPhase2AllOfStartAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1beta1api/model_tunnel_status.go b/services/vpn/v1beta1api/model_tunnel_status.go index b28d19b42..e13fb475b 100644 --- a/services/vpn/v1beta1api/model_tunnel_status.go +++ b/services/vpn/v1beta1api/model_tunnel_status.go @@ -19,10 +19,10 @@ var _ MappedNullable = &TunnelStatus{} // TunnelStatus Describes the status of the VPN itself. type TunnelStatus struct { - Established *bool `json:"established,omitempty"` - Name *string `json:"name,omitempty"` - Phase1 *Phase1Status `json:"phase1,omitempty"` - Phase2 *Phase2Status `json:"phase2,omitempty"` + Established *bool `json:"established,omitempty"` + Name *TunnelStatusName `json:"name,omitempty"` + Phase1 *Phase1Status `json:"phase1,omitempty"` + Phase2 *Phase2Status `json:"phase2,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,9 +78,9 @@ func (o *TunnelStatus) SetEstablished(v bool) { } // GetName returns the Name field value if set, zero value otherwise. -func (o *TunnelStatus) GetName() string { +func (o *TunnelStatus) GetName() TunnelStatusName { if o == nil || IsNil(o.Name) { - var ret string + var ret TunnelStatusName return ret } return *o.Name @@ -88,7 +88,7 @@ func (o *TunnelStatus) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TunnelStatus) GetNameOk() (*string, bool) { +func (o *TunnelStatus) GetNameOk() (*TunnelStatusName, bool) { if o == nil || IsNil(o.Name) { return nil, false } @@ -104,8 +104,8 @@ func (o *TunnelStatus) HasName() bool { return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *TunnelStatus) SetName(v string) { +// SetName gets a reference to the given TunnelStatusName and assigns it to the Name field. +func (o *TunnelStatus) SetName(v TunnelStatusName) { o.Name = &v } diff --git a/services/vpn/v1beta1api/model_tunnel_status_name.go b/services/vpn/v1beta1api/model_tunnel_status_name.go new file mode 100644 index 000000000..4b2c0b172 --- /dev/null +++ b/services/vpn/v1beta1api/model_tunnel_status_name.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// TunnelStatusName the model 'TunnelStatusName' +type TunnelStatusName string + +// List of TunnelStatus_name +const ( + TUNNELSTATUSNAME_TUNNEL1 TunnelStatusName = "tunnel1" + TUNNELSTATUSNAME_TUNNEL2 TunnelStatusName = "tunnel2" + TUNNELSTATUSNAME_UNKNOWN_DEFAULT_OPEN_API TunnelStatusName = "unknown_default_open_api" +) + +// All allowed values of TunnelStatusName enum +var AllowedTunnelStatusNameEnumValues = []TunnelStatusName{ + "tunnel1", + "tunnel2", + "unknown_default_open_api", +} + +func (v *TunnelStatusName) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TunnelStatusName(value) + for _, existing := range AllowedTunnelStatusNameEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = TUNNELSTATUSNAME_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewTunnelStatusNameFromValue returns a pointer to a valid TunnelStatusName +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTunnelStatusNameFromValue(v string) (*TunnelStatusName, error) { + ev := TunnelStatusName(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TunnelStatusName: valid values are %v", v, AllowedTunnelStatusNameEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TunnelStatusName) IsValid() bool { + for _, existing := range AllowedTunnelStatusNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TunnelStatus_name value +func (v TunnelStatusName) Ptr() *TunnelStatusName { + return &v +} + +type NullableTunnelStatusName struct { + value *TunnelStatusName + isSet bool +} + +func (v NullableTunnelStatusName) Get() *TunnelStatusName { + return v.value +} + +func (v *NullableTunnelStatusName) Set(val *TunnelStatusName) { + v.value = val + v.isSet = true +} + +func (v NullableTunnelStatusName) IsSet() bool { + return v.isSet +} + +func (v *NullableTunnelStatusName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTunnelStatusName(val *TunnelStatusName) *NullableTunnelStatusName { + return &NullableTunnelStatusName{value: val, isSet: true} +} + +func (v NullableTunnelStatusName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTunnelStatusName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1beta1api/model_vpn_tunnels.go b/services/vpn/v1beta1api/model_vpn_tunnels.go index 53f99ea01..cc623b521 100644 --- a/services/vpn/v1beta1api/model_vpn_tunnels.go +++ b/services/vpn/v1beta1api/model_vpn_tunnels.go @@ -21,7 +21,7 @@ var _ MappedNullable = &VPNTunnels{} type VPNTunnels struct { BgpStatus NullableBGPStatus `json:"bgpStatus,omitempty"` InstanceState *GatewayStatus `json:"instanceState,omitempty"` - Name *string `json:"name,omitempty"` + Name *VPNTunnelsName `json:"name,omitempty"` // The public IPv4 address of this endpoint. PublicIP *string `json:"publicIP,omitempty"` AdditionalProperties map[string]interface{} @@ -122,9 +122,9 @@ func (o *VPNTunnels) SetInstanceState(v GatewayStatus) { } // GetName returns the Name field value if set, zero value otherwise. -func (o *VPNTunnels) GetName() string { +func (o *VPNTunnels) GetName() VPNTunnelsName { if o == nil || IsNil(o.Name) { - var ret string + var ret VPNTunnelsName return ret } return *o.Name @@ -132,7 +132,7 @@ func (o *VPNTunnels) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VPNTunnels) GetNameOk() (*string, bool) { +func (o *VPNTunnels) GetNameOk() (*VPNTunnelsName, bool) { if o == nil || IsNil(o.Name) { return nil, false } @@ -148,8 +148,8 @@ func (o *VPNTunnels) HasName() bool { return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *VPNTunnels) SetName(v string) { +// SetName gets a reference to the given VPNTunnelsName and assigns it to the Name field. +func (o *VPNTunnels) SetName(v VPNTunnelsName) { o.Name = &v } diff --git a/services/vpn/v1beta1api/model_vpn_tunnels_name.go b/services/vpn/v1beta1api/model_vpn_tunnels_name.go new file mode 100644 index 000000000..6ba01456b --- /dev/null +++ b/services/vpn/v1beta1api/model_vpn_tunnels_name.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// VPNTunnelsName the model 'VPNTunnelsName' +type VPNTunnelsName string + +// List of VPNTunnels_name +const ( + VPNTUNNELSNAME_TUNNEL1 VPNTunnelsName = "tunnel1" + VPNTUNNELSNAME_TUNNEL2 VPNTunnelsName = "tunnel2" + VPNTUNNELSNAME_UNKNOWN_DEFAULT_OPEN_API VPNTunnelsName = "unknown_default_open_api" +) + +// All allowed values of VPNTunnelsName enum +var AllowedVPNTunnelsNameEnumValues = []VPNTunnelsName{ + "tunnel1", + "tunnel2", + "unknown_default_open_api", +} + +func (v *VPNTunnelsName) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VPNTunnelsName(value) + for _, existing := range AllowedVPNTunnelsNameEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = VPNTUNNELSNAME_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewVPNTunnelsNameFromValue returns a pointer to a valid VPNTunnelsName +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVPNTunnelsNameFromValue(v string) (*VPNTunnelsName, error) { + ev := VPNTunnelsName(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VPNTunnelsName: valid values are %v", v, AllowedVPNTunnelsNameEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VPNTunnelsName) IsValid() bool { + for _, existing := range AllowedVPNTunnelsNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VPNTunnels_name value +func (v VPNTunnelsName) Ptr() *VPNTunnelsName { + return &v +} + +type NullableVPNTunnelsName struct { + value *VPNTunnelsName + isSet bool +} + +func (v NullableVPNTunnelsName) Get() *VPNTunnelsName { + return v.value +} + +func (v *NullableVPNTunnelsName) Set(val *VPNTunnelsName) { + v.value = val + v.isSet = true +} + +func (v NullableVPNTunnelsName) IsSet() bool { + return v.isSet +} + +func (v *NullableVPNTunnelsName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVPNTunnelsName(val *VPNTunnelsName) *NullableVPNTunnelsName { + return &NullableVPNTunnelsName{value: val, isSet: true} +} + +func (v NullableVPNTunnelsName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVPNTunnelsName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 61e2d4cbe7500c89f3d557e7e16b75b80e5b4d84 Mon Sep 17 00:00:00 2001 From: Carlo Goetz Date: Fri, 22 May 2026 12:56:18 +0200 Subject: [PATCH 66/66] chore(vpn): fix examples, write changelog, bump version --- CHANGELOG.md | 2 ++ examples/vpn/vpn.go | 12 ++++++------ services/vpn/CHANGELOG.md | 3 +++ services/vpn/VERSION | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b58756606..4235efded 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -567,6 +567,8 @@ - **Breaking change:** Switch from regional to global API server URL. `config.WithRegion(...)` should not be used during client initialization anymore. - `v1beta1api`: Align package to latest API specification - `v1alpha1api`: Align package to latest API specification + - [v0.10.0](services/vpn/CHANGELOG.md#v0100) + - **Feature:** Introduce enums for various attributes ## Release (2026-04-07) - `alb`: [v0.13.1](services/alb/CHANGELOG.md#v0131) diff --git a/examples/vpn/vpn.go b/examples/vpn/vpn.go index 80144185a..018fa8990 100644 --- a/examples/vpn/vpn.go +++ b/examples/vpn/vpn.go @@ -48,14 +48,14 @@ func main() { // Create a VPN Connection phase1 := vpn.TunnelConfigurationPhase1{ - DhGroups: []string{"ecp384"}, - EncryptionAlgorithms: []string{"aes256"}, - IntegrityAlgorithms: []string{"sha2_384"}, + DhGroups: []vpn.PhaseDhGroupsInner{"ecp384"}, + EncryptionAlgorithms: []vpn.PhaseEncryptionAlgorithmsInner{"aes256"}, + IntegrityAlgorithms: []vpn.PhaseIntegrityAlgorithmsInner{"sha2_384"}, } phase2 := vpn.TunnelConfigurationPhase2{ - DhGroups: []string{"ecp384"}, - EncryptionAlgorithms: []string{"aes256"}, - IntegrityAlgorithms: []string{"sha2_384"}, + DhGroups: []vpn.PhaseDhGroupsInner{"ecp384"}, + EncryptionAlgorithms: []vpn.PhaseEncryptionAlgorithmsInner{"aes256"}, + IntegrityAlgorithms: []vpn.PhaseIntegrityAlgorithmsInner{"sha2_384"}, } tunnel := vpn.TunnelConfiguration{ Phase1: phase1, diff --git a/services/vpn/CHANGELOG.md b/services/vpn/CHANGELOG.md index 142b9e29b..1e34cc4c2 100644 --- a/services/vpn/CHANGELOG.md +++ b/services/vpn/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.10.0 +- **Feature:** Introduce enums for various attributes + ## v0.9.0 - `v1api`: - **Breaking change:** Switch from regional to global API server URL. `config.WithRegion(...)` should not be used during client initialization anymore. diff --git a/services/vpn/VERSION b/services/vpn/VERSION index 7965b36d6..f78dc3652 100644 --- a/services/vpn/VERSION +++ b/services/vpn/VERSION @@ -1 +1 @@ -v0.9.0 \ No newline at end of file +v0.10.0 \ No newline at end of file