// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package cloudwatch import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" "github.com/aws/aws-sdk-go-v2/private/protocol" "github.com/aws/aws-sdk-go-v2/private/protocol/query" ) type DeleteAlarmsInput struct { _ struct{} `type:"structure"` // The alarms to be deleted. // // AlarmNames is a required field AlarmNames []string `type:"list" required:"true"` } // String returns the string representation func (s DeleteAlarmsInput) String() string { return awsutil.Prettify(s) } // Validate inspects the fields of the type to determine if they are valid. func (s *DeleteAlarmsInput) Validate() error { invalidParams := aws.ErrInvalidParams{Context: "DeleteAlarmsInput"} if s.AlarmNames == nil { invalidParams.Add(aws.NewErrParamRequired("AlarmNames")) } if invalidParams.Len() > 0 { return invalidParams } return nil } type DeleteAlarmsOutput struct { _ struct{} `type:"structure"` } // String returns the string representation func (s DeleteAlarmsOutput) String() string { return awsutil.Prettify(s) } const opDeleteAlarms = "DeleteAlarms" // DeleteAlarmsRequest returns a request value for making API operation for // Amazon CloudWatch. // // Deletes the specified alarms. You can delete up to 100 alarms in one operation. // However, this total can include no more than one composite alarm. For example, // you could delete 99 metric alarms and one composite alarms with one operation, // but you can't delete two composite alarms with one operation. // // In the event of an error, no alarms are deleted. // // It is possible to create a loop or cycle of composite alarms, where composite // alarm A depends on composite alarm B, and composite alarm B also depends // on composite alarm A. In this scenario, you can't delete any composite alarm // that is part of the cycle because there is always still a composite alarm // that depends on that alarm that you want to delete. // // To get out of such a situation, you must break the cycle by changing the // rule of one of the composite alarms in the cycle to remove a dependency that // creates the cycle. The simplest change to make to break a cycle is to change // the AlarmRule of one of the alarms to False. // // Additionally, the evaluation of composite alarms stops if CloudWatch detects // a cycle in the evaluation path. // // // Example sending a request using DeleteAlarmsRequest. // req := client.DeleteAlarmsRequest(params) // resp, err := req.Send(context.TODO()) // if err == nil { // fmt.Println(resp) // } // // Please also see https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarms func (c *Client) DeleteAlarmsRequest(input *DeleteAlarmsInput) DeleteAlarmsRequest { op := &aws.Operation{ Name: opDeleteAlarms, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &DeleteAlarmsInput{} } req := c.newRequest(op, input, &DeleteAlarmsOutput{}) req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) return DeleteAlarmsRequest{Request: req, Input: input, Copy: c.DeleteAlarmsRequest} } // DeleteAlarmsRequest is the request type for the // DeleteAlarms API operation. type DeleteAlarmsRequest struct { *aws.Request Input *DeleteAlarmsInput Copy func(*DeleteAlarmsInput) DeleteAlarmsRequest } // Send marshals and sends the DeleteAlarms API request. func (r DeleteAlarmsRequest) Send(ctx context.Context) (*DeleteAlarmsResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &DeleteAlarmsResponse{ DeleteAlarmsOutput: r.Request.Data.(*DeleteAlarmsOutput), response: &aws.Response{Request: r.Request}, } return resp, nil } // DeleteAlarmsResponse is the response type for the // DeleteAlarms API operation. type DeleteAlarmsResponse struct { *DeleteAlarmsOutput response *aws.Response } // SDKResponseMetdata returns the response metadata for the // DeleteAlarms request. func (r *DeleteAlarmsResponse) SDKResponseMetdata() *aws.Response { return r.response }