From d3d49233676082f7232697b3bd15eafa5b652d1d Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 16 Jul 2026 14:35:56 +0000 Subject: [PATCH] Generate opensearch --- services/opensearch/api_default.go | 12 +- .../opensearch/model_list_backups_response.go | 149 ---------------- .../model_list_backups_response_test.go | 11 -- services/opensearch/oas_commit | 2 +- services/opensearch/v2api/api_default.go | 12 +- services/opensearch/v2api/api_default_mock.go | 6 +- .../v2api/model_list_backups_response.go | 166 ------------------ 7 files changed, 16 insertions(+), 342 deletions(-) delete mode 100644 services/opensearch/model_list_backups_response.go delete mode 100644 services/opensearch/model_list_backups_response_test.go delete mode 100644 services/opensearch/v2api/model_list_backups_response.go diff --git a/services/opensearch/api_default.go b/services/opensearch/api_default.go index cd898c7fb..ba477285f 100644 --- a/services/opensearch/api_default.go +++ b/services/opensearch/api_default.go @@ -259,11 +259,11 @@ type DefaultApi interface { @param projectId Project id on which user has permissions @param regionId region in which the project resides @param instanceId Instance id - @return ListBackupsResponse + @return []Backup // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) + ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]Backup, error) /* ListCredentials get list of credentials ids get list all credentials ids for instance @@ -542,7 +542,7 @@ type ApiGetMetricsRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListBackupsRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*ListBackupsResponse, error) + Execute() ([]Backup, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2143,12 +2143,12 @@ type ListBackupsRequest struct { } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { +func (r ListBackupsRequest) Execute() ([]Backup, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListBackupsResponse + localVarReturnValue []Backup ) a := r.apiService client, ok := a.client.(*APIClient) @@ -2287,7 +2287,7 @@ func (a *APIClient) ListBackups(ctx context.Context, projectId string, regionId } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) { +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]Backup, error) { r := ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, diff --git a/services/opensearch/model_list_backups_response.go b/services/opensearch/model_list_backups_response.go deleted file mode 100644 index bf5079a51..000000000 --- a/services/opensearch/model_list_backups_response.go +++ /dev/null @@ -1,149 +0,0 @@ -/* -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: 2.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package opensearch - -import ( - "encoding/json" -) - -// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListBackupsResponse{} - -/* - types and functions for instanceBackups -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponseGetInstanceBackupsAttributeType = *[]Backup - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponseGetInstanceBackupsArgType = []Backup - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponseGetInstanceBackupsRetType = []Backup - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListBackupsResponseGetInstanceBackupsAttributeTypeOk(arg ListBackupsResponseGetInstanceBackupsAttributeType) (ret ListBackupsResponseGetInstanceBackupsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListBackupsResponseGetInstanceBackupsAttributeType(arg *ListBackupsResponseGetInstanceBackupsAttributeType, val ListBackupsResponseGetInstanceBackupsRetType) { - *arg = &val -} - -// ListBackupsResponse struct for ListBackupsResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponse struct { - // REQUIRED - InstanceBackups ListBackupsResponseGetInstanceBackupsAttributeType `json:"instanceBackups" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _ListBackupsResponse ListBackupsResponse - -// NewListBackupsResponse instantiates a new ListBackupsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListBackupsResponse(instanceBackups ListBackupsResponseGetInstanceBackupsArgType) *ListBackupsResponse { - this := ListBackupsResponse{} - setListBackupsResponseGetInstanceBackupsAttributeType(&this.InstanceBackups, instanceBackups) - return &this -} - -// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListBackupsResponseWithDefaults() *ListBackupsResponse { - this := ListBackupsResponse{} - return &this -} - -// GetInstanceBackups returns the InstanceBackups field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) GetInstanceBackups() (ret ListBackupsResponseGetInstanceBackupsRetType) { - ret, _ = o.GetInstanceBackupsOk() - return ret -} - -// GetInstanceBackupsOk returns a tuple with the InstanceBackups field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) GetInstanceBackupsOk() (ret ListBackupsResponseGetInstanceBackupsRetType, ok bool) { - return getListBackupsResponseGetInstanceBackupsAttributeTypeOk(o.InstanceBackups) -} - -// SetInstanceBackups sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) SetInstanceBackups(v ListBackupsResponseGetInstanceBackupsRetType) { - setListBackupsResponseGetInstanceBackupsAttributeType(&o.InstanceBackups, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getListBackupsResponseGetInstanceBackupsAttributeTypeOk(o.InstanceBackups); ok { - toSerialize["InstanceBackups"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableListBackupsResponse struct { - value *ListBackupsResponse - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListBackupsResponse) Get() *ListBackupsResponse { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListBackupsResponse) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListBackupsResponse) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { - return &NullableListBackupsResponse{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/opensearch/model_list_backups_response_test.go b/services/opensearch/model_list_backups_response_test.go deleted file mode 100644 index acc93b4d9..000000000 --- a/services/opensearch/model_list_backups_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -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: 2.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch diff --git a/services/opensearch/oas_commit b/services/opensearch/oas_commit index 5319daad3..338ccfc45 100644 --- a/services/opensearch/oas_commit +++ b/services/opensearch/oas_commit @@ -1 +1 @@ -3ce30e12ea17197c003ced5176b6084b8d09a69f +c4128703f9d3ed3951e55d042b5a6ecc57011f2e diff --git a/services/opensearch/v2api/api_default.go b/services/opensearch/v2api/api_default.go index 56cc37e22..c42ee9616 100644 --- a/services/opensearch/v2api/api_default.go +++ b/services/opensearch/v2api/api_default.go @@ -183,8 +183,8 @@ type DefaultAPI interface { ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest // ListBackupsExecute executes the request - // @return ListBackupsResponse - ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) + // @return []Backup + ListBackupsExecute(r ApiListBackupsRequest) ([]Backup, error) /* ListCredentials get list of credentials ids @@ -1755,7 +1755,7 @@ type ApiListBackupsRequest struct { instanceId string } -func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { +func (r ApiListBackupsRequest) Execute() ([]Backup, error) { return r.ApiService.ListBackupsExecute(r) } @@ -1780,13 +1780,13 @@ func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, r // Execute executes the request // -// @return ListBackupsResponse -func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { +// @return []Backup +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) ([]Backup, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListBackupsResponse + localVarReturnValue []Backup ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") diff --git a/services/opensearch/v2api/api_default_mock.go b/services/opensearch/v2api/api_default_mock.go index 31f2e2855..a3622863f 100644 --- a/services/opensearch/v2api/api_default_mock.go +++ b/services/opensearch/v2api/api_default_mock.go @@ -40,7 +40,7 @@ type DefaultAPIServiceMock struct { // GetMetricsExecuteMock can be populated to implement the behavior of the GetMetricsExecute function of this mock GetMetricsExecuteMock *func(r ApiGetMetricsRequest) (*GetMetricsResponse, error) // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock - ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, error) + ListBackupsExecuteMock *func(r ApiListBackupsRequest) ([]Backup, error) // ListCredentialsExecuteMock can be populated to implement the behavior of the ListCredentialsExecute function of this mock ListCredentialsExecuteMock *func(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock @@ -252,9 +252,9 @@ func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string } // ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) ([]Backup, error) { if a.ListBackupsExecuteMock == nil { - var localVarReturnValue *ListBackupsResponse + var localVarReturnValue []Backup return localVarReturnValue, nil } diff --git a/services/opensearch/v2api/model_list_backups_response.go b/services/opensearch/v2api/model_list_backups_response.go deleted file mode 100644 index f8a8a1ee7..000000000 --- a/services/opensearch/v2api/model_list_backups_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -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: 2.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListBackupsResponse{} - -// ListBackupsResponse struct for ListBackupsResponse -type ListBackupsResponse struct { - InstanceBackups []Backup `json:"instanceBackups"` - AdditionalProperties map[string]interface{} -} - -type _ListBackupsResponse ListBackupsResponse - -// NewListBackupsResponse instantiates a new ListBackupsResponse 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 NewListBackupsResponse(instanceBackups []Backup) *ListBackupsResponse { - this := ListBackupsResponse{} - this.InstanceBackups = instanceBackups - return &this -} - -// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse 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 NewListBackupsResponseWithDefaults() *ListBackupsResponse { - this := ListBackupsResponse{} - return &this -} - -// GetInstanceBackups returns the InstanceBackups field value -func (o *ListBackupsResponse) GetInstanceBackups() []Backup { - if o == nil { - var ret []Backup - return ret - } - - return o.InstanceBackups -} - -// GetInstanceBackupsOk returns a tuple with the InstanceBackups field value -// and a boolean to check if the value has been set. -func (o *ListBackupsResponse) GetInstanceBackupsOk() ([]Backup, bool) { - if o == nil { - return nil, false - } - return o.InstanceBackups, true -} - -// SetInstanceBackups sets field value -func (o *ListBackupsResponse) SetInstanceBackups(v []Backup) { - o.InstanceBackups = v -} - -func (o ListBackupsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["instanceBackups"] = o.InstanceBackups - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListBackupsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "instanceBackups", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListBackupsResponse := _ListBackupsResponse{} - - err = json.Unmarshal(data, &varListBackupsResponse) - - if err != nil { - return err - } - - *o = ListBackupsResponse(varListBackupsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "instanceBackups") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableListBackupsResponse struct { - value *ListBackupsResponse - isSet bool -} - -func (v NullableListBackupsResponse) Get() *ListBackupsResponse { - return v.value -} - -func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListBackupsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListBackupsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { - return &NullableListBackupsResponse{value: val, isSet: true} -} - -func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -}