// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package redshift 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" ) // Contains the output from the CreateTags action. type CreateTagsInput struct { _ struct{} `type:"structure"` // The Amazon Resource Name (ARN) to which you want to add the tag or tags. // For example, arn:aws:redshift:us-east-2:123456789:cluster:t1. // // ResourceName is a required field ResourceName *string `type:"string" required:"true"` // One or more name/value pairs to add as tags to the specified resource. Each // tag name is passed in with the parameter Key and the corresponding value // is passed in with the parameter Value. The Key and Value parameters are separated // by a comma (,). Separate multiple tags with a space. For example, --tags // "Key"="owner","Value"="admin" "Key"="environment","Value"="test" "Key"="version","Value"="1.0". // // Tags is a required field Tags []Tag `locationNameList:"Tag" type:"list" required:"true"` } // String returns the string representation func (s CreateTagsInput) String() string { return awsutil.Prettify(s) } // Validate inspects the fields of the type to determine if they are valid. func (s *CreateTagsInput) Validate() error { invalidParams := aws.ErrInvalidParams{Context: "CreateTagsInput"} if s.ResourceName == nil { invalidParams.Add(aws.NewErrParamRequired("ResourceName")) } if s.Tags == nil { invalidParams.Add(aws.NewErrParamRequired("Tags")) } if invalidParams.Len() > 0 { return invalidParams } return nil } type CreateTagsOutput struct { _ struct{} `type:"structure"` } // String returns the string representation func (s CreateTagsOutput) String() string { return awsutil.Prettify(s) } const opCreateTags = "CreateTags" // CreateTagsRequest returns a request value for making API operation for // Amazon Redshift. // // Adds tags to a cluster. // // A resource can have up to 50 tags. If you try to create more than 50 tags // for a resource, you will receive an error and the attempt will fail. // // If you specify a key that already exists for the resource, the value for // that key will be updated with the new value. // // // Example sending a request using CreateTagsRequest. // req := client.CreateTagsRequest(params) // resp, err := req.Send(context.TODO()) // if err == nil { // fmt.Println(resp) // } // // Please also see https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateTags func (c *Client) CreateTagsRequest(input *CreateTagsInput) CreateTagsRequest { op := &aws.Operation{ Name: opCreateTags, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &CreateTagsInput{} } req := c.newRequest(op, input, &CreateTagsOutput{}) req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) return CreateTagsRequest{Request: req, Input: input, Copy: c.CreateTagsRequest} } // CreateTagsRequest is the request type for the // CreateTags API operation. type CreateTagsRequest struct { *aws.Request Input *CreateTagsInput Copy func(*CreateTagsInput) CreateTagsRequest } // Send marshals and sends the CreateTags API request. func (r CreateTagsRequest) Send(ctx context.Context) (*CreateTagsResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &CreateTagsResponse{ CreateTagsOutput: r.Request.Data.(*CreateTagsOutput), response: &aws.Response{Request: r.Request}, } return resp, nil } // CreateTagsResponse is the response type for the // CreateTags API operation. type CreateTagsResponse struct { *CreateTagsOutput response *aws.Response } // SDKResponseMetdata returns the response metadata for the // CreateTags request. func (r *CreateTagsResponse) SDKResponseMetdata() *aws.Response { return r.response }