From a6ab51e36f464d89f2746113721c98efcedc07ca Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 10 Jul 2025 06:20:41 +0000 Subject: [PATCH 1/3] Generate ske --- services/mongodbflex/api_default.go | 12 +- services/mongodbflex/api_default_test.go | 2 +- .../model_get_instance_response.go | 127 ------------------ .../mongodbflex/model_instance_response.go | 127 ++++++++++++++++++ ...est.go => model_instance_response_test.go} | 0 services/ske/model_cluster_error.go | 125 +---------------- services/ske/model_cluster_error_test.go | 82 ----------- 7 files changed, 140 insertions(+), 335 deletions(-) delete mode 100644 services/mongodbflex/model_get_instance_response.go create mode 100644 services/mongodbflex/model_instance_response.go rename services/mongodbflex/{model_get_instance_response_test.go => model_instance_response_test.go} (100%) diff --git a/services/mongodbflex/api_default.go b/services/mongodbflex/api_default.go index a1430c4e2..e6ff9417e 100644 --- a/services/mongodbflex/api_default.go +++ b/services/mongodbflex/api_default.go @@ -164,10 +164,10 @@ type DefaultApi interface { @param projectId project id @param instanceId instance id @param region The region which should be addressed - @return GetInstanceResponse + @return InstanceResponse */ - GetInstanceExecute(ctx context.Context, projectId string, instanceId string, region string) (*GetInstanceResponse, error) + GetInstanceExecute(ctx context.Context, projectId string, instanceId string, region string) (*InstanceResponse, error) /* GetUser Get User get detailed information of a user of a mongodb instance @@ -587,7 +587,7 @@ type ApiGetBackupRequest interface { } type ApiGetInstanceRequest interface { - Execute() (*GetInstanceResponse, error) + Execute() (*InstanceResponse, error) } type ApiGetUserRequest interface { @@ -1751,12 +1751,12 @@ type GetInstanceRequest struct { region string } -func (r GetInstanceRequest) Execute() (*GetInstanceResponse, error) { +func (r GetInstanceRequest) Execute() (*InstanceResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetInstanceResponse + localVarReturnValue *InstanceResponse ) a := r.apiService client, ok := a.client.(*APIClient) @@ -1895,7 +1895,7 @@ func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceI } } -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string, region string) (*GetInstanceResponse, error) { +func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string, region string) (*InstanceResponse, error) { r := GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, diff --git a/services/mongodbflex/api_default_test.go b/services/mongodbflex/api_default_test.go index c20149257..f15451ccb 100644 --- a/services/mongodbflex/api_default_test.go +++ b/services/mongodbflex/api_default_test.go @@ -376,7 +376,7 @@ func Test_mongodbflex_DefaultApiService(t *testing.T) { testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := GetInstanceResponse{} + data := InstanceResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) diff --git a/services/mongodbflex/model_get_instance_response.go b/services/mongodbflex/model_get_instance_response.go deleted file mode 100644 index 0fc443f71..000000000 --- a/services/mongodbflex/model_get_instance_response.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -STACKIT MongoDB Service API - -This is the documentation for the STACKIT MongoDB Flex Service API - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package mongodbflex - -import ( - "encoding/json" -) - -// checks if the GetInstanceResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetInstanceResponse{} - -/* - types and functions for item -*/ - -// isModel -type GetInstanceResponseGetItemAttributeType = *Instance -type GetInstanceResponseGetItemArgType = Instance -type GetInstanceResponseGetItemRetType = Instance - -func getGetInstanceResponseGetItemAttributeTypeOk(arg GetInstanceResponseGetItemAttributeType) (ret GetInstanceResponseGetItemRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setGetInstanceResponseGetItemAttributeType(arg *GetInstanceResponseGetItemAttributeType, val GetInstanceResponseGetItemRetType) { - *arg = &val -} - -// GetInstanceResponse struct for GetInstanceResponse -type GetInstanceResponse struct { - Item GetInstanceResponseGetItemAttributeType `json:"item,omitempty"` -} - -// NewGetInstanceResponse instantiates a new GetInstanceResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewGetInstanceResponse() *GetInstanceResponse { - this := GetInstanceResponse{} - return &this -} - -// NewGetInstanceResponseWithDefaults instantiates a new GetInstanceResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewGetInstanceResponseWithDefaults() *GetInstanceResponse { - this := GetInstanceResponse{} - return &this -} - -// GetItem returns the Item field value if set, zero value otherwise. -func (o *GetInstanceResponse) GetItem() (res GetInstanceResponseGetItemRetType) { - res, _ = o.GetItemOk() - return -} - -// GetItemOk returns a tuple with the Item field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetInstanceResponse) GetItemOk() (ret GetInstanceResponseGetItemRetType, ok bool) { - return getGetInstanceResponseGetItemAttributeTypeOk(o.Item) -} - -// HasItem returns a boolean if a field has been set. -func (o *GetInstanceResponse) HasItem() bool { - _, ok := o.GetItemOk() - return ok -} - -// SetItem gets a reference to the given Instance and assigns it to the Item field. -func (o *GetInstanceResponse) SetItem(v GetInstanceResponseGetItemRetType) { - setGetInstanceResponseGetItemAttributeType(&o.Item, v) -} - -func (o GetInstanceResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getGetInstanceResponseGetItemAttributeTypeOk(o.Item); ok { - toSerialize["Item"] = val - } - return toSerialize, nil -} - -type NullableGetInstanceResponse struct { - value *GetInstanceResponse - isSet bool -} - -func (v NullableGetInstanceResponse) Get() *GetInstanceResponse { - return v.value -} - -func (v *NullableGetInstanceResponse) Set(val *GetInstanceResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetInstanceResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetInstanceResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetInstanceResponse(val *GetInstanceResponse) *NullableGetInstanceResponse { - return &NullableGetInstanceResponse{value: val, isSet: true} -} - -func (v NullableGetInstanceResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetInstanceResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/mongodbflex/model_instance_response.go b/services/mongodbflex/model_instance_response.go new file mode 100644 index 000000000..56434ccdd --- /dev/null +++ b/services/mongodbflex/model_instance_response.go @@ -0,0 +1,127 @@ +/* +STACKIT MongoDB Service API + +This is the documentation for the STACKIT MongoDB Flex Service API + +API version: 2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package mongodbflex + +import ( + "encoding/json" +) + +// checks if the InstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceResponse{} + +/* + types and functions for item +*/ + +// isModel +type InstanceResponseGetItemAttributeType = *Instance +type InstanceResponseGetItemArgType = Instance +type InstanceResponseGetItemRetType = Instance + +func getInstanceResponseGetItemAttributeTypeOk(arg InstanceResponseGetItemAttributeType) (ret InstanceResponseGetItemRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setInstanceResponseGetItemAttributeType(arg *InstanceResponseGetItemAttributeType, val InstanceResponseGetItemRetType) { + *arg = &val +} + +// InstanceResponse struct for InstanceResponse +type InstanceResponse struct { + Item InstanceResponseGetItemAttributeType `json:"item,omitempty"` +} + +// NewInstanceResponse instantiates a new InstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceResponse() *InstanceResponse { + this := InstanceResponse{} + return &this +} + +// NewInstanceResponseWithDefaults instantiates a new InstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceResponseWithDefaults() *InstanceResponse { + this := InstanceResponse{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *InstanceResponse) GetItem() (res InstanceResponseGetItemRetType) { + res, _ = o.GetItemOk() + return +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceResponse) GetItemOk() (ret InstanceResponseGetItemRetType, ok bool) { + return getInstanceResponseGetItemAttributeTypeOk(o.Item) +} + +// HasItem returns a boolean if a field has been set. +func (o *InstanceResponse) HasItem() bool { + _, ok := o.GetItemOk() + return ok +} + +// SetItem gets a reference to the given Instance and assigns it to the Item field. +func (o *InstanceResponse) SetItem(v InstanceResponseGetItemRetType) { + setInstanceResponseGetItemAttributeType(&o.Item, v) +} + +func (o InstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getInstanceResponseGetItemAttributeTypeOk(o.Item); ok { + toSerialize["Item"] = val + } + return toSerialize, nil +} + +type NullableInstanceResponse struct { + value *InstanceResponse + isSet bool +} + +func (v NullableInstanceResponse) Get() *InstanceResponse { + return v.value +} + +func (v *NullableInstanceResponse) Set(val *InstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceResponse(val *InstanceResponse) *NullableInstanceResponse { + return &NullableInstanceResponse{value: val, isSet: true} +} + +func (v NullableInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/mongodbflex/model_get_instance_response_test.go b/services/mongodbflex/model_instance_response_test.go similarity index 100% rename from services/mongodbflex/model_get_instance_response_test.go rename to services/mongodbflex/model_instance_response_test.go diff --git a/services/ske/model_cluster_error.go b/services/ske/model_cluster_error.go index fe861e6c6..12abcf9f9 100644 --- a/services/ske/model_cluster_error.go +++ b/services/ske/model_cluster_error.go @@ -12,7 +12,6 @@ package ske import ( "encoding/json" - "fmt" ) // checks if the ClusterError type satisfies the MappedNullable interface at compile time @@ -22,124 +21,8 @@ var _ MappedNullable = &ClusterError{} types and functions for code */ -// isEnum - -// ClusterErrorCode the model 'ClusterError' -// value type for enums -type ClusterErrorCode string - -// List of Code -const ( - CLUSTERERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND ClusterErrorCode = "SKE_OBSERVABILITY_INSTANCE_NOT_FOUND" - CLUSTERERRORCODE_DNS_ZONE_NOT_FOUND ClusterErrorCode = "SKE_DNS_ZONE_NOT_FOUND" - CLUSTERERRORCODE_NODE_NO_VALID_HOST_FOUND ClusterErrorCode = "SKE_NODE_NO_VALID_HOST_FOUND" - CLUSTERERRORCODE_NODE_MISCONFIGURED_PDB ClusterErrorCode = "SKE_NODE_MISCONFIGURED_PDB" - CLUSTERERRORCODE_NODE_MACHINE_TYPE_NOT_FOUND ClusterErrorCode = "SKE_NODE_MACHINE_TYPE_NOT_FOUND" - CLUSTERERRORCODE_INFRA_SNA_NETWORK_NOT_FOUND ClusterErrorCode = "SKE_INFRA_SNA_NETWORK_NOT_FOUND" - CLUSTERERRORCODE_FETCHING_ERRORS_NOT_POSSIBLE ClusterErrorCode = "SKE_FETCHING_ERRORS_NOT_POSSIBLE" -) - -// All allowed values of ClusterError enum -var AllowedClusterErrorCodeEnumValues = []ClusterErrorCode{ - "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", -} - -func (v *ClusterErrorCode) UnmarshalJSON(src []byte) error { - // use a type alias to prevent infinite recursion during unmarshal, - // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers - type TmpJson ClusterErrorCode - var value TmpJson - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - // Allow unmarshalling zero value for testing purposes - var zeroValue TmpJson - if value == zeroValue { - return nil - } - enumTypeValue := ClusterErrorCode(value) - for _, existing := range AllowedClusterErrorCodeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid ClusterError", value) -} - -// NewClusterErrorCodeFromValue returns a pointer to a valid ClusterErrorCode -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewClusterErrorCodeFromValue(v ClusterErrorCode) (*ClusterErrorCode, error) { - ev := ClusterErrorCode(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ClusterErrorCode: valid values are %v", v, AllowedClusterErrorCodeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ClusterErrorCode) IsValid() bool { - for _, existing := range AllowedClusterErrorCodeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to CodeCode value -func (v ClusterErrorCode) Ptr() *ClusterErrorCode { - return &v -} - -type NullableClusterErrorCode struct { - value *ClusterErrorCode - isSet bool -} - -func (v NullableClusterErrorCode) Get() *ClusterErrorCode { - return v.value -} - -func (v *NullableClusterErrorCode) Set(val *ClusterErrorCode) { - v.value = val - v.isSet = true -} - -func (v NullableClusterErrorCode) IsSet() bool { - return v.isSet -} - -func (v *NullableClusterErrorCode) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableClusterErrorCode(val *ClusterErrorCode) *NullableClusterErrorCode { - return &NullableClusterErrorCode{value: val, isSet: true} -} - -func (v NullableClusterErrorCode) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableClusterErrorCode) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type ClusterErrorGetCodeAttributeType = *ClusterErrorCode -type ClusterErrorGetCodeArgType = ClusterErrorCode -type ClusterErrorGetCodeRetType = ClusterErrorCode +// isNotNullableString +type ClusterErrorGetCodeAttributeType = *string func getClusterErrorGetCodeAttributeTypeOk(arg ClusterErrorGetCodeAttributeType) (ret ClusterErrorGetCodeRetType, ok bool) { if arg == nil { @@ -152,6 +35,9 @@ func setClusterErrorGetCodeAttributeType(arg *ClusterErrorGetCodeAttributeType, *arg = &val } +type ClusterErrorGetCodeArgType = string +type ClusterErrorGetCodeRetType = string + /* types and functions for message */ @@ -175,6 +61,7 @@ type ClusterErrorGetMessageRetType = string // 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\"` Code ClusterErrorGetCodeAttributeType `json:"code,omitempty"` Message ClusterErrorGetMessageAttributeType `json:"message,omitempty"` } diff --git a/services/ske/model_cluster_error_test.go b/services/ske/model_cluster_error_test.go index c3b673432..416840235 100644 --- a/services/ske/model_cluster_error_test.go +++ b/services/ske/model_cluster_error_test.go @@ -9,85 +9,3 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package ske - -import ( - "testing" -) - -// isEnum - -func TestClusterErrorCode_UnmarshalJSON(t *testing.T) { - type args struct { - src []byte - } - tests := []struct { - name string - args args - wantErr bool - }{ - { - name: `success - possible enum value no. 1`, - args: args{ - src: []byte(`"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 2`, - args: args{ - src: []byte(`"SKE_DNS_ZONE_NOT_FOUND"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 3`, - args: args{ - src: []byte(`"SKE_NODE_NO_VALID_HOST_FOUND"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 4`, - args: args{ - src: []byte(`"SKE_NODE_MISCONFIGURED_PDB"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 5`, - args: args{ - src: []byte(`"SKE_NODE_MACHINE_TYPE_NOT_FOUND"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 6`, - args: args{ - src: []byte(`"SKE_INFRA_SNA_NETWORK_NOT_FOUND"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 7`, - args: args{ - src: []byte(`"SKE_FETCHING_ERRORS_NOT_POSSIBLE"`), - }, - wantErr: false, - }, - { - name: "fail", - args: args{ - src: []byte("\"FOOBAR\""), - }, - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := ClusterErrorCode("") - if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { - t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} From f4623ddf287bd5b5e43224db3085fc48ab89a577 Mon Sep 17 00:00:00 2001 From: Benjosh95 Date: Thu, 10 Jul 2025 09:07:53 +0200 Subject: [PATCH 2/3] fix: getInstanceResponse undefined, it got renamed to instanceResponse --- services/mongodbflex/wait/wait.go | 14 +++++++------- services/mongodbflex/wait/wait_test.go | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/services/mongodbflex/wait/wait.go b/services/mongodbflex/wait/wait.go index 76afae0e4..0b3bf6d11 100644 --- a/services/mongodbflex/wait/wait.go +++ b/services/mongodbflex/wait/wait.go @@ -31,13 +31,13 @@ const ( // Interface needed for tests type APIClientInstanceInterface interface { - GetInstanceExecute(ctx context.Context, projectId, instanceId, region string) (*mongodbflex.GetInstanceResponse, error) + GetInstanceExecute(ctx context.Context, projectId, instanceId, region string) (*mongodbflex.InstanceResponse, error) ListRestoreJobsExecute(ctx context.Context, projectId, instanceId, region string) (*mongodbflex.ListRestoreJobsResponse, error) } // CreateInstanceWaitHandler will wait for instance creation -func CreateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.GetInstanceResponse] { - handler := wait.New(func() (waitFinished bool, response *mongodbflex.GetInstanceResponse, err error) { +func CreateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { + handler := wait.New(func() (waitFinished bool, response *mongodbflex.InstanceResponse, err error) { s, err := a.GetInstanceExecute(ctx, projectId, instanceId, region) if err != nil { return false, nil, err @@ -66,7 +66,7 @@ func CreateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface } // CloneInstanceWaitHandler will wait for instance clone to be created -func CloneInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.GetInstanceResponse] { +func CloneInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { return CreateInstanceWaitHandler(ctx, a, projectId, instanceId, region) } @@ -115,8 +115,8 @@ func RestoreInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterfac } // UpdateInstanceWaitHandler will wait for instance update -func UpdateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.GetInstanceResponse] { - handler := wait.New(func() (waitFinished bool, response *mongodbflex.GetInstanceResponse, err error) { +func UpdateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { + handler := wait.New(func() (waitFinished bool, response *mongodbflex.InstanceResponse, err error) { s, err := a.GetInstanceExecute(ctx, projectId, instanceId, region) if err != nil { return false, nil, err @@ -144,7 +144,7 @@ func UpdateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface } // PartialUpdateInstanceWaitHandler will wait for instance update -func PartialUpdateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.GetInstanceResponse] { +func PartialUpdateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { return UpdateInstanceWaitHandler(ctx, a, projectId, instanceId, region) } diff --git a/services/mongodbflex/wait/wait_test.go b/services/mongodbflex/wait/wait_test.go index d136bb259..e606b8307 100644 --- a/services/mongodbflex/wait/wait_test.go +++ b/services/mongodbflex/wait/wait_test.go @@ -25,7 +25,7 @@ type apiClientInstanceMocked struct { const testRegion = "eu01" -func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _, _ string) (*mongodbflex.GetInstanceResponse, error) { +func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _, _ string) (*mongodbflex.InstanceResponse, error) { if a.instanceGetFails { return nil, &oapierror.GenericOpenAPIError{ StatusCode: 500, @@ -38,7 +38,7 @@ func (a *apiClientInstanceMocked) GetInstanceExecute(_ context.Context, _, _, _ } } - return &mongodbflex.GetInstanceResponse{ + return &mongodbflex.InstanceResponse{ Item: &mongodbflex.Instance{ Id: &a.instanceId, Status: &a.instanceState, @@ -117,9 +117,9 @@ func TestCreateInstanceWaitHandler(t *testing.T) { instanceGetFails: tt.instanceGetFails, } - var wantRes *mongodbflex.GetInstanceResponse + var wantRes *mongodbflex.InstanceResponse if tt.wantResp { - wantRes = &mongodbflex.GetInstanceResponse{ + wantRes = &mongodbflex.InstanceResponse{ Item: &mongodbflex.Instance{ Id: &instanceId, Status: utils.Ptr(tt.instanceState), @@ -194,9 +194,9 @@ func TestUpdateInstanceWaitHandler(t *testing.T) { instanceGetFails: tt.instanceGetFails, } - var wantRes *mongodbflex.GetInstanceResponse + var wantRes *mongodbflex.InstanceResponse if tt.wantResp { - wantRes = &mongodbflex.GetInstanceResponse{ + wantRes = &mongodbflex.InstanceResponse{ Item: &mongodbflex.Instance{ Id: &instanceId, Status: utils.Ptr(tt.instanceState), From 0fc30e468e6dc3bc0f1c9fbaf74b30506c8ab855 Mon Sep 17 00:00:00 2001 From: Benjosh95 Date: Thu, 10 Jul 2025 10:47:59 +0200 Subject: [PATCH 3/3] update changelogs and versions --- CHANGELOG.md | 5 +++++ services/mongodbflex/CHANGELOG.md | 3 +++ services/mongodbflex/VERSION | 2 +- services/ske/CHANGELOG.md | 3 +++ services/ske/VERSION | 2 +- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6986fb3e..9945b0b2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,12 @@ ## Release (2025-XX-XX) +- `ske`: [v1.1.0](services/ske/CHANGELOG.md#v110) + - **Breaking Change:** `ClusterError.Code` field is now a string type instead of an enum. The field no longer validates against predefined enum values and accepts any string value. +- `mongodbflex`: [v1.5.0](services/mongodbflex/CHANGELOG.md#v150) + - **Breaking Change:** Renamed `GetInstanceResponse` to `InstanceResponse`. This affects the return type of the `GetInstance` method. - `mongodbflex`: [v1.4.0](services/mongodbflex/CHANGELOG.md#v140) - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + ## Release (2025-07-07) - `ske`: [v1.0.0](services/ske/CHANGELOG.md#v100) diff --git a/services/mongodbflex/CHANGELOG.md b/services/mongodbflex/CHANGELOG.md index 5b08d9ffd..72b89f8ef 100644 --- a/services/mongodbflex/CHANGELOG.md +++ b/services/mongodbflex/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.5.0 +- **Breaking Change:** Renamed `GetInstanceResponse` to `InstanceResponse`. This affects the return type of the `GetInstance` method. + ## v1.4.0 - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. diff --git a/services/mongodbflex/VERSION b/services/mongodbflex/VERSION index ec7b96782..76864c1c2 100644 --- a/services/mongodbflex/VERSION +++ b/services/mongodbflex/VERSION @@ -1 +1 @@ -v1.4.0 \ No newline at end of file +v1.5.0 \ No newline at end of file diff --git a/services/ske/CHANGELOG.md b/services/ske/CHANGELOG.md index f406e282d..b82a0f61a 100644 --- a/services/ske/CHANGELOG.md +++ b/services/ske/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.1.0 +- **Breaking Change:** `ClusterError.Code` field is now a string type instead of an enum. The field no longer validates against predefined enum values and accepts any string value. + ## v1.0.0 - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. diff --git a/services/ske/VERSION b/services/ske/VERSION index 60453e690..992977ad2 100644 --- a/services/ske/VERSION +++ b/services/ske/VERSION @@ -1 +1 @@ -v1.0.0 \ No newline at end of file +v1.1.0 \ No newline at end of file