From 32a5e66cb382304f69ac3fbad4fe804a3f1e1adb Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 14 Nov 2025 09:31:40 +0000 Subject: [PATCH] Generate observability --- services/observability/api_default.go | 84 +++- services/observability/api_default_test.go | 4 +- .../model_cert_check_response.go | 47 +++ .../model_create_alertgroups_payload.go | 2 +- .../model_create_cert_check_400_response.go | 144 +++++++ ...del_create_cert_check_400_response_test.go | 60 +++ .../model_create_logs_alertgroups_payload.go | 8 +- ...te_logs_alertgroups_payload_rules_inner.go | 372 ++++++++++++++++++ ...gs_alertgroups_payload_rules_inner_test.go | 11 + .../model_http_check_response.go | 47 +++ ...partial_update_alertrules_request_inner.go | 319 +++++++++++++++ ...al_update_alertrules_request_inner_test.go | 11 + .../model_update_alertgroup_payload.go | 2 +- .../model_update_alertgroups_request_inner.go | 2 +- ...e_alertgroups_request_inner_rules_inner.go | 85 +++- .../model_update_logs_alertgroup_payload.go | 8 +- 16 files changed, 1157 insertions(+), 49 deletions(-) create mode 100644 services/observability/model_create_cert_check_400_response.go create mode 100644 services/observability/model_create_cert_check_400_response_test.go create mode 100644 services/observability/model_create_logs_alertgroups_payload_rules_inner.go create mode 100644 services/observability/model_create_logs_alertgroups_payload_rules_inner_test.go create mode 100644 services/observability/model_partial_update_alertrules_request_inner.go create mode 100644 services/observability/model_partial_update_alertrules_request_inner_test.go diff --git a/services/observability/api_default.go b/services/observability/api_default.go index 9d5465d0e..8727be181 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) } @@ -2346,6 +2346,17 @@ func (r CreateCertCheckRequest) Execute() (*CertCheckResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2648,6 +2659,17 @@ func (r CreateHttpCheckRequest) Execute() (*HttpCheckResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateCertCheck400Response + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4023,8 +4045,8 @@ func (r DeleteCertCheckRequest) Execute() (*CertCheckResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { - var v PermissionDenied + if localVarHTTPResponse.StatusCode == 400 { + var v []string err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4034,8 +4056,8 @@ func (r DeleteCertCheckRequest) Execute() (*CertCheckResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 404 { - var v Message + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4512,8 +4534,8 @@ func (r DeleteHttpCheckRequest) Execute() (*HttpCheckResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 403 { - var v PermissionDenied + if localVarHTTPResponse.StatusCode == 400 { + var v []string err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -4523,8 +4545,8 @@ func (r DeleteHttpCheckRequest) Execute() (*HttpCheckResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 404 { - var v Message + if localVarHTTPResponse.StatusCode == 403 { + var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -7700,6 +7722,17 @@ func (r ListCertChecksRequest) Execute() (*CertCheckResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -7972,6 +8005,17 @@ func (r ListHttpChecksRequest) Execute() (*HttpCheckResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v []string + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 403 { var v PermissionDenied err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -8731,16 +8775,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 +8813,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 +8835,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_cert_check_response.go b/services/observability/model_cert_check_response.go index 41ea4bf26..2a2df7e4f 100644 --- a/services/observability/model_cert_check_response.go +++ b/services/observability/model_cert_check_response.go @@ -17,6 +17,26 @@ import ( // checks if the CertCheckResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CertCheckResponse{} +/* + types and functions for certCheck +*/ + +// isModel +type CertCheckResponseGetCertCheckAttributeType = *CertCheckChildResponse +type CertCheckResponseGetCertCheckArgType = CertCheckChildResponse +type CertCheckResponseGetCertCheckRetType = CertCheckChildResponse + +func getCertCheckResponseGetCertCheckAttributeTypeOk(arg CertCheckResponseGetCertCheckAttributeType) (ret CertCheckResponseGetCertCheckRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCertCheckResponseGetCertCheckAttributeType(arg *CertCheckResponseGetCertCheckAttributeType, val CertCheckResponseGetCertCheckRetType) { + *arg = &val +} + /* types and functions for certChecks */ @@ -60,6 +80,7 @@ type CertCheckResponseGetMessageRetType = string // CertCheckResponse struct for CertCheckResponse type CertCheckResponse struct { + CertCheck CertCheckResponseGetCertCheckAttributeType `json:"certCheck,omitempty"` // REQUIRED CertChecks CertCheckResponseGetCertChecksAttributeType `json:"certChecks" required:"true"` // REQUIRED @@ -87,6 +108,29 @@ func NewCertCheckResponseWithDefaults() *CertCheckResponse { return &this } +// GetCertCheck returns the CertCheck field value if set, zero value otherwise. +func (o *CertCheckResponse) GetCertCheck() (res CertCheckResponseGetCertCheckRetType) { + res, _ = o.GetCertCheckOk() + return +} + +// GetCertCheckOk returns a tuple with the CertCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CertCheckResponse) GetCertCheckOk() (ret CertCheckResponseGetCertCheckRetType, ok bool) { + return getCertCheckResponseGetCertCheckAttributeTypeOk(o.CertCheck) +} + +// HasCertCheck returns a boolean if a field has been set. +func (o *CertCheckResponse) HasCertCheck() bool { + _, ok := o.GetCertCheckOk() + return ok +} + +// SetCertCheck gets a reference to the given CertCheckChildResponse and assigns it to the CertCheck field. +func (o *CertCheckResponse) SetCertCheck(v CertCheckResponseGetCertCheckRetType) { + setCertCheckResponseGetCertCheckAttributeType(&o.CertCheck, v) +} + // GetCertChecks returns the CertChecks field value func (o *CertCheckResponse) GetCertChecks() (ret CertCheckResponseGetCertChecksRetType) { ret, _ = o.GetCertChecksOk() @@ -123,6 +167,9 @@ func (o *CertCheckResponse) SetMessage(v CertCheckResponseGetMessageRetType) { func (o CertCheckResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if val, ok := getCertCheckResponseGetCertCheckAttributeTypeOk(o.CertCheck); ok { + toSerialize["CertCheck"] = val + } if val, ok := getCertCheckResponseGetCertChecksAttributeTypeOk(o.CertChecks); ok { toSerialize["CertChecks"] = val } 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_cert_check_400_response.go b/services/observability/model_create_cert_check_400_response.go new file mode 100644 index 000000000..6f4d36b6d --- /dev/null +++ b/services/observability/model_create_cert_check_400_response.go @@ -0,0 +1,144 @@ +/* +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" + "fmt" +) + +// CreateCertCheck400Response - struct for CreateCertCheck400Response +type CreateCertCheck400Response struct { + ArrayOfString *[]string + MapmapOfStringarrayOfString *map[string][]string +} + +// []stringAsCreateCertCheck400Response is a convenience function that returns []string wrapped in CreateCertCheck400Response +func ArrayOfStringAsCreateCertCheck400Response(v *[]string) CreateCertCheck400Response { + return CreateCertCheck400Response{ + ArrayOfString: v, + } +} + +// map[string][]stringAsCreateCertCheck400Response is a convenience function that returns map[string][]string wrapped in CreateCertCheck400Response +func MapmapOfStringarrayOfStringAsCreateCertCheck400Response(v *map[string][]string) CreateCertCheck400Response { + return CreateCertCheck400Response{ + MapmapOfStringarrayOfString: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateCertCheck400Response) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // Workaround until upstream issue is fixed: + // https://github.com/OpenAPITools/openapi-generator/issues/21751 + // Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-226 + // try to unmarshal data into MapmapOfStringarrayOfString + dstCreateCertCheck400Response1 := &CreateCertCheck400Response{} + err = json.Unmarshal(data, &dstCreateCertCheck400Response1.MapmapOfStringarrayOfString) + if err == nil { + jsonMapmapOfStringarrayOfString, _ := json.Marshal(&dstCreateCertCheck400Response1.MapmapOfStringarrayOfString) + if string(jsonMapmapOfStringarrayOfString) != "{}" { // empty struct + dst.MapmapOfStringarrayOfString = dstCreateCertCheck400Response1.MapmapOfStringarrayOfString + match++ + } + } + + // try to unmarshal data into ArrayOfString + dstCreateCertCheck400Response2 := &CreateCertCheck400Response{} + err = json.Unmarshal(data, &dstCreateCertCheck400Response2.ArrayOfString) + if err == nil { + jsonArrayOfString, _ := json.Marshal(&dstCreateCertCheck400Response2.ArrayOfString) + if string(jsonArrayOfString) != "{}" { // empty struct + dst.ArrayOfString = dstCreateCertCheck400Response2.ArrayOfString + match++ + } + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ArrayOfString = nil + dst.MapmapOfStringarrayOfString = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateCertCheck400Response)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateCertCheck400Response)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateCertCheck400Response) MarshalJSON() ([]byte, error) { + if src.ArrayOfString != nil { + return json.Marshal(&src.ArrayOfString) + } + + if src.MapmapOfStringarrayOfString != nil { + return json.Marshal(&src.MapmapOfStringarrayOfString) + } + + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object +} + +// Get the actual instance +func (obj *CreateCertCheck400Response) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.ArrayOfString != nil { + return obj.ArrayOfString + } + + if obj.MapmapOfStringarrayOfString != nil { + return obj.MapmapOfStringarrayOfString + } + + // all schemas are nil + return nil +} + +type NullableCreateCertCheck400Response struct { + value *CreateCertCheck400Response + isSet bool +} + +func (v NullableCreateCertCheck400Response) Get() *CreateCertCheck400Response { + return v.value +} + +func (v *NullableCreateCertCheck400Response) Set(val *CreateCertCheck400Response) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCertCheck400Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCertCheck400Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCertCheck400Response(val *CreateCertCheck400Response) *NullableCreateCertCheck400Response { + return &NullableCreateCertCheck400Response{value: val, isSet: true} +} + +func (v NullableCreateCertCheck400Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCertCheck400Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/observability/model_create_cert_check_400_response_test.go b/services/observability/model_create_cert_check_400_response_test.go new file mode 100644 index 000000000..b6e592ef3 --- /dev/null +++ b/services/observability/model_create_cert_check_400_response_test.go @@ -0,0 +1,60 @@ +/* +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 ( + "testing" +) + +// isOneOf + +func TestCreateCertCheck400Response_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + + { + name: "success - map[string][]string", + args: args{ + src: []byte(`{"map":["example"]}`), + }, + wantErr: false, + }, + + { + name: "success - []string", + args: args{ + src: []byte(`["example"]`), + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := &CreateCertCheck400Response{} + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + marshalJson, err := v.MarshalJSON() + if err != nil { + t.Fatalf("failed marshalling CreateCertCheck400Response: %v", err) + } + if string(marshalJson) != string(tt.args.src) { + t.Fatalf("wanted %s, get %s", tt.args.src, marshalJson) + } + }) + } +} 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_http_check_response.go b/services/observability/model_http_check_response.go index 22dc22fc5..82549c883 100644 --- a/services/observability/model_http_check_response.go +++ b/services/observability/model_http_check_response.go @@ -17,6 +17,26 @@ import ( // checks if the HttpCheckResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &HttpCheckResponse{} +/* + types and functions for httpCheck +*/ + +// isModel +type HttpCheckResponseGetHttpCheckAttributeType = *HttpCheckChildResponse +type HttpCheckResponseGetHttpCheckArgType = HttpCheckChildResponse +type HttpCheckResponseGetHttpCheckRetType = HttpCheckChildResponse + +func getHttpCheckResponseGetHttpCheckAttributeTypeOk(arg HttpCheckResponseGetHttpCheckAttributeType) (ret HttpCheckResponseGetHttpCheckRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setHttpCheckResponseGetHttpCheckAttributeType(arg *HttpCheckResponseGetHttpCheckAttributeType, val HttpCheckResponseGetHttpCheckRetType) { + *arg = &val +} + /* types and functions for httpChecks */ @@ -60,6 +80,7 @@ type HttpCheckResponseGetMessageRetType = string // HttpCheckResponse struct for HttpCheckResponse type HttpCheckResponse struct { + HttpCheck HttpCheckResponseGetHttpCheckAttributeType `json:"httpCheck,omitempty"` // REQUIRED HttpChecks HttpCheckResponseGetHttpChecksAttributeType `json:"httpChecks" required:"true"` // REQUIRED @@ -87,6 +108,29 @@ func NewHttpCheckResponseWithDefaults() *HttpCheckResponse { return &this } +// GetHttpCheck returns the HttpCheck field value if set, zero value otherwise. +func (o *HttpCheckResponse) GetHttpCheck() (res HttpCheckResponseGetHttpCheckRetType) { + res, _ = o.GetHttpCheckOk() + return +} + +// GetHttpCheckOk returns a tuple with the HttpCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpCheckResponse) GetHttpCheckOk() (ret HttpCheckResponseGetHttpCheckRetType, ok bool) { + return getHttpCheckResponseGetHttpCheckAttributeTypeOk(o.HttpCheck) +} + +// HasHttpCheck returns a boolean if a field has been set. +func (o *HttpCheckResponse) HasHttpCheck() bool { + _, ok := o.GetHttpCheckOk() + return ok +} + +// SetHttpCheck gets a reference to the given HttpCheckChildResponse and assigns it to the HttpCheck field. +func (o *HttpCheckResponse) SetHttpCheck(v HttpCheckResponseGetHttpCheckRetType) { + setHttpCheckResponseGetHttpCheckAttributeType(&o.HttpCheck, v) +} + // GetHttpChecks returns the HttpChecks field value func (o *HttpCheckResponse) GetHttpChecks() (ret HttpCheckResponseGetHttpChecksRetType) { ret, _ = o.GetHttpChecksOk() @@ -123,6 +167,9 @@ func (o *HttpCheckResponse) SetMessage(v HttpCheckResponseGetMessageRetType) { func (o HttpCheckResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if val, ok := getHttpCheckResponseGetHttpCheckAttributeTypeOk(o.HttpCheck); ok { + toSerialize["HttpCheck"] = val + } if val, ok := getHttpCheckResponseGetHttpChecksAttributeTypeOk(o.HttpChecks); ok { toSerialize["HttpChecks"] = val } 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"`