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"`