diff --git a/services/serviceenablement/api_default.go b/services/serviceenablement/api_default.go index 031dcaab0..5c8f04bd8 100644 --- a/services/serviceenablement/api_default.go +++ b/services/serviceenablement/api_default.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -23,6 +24,7 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DefaultApi interface { /* DisableServiceRegional Method for DisableServiceRegional @@ -38,6 +40,7 @@ type DefaultApi interface { /* DisableServiceRegionalExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DisableServiceRegionalExecute(ctx context.Context, region string, projectId string, serviceId string) error /* @@ -54,6 +57,7 @@ type DefaultApi interface { /* EnableServiceRegionalExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ EnableServiceRegionalExecute(ctx context.Context, region string, projectId string, serviceId string) error /* @@ -76,6 +80,7 @@ type DefaultApi interface { @param serviceId @return ServiceStatus + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetServiceStatusRegionalExecute(ctx context.Context, region string, projectId string, serviceId string) (*ServiceStatus, error) /* @@ -96,30 +101,38 @@ type DefaultApi interface { @param projectId @return ListServiceStatusRegional200Response + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListServiceStatusRegionalExecute(ctx context.Context, region string, projectId string) (*ListServiceStatusRegional200Response, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDisableServiceRegionalRequest interface { Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiEnableServiceRegionalRequest interface { Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetServiceStatusRegionalRequest interface { Execute() (*ServiceStatus, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListServiceStatusRegionalRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Cursor(cursor string) ApiListServiceStatusRegionalRequest Execute() (*ListServiceStatusRegional200Response, error) } // DefaultApiService DefaultApi service +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DefaultApiService service +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DisableServiceRegionalRequest struct { ctx context.Context apiService *DefaultApiService @@ -128,6 +141,7 @@ type DisableServiceRegionalRequest struct { serviceId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DisableServiceRegionalRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -233,7 +247,7 @@ func (r DisableServiceRegionalRequest) Execute() error { /* DisableServiceRegional: Method for DisableServiceRegional -disables the service in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param region @@ -251,6 +265,7 @@ func (a *APIClient) DisableServiceRegional(ctx context.Context, region string, p } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DisableServiceRegionalExecute(ctx context.Context, region string, projectId string, serviceId string) error { r := DisableServiceRegionalRequest{ apiService: a.defaultApi, @@ -262,6 +277,7 @@ func (a *APIClient) DisableServiceRegionalExecute(ctx context.Context, region st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type EnableServiceRegionalRequest struct { ctx context.Context apiService *DefaultApiService @@ -270,6 +286,7 @@ type EnableServiceRegionalRequest struct { serviceId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r EnableServiceRegionalRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -375,7 +392,7 @@ func (r EnableServiceRegionalRequest) Execute() error { /* EnableServiceRegional: Method for EnableServiceRegional -enables the service in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param region @@ -393,6 +410,7 @@ func (a *APIClient) EnableServiceRegional(ctx context.Context, region string, pr } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) EnableServiceRegionalExecute(ctx context.Context, region string, projectId string, serviceId string) error { r := EnableServiceRegionalRequest{ apiService: a.defaultApi, @@ -404,6 +422,7 @@ func (a *APIClient) EnableServiceRegionalExecute(ctx context.Context, region str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetServiceStatusRegionalRequest struct { ctx context.Context apiService *DefaultApiService @@ -412,6 +431,7 @@ type GetServiceStatusRegionalRequest struct { serviceId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetServiceStatusRegionalRequest) Execute() (*ServiceStatus, error) { var ( localVarHTTPMethod = http.MethodGet @@ -528,7 +548,7 @@ func (r GetServiceStatusRegionalRequest) Execute() (*ServiceStatus, error) { /* GetServiceStatusRegional: Method for GetServiceStatusRegional -returns the current status of a service in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param region @@ -546,6 +566,7 @@ func (a *APIClient) GetServiceStatusRegional(ctx context.Context, region string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetServiceStatusRegionalExecute(ctx context.Context, region string, projectId string, serviceId string) (*ServiceStatus, error) { r := GetServiceStatusRegionalRequest{ apiService: a.defaultApi, @@ -557,6 +578,7 @@ func (a *APIClient) GetServiceStatusRegionalExecute(ctx context.Context, region return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServiceStatusRegionalRequest struct { ctx context.Context apiService *DefaultApiService @@ -565,11 +587,13 @@ type ListServiceStatusRegionalRequest struct { cursor *string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListServiceStatusRegionalRequest) Cursor(cursor string) ApiListServiceStatusRegionalRequest { r.cursor = &cursor return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListServiceStatusRegionalRequest) Execute() (*ListServiceStatusRegional200Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -687,7 +711,7 @@ func (r ListServiceStatusRegionalRequest) Execute() (*ListServiceStatusRegional2 /* ListServiceStatusRegional: Method for ListServiceStatusRegional -returns a list of all available services for a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param region @@ -703,6 +727,7 @@ func (a *APIClient) ListServiceStatusRegional(ctx context.Context, region string } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListServiceStatusRegionalExecute(ctx context.Context, region string, projectId string) (*ListServiceStatusRegional200Response, error) { r := ListServiceStatusRegionalRequest{ apiService: a.defaultApi, diff --git a/services/serviceenablement/client.go b/services/serviceenablement/client.go index c8d616409..a1fd4ebb5 100644 --- a/services/serviceenablement/client.go +++ b/services/serviceenablement/client.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -44,18 +45,21 @@ var ( // APIClient manages communication with the STACKIT Service Enablement API API v2.0 // In most cases there should be only one, shared, APIClient. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { cfg *config.Configuration common service // Reuse a single struct instead of allocating one for each service on the heap. defaultApi *DefaultApiService } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type service struct { client DefaultApi } // NewAPIClient creates a new API client. // Optionally receives configuration options +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { cfg := NewConfiguration() @@ -144,6 +148,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func ParameterValueToString(obj interface{}, key string) string { if reflect.TypeOf(obj).Kind() != reflect.Ptr { return fmt.Sprintf("%v", obj) @@ -282,6 +287,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (c *APIClient) GetConfig() *config.Configuration { return c.cfg } @@ -592,6 +598,7 @@ func parseCacheControl(headers http.Header) cacheControl { } // CacheExpires helper function to determine remaining time before repeating a request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CacheExpires(r *http.Response) time.Time { // Figure out when the cache expires. var expires time.Time diff --git a/services/serviceenablement/configuration.go b/services/serviceenablement/configuration.go index 4f0ce9e47..76c679610 100644 --- a/services/serviceenablement/configuration.go +++ b/services/serviceenablement/configuration.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -15,6 +16,7 @@ import ( ) // NewConfiguration returns a new Configuration object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewConfiguration() *config.Configuration { cfg := &config.Configuration{ DefaultHeader: make(map[string]string), diff --git a/services/serviceenablement/go.mod b/services/serviceenablement/go.mod index cbdcae783..2386f1ef9 100644 --- a/services/serviceenablement/go.mod +++ b/services/serviceenablement/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/google/go-cmp v0.7.0 - github.com/stackitcloud/stackit-sdk-go/core v0.21.1 + github.com/stackitcloud/stackit-sdk-go/core v0.22.0 ) require ( diff --git a/services/serviceenablement/go.sum b/services/serviceenablement/go.sum index ca103c909..195011dd5 100644 --- a/services/serviceenablement/go.sum +++ b/services/serviceenablement/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.21.1 h1:Y/PcAgM7DPYMNqum0MLv4n1mF9ieuevzcCIZYQfm3Ts= -github.com/stackitcloud/stackit-sdk-go/core v0.21.1/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0 h1:6rViz7GnNwXSh51Lur5xuDzO8EWSZfN9J0HvEkBKq6c= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= diff --git a/services/serviceenablement/model_action_error.go b/services/serviceenablement/model_action_error.go index d3db5fc17..fc11f57b3 100644 --- a/services/serviceenablement/model_action_error.go +++ b/services/serviceenablement/model_action_error.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -26,20 +27,25 @@ var _ MappedNullable = &ActionError{} // ActionErrorAction the last action which was triggered on this service // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionErrorAction string // List of Action const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead ACTIONERRORACTION_DISABLE ActionErrorAction = "DISABLE" - ACTIONERRORACTION_ENABLE ActionErrorAction = "ENABLE" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + ACTIONERRORACTION_ENABLE ActionErrorAction = "ENABLE" ) // All allowed values of ActionError enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedActionErrorActionEnumValues = []ActionErrorAction{ "DISABLE", "ENABLE", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *ActionErrorAction) 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 @@ -67,6 +73,7 @@ func (v *ActionErrorAction) UnmarshalJSON(src []byte) error { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewActionErrorActionFromValue(v ActionErrorAction) (*ActionErrorAction, error) { ev := ActionErrorAction(v) if ev.IsValid() { @@ -77,6 +84,7 @@ func NewActionErrorActionFromValue(v ActionErrorAction) (*ActionErrorAction, err } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ActionErrorAction) IsValid() bool { for _, existing := range AllowedActionErrorActionEnumValues { if existing == v { @@ -87,50 +95,65 @@ func (v ActionErrorAction) IsValid() bool { } // Ptr returns reference to ActionAction value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ActionErrorAction) Ptr() *ActionErrorAction { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableActionErrorAction struct { value *ActionErrorAction isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableActionErrorAction) Get() *ActionErrorAction { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableActionErrorAction) Set(val *ActionErrorAction) { 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 NullableActionErrorAction) 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 *NullableActionErrorAction) 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 NewNullableActionErrorAction(val *ActionErrorAction) *NullableActionErrorAction { return &NullableActionErrorAction{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 NullableActionErrorAction) 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 *NullableActionErrorAction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionErrorGetActionAttributeType = *ActionErrorAction + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionErrorGetActionArgType = ActionErrorAction + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionErrorGetActionRetType = ActionErrorAction +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getActionErrorGetActionAttributeTypeOk(arg ActionErrorGetActionAttributeType) (ret ActionErrorGetActionRetType, ok bool) { if arg == nil { return ret, false @@ -138,6 +161,7 @@ func getActionErrorGetActionAttributeTypeOk(arg ActionErrorGetActionAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setActionErrorGetActionAttributeType(arg *ActionErrorGetActionAttributeType, val ActionErrorGetActionRetType) { *arg = &val } @@ -147,8 +171,10 @@ func setActionErrorGetActionAttributeType(arg *ActionErrorGetActionAttributeType */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionErrorGetCodeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getActionErrorGetCodeAttributeTypeOk(arg ActionErrorGetCodeAttributeType) (ret ActionErrorGetCodeRetType, ok bool) { if arg == nil { return ret, false @@ -156,11 +182,15 @@ func getActionErrorGetCodeAttributeTypeOk(arg ActionErrorGetCodeAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setActionErrorGetCodeAttributeType(arg *ActionErrorGetCodeAttributeType, val ActionErrorGetCodeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionErrorGetCodeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionErrorGetCodeRetType = string /* @@ -168,8 +198,10 @@ type ActionErrorGetCodeRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionErrorGetReasonAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getActionErrorGetReasonAttributeTypeOk(arg ActionErrorGetReasonAttributeType) (ret ActionErrorGetReasonRetType, ok bool) { if arg == nil { return ret, false @@ -177,14 +209,19 @@ func getActionErrorGetReasonAttributeTypeOk(arg ActionErrorGetReasonAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setActionErrorGetReasonAttributeType(arg *ActionErrorGetReasonAttributeType, val ActionErrorGetReasonRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionErrorGetReasonArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionErrorGetReasonRetType = string // ActionError the last error for this service. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ActionError struct { // the last action which was triggered on this service Action ActionErrorGetActionAttributeType `json:"action,omitempty"` @@ -198,6 +235,7 @@ type ActionError struct { // 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 NewActionError() *ActionError { this := ActionError{} return &this @@ -206,12 +244,14 @@ func NewActionError() *ActionError { // NewActionErrorWithDefaults instantiates a new ActionError 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 NewActionErrorWithDefaults() *ActionError { this := ActionError{} return &this } // GetAction returns the Action field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) GetAction() (res ActionErrorGetActionRetType) { res, _ = o.GetActionOk() return @@ -219,22 +259,26 @@ func (o *ActionError) GetAction() (res ActionErrorGetActionRetType) { // GetActionOk returns a tuple with the Action field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) GetActionOk() (ret ActionErrorGetActionRetType, ok bool) { return getActionErrorGetActionAttributeTypeOk(o.Action) } // HasAction returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) HasAction() bool { _, ok := o.GetActionOk() return ok } // SetAction gets a reference to the given string and assigns it to the Action field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) SetAction(v ActionErrorGetActionRetType) { setActionErrorGetActionAttributeType(&o.Action, v) } // GetCode returns the Code field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) GetCode() (res ActionErrorGetCodeRetType) { res, _ = o.GetCodeOk() return @@ -242,22 +286,26 @@ func (o *ActionError) GetCode() (res ActionErrorGetCodeRetType) { // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) GetCodeOk() (ret ActionErrorGetCodeRetType, ok bool) { return getActionErrorGetCodeAttributeTypeOk(o.Code) } // HasCode returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) HasCode() bool { _, ok := o.GetCodeOk() return ok } // SetCode gets a reference to the given string and assigns it to the Code field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) SetCode(v ActionErrorGetCodeRetType) { setActionErrorGetCodeAttributeType(&o.Code, v) } // GetReason returns the Reason field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) GetReason() (res ActionErrorGetReasonRetType) { res, _ = o.GetReasonOk() return @@ -265,21 +313,25 @@ func (o *ActionError) GetReason() (res ActionErrorGetReasonRetType) { // GetReasonOk returns a tuple with the Reason field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) GetReasonOk() (ret ActionErrorGetReasonRetType, ok bool) { return getActionErrorGetReasonAttributeTypeOk(o.Reason) } // HasReason returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) HasReason() bool { _, ok := o.GetReasonOk() return ok } // SetReason gets a reference to the given string and assigns it to the Reason field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ActionError) SetReason(v ActionErrorGetReasonRetType) { setActionErrorGetReasonAttributeType(&o.Reason, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ActionError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getActionErrorGetActionAttributeTypeOk(o.Action); ok { @@ -294,37 +346,45 @@ func (o ActionError) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableActionError struct { value *ActionError isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableActionError) Get() *ActionError { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableActionError) Set(val *ActionError) { 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 NullableActionError) 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 *NullableActionError) 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 NewNullableActionError(val *ActionError) *NullableActionError { return &NullableActionError{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 NullableActionError) 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 *NullableActionError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serviceenablement/model_check_service.go b/services/serviceenablement/model_check_service.go index 8d09c4cc2..1687f0e52 100644 --- a/services/serviceenablement/model_check_service.go +++ b/services/serviceenablement/model_check_service.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &CheckService{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckServiceGetResourceAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCheckServiceGetResourceAttributeTypeOk(arg CheckServiceGetResourceAttributeType) (ret CheckServiceGetResourceRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getCheckServiceGetResourceAttributeTypeOk(arg CheckServiceGetResourceAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCheckServiceGetResourceAttributeType(arg *CheckServiceGetResourceAttributeType, val CheckServiceGetResourceRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckServiceGetResourceArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckServiceGetResourceRetType = string /* @@ -47,18 +54,22 @@ type CheckServiceGetResourceRetType = string // CheckServiceResourceType the model 'CheckService' // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckServiceResourceType string // List of ResourceType const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CHECKSERVICERESOURCE_TYPE_PROJECT CheckServiceResourceType = "project" ) // All allowed values of CheckService enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedCheckServiceResourceTypeEnumValues = []CheckServiceResourceType{ "project", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *CheckServiceResourceType) 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 @@ -86,6 +97,7 @@ func (v *CheckServiceResourceType) UnmarshalJSON(src []byte) error { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCheckServiceResourceTypeFromValue(v CheckServiceResourceType) (*CheckServiceResourceType, error) { ev := CheckServiceResourceType(v) if ev.IsValid() { @@ -96,6 +108,7 @@ func NewCheckServiceResourceTypeFromValue(v CheckServiceResourceType) (*CheckSer } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v CheckServiceResourceType) IsValid() bool { for _, existing := range AllowedCheckServiceResourceTypeEnumValues { if existing == v { @@ -106,50 +119,65 @@ func (v CheckServiceResourceType) IsValid() bool { } // Ptr returns reference to ResourceTypeResourceType value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v CheckServiceResourceType) Ptr() *CheckServiceResourceType { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCheckServiceResourceType struct { value *CheckServiceResourceType isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCheckServiceResourceType) Get() *CheckServiceResourceType { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCheckServiceResourceType) Set(val *CheckServiceResourceType) { 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 NullableCheckServiceResourceType) 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 *NullableCheckServiceResourceType) 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 NewNullableCheckServiceResourceType(val *CheckServiceResourceType) *NullableCheckServiceResourceType { return &NullableCheckServiceResourceType{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 NullableCheckServiceResourceType) 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 *NullableCheckServiceResourceType) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckServiceGetResourceTypeAttributeType = *CheckServiceResourceType + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckServiceGetResourceTypeArgType = CheckServiceResourceType + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckServiceGetResourceTypeRetType = CheckServiceResourceType +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCheckServiceGetResourceTypeAttributeTypeOk(arg CheckServiceGetResourceTypeAttributeType) (ret CheckServiceGetResourceTypeRetType, ok bool) { if arg == nil { return ret, false @@ -157,6 +185,7 @@ func getCheckServiceGetResourceTypeAttributeTypeOk(arg CheckServiceGetResourceTy return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCheckServiceGetResourceTypeAttributeType(arg *CheckServiceGetResourceTypeAttributeType, val CheckServiceGetResourceTypeRetType) { *arg = &val } @@ -166,8 +195,10 @@ func setCheckServiceGetResourceTypeAttributeType(arg *CheckServiceGetResourceTyp */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckServiceGetServiceIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCheckServiceGetServiceIdAttributeTypeOk(arg CheckServiceGetServiceIdAttributeType) (ret CheckServiceGetServiceIdRetType, ok bool) { if arg == nil { return ret, false @@ -175,14 +206,19 @@ func getCheckServiceGetServiceIdAttributeTypeOk(arg CheckServiceGetServiceIdAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCheckServiceGetServiceIdAttributeType(arg *CheckServiceGetServiceIdAttributeType, val CheckServiceGetServiceIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckServiceGetServiceIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckServiceGetServiceIdRetType = string // CheckService struct for CheckService +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CheckService struct { // the identifier of the resource e.g. projectID Resource CheckServiceGetResourceAttributeType `json:"resource,omitempty"` @@ -195,6 +231,7 @@ type CheckService struct { // 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 NewCheckService() *CheckService { this := CheckService{} return &this @@ -203,6 +240,7 @@ func NewCheckService() *CheckService { // NewCheckServiceWithDefaults instantiates a new CheckService 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 NewCheckServiceWithDefaults() *CheckService { this := CheckService{} var resourceType CheckServiceResourceType = "project" @@ -211,6 +249,7 @@ func NewCheckServiceWithDefaults() *CheckService { } // GetResource returns the Resource field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) GetResource() (res CheckServiceGetResourceRetType) { res, _ = o.GetResourceOk() return @@ -218,22 +257,26 @@ func (o *CheckService) GetResource() (res CheckServiceGetResourceRetType) { // GetResourceOk returns a tuple with the Resource field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) GetResourceOk() (ret CheckServiceGetResourceRetType, ok bool) { return getCheckServiceGetResourceAttributeTypeOk(o.Resource) } // HasResource returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) HasResource() bool { _, ok := o.GetResourceOk() return ok } // SetResource gets a reference to the given string and assigns it to the Resource field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) SetResource(v CheckServiceGetResourceRetType) { setCheckServiceGetResourceAttributeType(&o.Resource, v) } // GetResourceType returns the ResourceType field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) GetResourceType() (res CheckServiceGetResourceTypeRetType) { res, _ = o.GetResourceTypeOk() return @@ -241,22 +284,26 @@ func (o *CheckService) GetResourceType() (res CheckServiceGetResourceTypeRetType // GetResourceTypeOk returns a tuple with the ResourceType field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) GetResourceTypeOk() (ret CheckServiceGetResourceTypeRetType, ok bool) { return getCheckServiceGetResourceTypeAttributeTypeOk(o.ResourceType) } // HasResourceType returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) HasResourceType() bool { _, ok := o.GetResourceTypeOk() return ok } // SetResourceType gets a reference to the given string and assigns it to the ResourceType field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) SetResourceType(v CheckServiceGetResourceTypeRetType) { setCheckServiceGetResourceTypeAttributeType(&o.ResourceType, v) } // GetServiceId returns the ServiceId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) GetServiceId() (res CheckServiceGetServiceIdRetType) { res, _ = o.GetServiceIdOk() return @@ -264,21 +311,25 @@ func (o *CheckService) GetServiceId() (res CheckServiceGetServiceIdRetType) { // GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) GetServiceIdOk() (ret CheckServiceGetServiceIdRetType, ok bool) { return getCheckServiceGetServiceIdAttributeTypeOk(o.ServiceId) } // HasServiceId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) HasServiceId() bool { _, ok := o.GetServiceIdOk() return ok } // SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CheckService) SetServiceId(v CheckServiceGetServiceIdRetType) { setCheckServiceGetServiceIdAttributeType(&o.ServiceId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CheckService) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCheckServiceGetResourceAttributeTypeOk(o.Resource); ok { @@ -293,37 +344,45 @@ func (o CheckService) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCheckService struct { value *CheckService isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCheckService) Get() *CheckService { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCheckService) Set(val *CheckService) { 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 NullableCheckService) 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 *NullableCheckService) 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 NewNullableCheckService(val *CheckService) *NullableCheckService { return &NullableCheckService{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 NullableCheckService) 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 *NullableCheckService) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serviceenablement/model_cloud_service.go b/services/serviceenablement/model_cloud_service.go index 66e847101..f1a7e440a 100644 --- a/services/serviceenablement/model_cloud_service.go +++ b/services/serviceenablement/model_cloud_service.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &CloudService{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetDependenciesAttributeType = *Dependencies + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetDependenciesArgType = Dependencies + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetDependenciesRetType = Dependencies +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCloudServiceGetDependenciesAttributeTypeOk(arg CloudServiceGetDependenciesAttributeType) (ret CloudServiceGetDependenciesRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getCloudServiceGetDependenciesAttributeTypeOk(arg CloudServiceGetDependenci return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCloudServiceGetDependenciesAttributeType(arg *CloudServiceGetDependenciesAttributeType, val CloudServiceGetDependenciesRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setCloudServiceGetDependenciesAttributeType(arg *CloudServiceGetDependencie */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetLabelsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetLabelsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetLabelsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCloudServiceGetLabelsAttributeTypeOk(arg CloudServiceGetLabelsAttributeType) (ret CloudServiceGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +68,7 @@ func getCloudServiceGetLabelsAttributeTypeOk(arg CloudServiceGetLabelsAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCloudServiceGetLabelsAttributeType(arg *CloudServiceGetLabelsAttributeType, val CloudServiceGetLabelsRetType) { *arg = &val } @@ -66,20 +81,25 @@ func setCloudServiceGetLabelsAttributeType(arg *CloudServiceGetLabelsAttributeTy // CloudServiceScope the model 'CloudService' // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceScope string // List of Scope const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CLOUDSERVICESCOPE_PRIVATE CloudServiceScope = "PRIVATE" - CLOUDSERVICESCOPE_PUBLIC CloudServiceScope = "PUBLIC" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CLOUDSERVICESCOPE_PUBLIC CloudServiceScope = "PUBLIC" ) // All allowed values of CloudService enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedCloudServiceScopeEnumValues = []CloudServiceScope{ "PRIVATE", "PUBLIC", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *CloudServiceScope) 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 @@ -107,6 +127,7 @@ func (v *CloudServiceScope) UnmarshalJSON(src []byte) error { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCloudServiceScopeFromValue(v CloudServiceScope) (*CloudServiceScope, error) { ev := CloudServiceScope(v) if ev.IsValid() { @@ -117,6 +138,7 @@ func NewCloudServiceScopeFromValue(v CloudServiceScope) (*CloudServiceScope, err } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v CloudServiceScope) IsValid() bool { for _, existing := range AllowedCloudServiceScopeEnumValues { if existing == v { @@ -127,50 +149,65 @@ func (v CloudServiceScope) IsValid() bool { } // Ptr returns reference to ScopeScope value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v CloudServiceScope) Ptr() *CloudServiceScope { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCloudServiceScope struct { value *CloudServiceScope isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCloudServiceScope) Get() *CloudServiceScope { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCloudServiceScope) Set(val *CloudServiceScope) { 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 NullableCloudServiceScope) 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 *NullableCloudServiceScope) 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 NewNullableCloudServiceScope(val *CloudServiceScope) *NullableCloudServiceScope { return &NullableCloudServiceScope{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 NullableCloudServiceScope) 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 *NullableCloudServiceScope) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetScopeAttributeType = *CloudServiceScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetScopeArgType = CloudServiceScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetScopeRetType = CloudServiceScope +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCloudServiceGetScopeAttributeTypeOk(arg CloudServiceGetScopeAttributeType) (ret CloudServiceGetScopeRetType, ok bool) { if arg == nil { return ret, false @@ -178,6 +215,7 @@ func getCloudServiceGetScopeAttributeTypeOk(arg CloudServiceGetScopeAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCloudServiceGetScopeAttributeType(arg *CloudServiceGetScopeAttributeType, val CloudServiceGetScopeRetType) { *arg = &val } @@ -187,8 +225,10 @@ func setCloudServiceGetScopeAttributeType(arg *CloudServiceGetScopeAttributeType */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetServiceIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCloudServiceGetServiceIdAttributeTypeOk(arg CloudServiceGetServiceIdAttributeType) (ret CloudServiceGetServiceIdRetType, ok bool) { if arg == nil { return ret, false @@ -196,14 +236,19 @@ func getCloudServiceGetServiceIdAttributeTypeOk(arg CloudServiceGetServiceIdAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCloudServiceGetServiceIdAttributeType(arg *CloudServiceGetServiceIdAttributeType, val CloudServiceGetServiceIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetServiceIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudServiceGetServiceIdRetType = string // CloudService struct for CloudService +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloudService struct { Dependencies CloudServiceGetDependenciesAttributeType `json:"dependencies,omitempty"` Labels CloudServiceGetLabelsAttributeType `json:"labels,omitempty"` @@ -216,6 +261,7 @@ type CloudService struct { // 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 NewCloudService() *CloudService { this := CloudService{} return &this @@ -224,6 +270,7 @@ func NewCloudService() *CloudService { // NewCloudServiceWithDefaults instantiates a new CloudService 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 NewCloudServiceWithDefaults() *CloudService { this := CloudService{} var scope CloudServiceScope = "PUBLIC" @@ -232,6 +279,7 @@ func NewCloudServiceWithDefaults() *CloudService { } // GetDependencies returns the Dependencies field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) GetDependencies() (res CloudServiceGetDependenciesRetType) { res, _ = o.GetDependenciesOk() return @@ -239,22 +287,26 @@ func (o *CloudService) GetDependencies() (res CloudServiceGetDependenciesRetType // GetDependenciesOk returns a tuple with the Dependencies field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) GetDependenciesOk() (ret CloudServiceGetDependenciesRetType, ok bool) { return getCloudServiceGetDependenciesAttributeTypeOk(o.Dependencies) } // HasDependencies returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) HasDependencies() bool { _, ok := o.GetDependenciesOk() return ok } // SetDependencies gets a reference to the given Dependencies and assigns it to the Dependencies field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) SetDependencies(v CloudServiceGetDependenciesRetType) { setCloudServiceGetDependenciesAttributeType(&o.Dependencies, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) GetLabels() (res CloudServiceGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -262,22 +314,26 @@ func (o *CloudService) GetLabels() (res CloudServiceGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) GetLabelsOk() (ret CloudServiceGetLabelsRetType, ok bool) { return getCloudServiceGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) SetLabels(v CloudServiceGetLabelsRetType) { setCloudServiceGetLabelsAttributeType(&o.Labels, v) } // GetScope returns the Scope field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) GetScope() (res CloudServiceGetScopeRetType) { res, _ = o.GetScopeOk() return @@ -285,22 +341,26 @@ func (o *CloudService) GetScope() (res CloudServiceGetScopeRetType) { // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) GetScopeOk() (ret CloudServiceGetScopeRetType, ok bool) { return getCloudServiceGetScopeAttributeTypeOk(o.Scope) } // HasScope returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) HasScope() bool { _, ok := o.GetScopeOk() return ok } // SetScope gets a reference to the given string and assigns it to the Scope field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) SetScope(v CloudServiceGetScopeRetType) { setCloudServiceGetScopeAttributeType(&o.Scope, v) } // GetServiceId returns the ServiceId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) GetServiceId() (res CloudServiceGetServiceIdRetType) { res, _ = o.GetServiceIdOk() return @@ -308,21 +368,25 @@ func (o *CloudService) GetServiceId() (res CloudServiceGetServiceIdRetType) { // GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) GetServiceIdOk() (ret CloudServiceGetServiceIdRetType, ok bool) { return getCloudServiceGetServiceIdAttributeTypeOk(o.ServiceId) } // HasServiceId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) HasServiceId() bool { _, ok := o.GetServiceIdOk() return ok } // SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloudService) SetServiceId(v CloudServiceGetServiceIdRetType) { setCloudServiceGetServiceIdAttributeType(&o.ServiceId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CloudService) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCloudServiceGetDependenciesAttributeTypeOk(o.Dependencies); ok { @@ -340,37 +404,45 @@ func (o CloudService) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCloudService struct { value *CloudService isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCloudService) Get() *CloudService { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCloudService) Set(val *CloudService) { 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 NullableCloudService) 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 *NullableCloudService) 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 NewNullableCloudService(val *CloudService) *NullableCloudService { return &NullableCloudService{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 NullableCloudService) 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 *NullableCloudService) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serviceenablement/model_dependencies.go b/services/serviceenablement/model_dependencies.go index 113e2e52e..76cfa68f9 100644 --- a/services/serviceenablement/model_dependencies.go +++ b/services/serviceenablement/model_dependencies.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Dependencies{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DependenciesGetHardAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DependenciesGetHardArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DependenciesGetHardRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDependenciesGetHardAttributeTypeOk(arg DependenciesGetHardAttributeType) (ret DependenciesGetHardRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getDependenciesGetHardAttributeTypeOk(arg DependenciesGetHardAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDependenciesGetHardAttributeType(arg *DependenciesGetHardAttributeType, val DependenciesGetHardRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setDependenciesGetHardAttributeType(arg *DependenciesGetHardAttributeType, */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DependenciesGetSoftAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DependenciesGetSoftArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DependenciesGetSoftRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDependenciesGetSoftAttributeTypeOk(arg DependenciesGetSoftAttributeType) (ret DependenciesGetSoftRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getDependenciesGetSoftAttributeTypeOk(arg DependenciesGetSoftAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDependenciesGetSoftAttributeType(arg *DependenciesGetSoftAttributeType, val DependenciesGetSoftRetType) { *arg = &val } // Dependencies struct for Dependencies +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Dependencies struct { // a list of service IDs which this service depend on. If the service is enabled, those service are enabled as well automatically. Hard DependenciesGetHardAttributeType `json:"hard,omitempty"` @@ -69,6 +85,7 @@ type Dependencies struct { // 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 NewDependencies() *Dependencies { this := Dependencies{} return &this @@ -77,12 +94,14 @@ func NewDependencies() *Dependencies { // NewDependenciesWithDefaults instantiates a new Dependencies 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 NewDependenciesWithDefaults() *Dependencies { this := Dependencies{} return &this } // GetHard returns the Hard field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Dependencies) GetHard() (res DependenciesGetHardRetType) { res, _ = o.GetHardOk() return @@ -90,22 +109,26 @@ func (o *Dependencies) GetHard() (res DependenciesGetHardRetType) { // GetHardOk returns a tuple with the Hard field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Dependencies) GetHardOk() (ret DependenciesGetHardRetType, ok bool) { return getDependenciesGetHardAttributeTypeOk(o.Hard) } // HasHard returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Dependencies) HasHard() bool { _, ok := o.GetHardOk() return ok } // SetHard gets a reference to the given []string and assigns it to the Hard field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Dependencies) SetHard(v DependenciesGetHardRetType) { setDependenciesGetHardAttributeType(&o.Hard, v) } // GetSoft returns the Soft field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Dependencies) GetSoft() (res DependenciesGetSoftRetType) { res, _ = o.GetSoftOk() return @@ -113,21 +136,25 @@ func (o *Dependencies) GetSoft() (res DependenciesGetSoftRetType) { // GetSoftOk returns a tuple with the Soft field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Dependencies) GetSoftOk() (ret DependenciesGetSoftRetType, ok bool) { return getDependenciesGetSoftAttributeTypeOk(o.Soft) } // HasSoft returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Dependencies) HasSoft() bool { _, ok := o.GetSoftOk() return ok } // SetSoft gets a reference to the given []string and assigns it to the Soft field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Dependencies) SetSoft(v DependenciesGetSoftRetType) { setDependenciesGetSoftAttributeType(&o.Soft, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Dependencies) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDependenciesGetHardAttributeTypeOk(o.Hard); ok { @@ -139,37 +166,45 @@ func (o Dependencies) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDependencies struct { value *Dependencies isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDependencies) Get() *Dependencies { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDependencies) Set(val *Dependencies) { 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 NullableDependencies) 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 *NullableDependencies) 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 NewNullableDependencies(val *Dependencies) *NullableDependencies { return &NullableDependencies{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 NullableDependencies) 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 *NullableDependencies) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serviceenablement/model_error_response.go b/services/serviceenablement/model_error_response.go index 81ab6001a..aa24e090d 100644 --- a/services/serviceenablement/model_error_response.go +++ b/services/serviceenablement/model_error_response.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &ErrorResponse{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetErrorAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorResponseGetErrorAttributeTypeOk(arg ErrorResponseGetErrorAttributeType) (ret ErrorResponseGetErrorRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getErrorResponseGetErrorAttributeTypeOk(arg ErrorResponseGetErrorAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorResponseGetErrorAttributeType(arg *ErrorResponseGetErrorAttributeType, val ErrorResponseGetErrorRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetErrorArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetErrorRetType = string /* @@ -44,8 +51,10 @@ type ErrorResponseGetErrorRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetMessageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorResponseGetMessageAttributeTypeOk(arg ErrorResponseGetMessageAttributeType) (ret ErrorResponseGetMessageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +62,15 @@ func getErrorResponseGetMessageAttributeTypeOk(arg ErrorResponseGetMessageAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorResponseGetMessageAttributeType(arg *ErrorResponseGetMessageAttributeType, val ErrorResponseGetMessageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetMessageRetType = string /* @@ -65,8 +78,10 @@ type ErrorResponseGetMessageRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetPathAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorResponseGetPathAttributeTypeOk(arg ErrorResponseGetPathAttributeType) (ret ErrorResponseGetPathRetType, ok bool) { if arg == nil { return ret, false @@ -74,11 +89,15 @@ func getErrorResponseGetPathAttributeTypeOk(arg ErrorResponseGetPathAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorResponseGetPathAttributeType(arg *ErrorResponseGetPathAttributeType, val ErrorResponseGetPathRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetPathArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetPathRetType = string /* @@ -86,10 +105,16 @@ type ErrorResponseGetPathRetType = string */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetStatusAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetStatusArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetStatusRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorResponseGetStatusAttributeTypeOk(arg ErrorResponseGetStatusAttributeType) (ret ErrorResponseGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -97,6 +122,7 @@ func getErrorResponseGetStatusAttributeTypeOk(arg ErrorResponseGetStatusAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorResponseGetStatusAttributeType(arg *ErrorResponseGetStatusAttributeType, val ErrorResponseGetStatusRetType) { *arg = &val } @@ -106,10 +132,16 @@ func setErrorResponseGetStatusAttributeType(arg *ErrorResponseGetStatusAttribute */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetTimestampAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetTimestampArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetTimestampRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorResponseGetTimestampAttributeTypeOk(arg ErrorResponseGetTimestampAttributeType) (ret ErrorResponseGetTimestampRetType, ok bool) { if arg == nil { return ret, false @@ -117,11 +149,13 @@ func getErrorResponseGetTimestampAttributeTypeOk(arg ErrorResponseGetTimestampAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorResponseGetTimestampAttributeType(arg *ErrorResponseGetTimestampAttributeType, val ErrorResponseGetTimestampRetType) { *arg = &val } // ErrorResponse struct for ErrorResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponse struct { Error ErrorResponseGetErrorAttributeType `json:"error,omitempty"` Message ErrorResponseGetMessageAttributeType `json:"message,omitempty"` @@ -135,6 +169,7 @@ type ErrorResponse struct { // 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 NewErrorResponse() *ErrorResponse { this := ErrorResponse{} return &this @@ -143,12 +178,14 @@ func NewErrorResponse() *ErrorResponse { // NewErrorResponseWithDefaults instantiates a new ErrorResponse 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 NewErrorResponseWithDefaults() *ErrorResponse { this := ErrorResponse{} return &this } // GetError returns the Error field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetError() (res ErrorResponseGetErrorRetType) { res, _ = o.GetErrorOk() return @@ -156,22 +193,26 @@ func (o *ErrorResponse) GetError() (res ErrorResponseGetErrorRetType) { // GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetErrorOk() (ret ErrorResponseGetErrorRetType, ok bool) { return getErrorResponseGetErrorAttributeTypeOk(o.Error) } // HasError returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) HasError() bool { _, ok := o.GetErrorOk() return ok } // SetError gets a reference to the given string and assigns it to the Error field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) SetError(v ErrorResponseGetErrorRetType) { setErrorResponseGetErrorAttributeType(&o.Error, v) } // GetMessage returns the Message field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetMessage() (res ErrorResponseGetMessageRetType) { res, _ = o.GetMessageOk() return @@ -179,22 +220,26 @@ func (o *ErrorResponse) GetMessage() (res ErrorResponseGetMessageRetType) { // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetMessageOk() (ret ErrorResponseGetMessageRetType, ok bool) { return getErrorResponseGetMessageAttributeTypeOk(o.Message) } // HasMessage returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) HasMessage() bool { _, ok := o.GetMessageOk() return ok } // SetMessage gets a reference to the given string and assigns it to the Message field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) SetMessage(v ErrorResponseGetMessageRetType) { setErrorResponseGetMessageAttributeType(&o.Message, v) } // GetPath returns the Path field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetPath() (res ErrorResponseGetPathRetType) { res, _ = o.GetPathOk() return @@ -202,22 +247,26 @@ func (o *ErrorResponse) GetPath() (res ErrorResponseGetPathRetType) { // GetPathOk returns a tuple with the Path field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetPathOk() (ret ErrorResponseGetPathRetType, ok bool) { return getErrorResponseGetPathAttributeTypeOk(o.Path) } // HasPath returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) HasPath() bool { _, ok := o.GetPathOk() return ok } // SetPath gets a reference to the given string and assigns it to the Path field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) SetPath(v ErrorResponseGetPathRetType) { setErrorResponseGetPathAttributeType(&o.Path, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetStatus() (res ErrorResponseGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -225,22 +274,26 @@ func (o *ErrorResponse) GetStatus() (res ErrorResponseGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetStatusOk() (ret ErrorResponseGetStatusRetType, ok bool) { return getErrorResponseGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given int64 and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) SetStatus(v ErrorResponseGetStatusRetType) { setErrorResponseGetStatusAttributeType(&o.Status, v) } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetTimestamp() (res ErrorResponseGetTimestampRetType) { res, _ = o.GetTimestampOk() return @@ -248,21 +301,25 @@ func (o *ErrorResponse) GetTimestamp() (res ErrorResponseGetTimestampRetType) { // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetTimestampOk() (ret ErrorResponseGetTimestampRetType, ok bool) { return getErrorResponseGetTimestampAttributeTypeOk(o.Timestamp) } // HasTimestamp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) HasTimestamp() bool { _, ok := o.GetTimestampOk() return ok } // SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) SetTimestamp(v ErrorResponseGetTimestampRetType) { setErrorResponseGetTimestampAttributeType(&o.Timestamp, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ErrorResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getErrorResponseGetErrorAttributeTypeOk(o.Error); ok { @@ -283,37 +340,45 @@ func (o ErrorResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableErrorResponse struct { value *ErrorResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableErrorResponse) Get() *ErrorResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableErrorResponse) Set(val *ErrorResponse) { 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 NullableErrorResponse) 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 *NullableErrorResponse) 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 NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { return &NullableErrorResponse{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 NullableErrorResponse) 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 *NullableErrorResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serviceenablement/model_list_service_status_regional_200_response.go b/services/serviceenablement/model_list_service_status_regional_200_response.go index 7c33fc18d..65ff27048 100644 --- a/services/serviceenablement/model_list_service_status_regional_200_response.go +++ b/services/serviceenablement/model_list_service_status_regional_200_response.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListServiceStatusRegional200Response{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServiceStatusRegional200ResponseGetItemsAttributeType = *[]ServiceStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServiceStatusRegional200ResponseGetItemsArgType = []ServiceStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServiceStatusRegional200ResponseGetItemsRetType = []ServiceStatus +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListServiceStatusRegional200ResponseGetItemsAttributeTypeOk(arg ListServiceStatusRegional200ResponseGetItemsAttributeType) (ret ListServiceStatusRegional200ResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getListServiceStatusRegional200ResponseGetItemsAttributeTypeOk(arg ListServ return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListServiceStatusRegional200ResponseGetItemsAttributeType(arg *ListServiceStatusRegional200ResponseGetItemsAttributeType, val ListServiceStatusRegional200ResponseGetItemsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setListServiceStatusRegional200ResponseGetItemsAttributeType(arg *ListServi */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServiceStatusRegional200ResponseGetNextCursorAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListServiceStatusRegional200ResponseGetNextCursorAttributeTypeOk(arg ListServiceStatusRegional200ResponseGetNextCursorAttributeType) (ret ListServiceStatusRegional200ResponseGetNextCursorRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getListServiceStatusRegional200ResponseGetNextCursorAttributeTypeOk(arg Lis return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListServiceStatusRegional200ResponseGetNextCursorAttributeType(arg *ListServiceStatusRegional200ResponseGetNextCursorAttributeType, val ListServiceStatusRegional200ResponseGetNextCursorRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServiceStatusRegional200ResponseGetNextCursorArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServiceStatusRegional200ResponseGetNextCursorRetType = string // ListServiceStatusRegional200Response struct for ListServiceStatusRegional200Response +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServiceStatusRegional200Response struct { Items ListServiceStatusRegional200ResponseGetItemsAttributeType `json:"items,omitempty"` NextCursor ListServiceStatusRegional200ResponseGetNextCursorAttributeType `json:"nextCursor,omitempty"` @@ -68,6 +83,7 @@ type ListServiceStatusRegional200Response struct { // 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 NewListServiceStatusRegional200Response() *ListServiceStatusRegional200Response { this := ListServiceStatusRegional200Response{} return &this @@ -76,12 +92,14 @@ func NewListServiceStatusRegional200Response() *ListServiceStatusRegional200Resp // NewListServiceStatusRegional200ResponseWithDefaults instantiates a new ListServiceStatusRegional200Response 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 NewListServiceStatusRegional200ResponseWithDefaults() *ListServiceStatusRegional200Response { this := ListServiceStatusRegional200Response{} return &this } // GetItems returns the Items field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListServiceStatusRegional200Response) GetItems() (res ListServiceStatusRegional200ResponseGetItemsRetType) { res, _ = o.GetItemsOk() return @@ -89,22 +107,26 @@ func (o *ListServiceStatusRegional200Response) GetItems() (res ListServiceStatus // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListServiceStatusRegional200Response) GetItemsOk() (ret ListServiceStatusRegional200ResponseGetItemsRetType, ok bool) { return getListServiceStatusRegional200ResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListServiceStatusRegional200Response) HasItems() bool { _, ok := o.GetItemsOk() return ok } // SetItems gets a reference to the given []ServiceStatus and assigns it to the Items field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListServiceStatusRegional200Response) SetItems(v ListServiceStatusRegional200ResponseGetItemsRetType) { setListServiceStatusRegional200ResponseGetItemsAttributeType(&o.Items, v) } // GetNextCursor returns the NextCursor field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListServiceStatusRegional200Response) GetNextCursor() (res ListServiceStatusRegional200ResponseGetNextCursorRetType) { res, _ = o.GetNextCursorOk() return @@ -112,21 +134,25 @@ func (o *ListServiceStatusRegional200Response) GetNextCursor() (res ListServiceS // GetNextCursorOk returns a tuple with the NextCursor field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListServiceStatusRegional200Response) GetNextCursorOk() (ret ListServiceStatusRegional200ResponseGetNextCursorRetType, ok bool) { return getListServiceStatusRegional200ResponseGetNextCursorAttributeTypeOk(o.NextCursor) } // HasNextCursor returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListServiceStatusRegional200Response) HasNextCursor() bool { _, ok := o.GetNextCursorOk() return ok } // SetNextCursor gets a reference to the given string and assigns it to the NextCursor field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListServiceStatusRegional200Response) SetNextCursor(v ListServiceStatusRegional200ResponseGetNextCursorRetType) { setListServiceStatusRegional200ResponseGetNextCursorAttributeType(&o.NextCursor, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListServiceStatusRegional200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListServiceStatusRegional200ResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -138,37 +164,45 @@ func (o ListServiceStatusRegional200Response) ToMap() (map[string]interface{}, e return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableListServiceStatusRegional200Response struct { value *ListServiceStatusRegional200Response isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListServiceStatusRegional200Response) Get() *ListServiceStatusRegional200Response { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListServiceStatusRegional200Response) Set(val *ListServiceStatusRegional200Response) { 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 NullableListServiceStatusRegional200Response) 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 *NullableListServiceStatusRegional200Response) 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 NewNullableListServiceStatusRegional200Response(val *ListServiceStatusRegional200Response) *NullableListServiceStatusRegional200Response { return &NullableListServiceStatusRegional200Response{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 NullableListServiceStatusRegional200Response) 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 *NullableListServiceStatusRegional200Response) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serviceenablement/model_parameters.go b/services/serviceenablement/model_parameters.go index dd380ab2e..575ad4be8 100644 --- a/services/serviceenablement/model_parameters.go +++ b/services/serviceenablement/model_parameters.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Parameters{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGetGeneralAttributeType = *ParametersGeneral + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGetGeneralArgType = ParametersGeneral + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGetGeneralRetType = ParametersGeneral +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getParametersGetGeneralAttributeTypeOk(arg ParametersGetGeneralAttributeType) (ret ParametersGetGeneralRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getParametersGetGeneralAttributeTypeOk(arg ParametersGetGeneralAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setParametersGetGeneralAttributeType(arg *ParametersGetGeneralAttributeType, val ParametersGetGeneralRetType) { *arg = &val } // Parameters service parameters +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Parameters struct { General ParametersGetGeneralAttributeType `json:"general,omitempty"` } @@ -46,6 +55,7 @@ type Parameters struct { // 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 NewParameters() *Parameters { this := Parameters{} return &this @@ -54,12 +64,14 @@ func NewParameters() *Parameters { // NewParametersWithDefaults instantiates a new Parameters 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 NewParametersWithDefaults() *Parameters { this := Parameters{} return &this } // GetGeneral returns the General field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Parameters) GetGeneral() (res ParametersGetGeneralRetType) { res, _ = o.GetGeneralOk() return @@ -67,21 +79,25 @@ func (o *Parameters) GetGeneral() (res ParametersGetGeneralRetType) { // GetGeneralOk returns a tuple with the General field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Parameters) GetGeneralOk() (ret ParametersGetGeneralRetType, ok bool) { return getParametersGetGeneralAttributeTypeOk(o.General) } // HasGeneral returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Parameters) HasGeneral() bool { _, ok := o.GetGeneralOk() return ok } // SetGeneral gets a reference to the given ParametersGeneral and assigns it to the General field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Parameters) SetGeneral(v ParametersGetGeneralRetType) { setParametersGetGeneralAttributeType(&o.General, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Parameters) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getParametersGetGeneralAttributeTypeOk(o.General); ok { @@ -90,37 +106,45 @@ func (o Parameters) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableParameters struct { value *Parameters isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableParameters) Get() *Parameters { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableParameters) Set(val *Parameters) { 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 NullableParameters) 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 *NullableParameters) 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 NewNullableParameters(val *Parameters) *NullableParameters { return &NullableParameters{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 NullableParameters) 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 *NullableParameters) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serviceenablement/model_parameters_general.go b/services/serviceenablement/model_parameters_general.go index a55befc2e..a93b44b23 100644 --- a/services/serviceenablement/model_parameters_general.go +++ b/services/serviceenablement/model_parameters_general.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &ParametersGeneral{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneralGetOrganizationIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getParametersGeneralGetOrganizationIdAttributeTypeOk(arg ParametersGeneralGetOrganizationIdAttributeType) (ret ParametersGeneralGetOrganizationIdRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getParametersGeneralGetOrganizationIdAttributeTypeOk(arg ParametersGeneralG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setParametersGeneralGetOrganizationIdAttributeType(arg *ParametersGeneralGetOrganizationIdAttributeType, val ParametersGeneralGetOrganizationIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneralGetOrganizationIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneralGetOrganizationIdRetType = string /* @@ -44,8 +51,10 @@ type ParametersGeneralGetOrganizationIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneralGetProjectNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getParametersGeneralGetProjectNameAttributeTypeOk(arg ParametersGeneralGetProjectNameAttributeType) (ret ParametersGeneralGetProjectNameRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +62,15 @@ func getParametersGeneralGetProjectNameAttributeTypeOk(arg ParametersGeneralGetP return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setParametersGeneralGetProjectNameAttributeType(arg *ParametersGeneralGetProjectNameAttributeType, val ParametersGeneralGetProjectNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneralGetProjectNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneralGetProjectNameRetType = string /* @@ -68,20 +81,25 @@ type ParametersGeneralGetProjectNameRetType = string // ParametersGeneralProjectScope the model 'ParametersGeneral' // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneralProjectScope string // List of ProjectScope const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PARAMETERSGENERALPROJECT_SCOPE_SCHWARZ ParametersGeneralProjectScope = "SCHWARZ" - PARAMETERSGENERALPROJECT_SCOPE_PUBLIC ParametersGeneralProjectScope = "PUBLIC" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + PARAMETERSGENERALPROJECT_SCOPE_PUBLIC ParametersGeneralProjectScope = "PUBLIC" ) // All allowed values of ParametersGeneral enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedParametersGeneralProjectScopeEnumValues = []ParametersGeneralProjectScope{ "SCHWARZ", "PUBLIC", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *ParametersGeneralProjectScope) 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 @@ -109,6 +127,7 @@ func (v *ParametersGeneralProjectScope) UnmarshalJSON(src []byte) error { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewParametersGeneralProjectScopeFromValue(v ParametersGeneralProjectScope) (*ParametersGeneralProjectScope, error) { ev := ParametersGeneralProjectScope(v) if ev.IsValid() { @@ -119,6 +138,7 @@ func NewParametersGeneralProjectScopeFromValue(v ParametersGeneralProjectScope) } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ParametersGeneralProjectScope) IsValid() bool { for _, existing := range AllowedParametersGeneralProjectScopeEnumValues { if existing == v { @@ -129,50 +149,65 @@ func (v ParametersGeneralProjectScope) IsValid() bool { } // Ptr returns reference to ProjectScopeProjectScope value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ParametersGeneralProjectScope) Ptr() *ParametersGeneralProjectScope { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableParametersGeneralProjectScope struct { value *ParametersGeneralProjectScope isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableParametersGeneralProjectScope) Get() *ParametersGeneralProjectScope { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableParametersGeneralProjectScope) Set(val *ParametersGeneralProjectScope) { 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 NullableParametersGeneralProjectScope) 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 *NullableParametersGeneralProjectScope) 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 NewNullableParametersGeneralProjectScope(val *ParametersGeneralProjectScope) *NullableParametersGeneralProjectScope { return &NullableParametersGeneralProjectScope{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 NullableParametersGeneralProjectScope) 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 *NullableParametersGeneralProjectScope) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneralGetProjectScopeAttributeType = *ParametersGeneralProjectScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneralGetProjectScopeArgType = ParametersGeneralProjectScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneralGetProjectScopeRetType = ParametersGeneralProjectScope +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getParametersGeneralGetProjectScopeAttributeTypeOk(arg ParametersGeneralGetProjectScopeAttributeType) (ret ParametersGeneralGetProjectScopeRetType, ok bool) { if arg == nil { return ret, false @@ -180,11 +215,13 @@ func getParametersGeneralGetProjectScopeAttributeTypeOk(arg ParametersGeneralGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setParametersGeneralGetProjectScopeAttributeType(arg *ParametersGeneralGetProjectScopeAttributeType, val ParametersGeneralGetProjectScopeRetType) { *arg = &val } // ParametersGeneral struct for ParametersGeneral +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ParametersGeneral struct { OrganizationId ParametersGeneralGetOrganizationIdAttributeType `json:"organizationId,omitempty"` ProjectName ParametersGeneralGetProjectNameAttributeType `json:"projectName,omitempty"` @@ -195,6 +232,7 @@ type ParametersGeneral struct { // 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 NewParametersGeneral() *ParametersGeneral { this := ParametersGeneral{} return &this @@ -203,6 +241,7 @@ func NewParametersGeneral() *ParametersGeneral { // NewParametersGeneralWithDefaults instantiates a new ParametersGeneral 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 NewParametersGeneralWithDefaults() *ParametersGeneral { this := ParametersGeneral{} var projectScope ParametersGeneralProjectScope = "PUBLIC" @@ -211,6 +250,7 @@ func NewParametersGeneralWithDefaults() *ParametersGeneral { } // GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) GetOrganizationId() (res ParametersGeneralGetOrganizationIdRetType) { res, _ = o.GetOrganizationIdOk() return @@ -218,22 +258,26 @@ func (o *ParametersGeneral) GetOrganizationId() (res ParametersGeneralGetOrganiz // GetOrganizationIdOk returns a tuple with the OrganizationId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) GetOrganizationIdOk() (ret ParametersGeneralGetOrganizationIdRetType, ok bool) { return getParametersGeneralGetOrganizationIdAttributeTypeOk(o.OrganizationId) } // HasOrganizationId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) HasOrganizationId() bool { _, ok := o.GetOrganizationIdOk() return ok } // SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) SetOrganizationId(v ParametersGeneralGetOrganizationIdRetType) { setParametersGeneralGetOrganizationIdAttributeType(&o.OrganizationId, v) } // GetProjectName returns the ProjectName field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) GetProjectName() (res ParametersGeneralGetProjectNameRetType) { res, _ = o.GetProjectNameOk() return @@ -241,22 +285,26 @@ func (o *ParametersGeneral) GetProjectName() (res ParametersGeneralGetProjectNam // GetProjectNameOk returns a tuple with the ProjectName field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) GetProjectNameOk() (ret ParametersGeneralGetProjectNameRetType, ok bool) { return getParametersGeneralGetProjectNameAttributeTypeOk(o.ProjectName) } // HasProjectName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) HasProjectName() bool { _, ok := o.GetProjectNameOk() return ok } // SetProjectName gets a reference to the given string and assigns it to the ProjectName field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) SetProjectName(v ParametersGeneralGetProjectNameRetType) { setParametersGeneralGetProjectNameAttributeType(&o.ProjectName, v) } // GetProjectScope returns the ProjectScope field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) GetProjectScope() (res ParametersGeneralGetProjectScopeRetType) { res, _ = o.GetProjectScopeOk() return @@ -264,21 +312,25 @@ func (o *ParametersGeneral) GetProjectScope() (res ParametersGeneralGetProjectSc // GetProjectScopeOk returns a tuple with the ProjectScope field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) GetProjectScopeOk() (ret ParametersGeneralGetProjectScopeRetType, ok bool) { return getParametersGeneralGetProjectScopeAttributeTypeOk(o.ProjectScope) } // HasProjectScope returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) HasProjectScope() bool { _, ok := o.GetProjectScopeOk() return ok } // SetProjectScope gets a reference to the given string and assigns it to the ProjectScope field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ParametersGeneral) SetProjectScope(v ParametersGeneralGetProjectScopeRetType) { setParametersGeneralGetProjectScopeAttributeType(&o.ProjectScope, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ParametersGeneral) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getParametersGeneralGetOrganizationIdAttributeTypeOk(o.OrganizationId); ok { @@ -293,37 +345,45 @@ func (o ParametersGeneral) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableParametersGeneral struct { value *ParametersGeneral isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableParametersGeneral) Get() *ParametersGeneral { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableParametersGeneral) Set(val *ParametersGeneral) { 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 NullableParametersGeneral) 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 *NullableParametersGeneral) 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 NewNullableParametersGeneral(val *ParametersGeneral) *NullableParametersGeneral { return &NullableParametersGeneral{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 NullableParametersGeneral) 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 *NullableParametersGeneral) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serviceenablement/model_service_status.go b/services/serviceenablement/model_service_status.go index 845940981..c4fc0e018 100644 --- a/services/serviceenablement/model_service_status.go +++ b/services/serviceenablement/model_service_status.go @@ -8,6 +8,7 @@ API version: 2.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 serviceenablement import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &ServiceStatus{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetDependenciesAttributeType = *Dependencies + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetDependenciesArgType = Dependencies + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetDependenciesRetType = Dependencies +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServiceStatusGetDependenciesAttributeTypeOk(arg ServiceStatusGetDependenciesAttributeType) (ret ServiceStatusGetDependenciesRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getServiceStatusGetDependenciesAttributeTypeOk(arg ServiceStatusGetDependen return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServiceStatusGetDependenciesAttributeType(arg *ServiceStatusGetDependenciesAttributeType, val ServiceStatusGetDependenciesRetType) { *arg = &val } @@ -46,20 +54,25 @@ func setServiceStatusGetDependenciesAttributeType(arg *ServiceStatusGetDependenc // ServiceStatusEnablement the model 'ServiceStatus' // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusEnablement string // List of Enablement const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead SERVICESTATUSENABLEMENT_REQUEST ServiceStatusEnablement = "REQUEST" - SERVICESTATUSENABLEMENT_AUTO ServiceStatusEnablement = "AUTO" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + SERVICESTATUSENABLEMENT_AUTO ServiceStatusEnablement = "AUTO" ) // All allowed values of ServiceStatus enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedServiceStatusEnablementEnumValues = []ServiceStatusEnablement{ "REQUEST", "AUTO", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *ServiceStatusEnablement) 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 @@ -87,6 +100,7 @@ func (v *ServiceStatusEnablement) UnmarshalJSON(src []byte) error { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServiceStatusEnablementFromValue(v ServiceStatusEnablement) (*ServiceStatusEnablement, error) { ev := ServiceStatusEnablement(v) if ev.IsValid() { @@ -97,6 +111,7 @@ func NewServiceStatusEnablementFromValue(v ServiceStatusEnablement) (*ServiceSta } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ServiceStatusEnablement) IsValid() bool { for _, existing := range AllowedServiceStatusEnablementEnumValues { if existing == v { @@ -107,50 +122,65 @@ func (v ServiceStatusEnablement) IsValid() bool { } // Ptr returns reference to EnablementEnablement value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ServiceStatusEnablement) Ptr() *ServiceStatusEnablement { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServiceStatusEnablement struct { value *ServiceStatusEnablement isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServiceStatusEnablement) Get() *ServiceStatusEnablement { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServiceStatusEnablement) Set(val *ServiceStatusEnablement) { 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 NullableServiceStatusEnablement) 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 *NullableServiceStatusEnablement) 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 NewNullableServiceStatusEnablement(val *ServiceStatusEnablement) *NullableServiceStatusEnablement { return &NullableServiceStatusEnablement{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 NullableServiceStatusEnablement) 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 *NullableServiceStatusEnablement) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetEnablementAttributeType = *ServiceStatusEnablement + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetEnablementArgType = ServiceStatusEnablement + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetEnablementRetType = ServiceStatusEnablement +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServiceStatusGetEnablementAttributeTypeOk(arg ServiceStatusGetEnablementAttributeType) (ret ServiceStatusGetEnablementRetType, ok bool) { if arg == nil { return ret, false @@ -158,6 +188,7 @@ func getServiceStatusGetEnablementAttributeTypeOk(arg ServiceStatusGetEnablement return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServiceStatusGetEnablementAttributeType(arg *ServiceStatusGetEnablementAttributeType, val ServiceStatusGetEnablementRetType) { *arg = &val } @@ -167,10 +198,16 @@ func setServiceStatusGetEnablementAttributeType(arg *ServiceStatusGetEnablementA */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetErrorAttributeType = *ActionError + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetErrorArgType = ActionError + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetErrorRetType = ActionError +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServiceStatusGetErrorAttributeTypeOk(arg ServiceStatusGetErrorAttributeType) (ret ServiceStatusGetErrorRetType, ok bool) { if arg == nil { return ret, false @@ -178,6 +215,7 @@ func getServiceStatusGetErrorAttributeTypeOk(arg ServiceStatusGetErrorAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServiceStatusGetErrorAttributeType(arg *ServiceStatusGetErrorAttributeType, val ServiceStatusGetErrorRetType) { *arg = &val } @@ -187,10 +225,16 @@ func setServiceStatusGetErrorAttributeType(arg *ServiceStatusGetErrorAttributeTy */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetLabelsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetLabelsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetLabelsRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServiceStatusGetLabelsAttributeTypeOk(arg ServiceStatusGetLabelsAttributeType) (ret ServiceStatusGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -198,6 +242,7 @@ func getServiceStatusGetLabelsAttributeTypeOk(arg ServiceStatusGetLabelsAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServiceStatusGetLabelsAttributeType(arg *ServiceStatusGetLabelsAttributeType, val ServiceStatusGetLabelsRetType) { *arg = &val } @@ -210,20 +255,25 @@ func setServiceStatusGetLabelsAttributeType(arg *ServiceStatusGetLabelsAttribute // ServiceStatusLifecycle the model 'ServiceStatus' // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusLifecycle string // List of Lifecycle const ( - SERVICESTATUSLIFECYCLE_FLEX ServiceStatusLifecycle = "FLEX" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + SERVICESTATUSLIFECYCLE_FLEX ServiceStatusLifecycle = "FLEX" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead SERVICESTATUSLIFECYCLE_PROJECT ServiceStatusLifecycle = "PROJECT" ) // All allowed values of ServiceStatus enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedServiceStatusLifecycleEnumValues = []ServiceStatusLifecycle{ "FLEX", "PROJECT", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *ServiceStatusLifecycle) 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 @@ -251,6 +301,7 @@ func (v *ServiceStatusLifecycle) UnmarshalJSON(src []byte) error { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServiceStatusLifecycleFromValue(v ServiceStatusLifecycle) (*ServiceStatusLifecycle, error) { ev := ServiceStatusLifecycle(v) if ev.IsValid() { @@ -261,6 +312,7 @@ func NewServiceStatusLifecycleFromValue(v ServiceStatusLifecycle) (*ServiceStatu } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ServiceStatusLifecycle) IsValid() bool { for _, existing := range AllowedServiceStatusLifecycleEnumValues { if existing == v { @@ -271,50 +323,65 @@ func (v ServiceStatusLifecycle) IsValid() bool { } // Ptr returns reference to LifecycleLifecycle value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ServiceStatusLifecycle) Ptr() *ServiceStatusLifecycle { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServiceStatusLifecycle struct { value *ServiceStatusLifecycle isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServiceStatusLifecycle) Get() *ServiceStatusLifecycle { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServiceStatusLifecycle) Set(val *ServiceStatusLifecycle) { 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 NullableServiceStatusLifecycle) 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 *NullableServiceStatusLifecycle) 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 NewNullableServiceStatusLifecycle(val *ServiceStatusLifecycle) *NullableServiceStatusLifecycle { return &NullableServiceStatusLifecycle{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 NullableServiceStatusLifecycle) 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 *NullableServiceStatusLifecycle) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetLifecycleAttributeType = *ServiceStatusLifecycle + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetLifecycleArgType = ServiceStatusLifecycle + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetLifecycleRetType = ServiceStatusLifecycle +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServiceStatusGetLifecycleAttributeTypeOk(arg ServiceStatusGetLifecycleAttributeType) (ret ServiceStatusGetLifecycleRetType, ok bool) { if arg == nil { return ret, false @@ -322,6 +389,7 @@ func getServiceStatusGetLifecycleAttributeTypeOk(arg ServiceStatusGetLifecycleAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServiceStatusGetLifecycleAttributeType(arg *ServiceStatusGetLifecycleAttributeType, val ServiceStatusGetLifecycleRetType) { *arg = &val } @@ -331,10 +399,16 @@ func setServiceStatusGetLifecycleAttributeType(arg *ServiceStatusGetLifecycleAtt */ // fallback +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetParametersAttributeType = *Parameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetParametersArgType = Parameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetParametersRetType = Parameters +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServiceStatusGetParametersAttributeTypeOk(arg ServiceStatusGetParametersAttributeType) (ret ServiceStatusGetParametersRetType, ok bool) { if arg == nil { return ret, false @@ -342,6 +416,7 @@ func getServiceStatusGetParametersAttributeTypeOk(arg ServiceStatusGetParameters return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServiceStatusGetParametersAttributeType(arg *ServiceStatusGetParametersAttributeType, val ServiceStatusGetParametersRetType) { *arg = &val } @@ -354,20 +429,25 @@ func setServiceStatusGetParametersAttributeType(arg *ServiceStatusGetParametersA // ServiceStatusScope the model 'ServiceStatus' // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusScope string // List of Scope const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead SERVICESTATUSSCOPE_PRIVATE ServiceStatusScope = "PRIVATE" - SERVICESTATUSSCOPE_PUBLIC ServiceStatusScope = "PUBLIC" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + SERVICESTATUSSCOPE_PUBLIC ServiceStatusScope = "PUBLIC" ) // All allowed values of ServiceStatus enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedServiceStatusScopeEnumValues = []ServiceStatusScope{ "PRIVATE", "PUBLIC", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *ServiceStatusScope) 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 @@ -395,6 +475,7 @@ func (v *ServiceStatusScope) UnmarshalJSON(src []byte) error { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServiceStatusScopeFromValue(v ServiceStatusScope) (*ServiceStatusScope, error) { ev := ServiceStatusScope(v) if ev.IsValid() { @@ -405,6 +486,7 @@ func NewServiceStatusScopeFromValue(v ServiceStatusScope) (*ServiceStatusScope, } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ServiceStatusScope) IsValid() bool { for _, existing := range AllowedServiceStatusScopeEnumValues { if existing == v { @@ -415,50 +497,65 @@ func (v ServiceStatusScope) IsValid() bool { } // Ptr returns reference to ScopeScope value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ServiceStatusScope) Ptr() *ServiceStatusScope { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServiceStatusScope struct { value *ServiceStatusScope isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServiceStatusScope) Get() *ServiceStatusScope { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServiceStatusScope) Set(val *ServiceStatusScope) { 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 NullableServiceStatusScope) 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 *NullableServiceStatusScope) 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 NewNullableServiceStatusScope(val *ServiceStatusScope) *NullableServiceStatusScope { return &NullableServiceStatusScope{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 NullableServiceStatusScope) 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 *NullableServiceStatusScope) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetScopeAttributeType = *ServiceStatusScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetScopeArgType = ServiceStatusScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetScopeRetType = ServiceStatusScope +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServiceStatusGetScopeAttributeTypeOk(arg ServiceStatusGetScopeAttributeType) (ret ServiceStatusGetScopeRetType, ok bool) { if arg == nil { return ret, false @@ -466,6 +563,7 @@ func getServiceStatusGetScopeAttributeTypeOk(arg ServiceStatusGetScopeAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServiceStatusGetScopeAttributeType(arg *ServiceStatusGetScopeAttributeType, val ServiceStatusGetScopeRetType) { *arg = &val } @@ -475,8 +573,10 @@ func setServiceStatusGetScopeAttributeType(arg *ServiceStatusGetScopeAttributeTy */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetServiceIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServiceStatusGetServiceIdAttributeTypeOk(arg ServiceStatusGetServiceIdAttributeType) (ret ServiceStatusGetServiceIdRetType, ok bool) { if arg == nil { return ret, false @@ -484,11 +584,15 @@ func getServiceStatusGetServiceIdAttributeTypeOk(arg ServiceStatusGetServiceIdAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServiceStatusGetServiceIdAttributeType(arg *ServiceStatusGetServiceIdAttributeType, val ServiceStatusGetServiceIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetServiceIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetServiceIdRetType = string /* @@ -499,17 +603,23 @@ type ServiceStatusGetServiceIdRetType = string // ServiceStatusState the state of a service within a project // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusState string // List of State const ( - SERVICESTATUSSTATE_ENABLED ServiceStatusState = "ENABLED" - SERVICESTATUSSTATE_ENABLING ServiceStatusState = "ENABLING" - SERVICESTATUSSTATE_DISABLED ServiceStatusState = "DISABLED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + SERVICESTATUSSTATE_ENABLED ServiceStatusState = "ENABLED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + SERVICESTATUSSTATE_ENABLING ServiceStatusState = "ENABLING" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + SERVICESTATUSSTATE_DISABLED ServiceStatusState = "DISABLED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead SERVICESTATUSSTATE_DISABLING ServiceStatusState = "DISABLING" ) // All allowed values of ServiceStatus enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedServiceStatusStateEnumValues = []ServiceStatusState{ "ENABLED", "ENABLING", @@ -517,6 +627,7 @@ var AllowedServiceStatusStateEnumValues = []ServiceStatusState{ "DISABLING", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *ServiceStatusState) 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 @@ -544,6 +655,7 @@ func (v *ServiceStatusState) UnmarshalJSON(src []byte) error { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServiceStatusStateFromValue(v ServiceStatusState) (*ServiceStatusState, error) { ev := ServiceStatusState(v) if ev.IsValid() { @@ -554,6 +666,7 @@ func NewServiceStatusStateFromValue(v ServiceStatusState) (*ServiceStatusState, } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ServiceStatusState) IsValid() bool { for _, existing := range AllowedServiceStatusStateEnumValues { if existing == v { @@ -564,50 +677,65 @@ func (v ServiceStatusState) IsValid() bool { } // Ptr returns reference to StateState value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ServiceStatusState) Ptr() *ServiceStatusState { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServiceStatusState struct { value *ServiceStatusState isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServiceStatusState) Get() *ServiceStatusState { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServiceStatusState) Set(val *ServiceStatusState) { 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 NullableServiceStatusState) 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 *NullableServiceStatusState) 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 NewNullableServiceStatusState(val *ServiceStatusState) *NullableServiceStatusState { return &NullableServiceStatusState{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 NullableServiceStatusState) 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 *NullableServiceStatusState) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetStateAttributeType = *ServiceStatusState + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetStateArgType = ServiceStatusState + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatusGetStateRetType = ServiceStatusState +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServiceStatusGetStateAttributeTypeOk(arg ServiceStatusGetStateAttributeType) (ret ServiceStatusGetStateRetType, ok bool) { if arg == nil { return ret, false @@ -615,11 +743,13 @@ func getServiceStatusGetStateAttributeTypeOk(arg ServiceStatusGetStateAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServiceStatusGetStateAttributeType(arg *ServiceStatusGetStateAttributeType, val ServiceStatusGetStateRetType) { *arg = &val } // ServiceStatus struct for ServiceStatus +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceStatus struct { Dependencies ServiceStatusGetDependenciesAttributeType `json:"dependencies,omitempty"` Enablement ServiceStatusGetEnablementAttributeType `json:"enablement,omitempty"` @@ -638,6 +768,7 @@ type ServiceStatus struct { // 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 NewServiceStatus() *ServiceStatus { this := ServiceStatus{} return &this @@ -646,6 +777,7 @@ func NewServiceStatus() *ServiceStatus { // NewServiceStatusWithDefaults instantiates a new ServiceStatus 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 NewServiceStatusWithDefaults() *ServiceStatus { this := ServiceStatus{} var enablement ServiceStatusEnablement = "REQUEST" @@ -660,6 +792,7 @@ func NewServiceStatusWithDefaults() *ServiceStatus { } // GetDependencies returns the Dependencies field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetDependencies() (res ServiceStatusGetDependenciesRetType) { res, _ = o.GetDependenciesOk() return @@ -667,22 +800,26 @@ func (o *ServiceStatus) GetDependencies() (res ServiceStatusGetDependenciesRetTy // GetDependenciesOk returns a tuple with the Dependencies field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetDependenciesOk() (ret ServiceStatusGetDependenciesRetType, ok bool) { return getServiceStatusGetDependenciesAttributeTypeOk(o.Dependencies) } // HasDependencies returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) HasDependencies() bool { _, ok := o.GetDependenciesOk() return ok } // SetDependencies gets a reference to the given Dependencies and assigns it to the Dependencies field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) SetDependencies(v ServiceStatusGetDependenciesRetType) { setServiceStatusGetDependenciesAttributeType(&o.Dependencies, v) } // GetEnablement returns the Enablement field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetEnablement() (res ServiceStatusGetEnablementRetType) { res, _ = o.GetEnablementOk() return @@ -690,22 +827,26 @@ func (o *ServiceStatus) GetEnablement() (res ServiceStatusGetEnablementRetType) // GetEnablementOk returns a tuple with the Enablement field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetEnablementOk() (ret ServiceStatusGetEnablementRetType, ok bool) { return getServiceStatusGetEnablementAttributeTypeOk(o.Enablement) } // HasEnablement returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) HasEnablement() bool { _, ok := o.GetEnablementOk() return ok } // SetEnablement gets a reference to the given string and assigns it to the Enablement field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) SetEnablement(v ServiceStatusGetEnablementRetType) { setServiceStatusGetEnablementAttributeType(&o.Enablement, v) } // GetError returns the Error field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetError() (res ServiceStatusGetErrorRetType) { res, _ = o.GetErrorOk() return @@ -713,22 +854,26 @@ func (o *ServiceStatus) GetError() (res ServiceStatusGetErrorRetType) { // GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetErrorOk() (ret ServiceStatusGetErrorRetType, ok bool) { return getServiceStatusGetErrorAttributeTypeOk(o.Error) } // HasError returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) HasError() bool { _, ok := o.GetErrorOk() return ok } // SetError gets a reference to the given ActionError and assigns it to the Error field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) SetError(v ServiceStatusGetErrorRetType) { setServiceStatusGetErrorAttributeType(&o.Error, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetLabels() (res ServiceStatusGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -736,22 +881,26 @@ func (o *ServiceStatus) GetLabels() (res ServiceStatusGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetLabelsOk() (ret ServiceStatusGetLabelsRetType, ok bool) { return getServiceStatusGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) SetLabels(v ServiceStatusGetLabelsRetType) { setServiceStatusGetLabelsAttributeType(&o.Labels, v) } // GetLifecycle returns the Lifecycle field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetLifecycle() (res ServiceStatusGetLifecycleRetType) { res, _ = o.GetLifecycleOk() return @@ -759,22 +908,26 @@ func (o *ServiceStatus) GetLifecycle() (res ServiceStatusGetLifecycleRetType) { // GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetLifecycleOk() (ret ServiceStatusGetLifecycleRetType, ok bool) { return getServiceStatusGetLifecycleAttributeTypeOk(o.Lifecycle) } // HasLifecycle returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) HasLifecycle() bool { _, ok := o.GetLifecycleOk() return ok } // SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) SetLifecycle(v ServiceStatusGetLifecycleRetType) { setServiceStatusGetLifecycleAttributeType(&o.Lifecycle, v) } // GetParameters returns the Parameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetParameters() (res ServiceStatusGetParametersRetType) { res, _ = o.GetParametersOk() return @@ -782,22 +935,26 @@ func (o *ServiceStatus) GetParameters() (res ServiceStatusGetParametersRetType) // GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetParametersOk() (ret ServiceStatusGetParametersRetType, ok bool) { return getServiceStatusGetParametersAttributeTypeOk(o.Parameters) } // HasParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) HasParameters() bool { _, ok := o.GetParametersOk() return ok } // SetParameters gets a reference to the given Parameters and assigns it to the Parameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) SetParameters(v ServiceStatusGetParametersRetType) { setServiceStatusGetParametersAttributeType(&o.Parameters, v) } // GetScope returns the Scope field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetScope() (res ServiceStatusGetScopeRetType) { res, _ = o.GetScopeOk() return @@ -805,22 +962,26 @@ func (o *ServiceStatus) GetScope() (res ServiceStatusGetScopeRetType) { // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetScopeOk() (ret ServiceStatusGetScopeRetType, ok bool) { return getServiceStatusGetScopeAttributeTypeOk(o.Scope) } // HasScope returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) HasScope() bool { _, ok := o.GetScopeOk() return ok } // SetScope gets a reference to the given string and assigns it to the Scope field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) SetScope(v ServiceStatusGetScopeRetType) { setServiceStatusGetScopeAttributeType(&o.Scope, v) } // GetServiceId returns the ServiceId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetServiceId() (res ServiceStatusGetServiceIdRetType) { res, _ = o.GetServiceIdOk() return @@ -828,22 +989,26 @@ func (o *ServiceStatus) GetServiceId() (res ServiceStatusGetServiceIdRetType) { // GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetServiceIdOk() (ret ServiceStatusGetServiceIdRetType, ok bool) { return getServiceStatusGetServiceIdAttributeTypeOk(o.ServiceId) } // HasServiceId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) HasServiceId() bool { _, ok := o.GetServiceIdOk() return ok } // SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) SetServiceId(v ServiceStatusGetServiceIdRetType) { setServiceStatusGetServiceIdAttributeType(&o.ServiceId, v) } // GetState returns the State field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetState() (res ServiceStatusGetStateRetType) { res, _ = o.GetStateOk() return @@ -851,21 +1016,25 @@ func (o *ServiceStatus) GetState() (res ServiceStatusGetStateRetType) { // GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) GetStateOk() (ret ServiceStatusGetStateRetType, ok bool) { return getServiceStatusGetStateAttributeTypeOk(o.State) } // HasState returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) HasState() bool { _, ok := o.GetStateOk() return ok } // SetState gets a reference to the given string and assigns it to the State field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceStatus) SetState(v ServiceStatusGetStateRetType) { setServiceStatusGetStateAttributeType(&o.State, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ServiceStatus) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getServiceStatusGetDependenciesAttributeTypeOk(o.Dependencies); ok { @@ -898,37 +1067,45 @@ func (o ServiceStatus) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServiceStatus struct { value *ServiceStatus isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServiceStatus) Get() *ServiceStatus { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServiceStatus) Set(val *ServiceStatus) { 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 NullableServiceStatus) 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 *NullableServiceStatus) 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 NewNullableServiceStatus(val *ServiceStatus) *NullableServiceStatus { return &NullableServiceStatus{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 NullableServiceStatus) 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 *NullableServiceStatus) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serviceenablement/oas_commit b/services/serviceenablement/oas_commit index 588ee296b..853627d06 100644 --- a/services/serviceenablement/oas_commit +++ b/services/serviceenablement/oas_commit @@ -1 +1 @@ -964ac4ce34f0b6417f2496a1d48585c4926dee3a +335aa32af4d6c0d2a036b8567773da2f051f7efb diff --git a/services/serviceenablement/utils.go b/services/serviceenablement/utils.go index a2a45e467..90fa684b3 100644 --- a/services/serviceenablement/utils.go +++ b/services/serviceenablement/utils.go @@ -18,341 +18,419 @@ import ( ) // PtrBool is a helper routine that returns a pointer to given boolean value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrBool(v bool) *bool { return &v } // PtrInt is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt(v int) *int { return &v } // PtrInt32 is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt32(v int32) *int32 { return &v } // PtrInt64 is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt64(v int64) *int64 { return &v } // PtrFloat32 is a helper routine that returns a pointer to given float value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrFloat32(v float32) *float32 { return &v } // PtrFloat64 is a helper routine that returns a pointer to given float value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrFloat64(v float64) *float64 { return &v } // PtrString is a helper routine that returns a pointer to given string value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrString(v string) *string { return &v } // PtrTime is helper routine that returns a pointer to given Time value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrTime(v time.Time) *time.Time { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableValue[T any] struct { value *T isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableValue[T]) Get() *T { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableValue[T]) Set(val *T) { 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 NullableValue[T]) 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 *NullableValue[T]) 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 type NullableBool struct { value *bool isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) Get() *bool { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) Set(val *bool) { 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 NullableBool) 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 *NullableBool) 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 NewNullableBool(val *bool) *NullableBool { return &NullableBool{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 NullableBool) 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 *NullableBool) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt struct { value *int isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) Get() *int { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) Set(val *int) { 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 NullableInt) 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 *NullableInt) 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 NewNullableInt(val *int) *NullableInt { return &NullableInt{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 NullableInt) 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 *NullableInt) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt32 struct { value *int32 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) Get() *int32 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) Set(val *int32) { 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 NullableInt32) 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 *NullableInt32) 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 NewNullableInt32(val *int32) *NullableInt32 { return &NullableInt32{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 NullableInt32) 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 *NullableInt32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt64 struct { value *int64 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) Get() *int64 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) Set(val *int64) { 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 NullableInt64) 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 *NullableInt64) 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 NewNullableInt64(val *int64) *NullableInt64 { return &NullableInt64{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 NullableInt64) 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 *NullableInt64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFloat32 struct { value *float32 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) Get() *float32 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) Set(val *float32) { 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 NullableFloat32) 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 *NullableFloat32) 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 NewNullableFloat32(val *float32) *NullableFloat32 { return &NullableFloat32{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 NullableFloat32) 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 *NullableFloat32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFloat64 struct { value *float64 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) Get() *float64 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) Set(val *float64) { 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 NullableFloat64) 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 *NullableFloat64) 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 NewNullableFloat64(val *float64) *NullableFloat64 { return &NullableFloat64{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 NullableFloat64) 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 *NullableFloat64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableString struct { value *string isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) Get() *string { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) Set(val *string) { 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 NullableString) 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 *NullableString) 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 NewNullableString(val *string) *NullableString { return &NullableString{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 NullableString) 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 *NullableString) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableTime struct { value *time.Time isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) Get() *time.Time { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) Set(val *time.Time) { 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 NullableTime) 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 *NullableTime) 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 NewNullableTime(val *time.Time) *NullableTime { return &NullableTime{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 NullableTime) MarshalJSON() ([]byte, error) { return v.value.MarshalJSON() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } // IsNil checks if an input is nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func IsNil(i interface{}) bool { if i == nil { return true @@ -369,13 +447,16 @@ func IsNil(i interface{}) bool { return false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MappedNullable interface { ToMap() (map[string]interface{}, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead const letterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // randString returns a random string with a specified length. It panics if n <= 0. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func randString(n int) string { b := make([]byte, n) for i := range b { diff --git a/services/serviceenablement/v1api/api_default.go b/services/serviceenablement/v1api/api_default.go new file mode 100644 index 000000000..c52d6c921 --- /dev/null +++ b/services/serviceenablement/v1api/api_default.go @@ -0,0 +1,544 @@ +/* +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 ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + DisableService Method for DisableService + + disables the service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param serviceId + @return ApiDisableServiceRequest + */ + DisableService(ctx context.Context, projectId string, serviceId string) ApiDisableServiceRequest + + // DisableServiceExecute executes the request + DisableServiceExecute(r ApiDisableServiceRequest) (*http.Response, error) + + /* + EnableService Method for EnableService + + enables the service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param serviceId + @return ApiEnableServiceRequest + */ + EnableService(ctx context.Context, projectId string, serviceId string) ApiEnableServiceRequest + + // EnableServiceExecute executes the request + EnableServiceExecute(r ApiEnableServiceRequest) (*http.Response, error) + + /* + GetServiceStatus Method for GetServiceStatus + + returns the current status of a service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param serviceId + @return ApiGetServiceStatusRequest + */ + GetServiceStatus(ctx context.Context, projectId string, serviceId string) ApiGetServiceStatusRequest + + // GetServiceStatusExecute executes the request + // @return ServiceStatus + GetServiceStatusExecute(r ApiGetServiceStatusRequest) (*ServiceStatus, *http.Response, error) + + /* + ListServiceStatus Method for ListServiceStatus + + returns a list of all available services for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListServiceStatusRequest + */ + ListServiceStatus(ctx context.Context, projectId string) ApiListServiceStatusRequest + + // ListServiceStatusExecute executes the request + // @return ListServiceStatus200Response + ListServiceStatusExecute(r ApiListServiceStatusRequest) (*ListServiceStatus200Response, *http.Response, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiDisableServiceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serviceId string +} + +func (r ApiDisableServiceRequest) Execute() (*http.Response, error) { + return r.ApiService.DisableServiceExecute(r) +} + +/* +DisableService Method for DisableService + +disables the service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param serviceId + @return ApiDisableServiceRequest +*/ +func (a *DefaultAPIService) DisableService(ctx context.Context, projectId string, serviceId string) ApiDisableServiceRequest { + return ApiDisableServiceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serviceId: serviceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DisableServiceExecute(r ApiDisableServiceRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DisableService") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/services/{serviceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", url.PathEscape(parameterValueToString(r.serviceId, "serviceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEnableServiceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serviceId string +} + +func (r ApiEnableServiceRequest) Execute() (*http.Response, error) { + return r.ApiService.EnableServiceExecute(r) +} + +/* +EnableService Method for EnableService + +enables the service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param serviceId + @return ApiEnableServiceRequest +*/ +func (a *DefaultAPIService) EnableService(ctx context.Context, projectId string, serviceId string) ApiEnableServiceRequest { + return ApiEnableServiceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serviceId: serviceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) EnableServiceExecute(r ApiEnableServiceRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.EnableService") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/services/{serviceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", url.PathEscape(parameterValueToString(r.serviceId, "serviceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetServiceStatusRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serviceId string +} + +func (r ApiGetServiceStatusRequest) Execute() (*ServiceStatus, *http.Response, error) { + return r.ApiService.GetServiceStatusExecute(r) +} + +/* +GetServiceStatus Method for GetServiceStatus + +returns the current status of a service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param serviceId + @return ApiGetServiceStatusRequest +*/ +func (a *DefaultAPIService) GetServiceStatus(ctx context.Context, projectId string, serviceId string) ApiGetServiceStatusRequest { + return ApiGetServiceStatusRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serviceId: serviceId, + } +} + +// Execute executes the request +// +// @return ServiceStatus +func (a *DefaultAPIService) GetServiceStatusExecute(r ApiGetServiceStatusRequest) (*ServiceStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServiceStatus") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/services/{serviceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", url.PathEscape(parameterValueToString(r.serviceId, "serviceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListServiceStatusRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + cursor *string +} + +func (r ApiListServiceStatusRequest) Cursor(cursor string) ApiListServiceStatusRequest { + r.cursor = &cursor + return r +} + +func (r ApiListServiceStatusRequest) Execute() (*ListServiceStatus200Response, *http.Response, error) { + return r.ApiService.ListServiceStatusExecute(r) +} + +/* +ListServiceStatus Method for ListServiceStatus + +returns a list of all available services for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListServiceStatusRequest +*/ +func (a *DefaultAPIService) ListServiceStatus(ctx context.Context, projectId string) ApiListServiceStatusRequest { + return ApiListServiceStatusRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListServiceStatus200Response +func (a *DefaultAPIService) ListServiceStatusExecute(r ApiListServiceStatusRequest) (*ListServiceStatus200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListServiceStatus200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServiceStatus") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/services" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/serviceenablement/v1api/api_default_mock.go b/services/serviceenablement/v1api/api_default_mock.go new file mode 100644 index 000000000..d6ff53e9a --- /dev/null +++ b/services/serviceenablement/v1api/api_default_mock.go @@ -0,0 +1,105 @@ +/* +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 ( + "context" + "net/http" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // DisableServiceExecuteMock can be populated to implement the behavior of the DisableServiceExecute function of this mock + DisableServiceExecuteMock *func(r ApiDisableServiceRequest) (*http.Response, error) + // EnableServiceExecuteMock can be populated to implement the behavior of the EnableServiceExecute function of this mock + EnableServiceExecuteMock *func(r ApiEnableServiceRequest) (*http.Response, error) + // GetServiceStatusExecuteMock can be populated to implement the behavior of the GetServiceStatusExecute function of this mock + GetServiceStatusExecuteMock *func(r ApiGetServiceStatusRequest) (*ServiceStatus, *http.Response, error) + // ListServiceStatusExecuteMock can be populated to implement the behavior of the ListServiceStatusExecute function of this mock + ListServiceStatusExecuteMock *func(r ApiListServiceStatusRequest) (*ListServiceStatus200Response, *http.Response, error) +} + +func (a DefaultAPIServiceMock) DisableService(ctx context.Context, projectId string, serviceId string) ApiDisableServiceRequest { + return ApiDisableServiceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serviceId: serviceId, + } +} + +// DisableServiceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DisableServiceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DisableServiceExecute(r ApiDisableServiceRequest) (*http.Response, error) { + if a.DisableServiceExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.DisableServiceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) EnableService(ctx context.Context, projectId string, serviceId string) ApiEnableServiceRequest { + return ApiEnableServiceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serviceId: serviceId, + } +} + +// EnableServiceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the EnableServiceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) EnableServiceExecute(r ApiEnableServiceRequest) (*http.Response, error) { + if a.EnableServiceExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.EnableServiceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetServiceStatus(ctx context.Context, projectId string, serviceId string) ApiGetServiceStatusRequest { + return ApiGetServiceStatusRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serviceId: serviceId, + } +} + +// GetServiceStatusExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServiceStatusExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServiceStatusExecute(r ApiGetServiceStatusRequest) (*ServiceStatus, *http.Response, error) { + if a.GetServiceStatusExecuteMock == nil { + var localVarReturnValue *ServiceStatus + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetServiceStatusExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListServiceStatus(ctx context.Context, projectId string) ApiListServiceStatusRequest { + return ApiListServiceStatusRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListServiceStatusExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServiceStatusExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServiceStatusExecute(r ApiListServiceStatusRequest) (*ListServiceStatus200Response, *http.Response, error) { + if a.ListServiceStatusExecuteMock == nil { + var localVarReturnValue *ListServiceStatus200Response + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListServiceStatusExecuteMock)(r) +} diff --git a/services/serviceenablement/v1api/client.go b/services/serviceenablement/v1api/client.go new file mode 100644 index 000000000..5cfbd9e06 --- /dev/null +++ b/services/serviceenablement/v1api/client.go @@ -0,0 +1,658 @@ +/* +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 ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT Service Enablement API API v1.1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/serviceenablement/v1api/configuration.go b/services/serviceenablement/v1api/configuration.go new file mode 100644 index 000000000..62a78d103 --- /dev/null +++ b/services/serviceenablement/v1api/configuration.go @@ -0,0 +1,41 @@ +/* +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 ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/serviceenablement", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://service-enablement.api.{region}stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "eu01.", + EnumValues: []string{ + "eu01.", + "eu02.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/serviceenablement/v1api/model_action_error.go b/services/serviceenablement/v1api/model_action_error.go new file mode 100644 index 000000000..3327ea229 --- /dev/null +++ b/services/serviceenablement/v1api/model_action_error.go @@ -0,0 +1,199 @@ +/* +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" +) + +// checks if the ActionError type satisfies the MappedNullable interface at compile time +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"` + // the error code if provided by the service + Code *string `json:"code,omitempty"` + // the error reason provided by the service + Reason *string `json:"reason,omitempty"` +} + +// NewActionError instantiates a new ActionError 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 NewActionError() *ActionError { + this := ActionError{} + return &this +} + +// NewActionErrorWithDefaults instantiates a new ActionError 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 NewActionErrorWithDefaults() *ActionError { + this := ActionError{} + return &this +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *ActionError) GetAction() string { + if o == nil || IsNil(o.Action) { + var ret string + return ret + } + return *o.Action +} + +// 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) { + if o == nil || IsNil(o.Action) { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *ActionError) HasAction() bool { + if o != nil && !IsNil(o.Action) { + return true + } + + return false +} + +// SetAction gets a reference to the given string and assigns it to the Action field. +func (o *ActionError) SetAction(v string) { + o.Action = &v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *ActionError) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// 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 *ActionError) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *ActionError) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *ActionError) SetCode(v string) { + o.Code = &v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *ActionError) GetReason() string { + if o == nil || IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionError) GetReasonOk() (*string, bool) { + if o == nil || IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *ActionError) HasReason() bool { + if o != nil && !IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *ActionError) SetReason(v string) { + o.Reason = &v +} + +func (o ActionError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActionError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Action) { + toSerialize["action"] = o.Action + } + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + return toSerialize, nil +} + +type NullableActionError struct { + value *ActionError + isSet bool +} + +func (v NullableActionError) Get() *ActionError { + return v.value +} + +func (v *NullableActionError) Set(val *ActionError) { + v.value = val + v.isSet = true +} + +func (v NullableActionError) IsSet() bool { + return v.isSet +} + +func (v *NullableActionError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActionError(val *ActionError) *NullableActionError { + return &NullableActionError{value: val, isSet: true} +} + +func (v NullableActionError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActionError) 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 new file mode 100644 index 000000000..0e556c230 --- /dev/null +++ b/services/serviceenablement/v1api/model_cloud_service.go @@ -0,0 +1,237 @@ +/* +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" +) + +// checks if the CloudService type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloudService{} + +// CloudService struct for CloudService +type CloudService struct { + Dependencies *Dependencies `json:"dependencies,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + Scope *string `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}$"` +} + +// NewCloudService instantiates a new CloudService 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 NewCloudService() *CloudService { + this := CloudService{} + var scope string = "PUBLIC" + this.Scope = &scope + return &this +} + +// NewCloudServiceWithDefaults instantiates a new CloudService 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 NewCloudServiceWithDefaults() *CloudService { + this := CloudService{} + var scope string = "PUBLIC" + this.Scope = &scope + return &this +} + +// GetDependencies returns the Dependencies field value if set, zero value otherwise. +func (o *CloudService) GetDependencies() Dependencies { + if o == nil || IsNil(o.Dependencies) { + var ret Dependencies + return ret + } + return *o.Dependencies +} + +// GetDependenciesOk returns a tuple with the Dependencies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloudService) GetDependenciesOk() (*Dependencies, bool) { + if o == nil || IsNil(o.Dependencies) { + return nil, false + } + return o.Dependencies, true +} + +// HasDependencies returns a boolean if a field has been set. +func (o *CloudService) HasDependencies() bool { + if o != nil && !IsNil(o.Dependencies) { + return true + } + + return false +} + +// SetDependencies gets a reference to the given Dependencies and assigns it to the Dependencies field. +func (o *CloudService) SetDependencies(v Dependencies) { + o.Dependencies = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CloudService) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloudService) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CloudService) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CloudService) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *CloudService) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// 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) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *CloudService) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *CloudService) SetScope(v string) { + o.Scope = &v +} + +// GetServiceId returns the ServiceId field value if set, zero value otherwise. +func (o *CloudService) GetServiceId() string { + if o == nil || IsNil(o.ServiceId) { + var ret string + return ret + } + return *o.ServiceId +} + +// GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloudService) GetServiceIdOk() (*string, bool) { + if o == nil || IsNil(o.ServiceId) { + return nil, false + } + return o.ServiceId, true +} + +// HasServiceId returns a boolean if a field has been set. +func (o *CloudService) HasServiceId() bool { + if o != nil && !IsNil(o.ServiceId) { + return true + } + + return false +} + +// SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +func (o *CloudService) SetServiceId(v string) { + o.ServiceId = &v +} + +func (o CloudService) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloudService) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dependencies) { + toSerialize["dependencies"] = o.Dependencies + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.ServiceId) { + toSerialize["serviceId"] = o.ServiceId + } + return toSerialize, nil +} + +type NullableCloudService struct { + value *CloudService + isSet bool +} + +func (v NullableCloudService) Get() *CloudService { + return v.value +} + +func (v *NullableCloudService) Set(val *CloudService) { + v.value = val + v.isSet = true +} + +func (v NullableCloudService) IsSet() bool { + return v.isSet +} + +func (v *NullableCloudService) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloudService(val *CloudService) *NullableCloudService { + return &NullableCloudService{value: val, isSet: true} +} + +func (v NullableCloudService) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloudService) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v1api/model_dependencies.go b/services/serviceenablement/v1api/model_dependencies.go new file mode 100644 index 000000000..a21a1ae83 --- /dev/null +++ b/services/serviceenablement/v1api/model_dependencies.go @@ -0,0 +1,162 @@ +/* +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" +) + +// checks if the Dependencies type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Dependencies{} + +// Dependencies struct for Dependencies +type Dependencies struct { + // a list of service IDs which this service depend on. If the service is enabled, those service are enabled as well automatically. + Hard []string `json:"hard,omitempty"` + // a list of service IDs which this service depend on. When they are disabled a notification is sent. + Soft []string `json:"soft,omitempty"` +} + +// NewDependencies instantiates a new Dependencies 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 NewDependencies() *Dependencies { + this := Dependencies{} + return &this +} + +// NewDependenciesWithDefaults instantiates a new Dependencies 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 NewDependenciesWithDefaults() *Dependencies { + this := Dependencies{} + return &this +} + +// GetHard returns the Hard field value if set, zero value otherwise. +func (o *Dependencies) GetHard() []string { + if o == nil || IsNil(o.Hard) { + var ret []string + return ret + } + return o.Hard +} + +// GetHardOk returns a tuple with the Hard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Dependencies) GetHardOk() ([]string, bool) { + if o == nil || IsNil(o.Hard) { + return nil, false + } + return o.Hard, true +} + +// HasHard returns a boolean if a field has been set. +func (o *Dependencies) HasHard() bool { + if o != nil && !IsNil(o.Hard) { + return true + } + + return false +} + +// SetHard gets a reference to the given []string and assigns it to the Hard field. +func (o *Dependencies) SetHard(v []string) { + o.Hard = v +} + +// GetSoft returns the Soft field value if set, zero value otherwise. +func (o *Dependencies) GetSoft() []string { + if o == nil || IsNil(o.Soft) { + var ret []string + return ret + } + return o.Soft +} + +// GetSoftOk returns a tuple with the Soft field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Dependencies) GetSoftOk() ([]string, bool) { + if o == nil || IsNil(o.Soft) { + return nil, false + } + return o.Soft, true +} + +// HasSoft returns a boolean if a field has been set. +func (o *Dependencies) HasSoft() bool { + if o != nil && !IsNil(o.Soft) { + return true + } + + return false +} + +// SetSoft gets a reference to the given []string and assigns it to the Soft field. +func (o *Dependencies) SetSoft(v []string) { + o.Soft = v +} + +func (o Dependencies) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Dependencies) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hard) { + toSerialize["hard"] = o.Hard + } + if !IsNil(o.Soft) { + toSerialize["soft"] = o.Soft + } + return toSerialize, nil +} + +type NullableDependencies struct { + value *Dependencies + isSet bool +} + +func (v NullableDependencies) Get() *Dependencies { + return v.value +} + +func (v *NullableDependencies) Set(val *Dependencies) { + v.value = val + v.isSet = true +} + +func (v NullableDependencies) IsSet() bool { + return v.isSet +} + +func (v *NullableDependencies) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDependencies(val *Dependencies) *NullableDependencies { + return &NullableDependencies{value: val, isSet: true} +} + +func (v NullableDependencies) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDependencies) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v1api/model_list_service_status_200_response.go b/services/serviceenablement/v1api/model_list_service_status_200_response.go new file mode 100644 index 000000000..c91789b3f --- /dev/null +++ b/services/serviceenablement/v1api/model_list_service_status_200_response.go @@ -0,0 +1,160 @@ +/* +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" +) + +// checks if the ListServiceStatus200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListServiceStatus200Response{} + +// ListServiceStatus200Response struct for ListServiceStatus200Response +type ListServiceStatus200Response struct { + Items []ServiceStatus `json:"items,omitempty"` + NextCursor *string `json:"nextCursor,omitempty"` +} + +// NewListServiceStatus200Response instantiates a new ListServiceStatus200Response 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 NewListServiceStatus200Response() *ListServiceStatus200Response { + this := ListServiceStatus200Response{} + return &this +} + +// NewListServiceStatus200ResponseWithDefaults instantiates a new ListServiceStatus200Response 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 NewListServiceStatus200ResponseWithDefaults() *ListServiceStatus200Response { + this := ListServiceStatus200Response{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListServiceStatus200Response) GetItems() []ServiceStatus { + if o == nil || IsNil(o.Items) { + var ret []ServiceStatus + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListServiceStatus200Response) GetItemsOk() ([]ServiceStatus, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListServiceStatus200Response) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []ServiceStatus and assigns it to the Items field. +func (o *ListServiceStatus200Response) SetItems(v []ServiceStatus) { + o.Items = v +} + +// GetNextCursor returns the NextCursor field value if set, zero value otherwise. +func (o *ListServiceStatus200Response) GetNextCursor() string { + if o == nil || IsNil(o.NextCursor) { + var ret string + return ret + } + return *o.NextCursor +} + +// GetNextCursorOk returns a tuple with the NextCursor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListServiceStatus200Response) GetNextCursorOk() (*string, bool) { + if o == nil || IsNil(o.NextCursor) { + return nil, false + } + return o.NextCursor, true +} + +// HasNextCursor returns a boolean if a field has been set. +func (o *ListServiceStatus200Response) HasNextCursor() bool { + if o != nil && !IsNil(o.NextCursor) { + return true + } + + return false +} + +// SetNextCursor gets a reference to the given string and assigns it to the NextCursor field. +func (o *ListServiceStatus200Response) SetNextCursor(v string) { + o.NextCursor = &v +} + +func (o ListServiceStatus200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListServiceStatus200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !IsNil(o.NextCursor) { + toSerialize["nextCursor"] = o.NextCursor + } + return toSerialize, nil +} + +type NullableListServiceStatus200Response struct { + value *ListServiceStatus200Response + isSet bool +} + +func (v NullableListServiceStatus200Response) Get() *ListServiceStatus200Response { + return v.value +} + +func (v *NullableListServiceStatus200Response) Set(val *ListServiceStatus200Response) { + v.value = val + v.isSet = true +} + +func (v NullableListServiceStatus200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableListServiceStatus200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListServiceStatus200Response(val *ListServiceStatus200Response) *NullableListServiceStatus200Response { + return &NullableListServiceStatus200Response{value: val, isSet: true} +} + +func (v NullableListServiceStatus200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListServiceStatus200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v1api/model_parameters.go b/services/serviceenablement/v1api/model_parameters.go new file mode 100644 index 000000000..ab91a5c4a --- /dev/null +++ b/services/serviceenablement/v1api/model_parameters.go @@ -0,0 +1,153 @@ +/* +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" +) + +// checks if the Parameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Parameters{} + +// Parameters service parameters +type Parameters struct { + General *ParametersGeneral `json:"general,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Parameters Parameters + +// NewParameters instantiates a new Parameters 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 NewParameters() *Parameters { + this := Parameters{} + return &this +} + +// NewParametersWithDefaults instantiates a new Parameters 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 NewParametersWithDefaults() *Parameters { + this := Parameters{} + return &this +} + +// GetGeneral returns the General field value if set, zero value otherwise. +func (o *Parameters) GetGeneral() ParametersGeneral { + if o == nil || IsNil(o.General) { + var ret ParametersGeneral + return ret + } + return *o.General +} + +// GetGeneralOk returns a tuple with the General field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Parameters) GetGeneralOk() (*ParametersGeneral, bool) { + if o == nil || IsNil(o.General) { + return nil, false + } + return o.General, true +} + +// HasGeneral returns a boolean if a field has been set. +func (o *Parameters) HasGeneral() bool { + if o != nil && !IsNil(o.General) { + return true + } + + return false +} + +// SetGeneral gets a reference to the given ParametersGeneral and assigns it to the General field. +func (o *Parameters) SetGeneral(v ParametersGeneral) { + o.General = &v +} + +func (o Parameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Parameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.General) { + toSerialize["general"] = o.General + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Parameters) UnmarshalJSON(data []byte) (err error) { + varParameters := _Parameters{} + + err = json.Unmarshal(data, &varParameters) + + if err != nil { + return err + } + + *o = Parameters(varParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "general") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableParameters struct { + value *Parameters + isSet bool +} + +func (v NullableParameters) Get() *Parameters { + return v.value +} + +func (v *NullableParameters) Set(val *Parameters) { + v.value = val + v.isSet = true +} + +func (v NullableParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParameters(val *Parameters) *NullableParameters { + return &NullableParameters{value: val, isSet: true} +} + +func (v NullableParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParameters) 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 new file mode 100644 index 000000000..37ba61615 --- /dev/null +++ b/services/serviceenablement/v1api/model_parameters_general.go @@ -0,0 +1,200 @@ +/* +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" +) + +// checks if the ParametersGeneral type satisfies the MappedNullable interface at compile time +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"` +} + +// NewParametersGeneral instantiates a new ParametersGeneral 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 NewParametersGeneral() *ParametersGeneral { + this := ParametersGeneral{} + var projectScope string = "PUBLIC" + this.ProjectScope = &projectScope + return &this +} + +// NewParametersGeneralWithDefaults instantiates a new ParametersGeneral 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 NewParametersGeneralWithDefaults() *ParametersGeneral { + this := ParametersGeneral{} + var projectScope string = "PUBLIC" + this.ProjectScope = &projectScope + return &this +} + +// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. +func (o *ParametersGeneral) GetOrganizationId() string { + if o == nil || IsNil(o.OrganizationId) { + var ret string + return ret + } + return *o.OrganizationId +} + +// GetOrganizationIdOk returns a tuple with the OrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ParametersGeneral) GetOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.OrganizationId) { + return nil, false + } + return o.OrganizationId, true +} + +// HasOrganizationId returns a boolean if a field has been set. +func (o *ParametersGeneral) HasOrganizationId() bool { + if o != nil && !IsNil(o.OrganizationId) { + return true + } + + return false +} + +// SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. +func (o *ParametersGeneral) SetOrganizationId(v string) { + o.OrganizationId = &v +} + +// GetProjectName returns the ProjectName field value if set, zero value otherwise. +func (o *ParametersGeneral) GetProjectName() string { + if o == nil || IsNil(o.ProjectName) { + var ret string + return ret + } + return *o.ProjectName +} + +// GetProjectNameOk returns a tuple with the ProjectName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ParametersGeneral) GetProjectNameOk() (*string, bool) { + if o == nil || IsNil(o.ProjectName) { + return nil, false + } + return o.ProjectName, true +} + +// HasProjectName returns a boolean if a field has been set. +func (o *ParametersGeneral) HasProjectName() bool { + if o != nil && !IsNil(o.ProjectName) { + return true + } + + return false +} + +// SetProjectName gets a reference to the given string and assigns it to the ProjectName field. +func (o *ParametersGeneral) SetProjectName(v string) { + o.ProjectName = &v +} + +// GetProjectScope returns the ProjectScope field value if set, zero value otherwise. +func (o *ParametersGeneral) GetProjectScope() string { + if o == nil || IsNil(o.ProjectScope) { + var ret string + return ret + } + return *o.ProjectScope +} + +// 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) { + if o == nil || IsNil(o.ProjectScope) { + return nil, false + } + return o.ProjectScope, true +} + +// HasProjectScope returns a boolean if a field has been set. +func (o *ParametersGeneral) HasProjectScope() bool { + if o != nil && !IsNil(o.ProjectScope) { + return true + } + + return false +} + +// SetProjectScope gets a reference to the given string and assigns it to the ProjectScope field. +func (o *ParametersGeneral) SetProjectScope(v string) { + o.ProjectScope = &v +} + +func (o ParametersGeneral) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ParametersGeneral) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.OrganizationId) { + toSerialize["organizationId"] = o.OrganizationId + } + if !IsNil(o.ProjectName) { + toSerialize["projectName"] = o.ProjectName + } + if !IsNil(o.ProjectScope) { + toSerialize["projectScope"] = o.ProjectScope + } + return toSerialize, nil +} + +type NullableParametersGeneral struct { + value *ParametersGeneral + isSet bool +} + +func (v NullableParametersGeneral) Get() *ParametersGeneral { + return v.value +} + +func (v *NullableParametersGeneral) Set(val *ParametersGeneral) { + v.value = val + v.isSet = true +} + +func (v NullableParametersGeneral) IsSet() bool { + return v.isSet +} + +func (v *NullableParametersGeneral) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParametersGeneral(val *ParametersGeneral) *NullableParametersGeneral { + return &NullableParametersGeneral{value: val, isSet: true} +} + +func (v NullableParametersGeneral) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParametersGeneral) 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 new file mode 100644 index 000000000..fdf4c7319 --- /dev/null +++ b/services/serviceenablement/v1api/model_service_status.go @@ -0,0 +1,430 @@ +/* +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" +) + +// checks if the ServiceStatus type satisfies the MappedNullable interface at compile time +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"` + // 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"` +} + +// NewServiceStatus instantiates a new ServiceStatus 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 NewServiceStatus() *ServiceStatus { + this := ServiceStatus{} + var enablement string = "REQUEST" + this.Enablement = &enablement + var lifecycle string = "FLEX" + this.Lifecycle = &lifecycle + var scope string = "PUBLIC" + this.Scope = &scope + var state string = "ENABLED" + this.State = &state + return &this +} + +// NewServiceStatusWithDefaults instantiates a new ServiceStatus 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 NewServiceStatusWithDefaults() *ServiceStatus { + this := ServiceStatus{} + var enablement string = "REQUEST" + this.Enablement = &enablement + var lifecycle string = "FLEX" + this.Lifecycle = &lifecycle + var scope string = "PUBLIC" + this.Scope = &scope + var state string = "ENABLED" + this.State = &state + return &this +} + +// GetDependencies returns the Dependencies field value if set, zero value otherwise. +func (o *ServiceStatus) GetDependencies() Dependencies { + if o == nil || IsNil(o.Dependencies) { + var ret Dependencies + return ret + } + return *o.Dependencies +} + +// GetDependenciesOk returns a tuple with the Dependencies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetDependenciesOk() (*Dependencies, bool) { + if o == nil || IsNil(o.Dependencies) { + return nil, false + } + return o.Dependencies, true +} + +// HasDependencies returns a boolean if a field has been set. +func (o *ServiceStatus) HasDependencies() bool { + if o != nil && !IsNil(o.Dependencies) { + return true + } + + return false +} + +// SetDependencies gets a reference to the given Dependencies and assigns it to the Dependencies field. +func (o *ServiceStatus) SetDependencies(v Dependencies) { + o.Dependencies = &v +} + +// GetEnablement returns the Enablement field value if set, zero value otherwise. +func (o *ServiceStatus) GetEnablement() string { + if o == nil || IsNil(o.Enablement) { + var ret string + return ret + } + return *o.Enablement +} + +// 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) { + if o == nil || IsNil(o.Enablement) { + return nil, false + } + return o.Enablement, true +} + +// HasEnablement returns a boolean if a field has been set. +func (o *ServiceStatus) HasEnablement() bool { + if o != nil && !IsNil(o.Enablement) { + return true + } + + return false +} + +// SetEnablement gets a reference to the given string and assigns it to the Enablement field. +func (o *ServiceStatus) SetEnablement(v string) { + o.Enablement = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ServiceStatus) GetError() ActionError { + if o == nil || IsNil(o.Error) { + var ret ActionError + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetErrorOk() (*ActionError, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ServiceStatus) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given ActionError and assigns it to the Error field. +func (o *ServiceStatus) SetError(v ActionError) { + o.Error = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *ServiceStatus) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *ServiceStatus) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *ServiceStatus) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetLifecycle returns the Lifecycle field value if set, zero value otherwise. +func (o *ServiceStatus) GetLifecycle() string { + if o == nil || IsNil(o.Lifecycle) { + var ret string + return ret + } + return *o.Lifecycle +} + +// 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) { + if o == nil || IsNil(o.Lifecycle) { + return nil, false + } + return o.Lifecycle, true +} + +// HasLifecycle returns a boolean if a field has been set. +func (o *ServiceStatus) HasLifecycle() bool { + if o != nil && !IsNil(o.Lifecycle) { + return true + } + + return false +} + +// SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. +func (o *ServiceStatus) SetLifecycle(v string) { + o.Lifecycle = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *ServiceStatus) GetParameters() Parameters { + if o == nil || IsNil(o.Parameters) { + var ret Parameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetParametersOk() (*Parameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *ServiceStatus) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given Parameters and assigns it to the Parameters field. +func (o *ServiceStatus) SetParameters(v Parameters) { + o.Parameters = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *ServiceStatus) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// 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) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *ServiceStatus) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *ServiceStatus) SetScope(v string) { + o.Scope = &v +} + +// GetServiceId returns the ServiceId field value if set, zero value otherwise. +func (o *ServiceStatus) GetServiceId() string { + if o == nil || IsNil(o.ServiceId) { + var ret string + return ret + } + return *o.ServiceId +} + +// GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetServiceIdOk() (*string, bool) { + if o == nil || IsNil(o.ServiceId) { + return nil, false + } + return o.ServiceId, true +} + +// HasServiceId returns a boolean if a field has been set. +func (o *ServiceStatus) HasServiceId() bool { + if o != nil && !IsNil(o.ServiceId) { + return true + } + + return false +} + +// SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +func (o *ServiceStatus) SetServiceId(v string) { + o.ServiceId = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *ServiceStatus) GetState() string { + if o == nil || IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetStateOk() (*string, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *ServiceStatus) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *ServiceStatus) SetState(v string) { + o.State = &v +} + +func (o ServiceStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dependencies) { + toSerialize["dependencies"] = o.Dependencies + } + if !IsNil(o.Enablement) { + toSerialize["enablement"] = o.Enablement + } + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Lifecycle) { + toSerialize["lifecycle"] = o.Lifecycle + } + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.ServiceId) { + toSerialize["serviceId"] = o.ServiceId + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + return toSerialize, nil +} + +type NullableServiceStatus struct { + value *ServiceStatus + isSet bool +} + +func (v NullableServiceStatus) Get() *ServiceStatus { + return v.value +} + +func (v *NullableServiceStatus) Set(val *ServiceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableServiceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceStatus(val *ServiceStatus) *NullableServiceStatus { + return &NullableServiceStatus{value: val, isSet: true} +} + +func (v NullableServiceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v1api/response.go b/services/serviceenablement/v1api/response.go new file mode 100644 index 000000000..e08ed9b4a --- /dev/null +++ b/services/serviceenablement/v1api/response.go @@ -0,0 +1,47 @@ +/* +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 ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/serviceenablement/v1api/utils.go b/services/serviceenablement/v1api/utils.go new file mode 100644 index 000000000..2981e2133 --- /dev/null +++ b/services/serviceenablement/v1api/utils.go @@ -0,0 +1,361 @@ +/* +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 ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/serviceenablement/v2api/api_default.go b/services/serviceenablement/v2api/api_default.go new file mode 100644 index 000000000..75ffb1128 --- /dev/null +++ b/services/serviceenablement/v2api/api_default.go @@ -0,0 +1,659 @@ +/* +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 ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + DisableServiceRegional Method for DisableServiceRegional + + disables the service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @param serviceId + @return ApiDisableServiceRegionalRequest + */ + DisableServiceRegional(ctx context.Context, region string, projectId string, serviceId string) ApiDisableServiceRegionalRequest + + // DisableServiceRegionalExecute executes the request + DisableServiceRegionalExecute(r ApiDisableServiceRegionalRequest) (*http.Response, error) + + /* + EnableServiceRegional Method for EnableServiceRegional + + enables the service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @param serviceId + @return ApiEnableServiceRegionalRequest + */ + EnableServiceRegional(ctx context.Context, region string, projectId string, serviceId string) ApiEnableServiceRegionalRequest + + // EnableServiceRegionalExecute executes the request + EnableServiceRegionalExecute(r ApiEnableServiceRegionalRequest) (*http.Response, error) + + /* + GetServiceStatusRegional Method for GetServiceStatusRegional + + returns the current status of a service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @param serviceId + @return ApiGetServiceStatusRegionalRequest + */ + GetServiceStatusRegional(ctx context.Context, region string, projectId string, serviceId string) ApiGetServiceStatusRegionalRequest + + // GetServiceStatusRegionalExecute executes the request + // @return ServiceStatus + GetServiceStatusRegionalExecute(r ApiGetServiceStatusRegionalRequest) (*ServiceStatus, *http.Response, error) + + /* + ListServiceStatusRegional Method for ListServiceStatusRegional + + returns a list of all available services for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @return ApiListServiceStatusRegionalRequest + */ + ListServiceStatusRegional(ctx context.Context, region string, projectId string) ApiListServiceStatusRegionalRequest + + // ListServiceStatusRegionalExecute executes the request + // @return ListServiceStatusRegional200Response + ListServiceStatusRegionalExecute(r ApiListServiceStatusRegionalRequest) (*ListServiceStatusRegional200Response, *http.Response, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiDisableServiceRegionalRequest struct { + ctx context.Context + ApiService DefaultAPI + region string + projectId string + serviceId string +} + +func (r ApiDisableServiceRegionalRequest) Execute() (*http.Response, error) { + return r.ApiService.DisableServiceRegionalExecute(r) +} + +/* +DisableServiceRegional Method for DisableServiceRegional + +disables the service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @param serviceId + @return ApiDisableServiceRegionalRequest +*/ +func (a *DefaultAPIService) DisableServiceRegional(ctx context.Context, region string, projectId string, serviceId string) ApiDisableServiceRegionalRequest { + return ApiDisableServiceRegionalRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + serviceId: serviceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DisableServiceRegionalExecute(r ApiDisableServiceRegionalRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DisableServiceRegional") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", url.PathEscape(parameterValueToString(r.serviceId, "serviceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEnableServiceRegionalRequest struct { + ctx context.Context + ApiService DefaultAPI + region string + projectId string + serviceId string +} + +func (r ApiEnableServiceRegionalRequest) Execute() (*http.Response, error) { + return r.ApiService.EnableServiceRegionalExecute(r) +} + +/* +EnableServiceRegional Method for EnableServiceRegional + +enables the service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @param serviceId + @return ApiEnableServiceRegionalRequest +*/ +func (a *DefaultAPIService) EnableServiceRegional(ctx context.Context, region string, projectId string, serviceId string) ApiEnableServiceRegionalRequest { + return ApiEnableServiceRegionalRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + serviceId: serviceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) EnableServiceRegionalExecute(r ApiEnableServiceRegionalRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.EnableServiceRegional") + if err != nil { + return nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", url.PathEscape(parameterValueToString(r.serviceId, "serviceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetServiceStatusRegionalRequest struct { + ctx context.Context + ApiService DefaultAPI + region string + projectId string + serviceId string +} + +func (r ApiGetServiceStatusRegionalRequest) Execute() (*ServiceStatus, *http.Response, error) { + return r.ApiService.GetServiceStatusRegionalExecute(r) +} + +/* +GetServiceStatusRegional Method for GetServiceStatusRegional + +returns the current status of a service in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @param serviceId + @return ApiGetServiceStatusRegionalRequest +*/ +func (a *DefaultAPIService) GetServiceStatusRegional(ctx context.Context, region string, projectId string, serviceId string) ApiGetServiceStatusRegionalRequest { + return ApiGetServiceStatusRegionalRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + serviceId: serviceId, + } +} + +// Execute executes the request +// +// @return ServiceStatus +func (a *DefaultAPIService) GetServiceStatusRegionalExecute(r ApiGetServiceStatusRegionalRequest) (*ServiceStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServiceStatusRegional") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", url.PathEscape(parameterValueToString(r.serviceId, "serviceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListServiceStatusRegionalRequest struct { + ctx context.Context + ApiService DefaultAPI + region string + projectId string + cursor *string +} + +func (r ApiListServiceStatusRegionalRequest) Cursor(cursor string) ApiListServiceStatusRegionalRequest { + r.cursor = &cursor + return r +} + +func (r ApiListServiceStatusRegionalRequest) Execute() (*ListServiceStatusRegional200Response, *http.Response, error) { + return r.ApiService.ListServiceStatusRegionalExecute(r) +} + +/* +ListServiceStatusRegional Method for ListServiceStatusRegional + +returns a list of all available services for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @return ApiListServiceStatusRegionalRequest +*/ +func (a *DefaultAPIService) ListServiceStatusRegional(ctx context.Context, region string, projectId string) ApiListServiceStatusRegionalRequest { + return ApiListServiceStatusRegionalRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListServiceStatusRegional200Response +func (a *DefaultAPIService) ListServiceStatusRegionalExecute(r ApiListServiceStatusRegionalRequest) (*ListServiceStatusRegional200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListServiceStatusRegional200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServiceStatusRegional") + if err != nil { + return localVarReturnValue, nil, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/services" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cursor != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cursor", r.cursor, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/serviceenablement/v2api/api_default_mock.go b/services/serviceenablement/v2api/api_default_mock.go new file mode 100644 index 000000000..16bdb080a --- /dev/null +++ b/services/serviceenablement/v2api/api_default_mock.go @@ -0,0 +1,109 @@ +/* +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 ( + "context" + "net/http" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // DisableServiceRegionalExecuteMock can be populated to implement the behavior of the DisableServiceRegionalExecute function of this mock + DisableServiceRegionalExecuteMock *func(r ApiDisableServiceRegionalRequest) (*http.Response, error) + // EnableServiceRegionalExecuteMock can be populated to implement the behavior of the EnableServiceRegionalExecute function of this mock + EnableServiceRegionalExecuteMock *func(r ApiEnableServiceRegionalRequest) (*http.Response, error) + // GetServiceStatusRegionalExecuteMock can be populated to implement the behavior of the GetServiceStatusRegionalExecute function of this mock + GetServiceStatusRegionalExecuteMock *func(r ApiGetServiceStatusRegionalRequest) (*ServiceStatus, *http.Response, error) + // ListServiceStatusRegionalExecuteMock can be populated to implement the behavior of the ListServiceStatusRegionalExecute function of this mock + ListServiceStatusRegionalExecuteMock *func(r ApiListServiceStatusRegionalRequest) (*ListServiceStatusRegional200Response, *http.Response, error) +} + +func (a DefaultAPIServiceMock) DisableServiceRegional(ctx context.Context, region string, projectId string, serviceId string) ApiDisableServiceRegionalRequest { + return ApiDisableServiceRegionalRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + serviceId: serviceId, + } +} + +// DisableServiceRegionalExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DisableServiceRegionalExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DisableServiceRegionalExecute(r ApiDisableServiceRegionalRequest) (*http.Response, error) { + if a.DisableServiceRegionalExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.DisableServiceRegionalExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) EnableServiceRegional(ctx context.Context, region string, projectId string, serviceId string) ApiEnableServiceRegionalRequest { + return ApiEnableServiceRegionalRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + serviceId: serviceId, + } +} + +// EnableServiceRegionalExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the EnableServiceRegionalExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) EnableServiceRegionalExecute(r ApiEnableServiceRegionalRequest) (*http.Response, error) { + if a.EnableServiceRegionalExecuteMock == nil { + return &http.Response{}, nil + } + + return (*a.EnableServiceRegionalExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetServiceStatusRegional(ctx context.Context, region string, projectId string, serviceId string) ApiGetServiceStatusRegionalRequest { + return ApiGetServiceStatusRegionalRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + serviceId: serviceId, + } +} + +// GetServiceStatusRegionalExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServiceStatusRegionalExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServiceStatusRegionalExecute(r ApiGetServiceStatusRegionalRequest) (*ServiceStatus, *http.Response, error) { + if a.GetServiceStatusRegionalExecuteMock == nil { + var localVarReturnValue *ServiceStatus + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.GetServiceStatusRegionalExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListServiceStatusRegional(ctx context.Context, region string, projectId string) ApiListServiceStatusRegionalRequest { + return ApiListServiceStatusRegionalRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + } +} + +// ListServiceStatusRegionalExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServiceStatusRegionalExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServiceStatusRegionalExecute(r ApiListServiceStatusRegionalRequest) (*ListServiceStatusRegional200Response, *http.Response, error) { + if a.ListServiceStatusRegionalExecuteMock == nil { + var localVarReturnValue *ListServiceStatusRegional200Response + return localVarReturnValue, &http.Response{}, nil + } + + return (*a.ListServiceStatusRegionalExecuteMock)(r) +} diff --git a/services/serviceenablement/v2api/client.go b/services/serviceenablement/v2api/client.go new file mode 100644 index 000000000..3d01d9f07 --- /dev/null +++ b/services/serviceenablement/v2api/client.go @@ -0,0 +1,658 @@ +/* +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 ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT Service Enablement API API v2.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/serviceenablement/v2api/configuration.go b/services/serviceenablement/v2api/configuration.go new file mode 100644 index 000000000..2be2170e0 --- /dev/null +++ b/services/serviceenablement/v2api/configuration.go @@ -0,0 +1,37 @@ +/* +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 ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/serviceenablement", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://service-enablement.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/serviceenablement/v2api/model_action_error.go b/services/serviceenablement/v2api/model_action_error.go new file mode 100644 index 000000000..89b653f9e --- /dev/null +++ b/services/serviceenablement/v2api/model_action_error.go @@ -0,0 +1,199 @@ +/* +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" +) + +// checks if the ActionError type satisfies the MappedNullable interface at compile time +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"` + // the error code if provided by the service + Code *string `json:"code,omitempty"` + // the error reason provided by the service + Reason *string `json:"reason,omitempty"` +} + +// NewActionError instantiates a new ActionError 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 NewActionError() *ActionError { + this := ActionError{} + return &this +} + +// NewActionErrorWithDefaults instantiates a new ActionError 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 NewActionErrorWithDefaults() *ActionError { + this := ActionError{} + return &this +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *ActionError) GetAction() string { + if o == nil || IsNil(o.Action) { + var ret string + return ret + } + return *o.Action +} + +// 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) { + if o == nil || IsNil(o.Action) { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *ActionError) HasAction() bool { + if o != nil && !IsNil(o.Action) { + return true + } + + return false +} + +// SetAction gets a reference to the given string and assigns it to the Action field. +func (o *ActionError) SetAction(v string) { + o.Action = &v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *ActionError) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// 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 *ActionError) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *ActionError) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *ActionError) SetCode(v string) { + o.Code = &v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *ActionError) GetReason() string { + if o == nil || IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionError) GetReasonOk() (*string, bool) { + if o == nil || IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *ActionError) HasReason() bool { + if o != nil && !IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *ActionError) SetReason(v string) { + o.Reason = &v +} + +func (o ActionError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActionError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Action) { + toSerialize["action"] = o.Action + } + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + return toSerialize, nil +} + +type NullableActionError struct { + value *ActionError + isSet bool +} + +func (v NullableActionError) Get() *ActionError { + return v.value +} + +func (v *NullableActionError) Set(val *ActionError) { + v.value = val + v.isSet = true +} + +func (v NullableActionError) IsSet() bool { + return v.isSet +} + +func (v *NullableActionError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActionError(val *ActionError) *NullableActionError { + return &NullableActionError{value: val, isSet: true} +} + +func (v NullableActionError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActionError) 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 new file mode 100644 index 000000000..798fd5cb7 --- /dev/null +++ b/services/serviceenablement/v2api/model_check_service.go @@ -0,0 +1,202 @@ +/* +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" +) + +// checks if the CheckService type satisfies the MappedNullable interface at compile time +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"` + // the id of the service + ServiceId *string `json:"serviceId,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$"` +} + +// NewCheckService instantiates a new CheckService 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 NewCheckService() *CheckService { + this := CheckService{} + var resourceType string = "project" + this.ResourceType = &resourceType + return &this +} + +// NewCheckServiceWithDefaults instantiates a new CheckService 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 NewCheckServiceWithDefaults() *CheckService { + this := CheckService{} + var resourceType string = "project" + this.ResourceType = &resourceType + return &this +} + +// GetResource returns the Resource field value if set, zero value otherwise. +func (o *CheckService) GetResource() string { + if o == nil || IsNil(o.Resource) { + var ret string + return ret + } + return *o.Resource +} + +// GetResourceOk returns a tuple with the Resource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckService) GetResourceOk() (*string, bool) { + if o == nil || IsNil(o.Resource) { + return nil, false + } + return o.Resource, true +} + +// HasResource returns a boolean if a field has been set. +func (o *CheckService) HasResource() bool { + if o != nil && !IsNil(o.Resource) { + return true + } + + return false +} + +// SetResource gets a reference to the given string and assigns it to the Resource field. +func (o *CheckService) SetResource(v string) { + o.Resource = &v +} + +// GetResourceType returns the ResourceType field value if set, zero value otherwise. +func (o *CheckService) GetResourceType() string { + if o == nil || IsNil(o.ResourceType) { + var ret string + return ret + } + return *o.ResourceType +} + +// 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) { + if o == nil || IsNil(o.ResourceType) { + return nil, false + } + return o.ResourceType, true +} + +// HasResourceType returns a boolean if a field has been set. +func (o *CheckService) HasResourceType() bool { + if o != nil && !IsNil(o.ResourceType) { + return true + } + + return false +} + +// SetResourceType gets a reference to the given string and assigns it to the ResourceType field. +func (o *CheckService) SetResourceType(v string) { + o.ResourceType = &v +} + +// GetServiceId returns the ServiceId field value if set, zero value otherwise. +func (o *CheckService) GetServiceId() string { + if o == nil || IsNil(o.ServiceId) { + var ret string + return ret + } + return *o.ServiceId +} + +// GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckService) GetServiceIdOk() (*string, bool) { + if o == nil || IsNil(o.ServiceId) { + return nil, false + } + return o.ServiceId, true +} + +// HasServiceId returns a boolean if a field has been set. +func (o *CheckService) HasServiceId() bool { + if o != nil && !IsNil(o.ServiceId) { + return true + } + + return false +} + +// SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +func (o *CheckService) SetServiceId(v string) { + o.ServiceId = &v +} + +func (o CheckService) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CheckService) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Resource) { + toSerialize["resource"] = o.Resource + } + if !IsNil(o.ResourceType) { + toSerialize["resourceType"] = o.ResourceType + } + if !IsNil(o.ServiceId) { + toSerialize["serviceId"] = o.ServiceId + } + return toSerialize, nil +} + +type NullableCheckService struct { + value *CheckService + isSet bool +} + +func (v NullableCheckService) Get() *CheckService { + return v.value +} + +func (v *NullableCheckService) Set(val *CheckService) { + v.value = val + v.isSet = true +} + +func (v NullableCheckService) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckService) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckService(val *CheckService) *NullableCheckService { + return &NullableCheckService{value: val, isSet: true} +} + +func (v NullableCheckService) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckService) 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 new file mode 100644 index 000000000..5126f5f95 --- /dev/null +++ b/services/serviceenablement/v2api/model_cloud_service.go @@ -0,0 +1,237 @@ +/* +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" +) + +// checks if the CloudService type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloudService{} + +// CloudService struct for CloudService +type CloudService struct { + Dependencies *Dependencies `json:"dependencies,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + Scope *string `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}$"` +} + +// NewCloudService instantiates a new CloudService 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 NewCloudService() *CloudService { + this := CloudService{} + var scope string = "PUBLIC" + this.Scope = &scope + return &this +} + +// NewCloudServiceWithDefaults instantiates a new CloudService 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 NewCloudServiceWithDefaults() *CloudService { + this := CloudService{} + var scope string = "PUBLIC" + this.Scope = &scope + return &this +} + +// GetDependencies returns the Dependencies field value if set, zero value otherwise. +func (o *CloudService) GetDependencies() Dependencies { + if o == nil || IsNil(o.Dependencies) { + var ret Dependencies + return ret + } + return *o.Dependencies +} + +// GetDependenciesOk returns a tuple with the Dependencies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloudService) GetDependenciesOk() (*Dependencies, bool) { + if o == nil || IsNil(o.Dependencies) { + return nil, false + } + return o.Dependencies, true +} + +// HasDependencies returns a boolean if a field has been set. +func (o *CloudService) HasDependencies() bool { + if o != nil && !IsNil(o.Dependencies) { + return true + } + + return false +} + +// SetDependencies gets a reference to the given Dependencies and assigns it to the Dependencies field. +func (o *CloudService) SetDependencies(v Dependencies) { + o.Dependencies = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CloudService) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloudService) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CloudService) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CloudService) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *CloudService) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// 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) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *CloudService) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *CloudService) SetScope(v string) { + o.Scope = &v +} + +// GetServiceId returns the ServiceId field value if set, zero value otherwise. +func (o *CloudService) GetServiceId() string { + if o == nil || IsNil(o.ServiceId) { + var ret string + return ret + } + return *o.ServiceId +} + +// GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloudService) GetServiceIdOk() (*string, bool) { + if o == nil || IsNil(o.ServiceId) { + return nil, false + } + return o.ServiceId, true +} + +// HasServiceId returns a boolean if a field has been set. +func (o *CloudService) HasServiceId() bool { + if o != nil && !IsNil(o.ServiceId) { + return true + } + + return false +} + +// SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +func (o *CloudService) SetServiceId(v string) { + o.ServiceId = &v +} + +func (o CloudService) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloudService) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dependencies) { + toSerialize["dependencies"] = o.Dependencies + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.ServiceId) { + toSerialize["serviceId"] = o.ServiceId + } + return toSerialize, nil +} + +type NullableCloudService struct { + value *CloudService + isSet bool +} + +func (v NullableCloudService) Get() *CloudService { + return v.value +} + +func (v *NullableCloudService) Set(val *CloudService) { + v.value = val + v.isSet = true +} + +func (v NullableCloudService) IsSet() bool { + return v.isSet +} + +func (v *NullableCloudService) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloudService(val *CloudService) *NullableCloudService { + return &NullableCloudService{value: val, isSet: true} +} + +func (v NullableCloudService) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloudService) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_dependencies.go b/services/serviceenablement/v2api/model_dependencies.go new file mode 100644 index 000000000..ca8322bde --- /dev/null +++ b/services/serviceenablement/v2api/model_dependencies.go @@ -0,0 +1,162 @@ +/* +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" +) + +// checks if the Dependencies type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Dependencies{} + +// Dependencies struct for Dependencies +type Dependencies struct { + // a list of service IDs which this service depend on. If the service is enabled, those service are enabled as well automatically. + Hard []string `json:"hard,omitempty"` + // a list of service IDs which this service depend on. When they are disabled a notification is sent. + Soft []string `json:"soft,omitempty"` +} + +// NewDependencies instantiates a new Dependencies 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 NewDependencies() *Dependencies { + this := Dependencies{} + return &this +} + +// NewDependenciesWithDefaults instantiates a new Dependencies 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 NewDependenciesWithDefaults() *Dependencies { + this := Dependencies{} + return &this +} + +// GetHard returns the Hard field value if set, zero value otherwise. +func (o *Dependencies) GetHard() []string { + if o == nil || IsNil(o.Hard) { + var ret []string + return ret + } + return o.Hard +} + +// GetHardOk returns a tuple with the Hard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Dependencies) GetHardOk() ([]string, bool) { + if o == nil || IsNil(o.Hard) { + return nil, false + } + return o.Hard, true +} + +// HasHard returns a boolean if a field has been set. +func (o *Dependencies) HasHard() bool { + if o != nil && !IsNil(o.Hard) { + return true + } + + return false +} + +// SetHard gets a reference to the given []string and assigns it to the Hard field. +func (o *Dependencies) SetHard(v []string) { + o.Hard = v +} + +// GetSoft returns the Soft field value if set, zero value otherwise. +func (o *Dependencies) GetSoft() []string { + if o == nil || IsNil(o.Soft) { + var ret []string + return ret + } + return o.Soft +} + +// GetSoftOk returns a tuple with the Soft field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Dependencies) GetSoftOk() ([]string, bool) { + if o == nil || IsNil(o.Soft) { + return nil, false + } + return o.Soft, true +} + +// HasSoft returns a boolean if a field has been set. +func (o *Dependencies) HasSoft() bool { + if o != nil && !IsNil(o.Soft) { + return true + } + + return false +} + +// SetSoft gets a reference to the given []string and assigns it to the Soft field. +func (o *Dependencies) SetSoft(v []string) { + o.Soft = v +} + +func (o Dependencies) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Dependencies) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hard) { + toSerialize["hard"] = o.Hard + } + if !IsNil(o.Soft) { + toSerialize["soft"] = o.Soft + } + return toSerialize, nil +} + +type NullableDependencies struct { + value *Dependencies + isSet bool +} + +func (v NullableDependencies) Get() *Dependencies { + return v.value +} + +func (v *NullableDependencies) Set(val *Dependencies) { + v.value = val + v.isSet = true +} + +func (v NullableDependencies) IsSet() bool { + return v.isSet +} + +func (v *NullableDependencies) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDependencies(val *Dependencies) *NullableDependencies { + return &NullableDependencies{value: val, isSet: true} +} + +func (v NullableDependencies) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDependencies) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_error_response.go b/services/serviceenablement/v2api/model_error_response.go new file mode 100644 index 000000000..cabb41a4c --- /dev/null +++ b/services/serviceenablement/v2api/model_error_response.go @@ -0,0 +1,269 @@ +/* +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" + "time" +) + +// checks if the ErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorResponse{} + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Error *string `json:"error,omitempty"` + Message *string `json:"message,omitempty"` + Path *string `json:"path,omitempty"` + Status *int32 `json:"status,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewErrorResponse instantiates a new ErrorResponse 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 NewErrorResponse() *ErrorResponse { + this := ErrorResponse{} + return &this +} + +// NewErrorResponseWithDefaults instantiates a new ErrorResponse 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 NewErrorResponseWithDefaults() *ErrorResponse { + this := ErrorResponse{} + return &this +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ErrorResponse) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ErrorResponse) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *ErrorResponse) SetError(v string) { + o.Error = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ErrorResponse) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ErrorResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ErrorResponse) SetMessage(v string) { + o.Message = &v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *ErrorResponse) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *ErrorResponse) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *ErrorResponse) SetPath(v string) { + o.Path = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ErrorResponse) GetStatus() int32 { + if o == nil || IsNil(o.Status) { + var ret int32 + return ret + } + return *o.Status +} + +// 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 *ErrorResponse) GetStatusOk() (*int32, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *ErrorResponse) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given int32 and assigns it to the Status field. +func (o *ErrorResponse) SetStatus(v int32) { + o.Status = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *ErrorResponse) GetTimestamp() time.Time { + if o == nil || IsNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetTimestampOk() (*time.Time, bool) { + if o == nil || IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *ErrorResponse) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *ErrorResponse) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o ErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil +} + +type NullableErrorResponse struct { + value *ErrorResponse + isSet bool +} + +func (v NullableErrorResponse) Get() *ErrorResponse { + return v.value +} + +func (v *NullableErrorResponse) Set(val *ErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { + return &NullableErrorResponse{value: val, isSet: true} +} + +func (v NullableErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_list_service_status_regional_200_response.go b/services/serviceenablement/v2api/model_list_service_status_regional_200_response.go new file mode 100644 index 000000000..eab5a0177 --- /dev/null +++ b/services/serviceenablement/v2api/model_list_service_status_regional_200_response.go @@ -0,0 +1,160 @@ +/* +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" +) + +// checks if the ListServiceStatusRegional200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListServiceStatusRegional200Response{} + +// ListServiceStatusRegional200Response struct for ListServiceStatusRegional200Response +type ListServiceStatusRegional200Response struct { + Items []ServiceStatus `json:"items,omitempty"` + NextCursor *string `json:"nextCursor,omitempty"` +} + +// NewListServiceStatusRegional200Response instantiates a new ListServiceStatusRegional200Response 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 NewListServiceStatusRegional200Response() *ListServiceStatusRegional200Response { + this := ListServiceStatusRegional200Response{} + return &this +} + +// NewListServiceStatusRegional200ResponseWithDefaults instantiates a new ListServiceStatusRegional200Response 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 NewListServiceStatusRegional200ResponseWithDefaults() *ListServiceStatusRegional200Response { + this := ListServiceStatusRegional200Response{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListServiceStatusRegional200Response) GetItems() []ServiceStatus { + if o == nil || IsNil(o.Items) { + var ret []ServiceStatus + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListServiceStatusRegional200Response) GetItemsOk() ([]ServiceStatus, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListServiceStatusRegional200Response) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []ServiceStatus and assigns it to the Items field. +func (o *ListServiceStatusRegional200Response) SetItems(v []ServiceStatus) { + o.Items = v +} + +// GetNextCursor returns the NextCursor field value if set, zero value otherwise. +func (o *ListServiceStatusRegional200Response) GetNextCursor() string { + if o == nil || IsNil(o.NextCursor) { + var ret string + return ret + } + return *o.NextCursor +} + +// GetNextCursorOk returns a tuple with the NextCursor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListServiceStatusRegional200Response) GetNextCursorOk() (*string, bool) { + if o == nil || IsNil(o.NextCursor) { + return nil, false + } + return o.NextCursor, true +} + +// HasNextCursor returns a boolean if a field has been set. +func (o *ListServiceStatusRegional200Response) HasNextCursor() bool { + if o != nil && !IsNil(o.NextCursor) { + return true + } + + return false +} + +// SetNextCursor gets a reference to the given string and assigns it to the NextCursor field. +func (o *ListServiceStatusRegional200Response) SetNextCursor(v string) { + o.NextCursor = &v +} + +func (o ListServiceStatusRegional200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListServiceStatusRegional200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !IsNil(o.NextCursor) { + toSerialize["nextCursor"] = o.NextCursor + } + return toSerialize, nil +} + +type NullableListServiceStatusRegional200Response struct { + value *ListServiceStatusRegional200Response + isSet bool +} + +func (v NullableListServiceStatusRegional200Response) Get() *ListServiceStatusRegional200Response { + return v.value +} + +func (v *NullableListServiceStatusRegional200Response) Set(val *ListServiceStatusRegional200Response) { + v.value = val + v.isSet = true +} + +func (v NullableListServiceStatusRegional200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableListServiceStatusRegional200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListServiceStatusRegional200Response(val *ListServiceStatusRegional200Response) *NullableListServiceStatusRegional200Response { + return &NullableListServiceStatusRegional200Response{value: val, isSet: true} +} + +func (v NullableListServiceStatusRegional200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListServiceStatusRegional200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/model_parameters.go b/services/serviceenablement/v2api/model_parameters.go new file mode 100644 index 000000000..0e0c2baf3 --- /dev/null +++ b/services/serviceenablement/v2api/model_parameters.go @@ -0,0 +1,153 @@ +/* +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" +) + +// checks if the Parameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Parameters{} + +// Parameters service parameters +type Parameters struct { + General *ParametersGeneral `json:"general,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Parameters Parameters + +// NewParameters instantiates a new Parameters 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 NewParameters() *Parameters { + this := Parameters{} + return &this +} + +// NewParametersWithDefaults instantiates a new Parameters 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 NewParametersWithDefaults() *Parameters { + this := Parameters{} + return &this +} + +// GetGeneral returns the General field value if set, zero value otherwise. +func (o *Parameters) GetGeneral() ParametersGeneral { + if o == nil || IsNil(o.General) { + var ret ParametersGeneral + return ret + } + return *o.General +} + +// GetGeneralOk returns a tuple with the General field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Parameters) GetGeneralOk() (*ParametersGeneral, bool) { + if o == nil || IsNil(o.General) { + return nil, false + } + return o.General, true +} + +// HasGeneral returns a boolean if a field has been set. +func (o *Parameters) HasGeneral() bool { + if o != nil && !IsNil(o.General) { + return true + } + + return false +} + +// SetGeneral gets a reference to the given ParametersGeneral and assigns it to the General field. +func (o *Parameters) SetGeneral(v ParametersGeneral) { + o.General = &v +} + +func (o Parameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Parameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.General) { + toSerialize["general"] = o.General + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Parameters) UnmarshalJSON(data []byte) (err error) { + varParameters := _Parameters{} + + err = json.Unmarshal(data, &varParameters) + + if err != nil { + return err + } + + *o = Parameters(varParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "general") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableParameters struct { + value *Parameters + isSet bool +} + +func (v NullableParameters) Get() *Parameters { + return v.value +} + +func (v *NullableParameters) Set(val *Parameters) { + v.value = val + v.isSet = true +} + +func (v NullableParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParameters(val *Parameters) *NullableParameters { + return &NullableParameters{value: val, isSet: true} +} + +func (v NullableParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParameters) 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 new file mode 100644 index 000000000..05aafadcd --- /dev/null +++ b/services/serviceenablement/v2api/model_parameters_general.go @@ -0,0 +1,200 @@ +/* +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" +) + +// checks if the ParametersGeneral type satisfies the MappedNullable interface at compile time +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"` +} + +// NewParametersGeneral instantiates a new ParametersGeneral 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 NewParametersGeneral() *ParametersGeneral { + this := ParametersGeneral{} + var projectScope string = "PUBLIC" + this.ProjectScope = &projectScope + return &this +} + +// NewParametersGeneralWithDefaults instantiates a new ParametersGeneral 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 NewParametersGeneralWithDefaults() *ParametersGeneral { + this := ParametersGeneral{} + var projectScope string = "PUBLIC" + this.ProjectScope = &projectScope + return &this +} + +// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. +func (o *ParametersGeneral) GetOrganizationId() string { + if o == nil || IsNil(o.OrganizationId) { + var ret string + return ret + } + return *o.OrganizationId +} + +// GetOrganizationIdOk returns a tuple with the OrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ParametersGeneral) GetOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.OrganizationId) { + return nil, false + } + return o.OrganizationId, true +} + +// HasOrganizationId returns a boolean if a field has been set. +func (o *ParametersGeneral) HasOrganizationId() bool { + if o != nil && !IsNil(o.OrganizationId) { + return true + } + + return false +} + +// SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. +func (o *ParametersGeneral) SetOrganizationId(v string) { + o.OrganizationId = &v +} + +// GetProjectName returns the ProjectName field value if set, zero value otherwise. +func (o *ParametersGeneral) GetProjectName() string { + if o == nil || IsNil(o.ProjectName) { + var ret string + return ret + } + return *o.ProjectName +} + +// GetProjectNameOk returns a tuple with the ProjectName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ParametersGeneral) GetProjectNameOk() (*string, bool) { + if o == nil || IsNil(o.ProjectName) { + return nil, false + } + return o.ProjectName, true +} + +// HasProjectName returns a boolean if a field has been set. +func (o *ParametersGeneral) HasProjectName() bool { + if o != nil && !IsNil(o.ProjectName) { + return true + } + + return false +} + +// SetProjectName gets a reference to the given string and assigns it to the ProjectName field. +func (o *ParametersGeneral) SetProjectName(v string) { + o.ProjectName = &v +} + +// GetProjectScope returns the ProjectScope field value if set, zero value otherwise. +func (o *ParametersGeneral) GetProjectScope() string { + if o == nil || IsNil(o.ProjectScope) { + var ret string + return ret + } + return *o.ProjectScope +} + +// 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) { + if o == nil || IsNil(o.ProjectScope) { + return nil, false + } + return o.ProjectScope, true +} + +// HasProjectScope returns a boolean if a field has been set. +func (o *ParametersGeneral) HasProjectScope() bool { + if o != nil && !IsNil(o.ProjectScope) { + return true + } + + return false +} + +// SetProjectScope gets a reference to the given string and assigns it to the ProjectScope field. +func (o *ParametersGeneral) SetProjectScope(v string) { + o.ProjectScope = &v +} + +func (o ParametersGeneral) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ParametersGeneral) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.OrganizationId) { + toSerialize["organizationId"] = o.OrganizationId + } + if !IsNil(o.ProjectName) { + toSerialize["projectName"] = o.ProjectName + } + if !IsNil(o.ProjectScope) { + toSerialize["projectScope"] = o.ProjectScope + } + return toSerialize, nil +} + +type NullableParametersGeneral struct { + value *ParametersGeneral + isSet bool +} + +func (v NullableParametersGeneral) Get() *ParametersGeneral { + return v.value +} + +func (v *NullableParametersGeneral) Set(val *ParametersGeneral) { + v.value = val + v.isSet = true +} + +func (v NullableParametersGeneral) IsSet() bool { + return v.isSet +} + +func (v *NullableParametersGeneral) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParametersGeneral(val *ParametersGeneral) *NullableParametersGeneral { + return &NullableParametersGeneral{value: val, isSet: true} +} + +func (v NullableParametersGeneral) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParametersGeneral) 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 new file mode 100644 index 000000000..c460fcac6 --- /dev/null +++ b/services/serviceenablement/v2api/model_service_status.go @@ -0,0 +1,430 @@ +/* +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" +) + +// checks if the ServiceStatus type satisfies the MappedNullable interface at compile time +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"` + // 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"` +} + +// NewServiceStatus instantiates a new ServiceStatus 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 NewServiceStatus() *ServiceStatus { + this := ServiceStatus{} + var enablement string = "REQUEST" + this.Enablement = &enablement + var lifecycle string = "FLEX" + this.Lifecycle = &lifecycle + var scope string = "PUBLIC" + this.Scope = &scope + var state string = "ENABLED" + this.State = &state + return &this +} + +// NewServiceStatusWithDefaults instantiates a new ServiceStatus 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 NewServiceStatusWithDefaults() *ServiceStatus { + this := ServiceStatus{} + var enablement string = "REQUEST" + this.Enablement = &enablement + var lifecycle string = "FLEX" + this.Lifecycle = &lifecycle + var scope string = "PUBLIC" + this.Scope = &scope + var state string = "ENABLED" + this.State = &state + return &this +} + +// GetDependencies returns the Dependencies field value if set, zero value otherwise. +func (o *ServiceStatus) GetDependencies() Dependencies { + if o == nil || IsNil(o.Dependencies) { + var ret Dependencies + return ret + } + return *o.Dependencies +} + +// GetDependenciesOk returns a tuple with the Dependencies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetDependenciesOk() (*Dependencies, bool) { + if o == nil || IsNil(o.Dependencies) { + return nil, false + } + return o.Dependencies, true +} + +// HasDependencies returns a boolean if a field has been set. +func (o *ServiceStatus) HasDependencies() bool { + if o != nil && !IsNil(o.Dependencies) { + return true + } + + return false +} + +// SetDependencies gets a reference to the given Dependencies and assigns it to the Dependencies field. +func (o *ServiceStatus) SetDependencies(v Dependencies) { + o.Dependencies = &v +} + +// GetEnablement returns the Enablement field value if set, zero value otherwise. +func (o *ServiceStatus) GetEnablement() string { + if o == nil || IsNil(o.Enablement) { + var ret string + return ret + } + return *o.Enablement +} + +// 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) { + if o == nil || IsNil(o.Enablement) { + return nil, false + } + return o.Enablement, true +} + +// HasEnablement returns a boolean if a field has been set. +func (o *ServiceStatus) HasEnablement() bool { + if o != nil && !IsNil(o.Enablement) { + return true + } + + return false +} + +// SetEnablement gets a reference to the given string and assigns it to the Enablement field. +func (o *ServiceStatus) SetEnablement(v string) { + o.Enablement = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ServiceStatus) GetError() ActionError { + if o == nil || IsNil(o.Error) { + var ret ActionError + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetErrorOk() (*ActionError, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ServiceStatus) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given ActionError and assigns it to the Error field. +func (o *ServiceStatus) SetError(v ActionError) { + o.Error = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *ServiceStatus) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *ServiceStatus) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *ServiceStatus) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetLifecycle returns the Lifecycle field value if set, zero value otherwise. +func (o *ServiceStatus) GetLifecycle() string { + if o == nil || IsNil(o.Lifecycle) { + var ret string + return ret + } + return *o.Lifecycle +} + +// 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) { + if o == nil || IsNil(o.Lifecycle) { + return nil, false + } + return o.Lifecycle, true +} + +// HasLifecycle returns a boolean if a field has been set. +func (o *ServiceStatus) HasLifecycle() bool { + if o != nil && !IsNil(o.Lifecycle) { + return true + } + + return false +} + +// SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. +func (o *ServiceStatus) SetLifecycle(v string) { + o.Lifecycle = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *ServiceStatus) GetParameters() Parameters { + if o == nil || IsNil(o.Parameters) { + var ret Parameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetParametersOk() (*Parameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *ServiceStatus) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given Parameters and assigns it to the Parameters field. +func (o *ServiceStatus) SetParameters(v Parameters) { + o.Parameters = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *ServiceStatus) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// 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) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *ServiceStatus) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *ServiceStatus) SetScope(v string) { + o.Scope = &v +} + +// GetServiceId returns the ServiceId field value if set, zero value otherwise. +func (o *ServiceStatus) GetServiceId() string { + if o == nil || IsNil(o.ServiceId) { + var ret string + return ret + } + return *o.ServiceId +} + +// GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetServiceIdOk() (*string, bool) { + if o == nil || IsNil(o.ServiceId) { + return nil, false + } + return o.ServiceId, true +} + +// HasServiceId returns a boolean if a field has been set. +func (o *ServiceStatus) HasServiceId() bool { + if o != nil && !IsNil(o.ServiceId) { + return true + } + + return false +} + +// SetServiceId gets a reference to the given string and assigns it to the ServiceId field. +func (o *ServiceStatus) SetServiceId(v string) { + o.ServiceId = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *ServiceStatus) GetState() string { + if o == nil || IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceStatus) GetStateOk() (*string, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *ServiceStatus) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *ServiceStatus) SetState(v string) { + o.State = &v +} + +func (o ServiceStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dependencies) { + toSerialize["dependencies"] = o.Dependencies + } + if !IsNil(o.Enablement) { + toSerialize["enablement"] = o.Enablement + } + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Lifecycle) { + toSerialize["lifecycle"] = o.Lifecycle + } + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.ServiceId) { + toSerialize["serviceId"] = o.ServiceId + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + return toSerialize, nil +} + +type NullableServiceStatus struct { + value *ServiceStatus + isSet bool +} + +func (v NullableServiceStatus) Get() *ServiceStatus { + return v.value +} + +func (v *NullableServiceStatus) Set(val *ServiceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableServiceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceStatus(val *ServiceStatus) *NullableServiceStatus { + return &NullableServiceStatus{value: val, isSet: true} +} + +func (v NullableServiceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serviceenablement/v2api/response.go b/services/serviceenablement/v2api/response.go new file mode 100644 index 000000000..340cb00c7 --- /dev/null +++ b/services/serviceenablement/v2api/response.go @@ -0,0 +1,47 @@ +/* +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 ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/serviceenablement/v2api/utils.go b/services/serviceenablement/v2api/utils.go new file mode 100644 index 000000000..062599aee --- /dev/null +++ b/services/serviceenablement/v2api/utils.go @@ -0,0 +1,361 @@ +/* +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 ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/serviceenablement/wait/deprecation.go b/services/serviceenablement/wait/deprecation.go new file mode 100644 index 000000000..58f184c09 --- /dev/null +++ b/services/serviceenablement/wait/deprecation.go @@ -0,0 +1,2 @@ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package wait