diff --git a/CHANGELOG.md b/CHANGELOG.md index dd1d60e04..4d907122f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ - `postgresflex`: [v1.3.0](services/postgresflex/CHANGELOG.md#v130) - **Breaking Change:** The attribute type for `PartialUpdateInstancePayload` and `UpdateInstancePayload` changed from `Storage` to `StorageUpdate`. - **Deprecation:** `StorageUpdate`: updating the performance class field is not possible. +- `resourcemanager`: [v0.18.0](services/resourcemanager/CHANGELOG.md#v0180) + - **Feature:** Add `ContainerSearchResult` model for container search functionality +- `observability`: [v0.16.0](services/observability/CHANGELOG.md#v0160) + - **Breaking Change:** `PartialUpdateAlertrulesRequest` interface method renamed from `UpdateAlertgroupsRequestInnerRulesInner` to `PartialUpdateAlertrulesRequestInner` + - **Breaking Change:** `CreateLogsAlertgroupsPayload` now uses `CreateLogsAlertgroupsPayloadRulesInner` instead of `UpdateAlertgroupsRequestInnerRulesInner` + - **Breaking Change:** `UpdateLogsAlertgroupPayload` now uses `CreateLogsAlertgroupsPayloadRulesInner` instead of `UpdateAlertgroupsRequestInnerRulesInner` + - **Feature:** Field `alert` of `UpdateAlertgroupsRequestInnerRulesInner` is now optional + - **Feature:** Add `Record` field to `UpdateAlertgroupsRequestInnerRulesInner` + - **Feature:** Add new models `CreateLogsAlertgroupsPayloadRulesInner` and `PartialUpdateAlertrulesRequestInner` ## Release (2025-10-13) - `observability`: [v0.15.0](services/observability/CHANGELOG.md#v0150) diff --git a/services/observability/CHANGELOG.md b/services/observability/CHANGELOG.md index b9065d475..1aec48d31 100644 --- a/services/observability/CHANGELOG.md +++ b/services/observability/CHANGELOG.md @@ -1,3 +1,11 @@ +# v0.16.0 +- **Breaking Change:** `PartialUpdateAlertrulesRequest` interface method renamed from `UpdateAlertgroupsRequestInnerRulesInner` to `PartialUpdateAlertrulesRequestInner` +- **Breaking Change:** `CreateLogsAlertgroupsPayload` now uses `CreateLogsAlertgroupsPayloadRulesInner` instead of `UpdateAlertgroupsRequestInnerRulesInner` +- **Breaking Change:** `UpdateLogsAlertgroupPayload` now uses `CreateLogsAlertgroupsPayloadRulesInner` instead of `UpdateAlertgroupsRequestInnerRulesInner` +- **Feature:** Field `alert` of `UpdateAlertgroupsRequestInnerRulesInner` is now optional +- **Feature:** Add `Record` field to `UpdateAlertgroupsRequestInnerRulesInner` +- **Feature:** Add new models `CreateLogsAlertgroupsPayloadRulesInner` and `PartialUpdateAlertrulesRequestInner` + # v0.15.0 - **Deprecation:** The `JaegerHttpTracesUrl` field is now deprecated in all relevant models and will be removed after 9th April 2026. Use the new `JaegerHttpUrl` field instead. diff --git a/services/observability/VERSION b/services/observability/VERSION index 86dd09abc..cfe6c0094 100644 --- a/services/observability/VERSION +++ b/services/observability/VERSION @@ -1 +1 @@ -v0.15.0 +v0.16.0 diff --git a/services/observability/api_default.go b/services/observability/api_default.go index 9d5465d0e..f4a3f4cb5 100644 --- a/services/observability/api_default.go +++ b/services/observability/api_default.go @@ -1540,7 +1540,7 @@ type ApiPartialUpdateAlertgroupsRequest interface { } type ApiPartialUpdateAlertrulesRequest interface { - UpdateAlertgroupsRequestInnerRulesInner(updateAlertgroupsRequestInnerRulesInner []UpdateAlertgroupsRequestInnerRulesInner) ApiPartialUpdateAlertrulesRequest + PartialUpdateAlertrulesRequestInner(partialUpdateAlertrulesRequestInner []PartialUpdateAlertrulesRequestInner) ApiPartialUpdateAlertrulesRequest Execute() (*AlertRulesResponse, error) } @@ -8731,16 +8731,16 @@ func (a *APIClient) PartialUpdateAlertgroupsExecute(ctx context.Context, instanc } type PartialUpdateAlertrulesRequest struct { - ctx context.Context - apiService *DefaultApiService - groupName string - instanceId string - projectId string - updateAlertgroupsRequestInnerRulesInner *[]UpdateAlertgroupsRequestInnerRulesInner + ctx context.Context + apiService *DefaultApiService + groupName string + instanceId string + projectId string + partialUpdateAlertrulesRequestInner *[]PartialUpdateAlertrulesRequestInner } -func (r PartialUpdateAlertrulesRequest) UpdateAlertgroupsRequestInnerRulesInner(updateAlertgroupsRequestInnerRulesInner []UpdateAlertgroupsRequestInnerRulesInner) ApiPartialUpdateAlertrulesRequest { - r.updateAlertgroupsRequestInnerRulesInner = &updateAlertgroupsRequestInnerRulesInner +func (r PartialUpdateAlertrulesRequest) PartialUpdateAlertrulesRequestInner(partialUpdateAlertrulesRequestInner []PartialUpdateAlertrulesRequestInner) ApiPartialUpdateAlertrulesRequest { + r.partialUpdateAlertrulesRequestInner = &partialUpdateAlertrulesRequestInner return r } @@ -8769,8 +8769,8 @@ func (r PartialUpdateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.updateAlertgroupsRequestInnerRulesInner == nil { - return localVarReturnValue, fmt.Errorf("updateAlertgroupsRequestInnerRulesInner is required and must be specified") + if r.partialUpdateAlertrulesRequestInner == nil { + return localVarReturnValue, fmt.Errorf("partialUpdateAlertrulesRequestInner is required and must be specified") } // to determine the Content-Type header @@ -8791,7 +8791,7 @@ func (r PartialUpdateAlertrulesRequest) Execute() (*AlertRulesResponse, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateAlertgroupsRequestInnerRulesInner + localVarPostBody = r.partialUpdateAlertrulesRequestInner req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err diff --git a/services/observability/api_default_test.go b/services/observability/api_default_test.go index db36dedfe..9cb832ba0 100644 --- a/services/observability/api_default_test.go +++ b/services/observability/api_default_test.go @@ -2770,9 +2770,9 @@ func Test_observability_DefaultApiService(t *testing.T) { groupName := groupNameValue instanceId := instanceIdValue projectId := projectIdValue - updateAlertgroupsRequestInnerRulesInner := []UpdateAlertgroupsRequestInnerRulesInner{} + partialUpdateAlertrulesRequestInner := []PartialUpdateAlertrulesRequestInner{} - resp, reqErr := apiClient.PartialUpdateAlertrules(context.Background(), groupName, instanceId, projectId).UpdateAlertgroupsRequestInnerRulesInner(updateAlertgroupsRequestInnerRulesInner).Execute() + resp, reqErr := apiClient.PartialUpdateAlertrules(context.Background(), groupName, instanceId, projectId).PartialUpdateAlertrulesRequestInner(partialUpdateAlertrulesRequestInner).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) diff --git a/services/observability/model_create_alertgroups_payload.go b/services/observability/model_create_alertgroups_payload.go index 9e45886dd..e4c66033a 100644 --- a/services/observability/model_create_alertgroups_payload.go +++ b/services/observability/model_create_alertgroups_payload.go @@ -79,7 +79,7 @@ func setCreateAlertgroupsPayloadGetRulesAttributeType(arg *CreateAlertgroupsPayl *arg = &val } -// CreateAlertgroupsPayload Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. +// CreateAlertgroupsPayload Alert group that should be created or updated. `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. type CreateAlertgroupsPayload struct { // How often rules in the group are evaluated. `Additional Validators:` * must be a valid time string * should be >=60s Interval CreateAlertgroupsPayloadGetIntervalAttributeType `json:"interval,omitempty"` diff --git a/services/observability/model_create_logs_alertgroups_payload.go b/services/observability/model_create_logs_alertgroups_payload.go index 9ceb65a64..3f72298ec 100644 --- a/services/observability/model_create_logs_alertgroups_payload.go +++ b/services/observability/model_create_logs_alertgroups_payload.go @@ -64,9 +64,9 @@ type CreateLogsAlertgroupsPayloadGetNameRetType = string */ // isArray -type CreateLogsAlertgroupsPayloadGetRulesAttributeType = *[]UpdateAlertgroupsRequestInnerRulesInner -type CreateLogsAlertgroupsPayloadGetRulesArgType = []UpdateAlertgroupsRequestInnerRulesInner -type CreateLogsAlertgroupsPayloadGetRulesRetType = []UpdateAlertgroupsRequestInnerRulesInner +type CreateLogsAlertgroupsPayloadGetRulesAttributeType = *[]CreateLogsAlertgroupsPayloadRulesInner +type CreateLogsAlertgroupsPayloadGetRulesArgType = []CreateLogsAlertgroupsPayloadRulesInner +type CreateLogsAlertgroupsPayloadGetRulesRetType = []CreateLogsAlertgroupsPayloadRulesInner func getCreateLogsAlertgroupsPayloadGetRulesAttributeTypeOk(arg CreateLogsAlertgroupsPayloadGetRulesAttributeType) (ret CreateLogsAlertgroupsPayloadGetRulesRetType, ok bool) { if arg == nil { @@ -79,7 +79,7 @@ func setCreateLogsAlertgroupsPayloadGetRulesAttributeType(arg *CreateLogsAlertgr *arg = &val } -// CreateLogsAlertgroupsPayload Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. +// CreateLogsAlertgroupsPayload Alert group that should be created or updated. `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. type CreateLogsAlertgroupsPayload struct { // How often rules in the group are evaluated. `Additional Validators:` * must be a valid time string * should be >=60s Interval CreateLogsAlertgroupsPayloadGetIntervalAttributeType `json:"interval,omitempty"` diff --git a/services/observability/model_create_logs_alertgroups_payload_rules_inner.go b/services/observability/model_create_logs_alertgroups_payload_rules_inner.go new file mode 100644 index 000000000..5d8d6dd2b --- /dev/null +++ b/services/observability/model_create_logs_alertgroups_payload_rules_inner.go @@ -0,0 +1,372 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the CreateLogsAlertgroupsPayloadRulesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateLogsAlertgroupsPayloadRulesInner{} + +/* + types and functions for alert +*/ + +// isNotNullableString +type CreateLogsAlertgroupsPayloadRulesInnerGetAlertAttributeType = *string + +func getCreateLogsAlertgroupsPayloadRulesInnerGetAlertAttributeTypeOk(arg CreateLogsAlertgroupsPayloadRulesInnerGetAlertAttributeType) (ret CreateLogsAlertgroupsPayloadRulesInnerGetAlertRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateLogsAlertgroupsPayloadRulesInnerGetAlertAttributeType(arg *CreateLogsAlertgroupsPayloadRulesInnerGetAlertAttributeType, val CreateLogsAlertgroupsPayloadRulesInnerGetAlertRetType) { + *arg = &val +} + +type CreateLogsAlertgroupsPayloadRulesInnerGetAlertArgType = string +type CreateLogsAlertgroupsPayloadRulesInnerGetAlertRetType = string + +/* + types and functions for annotations +*/ + +// isFreeform +type CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsAttributeType = *map[string]interface{} +type CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsArgType = map[string]interface{} +type CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsRetType = map[string]interface{} + +func getCreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsAttributeTypeOk(arg CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsAttributeType) (ret CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsAttributeType(arg *CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsAttributeType, val CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsRetType) { + *arg = &val +} + +/* + types and functions for expr +*/ + +// isNotNullableString +type CreateLogsAlertgroupsPayloadRulesInnerGetExprAttributeType = *string + +func getCreateLogsAlertgroupsPayloadRulesInnerGetExprAttributeTypeOk(arg CreateLogsAlertgroupsPayloadRulesInnerGetExprAttributeType) (ret CreateLogsAlertgroupsPayloadRulesInnerGetExprRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateLogsAlertgroupsPayloadRulesInnerGetExprAttributeType(arg *CreateLogsAlertgroupsPayloadRulesInnerGetExprAttributeType, val CreateLogsAlertgroupsPayloadRulesInnerGetExprRetType) { + *arg = &val +} + +type CreateLogsAlertgroupsPayloadRulesInnerGetExprArgType = string +type CreateLogsAlertgroupsPayloadRulesInnerGetExprRetType = string + +/* + types and functions for for +*/ + +// isNotNullableString +type CreateLogsAlertgroupsPayloadRulesInnerGetForAttributeType = *string + +func getCreateLogsAlertgroupsPayloadRulesInnerGetForAttributeTypeOk(arg CreateLogsAlertgroupsPayloadRulesInnerGetForAttributeType) (ret CreateLogsAlertgroupsPayloadRulesInnerGetForRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateLogsAlertgroupsPayloadRulesInnerGetForAttributeType(arg *CreateLogsAlertgroupsPayloadRulesInnerGetForAttributeType, val CreateLogsAlertgroupsPayloadRulesInnerGetForRetType) { + *arg = &val +} + +type CreateLogsAlertgroupsPayloadRulesInnerGetForArgType = string +type CreateLogsAlertgroupsPayloadRulesInnerGetForRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type CreateLogsAlertgroupsPayloadRulesInnerGetLabelsAttributeType = *map[string]interface{} +type CreateLogsAlertgroupsPayloadRulesInnerGetLabelsArgType = map[string]interface{} +type CreateLogsAlertgroupsPayloadRulesInnerGetLabelsRetType = map[string]interface{} + +func getCreateLogsAlertgroupsPayloadRulesInnerGetLabelsAttributeTypeOk(arg CreateLogsAlertgroupsPayloadRulesInnerGetLabelsAttributeType) (ret CreateLogsAlertgroupsPayloadRulesInnerGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateLogsAlertgroupsPayloadRulesInnerGetLabelsAttributeType(arg *CreateLogsAlertgroupsPayloadRulesInnerGetLabelsAttributeType, val CreateLogsAlertgroupsPayloadRulesInnerGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for record +*/ + +// isNotNullableString +type CreateLogsAlertgroupsPayloadRulesInnerGetRecordAttributeType = *string + +func getCreateLogsAlertgroupsPayloadRulesInnerGetRecordAttributeTypeOk(arg CreateLogsAlertgroupsPayloadRulesInnerGetRecordAttributeType) (ret CreateLogsAlertgroupsPayloadRulesInnerGetRecordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateLogsAlertgroupsPayloadRulesInnerGetRecordAttributeType(arg *CreateLogsAlertgroupsPayloadRulesInnerGetRecordAttributeType, val CreateLogsAlertgroupsPayloadRulesInnerGetRecordRetType) { + *arg = &val +} + +type CreateLogsAlertgroupsPayloadRulesInnerGetRecordArgType = string +type CreateLogsAlertgroupsPayloadRulesInnerGetRecordRetType = string + +// CreateLogsAlertgroupsPayloadRulesInner Rule definition. Must be either an Alerting Rule (using 'alert') or a Recording Rule (using 'record'). `Additional Validators:` * total config (all alert groups/rules) should not be bigger than 500000 characters as string since this the limitation of prometheus. +type CreateLogsAlertgroupsPayloadRulesInner struct { + // The name of the alert. When this attribute is used, an Alerting Rule will be created. `Additional Validators:` * is the identifier and so unique in the group * should only include the characters: a-zA-Z0-9- * required when 'record' is not used in this rule, otherwise not allowed + Alert CreateLogsAlertgroupsPayloadRulesInnerGetAlertAttributeType `json:"alert,omitempty"` + // Map of key:value. Annotations to add to each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters * is not allowed to use when 'record' is used in this rule + Annotations CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsAttributeType `json:"annotations,omitempty"` + // The LogQL expression to evaluate to create alerts when using the 'alert' attribute in this rule, or to create a metric when using the 'record' attribute. + // REQUIRED + Expr CreateLogsAlertgroupsPayloadRulesInnerGetExprAttributeType `json:"expr" required:"true"` + // Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. `Additional Validators:` * must be a valid time string * is not allowed to use when 'record' is used in this rule + For CreateLogsAlertgroupsPayloadRulesInnerGetForAttributeType `json:"for,omitempty"` + // Map of key:value. Labels to add or overwrite for each alert or metric. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters + Labels CreateLogsAlertgroupsPayloadRulesInnerGetLabelsAttributeType `json:"labels,omitempty"` + // The name of the metric. When this attribute is used, an Recording Rule will be created. `Additional Validators:` * is the identifier and so unique in the group * should only include the characters: a-zA-Z0-9:_ * required when 'alert' is not used in this rule, otherwise not allowed + Record CreateLogsAlertgroupsPayloadRulesInnerGetRecordAttributeType `json:"record,omitempty"` +} + +type _CreateLogsAlertgroupsPayloadRulesInner CreateLogsAlertgroupsPayloadRulesInner + +// NewCreateLogsAlertgroupsPayloadRulesInner instantiates a new CreateLogsAlertgroupsPayloadRulesInner 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 NewCreateLogsAlertgroupsPayloadRulesInner(expr CreateLogsAlertgroupsPayloadRulesInnerGetExprArgType) *CreateLogsAlertgroupsPayloadRulesInner { + this := CreateLogsAlertgroupsPayloadRulesInner{} + setCreateLogsAlertgroupsPayloadRulesInnerGetExprAttributeType(&this.Expr, expr) + return &this +} + +// NewCreateLogsAlertgroupsPayloadRulesInnerWithDefaults instantiates a new CreateLogsAlertgroupsPayloadRulesInner 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 NewCreateLogsAlertgroupsPayloadRulesInnerWithDefaults() *CreateLogsAlertgroupsPayloadRulesInner { + this := CreateLogsAlertgroupsPayloadRulesInner{} + var for_ string = "0s" + this.For = &for_ + return &this +} + +// GetAlert returns the Alert field value if set, zero value otherwise. +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetAlert() (res CreateLogsAlertgroupsPayloadRulesInnerGetAlertRetType) { + res, _ = o.GetAlertOk() + return +} + +// GetAlertOk returns a tuple with the Alert field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetAlertOk() (ret CreateLogsAlertgroupsPayloadRulesInnerGetAlertRetType, ok bool) { + return getCreateLogsAlertgroupsPayloadRulesInnerGetAlertAttributeTypeOk(o.Alert) +} + +// HasAlert returns a boolean if a field has been set. +func (o *CreateLogsAlertgroupsPayloadRulesInner) HasAlert() bool { + _, ok := o.GetAlertOk() + return ok +} + +// SetAlert gets a reference to the given string and assigns it to the Alert field. +func (o *CreateLogsAlertgroupsPayloadRulesInner) SetAlert(v CreateLogsAlertgroupsPayloadRulesInnerGetAlertRetType) { + setCreateLogsAlertgroupsPayloadRulesInnerGetAlertAttributeType(&o.Alert, v) +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise. +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetAnnotations() (res CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsRetType) { + res, _ = o.GetAnnotationsOk() + return +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetAnnotationsOk() (ret CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsRetType, ok bool) { + return getCreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsAttributeTypeOk(o.Annotations) +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *CreateLogsAlertgroupsPayloadRulesInner) HasAnnotations() bool { + _, ok := o.GetAnnotationsOk() + return ok +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *CreateLogsAlertgroupsPayloadRulesInner) SetAnnotations(v CreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsRetType) { + setCreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsAttributeType(&o.Annotations, v) +} + +// GetExpr returns the Expr field value +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetExpr() (ret CreateLogsAlertgroupsPayloadRulesInnerGetExprRetType) { + ret, _ = o.GetExprOk() + return ret +} + +// GetExprOk returns a tuple with the Expr field value +// and a boolean to check if the value has been set. +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetExprOk() (ret CreateLogsAlertgroupsPayloadRulesInnerGetExprRetType, ok bool) { + return getCreateLogsAlertgroupsPayloadRulesInnerGetExprAttributeTypeOk(o.Expr) +} + +// SetExpr sets field value +func (o *CreateLogsAlertgroupsPayloadRulesInner) SetExpr(v CreateLogsAlertgroupsPayloadRulesInnerGetExprRetType) { + setCreateLogsAlertgroupsPayloadRulesInnerGetExprAttributeType(&o.Expr, v) +} + +// GetFor returns the For field value if set, zero value otherwise. +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetFor() (res CreateLogsAlertgroupsPayloadRulesInnerGetForRetType) { + res, _ = o.GetForOk() + return +} + +// GetForOk returns a tuple with the For field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetForOk() (ret CreateLogsAlertgroupsPayloadRulesInnerGetForRetType, ok bool) { + return getCreateLogsAlertgroupsPayloadRulesInnerGetForAttributeTypeOk(o.For) +} + +// HasFor returns a boolean if a field has been set. +func (o *CreateLogsAlertgroupsPayloadRulesInner) HasFor() bool { + _, ok := o.GetForOk() + return ok +} + +// SetFor gets a reference to the given string and assigns it to the For field. +func (o *CreateLogsAlertgroupsPayloadRulesInner) SetFor(v CreateLogsAlertgroupsPayloadRulesInnerGetForRetType) { + setCreateLogsAlertgroupsPayloadRulesInnerGetForAttributeType(&o.For, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetLabels() (res CreateLogsAlertgroupsPayloadRulesInnerGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *CreateLogsAlertgroupsPayloadRulesInner) GetLabelsOk() (ret CreateLogsAlertgroupsPayloadRulesInnerGetLabelsRetType, ok bool) { + return getCreateLogsAlertgroupsPayloadRulesInnerGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateLogsAlertgroupsPayloadRulesInner) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateLogsAlertgroupsPayloadRulesInner) SetLabels(v CreateLogsAlertgroupsPayloadRulesInnerGetLabelsRetType) { + setCreateLogsAlertgroupsPayloadRulesInnerGetLabelsAttributeType(&o.Labels, v) +} + +// GetRecord returns the Record field value if set, zero value otherwise. +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetRecord() (res CreateLogsAlertgroupsPayloadRulesInnerGetRecordRetType) { + res, _ = o.GetRecordOk() + return +} + +// GetRecordOk returns a tuple with the Record field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLogsAlertgroupsPayloadRulesInner) GetRecordOk() (ret CreateLogsAlertgroupsPayloadRulesInnerGetRecordRetType, ok bool) { + return getCreateLogsAlertgroupsPayloadRulesInnerGetRecordAttributeTypeOk(o.Record) +} + +// HasRecord returns a boolean if a field has been set. +func (o *CreateLogsAlertgroupsPayloadRulesInner) HasRecord() bool { + _, ok := o.GetRecordOk() + return ok +} + +// SetRecord gets a reference to the given string and assigns it to the Record field. +func (o *CreateLogsAlertgroupsPayloadRulesInner) SetRecord(v CreateLogsAlertgroupsPayloadRulesInnerGetRecordRetType) { + setCreateLogsAlertgroupsPayloadRulesInnerGetRecordAttributeType(&o.Record, v) +} + +func (o CreateLogsAlertgroupsPayloadRulesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateLogsAlertgroupsPayloadRulesInnerGetAlertAttributeTypeOk(o.Alert); ok { + toSerialize["Alert"] = val + } + if val, ok := getCreateLogsAlertgroupsPayloadRulesInnerGetAnnotationsAttributeTypeOk(o.Annotations); ok { + toSerialize["Annotations"] = val + } + if val, ok := getCreateLogsAlertgroupsPayloadRulesInnerGetExprAttributeTypeOk(o.Expr); ok { + toSerialize["Expr"] = val + } + if val, ok := getCreateLogsAlertgroupsPayloadRulesInnerGetForAttributeTypeOk(o.For); ok { + toSerialize["For"] = val + } + if val, ok := getCreateLogsAlertgroupsPayloadRulesInnerGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateLogsAlertgroupsPayloadRulesInnerGetRecordAttributeTypeOk(o.Record); ok { + toSerialize["Record"] = val + } + return toSerialize, nil +} + +type NullableCreateLogsAlertgroupsPayloadRulesInner struct { + value *CreateLogsAlertgroupsPayloadRulesInner + isSet bool +} + +func (v NullableCreateLogsAlertgroupsPayloadRulesInner) Get() *CreateLogsAlertgroupsPayloadRulesInner { + return v.value +} + +func (v *NullableCreateLogsAlertgroupsPayloadRulesInner) Set(val *CreateLogsAlertgroupsPayloadRulesInner) { + v.value = val + v.isSet = true +} + +func (v NullableCreateLogsAlertgroupsPayloadRulesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateLogsAlertgroupsPayloadRulesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateLogsAlertgroupsPayloadRulesInner(val *CreateLogsAlertgroupsPayloadRulesInner) *NullableCreateLogsAlertgroupsPayloadRulesInner { + return &NullableCreateLogsAlertgroupsPayloadRulesInner{value: val, isSet: true} +} + +func (v NullableCreateLogsAlertgroupsPayloadRulesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateLogsAlertgroupsPayloadRulesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_logs_alertgroups_payload_rules_inner_test.go b/services/observability/model_create_logs_alertgroups_payload_rules_inner_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_create_logs_alertgroups_payload_rules_inner_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_partial_update_alertrules_request_inner.go b/services/observability/model_partial_update_alertrules_request_inner.go new file mode 100644 index 000000000..4d3094dc3 --- /dev/null +++ b/services/observability/model_partial_update_alertrules_request_inner.go @@ -0,0 +1,319 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability + +import ( + "encoding/json" +) + +// checks if the PartialUpdateAlertrulesRequestInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateAlertrulesRequestInner{} + +/* + types and functions for alert +*/ + +// isNotNullableString +type PartialUpdateAlertrulesRequestInnerGetAlertAttributeType = *string + +func getPartialUpdateAlertrulesRequestInnerGetAlertAttributeTypeOk(arg PartialUpdateAlertrulesRequestInnerGetAlertAttributeType) (ret PartialUpdateAlertrulesRequestInnerGetAlertRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateAlertrulesRequestInnerGetAlertAttributeType(arg *PartialUpdateAlertrulesRequestInnerGetAlertAttributeType, val PartialUpdateAlertrulesRequestInnerGetAlertRetType) { + *arg = &val +} + +type PartialUpdateAlertrulesRequestInnerGetAlertArgType = string +type PartialUpdateAlertrulesRequestInnerGetAlertRetType = string + +/* + types and functions for annotations +*/ + +// isFreeform +type PartialUpdateAlertrulesRequestInnerGetAnnotationsAttributeType = *map[string]interface{} +type PartialUpdateAlertrulesRequestInnerGetAnnotationsArgType = map[string]interface{} +type PartialUpdateAlertrulesRequestInnerGetAnnotationsRetType = map[string]interface{} + +func getPartialUpdateAlertrulesRequestInnerGetAnnotationsAttributeTypeOk(arg PartialUpdateAlertrulesRequestInnerGetAnnotationsAttributeType) (ret PartialUpdateAlertrulesRequestInnerGetAnnotationsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateAlertrulesRequestInnerGetAnnotationsAttributeType(arg *PartialUpdateAlertrulesRequestInnerGetAnnotationsAttributeType, val PartialUpdateAlertrulesRequestInnerGetAnnotationsRetType) { + *arg = &val +} + +/* + types and functions for expr +*/ + +// isNotNullableString +type PartialUpdateAlertrulesRequestInnerGetExprAttributeType = *string + +func getPartialUpdateAlertrulesRequestInnerGetExprAttributeTypeOk(arg PartialUpdateAlertrulesRequestInnerGetExprAttributeType) (ret PartialUpdateAlertrulesRequestInnerGetExprRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateAlertrulesRequestInnerGetExprAttributeType(arg *PartialUpdateAlertrulesRequestInnerGetExprAttributeType, val PartialUpdateAlertrulesRequestInnerGetExprRetType) { + *arg = &val +} + +type PartialUpdateAlertrulesRequestInnerGetExprArgType = string +type PartialUpdateAlertrulesRequestInnerGetExprRetType = string + +/* + types and functions for for +*/ + +// isNotNullableString +type PartialUpdateAlertrulesRequestInnerGetForAttributeType = *string + +func getPartialUpdateAlertrulesRequestInnerGetForAttributeTypeOk(arg PartialUpdateAlertrulesRequestInnerGetForAttributeType) (ret PartialUpdateAlertrulesRequestInnerGetForRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateAlertrulesRequestInnerGetForAttributeType(arg *PartialUpdateAlertrulesRequestInnerGetForAttributeType, val PartialUpdateAlertrulesRequestInnerGetForRetType) { + *arg = &val +} + +type PartialUpdateAlertrulesRequestInnerGetForArgType = string +type PartialUpdateAlertrulesRequestInnerGetForRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type PartialUpdateAlertrulesRequestInnerGetLabelsAttributeType = *map[string]interface{} +type PartialUpdateAlertrulesRequestInnerGetLabelsArgType = map[string]interface{} +type PartialUpdateAlertrulesRequestInnerGetLabelsRetType = map[string]interface{} + +func getPartialUpdateAlertrulesRequestInnerGetLabelsAttributeTypeOk(arg PartialUpdateAlertrulesRequestInnerGetLabelsAttributeType) (ret PartialUpdateAlertrulesRequestInnerGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateAlertrulesRequestInnerGetLabelsAttributeType(arg *PartialUpdateAlertrulesRequestInnerGetLabelsAttributeType, val PartialUpdateAlertrulesRequestInnerGetLabelsRetType) { + *arg = &val +} + +// PartialUpdateAlertrulesRequestInner Alert rule. `Additional Validators:` * total config (all alert groups/rules) should not be bigger than 500000 characters as string since this the limitation of prometheus. +type PartialUpdateAlertrulesRequestInner struct { + // The name of the alert. `Additional Validators:` * is the identifier and so unique in the group * should only include the characters: a-zA-Z0-9- + // REQUIRED + Alert PartialUpdateAlertrulesRequestInnerGetAlertAttributeType `json:"alert" required:"true"` + // map of key:value. Annotations to add to each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters + Annotations PartialUpdateAlertrulesRequestInnerGetAnnotationsAttributeType `json:"annotations,omitempty"` + // The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts. + // REQUIRED + Expr PartialUpdateAlertrulesRequestInnerGetExprAttributeType `json:"expr" required:"true"` + // Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. `Additional Validators:` * must be a valid time string + For PartialUpdateAlertrulesRequestInnerGetForAttributeType `json:"for,omitempty"` + // map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters + Labels PartialUpdateAlertrulesRequestInnerGetLabelsAttributeType `json:"labels,omitempty"` +} + +type _PartialUpdateAlertrulesRequestInner PartialUpdateAlertrulesRequestInner + +// NewPartialUpdateAlertrulesRequestInner instantiates a new PartialUpdateAlertrulesRequestInner 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 NewPartialUpdateAlertrulesRequestInner(alert PartialUpdateAlertrulesRequestInnerGetAlertArgType, expr PartialUpdateAlertrulesRequestInnerGetExprArgType) *PartialUpdateAlertrulesRequestInner { + this := PartialUpdateAlertrulesRequestInner{} + setPartialUpdateAlertrulesRequestInnerGetAlertAttributeType(&this.Alert, alert) + setPartialUpdateAlertrulesRequestInnerGetExprAttributeType(&this.Expr, expr) + return &this +} + +// NewPartialUpdateAlertrulesRequestInnerWithDefaults instantiates a new PartialUpdateAlertrulesRequestInner 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 NewPartialUpdateAlertrulesRequestInnerWithDefaults() *PartialUpdateAlertrulesRequestInner { + this := PartialUpdateAlertrulesRequestInner{} + var for_ string = "0s" + this.For = &for_ + return &this +} + +// GetAlert returns the Alert field value +func (o *PartialUpdateAlertrulesRequestInner) GetAlert() (ret PartialUpdateAlertrulesRequestInnerGetAlertRetType) { + ret, _ = o.GetAlertOk() + return ret +} + +// GetAlertOk returns a tuple with the Alert field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateAlertrulesRequestInner) GetAlertOk() (ret PartialUpdateAlertrulesRequestInnerGetAlertRetType, ok bool) { + return getPartialUpdateAlertrulesRequestInnerGetAlertAttributeTypeOk(o.Alert) +} + +// SetAlert sets field value +func (o *PartialUpdateAlertrulesRequestInner) SetAlert(v PartialUpdateAlertrulesRequestInnerGetAlertRetType) { + setPartialUpdateAlertrulesRequestInnerGetAlertAttributeType(&o.Alert, v) +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise. +func (o *PartialUpdateAlertrulesRequestInner) GetAnnotations() (res PartialUpdateAlertrulesRequestInnerGetAnnotationsRetType) { + res, _ = o.GetAnnotationsOk() + return +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateAlertrulesRequestInner) GetAnnotationsOk() (ret PartialUpdateAlertrulesRequestInnerGetAnnotationsRetType, ok bool) { + return getPartialUpdateAlertrulesRequestInnerGetAnnotationsAttributeTypeOk(o.Annotations) +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *PartialUpdateAlertrulesRequestInner) HasAnnotations() bool { + _, ok := o.GetAnnotationsOk() + return ok +} + +// SetAnnotations gets a reference to the given map[string]interface{} and assigns it to the Annotations field. +func (o *PartialUpdateAlertrulesRequestInner) SetAnnotations(v PartialUpdateAlertrulesRequestInnerGetAnnotationsRetType) { + setPartialUpdateAlertrulesRequestInnerGetAnnotationsAttributeType(&o.Annotations, v) +} + +// GetExpr returns the Expr field value +func (o *PartialUpdateAlertrulesRequestInner) GetExpr() (ret PartialUpdateAlertrulesRequestInnerGetExprRetType) { + ret, _ = o.GetExprOk() + return ret +} + +// GetExprOk returns a tuple with the Expr field value +// and a boolean to check if the value has been set. +func (o *PartialUpdateAlertrulesRequestInner) GetExprOk() (ret PartialUpdateAlertrulesRequestInnerGetExprRetType, ok bool) { + return getPartialUpdateAlertrulesRequestInnerGetExprAttributeTypeOk(o.Expr) +} + +// SetExpr sets field value +func (o *PartialUpdateAlertrulesRequestInner) SetExpr(v PartialUpdateAlertrulesRequestInnerGetExprRetType) { + setPartialUpdateAlertrulesRequestInnerGetExprAttributeType(&o.Expr, v) +} + +// GetFor returns the For field value if set, zero value otherwise. +func (o *PartialUpdateAlertrulesRequestInner) GetFor() (res PartialUpdateAlertrulesRequestInnerGetForRetType) { + res, _ = o.GetForOk() + return +} + +// GetForOk returns a tuple with the For field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateAlertrulesRequestInner) GetForOk() (ret PartialUpdateAlertrulesRequestInnerGetForRetType, ok bool) { + return getPartialUpdateAlertrulesRequestInnerGetForAttributeTypeOk(o.For) +} + +// HasFor returns a boolean if a field has been set. +func (o *PartialUpdateAlertrulesRequestInner) HasFor() bool { + _, ok := o.GetForOk() + return ok +} + +// SetFor gets a reference to the given string and assigns it to the For field. +func (o *PartialUpdateAlertrulesRequestInner) SetFor(v PartialUpdateAlertrulesRequestInnerGetForRetType) { + setPartialUpdateAlertrulesRequestInnerGetForAttributeType(&o.For, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateAlertrulesRequestInner) GetLabels() (res PartialUpdateAlertrulesRequestInnerGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// 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 *PartialUpdateAlertrulesRequestInner) GetLabelsOk() (ret PartialUpdateAlertrulesRequestInnerGetLabelsRetType, ok bool) { + return getPartialUpdateAlertrulesRequestInnerGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateAlertrulesRequestInner) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateAlertrulesRequestInner) SetLabels(v PartialUpdateAlertrulesRequestInnerGetLabelsRetType) { + setPartialUpdateAlertrulesRequestInnerGetLabelsAttributeType(&o.Labels, v) +} + +func (o PartialUpdateAlertrulesRequestInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPartialUpdateAlertrulesRequestInnerGetAlertAttributeTypeOk(o.Alert); ok { + toSerialize["Alert"] = val + } + if val, ok := getPartialUpdateAlertrulesRequestInnerGetAnnotationsAttributeTypeOk(o.Annotations); ok { + toSerialize["Annotations"] = val + } + if val, ok := getPartialUpdateAlertrulesRequestInnerGetExprAttributeTypeOk(o.Expr); ok { + toSerialize["Expr"] = val + } + if val, ok := getPartialUpdateAlertrulesRequestInnerGetForAttributeTypeOk(o.For); ok { + toSerialize["For"] = val + } + if val, ok := getPartialUpdateAlertrulesRequestInnerGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + return toSerialize, nil +} + +type NullablePartialUpdateAlertrulesRequestInner struct { + value *PartialUpdateAlertrulesRequestInner + isSet bool +} + +func (v NullablePartialUpdateAlertrulesRequestInner) Get() *PartialUpdateAlertrulesRequestInner { + return v.value +} + +func (v *NullablePartialUpdateAlertrulesRequestInner) Set(val *PartialUpdateAlertrulesRequestInner) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateAlertrulesRequestInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateAlertrulesRequestInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateAlertrulesRequestInner(val *PartialUpdateAlertrulesRequestInner) *NullablePartialUpdateAlertrulesRequestInner { + return &NullablePartialUpdateAlertrulesRequestInner{value: val, isSet: true} +} + +func (v NullablePartialUpdateAlertrulesRequestInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateAlertrulesRequestInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_partial_update_alertrules_request_inner_test.go b/services/observability/model_partial_update_alertrules_request_inner_test.go new file mode 100644 index 000000000..ae3f559ed --- /dev/null +++ b/services/observability/model_partial_update_alertrules_request_inner_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Observability API + +API endpoints for Observability on STACKIT + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package observability diff --git a/services/observability/model_update_alertgroup_payload.go b/services/observability/model_update_alertgroup_payload.go index 957007a86..145d01bb9 100644 --- a/services/observability/model_update_alertgroup_payload.go +++ b/services/observability/model_update_alertgroup_payload.go @@ -58,7 +58,7 @@ func setUpdateAlertgroupPayloadGetRulesAttributeType(arg *UpdateAlertgroupPayloa *arg = &val } -// UpdateAlertgroupPayload Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. +// UpdateAlertgroupPayload Alert group that should be created or updated. `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. type UpdateAlertgroupPayload struct { // How often rules in the group are evaluated. `Additional Validators:` * must be a valid time string * should be >=60s Interval UpdateAlertgroupPayloadGetIntervalAttributeType `json:"interval,omitempty"` diff --git a/services/observability/model_update_alertgroups_request_inner.go b/services/observability/model_update_alertgroups_request_inner.go index 7d4b40283..972b51171 100644 --- a/services/observability/model_update_alertgroups_request_inner.go +++ b/services/observability/model_update_alertgroups_request_inner.go @@ -79,7 +79,7 @@ func setUpdateAlertgroupsRequestInnerGetRulesAttributeType(arg *UpdateAlertgroup *arg = &val } -// UpdateAlertgroupsRequestInner Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. +// UpdateAlertgroupsRequestInner Alert group that should be created or updated. `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. type UpdateAlertgroupsRequestInner struct { // How often rules in the group are evaluated. `Additional Validators:` * must be a valid time string * should be >=60s Interval UpdateAlertgroupsRequestInnerGetIntervalAttributeType `json:"interval,omitempty"` diff --git a/services/observability/model_update_alertgroups_request_inner_rules_inner.go b/services/observability/model_update_alertgroups_request_inner_rules_inner.go index 9cafaff38..0d4e43d50 100644 --- a/services/observability/model_update_alertgroups_request_inner_rules_inner.go +++ b/services/observability/model_update_alertgroups_request_inner_rules_inner.go @@ -120,20 +120,42 @@ func setUpdateAlertgroupsRequestInnerRulesInnerGetLabelsAttributeType(arg *Updat *arg = &val } -// UpdateAlertgroupsRequestInnerRulesInner Alert rule. `Additional Validators:` * total config (all alert groups/rules) should not be bigger than 500000 characters as string since this the limitation of prometheus. +/* + types and functions for record +*/ + +// isNotNullableString +type UpdateAlertgroupsRequestInnerRulesInnerGetRecordAttributeType = *string + +func getUpdateAlertgroupsRequestInnerRulesInnerGetRecordAttributeTypeOk(arg UpdateAlertgroupsRequestInnerRulesInnerGetRecordAttributeType) (ret UpdateAlertgroupsRequestInnerRulesInnerGetRecordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAlertgroupsRequestInnerRulesInnerGetRecordAttributeType(arg *UpdateAlertgroupsRequestInnerRulesInnerGetRecordAttributeType, val UpdateAlertgroupsRequestInnerRulesInnerGetRecordRetType) { + *arg = &val +} + +type UpdateAlertgroupsRequestInnerRulesInnerGetRecordArgType = string +type UpdateAlertgroupsRequestInnerRulesInnerGetRecordRetType = string + +// UpdateAlertgroupsRequestInnerRulesInner Rule definition. Must be either an Alerting Rule (using 'alert') or a Recording Rule (using 'record'). `Additional Validators:` * total config (all alert groups/rules) should not be bigger than 500000 characters as string since this the limitation of prometheus. type UpdateAlertgroupsRequestInnerRulesInner struct { - // The name of the alert. `Additional Validators:` * is the identifier and so unique in the group * should only include the characters: a-zA-Z0-9- - // REQUIRED - Alert UpdateAlertgroupsRequestInnerRulesInnerGetAlertAttributeType `json:"alert" required:"true"` - // map of key:value. Annotations to add to each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters + // The name of the alert. When this attribute is used, an Alerting Rule will be created. `Additional Validators:` * is the identifier and so unique in the group * should only include the characters: a-zA-Z0-9- * required when 'record' is not used in this rule, otherwise not allowed + Alert UpdateAlertgroupsRequestInnerRulesInnerGetAlertAttributeType `json:"alert,omitempty"` + // Map of key:value. Annotations to add to each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters * is not allowed to use when 'record' is used in this rule Annotations UpdateAlertgroupsRequestInnerRulesInnerGetAnnotationsAttributeType `json:"annotations,omitempty"` - // The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts. + // The PromQL expression to evaluate to create alerts when using the 'alert' attribute in this rule, or to create a metric when using the 'record' attribute. // REQUIRED Expr UpdateAlertgroupsRequestInnerRulesInnerGetExprAttributeType `json:"expr" required:"true"` - // Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. `Additional Validators:` * must be a valid time string + // Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. `Additional Validators:` * must be a valid time string * is not allowed to use when 'record' is used in this rule For UpdateAlertgroupsRequestInnerRulesInnerGetForAttributeType `json:"for,omitempty"` - // map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters + // Map of key:value. Labels to add or overwrite for each alert or metric. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters Labels UpdateAlertgroupsRequestInnerRulesInnerGetLabelsAttributeType `json:"labels,omitempty"` + // The name of the metric. When this attribute is used, an Recording Rule will be created. `Additional Validators:` * is the identifier and so unique in the group * should only include the characters: a-zA-Z0-9:_ * required when 'alert' is not used in this rule, otherwise not allowed + Record UpdateAlertgroupsRequestInnerRulesInnerGetRecordAttributeType `json:"record,omitempty"` } type _UpdateAlertgroupsRequestInnerRulesInner UpdateAlertgroupsRequestInnerRulesInner @@ -142,9 +164,8 @@ type _UpdateAlertgroupsRequestInnerRulesInner UpdateAlertgroupsRequestInnerRules // 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 NewUpdateAlertgroupsRequestInnerRulesInner(alert UpdateAlertgroupsRequestInnerRulesInnerGetAlertArgType, expr UpdateAlertgroupsRequestInnerRulesInnerGetExprArgType) *UpdateAlertgroupsRequestInnerRulesInner { +func NewUpdateAlertgroupsRequestInnerRulesInner(expr UpdateAlertgroupsRequestInnerRulesInnerGetExprArgType) *UpdateAlertgroupsRequestInnerRulesInner { this := UpdateAlertgroupsRequestInnerRulesInner{} - setUpdateAlertgroupsRequestInnerRulesInnerGetAlertAttributeType(&this.Alert, alert) setUpdateAlertgroupsRequestInnerRulesInnerGetExprAttributeType(&this.Expr, expr) return &this } @@ -159,19 +180,25 @@ func NewUpdateAlertgroupsRequestInnerRulesInnerWithDefaults() *UpdateAlertgroups return &this } -// GetAlert returns the Alert field value -func (o *UpdateAlertgroupsRequestInnerRulesInner) GetAlert() (ret UpdateAlertgroupsRequestInnerRulesInnerGetAlertRetType) { - ret, _ = o.GetAlertOk() - return ret +// GetAlert returns the Alert field value if set, zero value otherwise. +func (o *UpdateAlertgroupsRequestInnerRulesInner) GetAlert() (res UpdateAlertgroupsRequestInnerRulesInnerGetAlertRetType) { + res, _ = o.GetAlertOk() + return } -// GetAlertOk returns a tuple with the Alert field value +// GetAlertOk returns a tuple with the Alert field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateAlertgroupsRequestInnerRulesInner) GetAlertOk() (ret UpdateAlertgroupsRequestInnerRulesInnerGetAlertRetType, ok bool) { return getUpdateAlertgroupsRequestInnerRulesInnerGetAlertAttributeTypeOk(o.Alert) } -// SetAlert sets field value +// HasAlert returns a boolean if a field has been set. +func (o *UpdateAlertgroupsRequestInnerRulesInner) HasAlert() bool { + _, ok := o.GetAlertOk() + return ok +} + +// SetAlert gets a reference to the given string and assigns it to the Alert field. func (o *UpdateAlertgroupsRequestInnerRulesInner) SetAlert(v UpdateAlertgroupsRequestInnerRulesInnerGetAlertRetType) { setUpdateAlertgroupsRequestInnerRulesInnerGetAlertAttributeType(&o.Alert, v) } @@ -262,6 +289,29 @@ func (o *UpdateAlertgroupsRequestInnerRulesInner) SetLabels(v UpdateAlertgroupsR setUpdateAlertgroupsRequestInnerRulesInnerGetLabelsAttributeType(&o.Labels, v) } +// GetRecord returns the Record field value if set, zero value otherwise. +func (o *UpdateAlertgroupsRequestInnerRulesInner) GetRecord() (res UpdateAlertgroupsRequestInnerRulesInnerGetRecordRetType) { + res, _ = o.GetRecordOk() + return +} + +// GetRecordOk returns a tuple with the Record field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAlertgroupsRequestInnerRulesInner) GetRecordOk() (ret UpdateAlertgroupsRequestInnerRulesInnerGetRecordRetType, ok bool) { + return getUpdateAlertgroupsRequestInnerRulesInnerGetRecordAttributeTypeOk(o.Record) +} + +// HasRecord returns a boolean if a field has been set. +func (o *UpdateAlertgroupsRequestInnerRulesInner) HasRecord() bool { + _, ok := o.GetRecordOk() + return ok +} + +// SetRecord gets a reference to the given string and assigns it to the Record field. +func (o *UpdateAlertgroupsRequestInnerRulesInner) SetRecord(v UpdateAlertgroupsRequestInnerRulesInnerGetRecordRetType) { + setUpdateAlertgroupsRequestInnerRulesInnerGetRecordAttributeType(&o.Record, v) +} + func (o UpdateAlertgroupsRequestInnerRulesInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateAlertgroupsRequestInnerRulesInnerGetAlertAttributeTypeOk(o.Alert); ok { @@ -279,6 +329,9 @@ func (o UpdateAlertgroupsRequestInnerRulesInner) ToMap() (map[string]interface{} if val, ok := getUpdateAlertgroupsRequestInnerRulesInnerGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val } + if val, ok := getUpdateAlertgroupsRequestInnerRulesInnerGetRecordAttributeTypeOk(o.Record); ok { + toSerialize["Record"] = val + } return toSerialize, nil } diff --git a/services/observability/model_update_logs_alertgroup_payload.go b/services/observability/model_update_logs_alertgroup_payload.go index d8026d57f..e4707225e 100644 --- a/services/observability/model_update_logs_alertgroup_payload.go +++ b/services/observability/model_update_logs_alertgroup_payload.go @@ -43,9 +43,9 @@ type UpdateLogsAlertgroupPayloadGetIntervalRetType = string */ // isArray -type UpdateLogsAlertgroupPayloadGetRulesAttributeType = *[]UpdateAlertgroupsRequestInnerRulesInner -type UpdateLogsAlertgroupPayloadGetRulesArgType = []UpdateAlertgroupsRequestInnerRulesInner -type UpdateLogsAlertgroupPayloadGetRulesRetType = []UpdateAlertgroupsRequestInnerRulesInner +type UpdateLogsAlertgroupPayloadGetRulesAttributeType = *[]CreateLogsAlertgroupsPayloadRulesInner +type UpdateLogsAlertgroupPayloadGetRulesArgType = []CreateLogsAlertgroupsPayloadRulesInner +type UpdateLogsAlertgroupPayloadGetRulesRetType = []CreateLogsAlertgroupsPayloadRulesInner func getUpdateLogsAlertgroupPayloadGetRulesAttributeTypeOk(arg UpdateLogsAlertgroupPayloadGetRulesAttributeType) (ret UpdateLogsAlertgroupPayloadGetRulesRetType, ok bool) { if arg == nil { @@ -58,7 +58,7 @@ func setUpdateLogsAlertgroupPayloadGetRulesAttributeType(arg *UpdateLogsAlertgro *arg = &val } -// UpdateLogsAlertgroupPayload Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. +// UpdateLogsAlertgroupPayload Alert group that should be created or updated. `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. type UpdateLogsAlertgroupPayload struct { // How often rules in the group are evaluated. `Additional Validators:` * must be a valid time string * should be >=60s Interval UpdateLogsAlertgroupPayloadGetIntervalAttributeType `json:"interval,omitempty"` diff --git a/services/resourcemanager/CHANGELOG.md b/services/resourcemanager/CHANGELOG.md index 5fb20e305..5062da0ef 100644 --- a/services/resourcemanager/CHANGELOG.md +++ b/services/resourcemanager/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.18.0 +- **Feature:** Add `ContainerSearchResult` model for container search functionality + ## v0.17.1 - **Dependencies:** Bump `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3` diff --git a/services/resourcemanager/VERSION b/services/resourcemanager/VERSION index cfafe1078..ade995fb7 100644 --- a/services/resourcemanager/VERSION +++ b/services/resourcemanager/VERSION @@ -1 +1 @@ -v0.17.1 \ No newline at end of file +v0.18.0 \ No newline at end of file diff --git a/services/resourcemanager/model_container_search_result.go b/services/resourcemanager/model_container_search_result.go new file mode 100644 index 000000000..82cf38321 --- /dev/null +++ b/services/resourcemanager/model_container_search_result.go @@ -0,0 +1,462 @@ +/* +Resource Manager API + +API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package resourcemanager + +import ( + "encoding/json" + "fmt" +) + +// checks if the ContainerSearchResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContainerSearchResult{} + +/* + types and functions for containerId +*/ + +// isNotNullableString +type ContainerSearchResultGetContainerIdAttributeType = *string + +func getContainerSearchResultGetContainerIdAttributeTypeOk(arg ContainerSearchResultGetContainerIdAttributeType) (ret ContainerSearchResultGetContainerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setContainerSearchResultGetContainerIdAttributeType(arg *ContainerSearchResultGetContainerIdAttributeType, val ContainerSearchResultGetContainerIdRetType) { + *arg = &val +} + +type ContainerSearchResultGetContainerIdArgType = string +type ContainerSearchResultGetContainerIdRetType = string + +/* + types and functions for containerType +*/ + +// isEnum + +// ContainerSearchResultContainerType Resource container type. +// value type for enums +type ContainerSearchResultContainerType string + +// List of ContainerType +const ( + CONTAINERSEARCHRESULTCONTAINER_TYPE_PROJECT ContainerSearchResultContainerType = "PROJECT" + CONTAINERSEARCHRESULTCONTAINER_TYPE_FOLDER ContainerSearchResultContainerType = "FOLDER" +) + +// All allowed values of ContainerSearchResult enum +var AllowedContainerSearchResultContainerTypeEnumValues = []ContainerSearchResultContainerType{ + "PROJECT", + "FOLDER", +} + +func (v *ContainerSearchResultContainerType) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson ContainerSearchResultContainerType + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := ContainerSearchResultContainerType(value) + for _, existing := range AllowedContainerSearchResultContainerTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ContainerSearchResult", value) +} + +// NewContainerSearchResultContainerTypeFromValue returns a pointer to a valid ContainerSearchResultContainerType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewContainerSearchResultContainerTypeFromValue(v ContainerSearchResultContainerType) (*ContainerSearchResultContainerType, error) { + ev := ContainerSearchResultContainerType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ContainerSearchResultContainerType: valid values are %v", v, AllowedContainerSearchResultContainerTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ContainerSearchResultContainerType) IsValid() bool { + for _, existing := range AllowedContainerSearchResultContainerTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ContainerTypeContainerType value +func (v ContainerSearchResultContainerType) Ptr() *ContainerSearchResultContainerType { + return &v +} + +type NullableContainerSearchResultContainerType struct { + value *ContainerSearchResultContainerType + isSet bool +} + +func (v NullableContainerSearchResultContainerType) Get() *ContainerSearchResultContainerType { + return v.value +} + +func (v *NullableContainerSearchResultContainerType) Set(val *ContainerSearchResultContainerType) { + v.value = val + v.isSet = true +} + +func (v NullableContainerSearchResultContainerType) IsSet() bool { + return v.isSet +} + +func (v *NullableContainerSearchResultContainerType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContainerSearchResultContainerType(val *ContainerSearchResultContainerType) *NullableContainerSearchResultContainerType { + return &NullableContainerSearchResultContainerType{value: val, isSet: true} +} + +func (v NullableContainerSearchResultContainerType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContainerSearchResultContainerType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type ContainerSearchResultGetContainerTypeAttributeType = *ContainerSearchResultContainerType +type ContainerSearchResultGetContainerTypeArgType = ContainerSearchResultContainerType +type ContainerSearchResultGetContainerTypeRetType = ContainerSearchResultContainerType + +func getContainerSearchResultGetContainerTypeAttributeTypeOk(arg ContainerSearchResultGetContainerTypeAttributeType) (ret ContainerSearchResultGetContainerTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setContainerSearchResultGetContainerTypeAttributeType(arg *ContainerSearchResultGetContainerTypeAttributeType, val ContainerSearchResultGetContainerTypeRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type ContainerSearchResultGetIdAttributeType = *string + +func getContainerSearchResultGetIdAttributeTypeOk(arg ContainerSearchResultGetIdAttributeType) (ret ContainerSearchResultGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setContainerSearchResultGetIdAttributeType(arg *ContainerSearchResultGetIdAttributeType, val ContainerSearchResultGetIdRetType) { + *arg = &val +} + +type ContainerSearchResultGetIdArgType = string +type ContainerSearchResultGetIdRetType = string + +/* + types and functions for lifecycleState +*/ + +// isEnumRef +type ContainerSearchResultGetLifecycleStateAttributeType = *LifecycleState +type ContainerSearchResultGetLifecycleStateArgType = LifecycleState +type ContainerSearchResultGetLifecycleStateRetType = LifecycleState + +func getContainerSearchResultGetLifecycleStateAttributeTypeOk(arg ContainerSearchResultGetLifecycleStateAttributeType) (ret ContainerSearchResultGetLifecycleStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setContainerSearchResultGetLifecycleStateAttributeType(arg *ContainerSearchResultGetLifecycleStateAttributeType, val ContainerSearchResultGetLifecycleStateRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type ContainerSearchResultGetNameAttributeType = *string + +func getContainerSearchResultGetNameAttributeTypeOk(arg ContainerSearchResultGetNameAttributeType) (ret ContainerSearchResultGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setContainerSearchResultGetNameAttributeType(arg *ContainerSearchResultGetNameAttributeType, val ContainerSearchResultGetNameRetType) { + *arg = &val +} + +type ContainerSearchResultGetNameArgType = string +type ContainerSearchResultGetNameRetType = string + +/* + types and functions for organizationId +*/ + +// isNotNullableString +type ContainerSearchResultGetOrganizationIdAttributeType = *string + +func getContainerSearchResultGetOrganizationIdAttributeTypeOk(arg ContainerSearchResultGetOrganizationIdAttributeType) (ret ContainerSearchResultGetOrganizationIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setContainerSearchResultGetOrganizationIdAttributeType(arg *ContainerSearchResultGetOrganizationIdAttributeType, val ContainerSearchResultGetOrganizationIdRetType) { + *arg = &val +} + +type ContainerSearchResultGetOrganizationIdArgType = string +type ContainerSearchResultGetOrganizationIdRetType = string + +// ContainerSearchResult struct for ContainerSearchResult +type ContainerSearchResult struct { + // Globally unique user-friendly identifier. + // REQUIRED + ContainerId ContainerSearchResultGetContainerIdAttributeType `json:"containerId" required:"true"` + // Resource container type. + // REQUIRED + ContainerType ContainerSearchResultGetContainerTypeAttributeType `json:"containerType" required:"true"` + // Globally unique identifier. + // REQUIRED + Id ContainerSearchResultGetIdAttributeType `json:"id" required:"true"` + LifecycleState ContainerSearchResultGetLifecycleStateAttributeType `json:"lifecycleState,omitempty"` + // Resource container name. + // REQUIRED + Name ContainerSearchResultGetNameAttributeType `json:"name" required:"true"` + // Id of the organization the container is in. + OrganizationId ContainerSearchResultGetOrganizationIdAttributeType `json:"organizationId,omitempty"` +} + +type _ContainerSearchResult ContainerSearchResult + +// NewContainerSearchResult instantiates a new ContainerSearchResult 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 NewContainerSearchResult(containerId ContainerSearchResultGetContainerIdArgType, containerType ContainerSearchResultGetContainerTypeArgType, id ContainerSearchResultGetIdArgType, name ContainerSearchResultGetNameArgType) *ContainerSearchResult { + this := ContainerSearchResult{} + setContainerSearchResultGetContainerIdAttributeType(&this.ContainerId, containerId) + setContainerSearchResultGetContainerTypeAttributeType(&this.ContainerType, containerType) + setContainerSearchResultGetIdAttributeType(&this.Id, id) + setContainerSearchResultGetNameAttributeType(&this.Name, name) + return &this +} + +// NewContainerSearchResultWithDefaults instantiates a new ContainerSearchResult 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 NewContainerSearchResultWithDefaults() *ContainerSearchResult { + this := ContainerSearchResult{} + return &this +} + +// GetContainerId returns the ContainerId field value +func (o *ContainerSearchResult) GetContainerId() (ret ContainerSearchResultGetContainerIdRetType) { + ret, _ = o.GetContainerIdOk() + return ret +} + +// GetContainerIdOk returns a tuple with the ContainerId field value +// and a boolean to check if the value has been set. +func (o *ContainerSearchResult) GetContainerIdOk() (ret ContainerSearchResultGetContainerIdRetType, ok bool) { + return getContainerSearchResultGetContainerIdAttributeTypeOk(o.ContainerId) +} + +// SetContainerId sets field value +func (o *ContainerSearchResult) SetContainerId(v ContainerSearchResultGetContainerIdRetType) { + setContainerSearchResultGetContainerIdAttributeType(&o.ContainerId, v) +} + +// GetContainerType returns the ContainerType field value +func (o *ContainerSearchResult) GetContainerType() (ret ContainerSearchResultGetContainerTypeRetType) { + ret, _ = o.GetContainerTypeOk() + return ret +} + +// GetContainerTypeOk returns a tuple with the ContainerType field value +// and a boolean to check if the value has been set. +func (o *ContainerSearchResult) GetContainerTypeOk() (ret ContainerSearchResultGetContainerTypeRetType, ok bool) { + return getContainerSearchResultGetContainerTypeAttributeTypeOk(o.ContainerType) +} + +// SetContainerType sets field value +func (o *ContainerSearchResult) SetContainerType(v ContainerSearchResultGetContainerTypeRetType) { + setContainerSearchResultGetContainerTypeAttributeType(&o.ContainerType, v) +} + +// GetId returns the Id field value +func (o *ContainerSearchResult) GetId() (ret ContainerSearchResultGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ContainerSearchResult) GetIdOk() (ret ContainerSearchResultGetIdRetType, ok bool) { + return getContainerSearchResultGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +func (o *ContainerSearchResult) SetId(v ContainerSearchResultGetIdRetType) { + setContainerSearchResultGetIdAttributeType(&o.Id, v) +} + +// GetLifecycleState returns the LifecycleState field value if set, zero value otherwise. +func (o *ContainerSearchResult) GetLifecycleState() (res ContainerSearchResultGetLifecycleStateRetType) { + res, _ = o.GetLifecycleStateOk() + return +} + +// GetLifecycleStateOk returns a tuple with the LifecycleState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContainerSearchResult) GetLifecycleStateOk() (ret ContainerSearchResultGetLifecycleStateRetType, ok bool) { + return getContainerSearchResultGetLifecycleStateAttributeTypeOk(o.LifecycleState) +} + +// HasLifecycleState returns a boolean if a field has been set. +func (o *ContainerSearchResult) HasLifecycleState() bool { + _, ok := o.GetLifecycleStateOk() + return ok +} + +// SetLifecycleState gets a reference to the given LifecycleState and assigns it to the LifecycleState field. +func (o *ContainerSearchResult) SetLifecycleState(v ContainerSearchResultGetLifecycleStateRetType) { + setContainerSearchResultGetLifecycleStateAttributeType(&o.LifecycleState, v) +} + +// GetName returns the Name field value +func (o *ContainerSearchResult) GetName() (ret ContainerSearchResultGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ContainerSearchResult) GetNameOk() (ret ContainerSearchResultGetNameRetType, ok bool) { + return getContainerSearchResultGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +func (o *ContainerSearchResult) SetName(v ContainerSearchResultGetNameRetType) { + setContainerSearchResultGetNameAttributeType(&o.Name, v) +} + +// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. +func (o *ContainerSearchResult) GetOrganizationId() (res ContainerSearchResultGetOrganizationIdRetType) { + res, _ = o.GetOrganizationIdOk() + return +} + +// 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 *ContainerSearchResult) GetOrganizationIdOk() (ret ContainerSearchResultGetOrganizationIdRetType, ok bool) { + return getContainerSearchResultGetOrganizationIdAttributeTypeOk(o.OrganizationId) +} + +// HasOrganizationId returns a boolean if a field has been set. +func (o *ContainerSearchResult) HasOrganizationId() bool { + _, ok := o.GetOrganizationIdOk() + return ok +} + +// SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. +func (o *ContainerSearchResult) SetOrganizationId(v ContainerSearchResultGetOrganizationIdRetType) { + setContainerSearchResultGetOrganizationIdAttributeType(&o.OrganizationId, v) +} + +func (o ContainerSearchResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getContainerSearchResultGetContainerIdAttributeTypeOk(o.ContainerId); ok { + toSerialize["ContainerId"] = val + } + if val, ok := getContainerSearchResultGetContainerTypeAttributeTypeOk(o.ContainerType); ok { + toSerialize["ContainerType"] = val + } + if val, ok := getContainerSearchResultGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getContainerSearchResultGetLifecycleStateAttributeTypeOk(o.LifecycleState); ok { + toSerialize["LifecycleState"] = val + } + if val, ok := getContainerSearchResultGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getContainerSearchResultGetOrganizationIdAttributeTypeOk(o.OrganizationId); ok { + toSerialize["OrganizationId"] = val + } + return toSerialize, nil +} + +type NullableContainerSearchResult struct { + value *ContainerSearchResult + isSet bool +} + +func (v NullableContainerSearchResult) Get() *ContainerSearchResult { + return v.value +} + +func (v *NullableContainerSearchResult) Set(val *ContainerSearchResult) { + v.value = val + v.isSet = true +} + +func (v NullableContainerSearchResult) IsSet() bool { + return v.isSet +} + +func (v *NullableContainerSearchResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContainerSearchResult(val *ContainerSearchResult) *NullableContainerSearchResult { + return &NullableContainerSearchResult{value: val, isSet: true} +} + +func (v NullableContainerSearchResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContainerSearchResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/resourcemanager/model_container_search_result_test.go b/services/resourcemanager/model_container_search_result_test.go new file mode 100644 index 000000000..8ce1ffb78 --- /dev/null +++ b/services/resourcemanager/model_container_search_result_test.go @@ -0,0 +1,58 @@ +/* +Resource Manager API + +API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package resourcemanager + +import ( + "testing" +) + +// isEnum + +func TestContainerSearchResultContainerType_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"PROJECT"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 2`, + args: args{ + src: []byte(`"FOLDER"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := ContainerSearchResultContainerType("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +}