// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package efs 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" ) type DescribeTagsInput struct { _ struct{} `type:"structure"` // The ID of the file system whose tag set you want to retrieve. // // FileSystemId is a required field FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` // (Optional) An opaque pagination token returned from a previous DescribeTags // operation (String). If present, it specifies to continue the list from where // the previous call left off. Marker *string `location:"querystring" locationName:"Marker" min:"1" type:"string"` // (Optional) The maximum number of file system tags to return in the response. // Currently, this number is automatically set to 100, and other values are // ignored. The response is paginated at 100 per page if you have more than // 100 tags. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` } // String returns the string representation func (s DescribeTagsInput) String() string { return awsutil.Prettify(s) } // Validate inspects the fields of the type to determine if they are valid. func (s *DescribeTagsInput) Validate() error { invalidParams := aws.ErrInvalidParams{Context: "DescribeTagsInput"} if s.FileSystemId == nil { invalidParams.Add(aws.NewErrParamRequired("FileSystemId")) } if s.Marker != nil && len(*s.Marker) < 1 { invalidParams.Add(aws.NewErrParamMinLen("Marker", 1)) } if s.MaxItems != nil && *s.MaxItems < 1 { invalidParams.Add(aws.NewErrParamMinValue("MaxItems", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s DescribeTagsInput) MarshalFields(e protocol.FieldEncoder) error { e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{}) if s.FileSystemId != nil { v := *s.FileSystemId metadata := protocol.Metadata{} e.SetValue(protocol.PathTarget, "FileSystemId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.Marker != nil { v := *s.Marker metadata := protocol.Metadata{} e.SetValue(protocol.QueryTarget, "Marker", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.MaxItems != nil { v := *s.MaxItems metadata := protocol.Metadata{} e.SetValue(protocol.QueryTarget, "MaxItems", protocol.Int64Value(v), metadata) } return nil } type DescribeTagsOutput struct { _ struct{} `type:"structure"` // If the request included a Marker, the response returns that value in this // field. Marker *string `min:"1" type:"string"` // If a value is present, there are more tags to return. In a subsequent request, // you can provide the value of NextMarker as the value of the Marker parameter // in your next request to retrieve the next set of tags. NextMarker *string `min:"1" type:"string"` // Returns tags associated with the file system as an array of Tag objects. // // Tags is a required field Tags []Tag `type:"list" required:"true"` } // String returns the string representation func (s DescribeTagsOutput) String() string { return awsutil.Prettify(s) } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s DescribeTagsOutput) MarshalFields(e protocol.FieldEncoder) error { if s.Marker != nil { v := *s.Marker metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "Marker", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.NextMarker != nil { v := *s.NextMarker metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "NextMarker", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.Tags != nil { v := s.Tags metadata := protocol.Metadata{} ls0 := e.List(protocol.BodyTarget, "Tags", metadata) ls0.Start() for _, v1 := range v { ls0.ListAddFields(v1) } ls0.End() } return nil } const opDescribeTags = "DescribeTags" // DescribeTagsRequest returns a request value for making API operation for // Amazon Elastic File System. // // Returns the tags associated with a file system. The order of tags returned // in the response of one DescribeTags call and the order of tags returned across // the responses of a multiple-call iteration (when using pagination) is unspecified. // // This operation requires permissions for the elasticfilesystem:DescribeTags // action. // // // Example sending a request using DescribeTagsRequest. // req := client.DescribeTagsRequest(params) // resp, err := req.Send(context.TODO()) // if err == nil { // fmt.Println(resp) // } // // Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeTags func (c *Client) DescribeTagsRequest(input *DescribeTagsInput) DescribeTagsRequest { if c.Client.Config.Logger != nil { c.Client.Config.Logger.Log("This operation, DescribeTags, has been deprecated") } op := &aws.Operation{ Name: opDescribeTags, HTTPMethod: "GET", HTTPPath: "/2015-02-01/tags/{FileSystemId}/", Paginator: &aws.Paginator{ InputTokens: []string{"Marker"}, OutputTokens: []string{"NextMarker"}, LimitToken: "MaxItems", TruncationToken: "", }, } if input == nil { input = &DescribeTagsInput{} } req := c.newRequest(op, input, &DescribeTagsOutput{}) return DescribeTagsRequest{Request: req, Input: input, Copy: c.DescribeTagsRequest} } // DescribeTagsRequest is the request type for the // DescribeTags API operation. type DescribeTagsRequest struct { *aws.Request Input *DescribeTagsInput Copy func(*DescribeTagsInput) DescribeTagsRequest } // Send marshals and sends the DescribeTags API request. func (r DescribeTagsRequest) Send(ctx context.Context) (*DescribeTagsResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &DescribeTagsResponse{ DescribeTagsOutput: r.Request.Data.(*DescribeTagsOutput), response: &aws.Response{Request: r.Request}, } return resp, nil } // NewDescribeTagsRequestPaginator returns a paginator for DescribeTags. // Use Next method to get the next page, and CurrentPage to get the current // response page from the paginator. Next will return false, if there are // no more pages, or an error was encountered. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over pages. // req := client.DescribeTagsRequest(input) // p := efs.NewDescribeTagsRequestPaginator(req) // // for p.Next(context.TODO()) { // page := p.CurrentPage() // } // // if err := p.Err(); err != nil { // return err // } // func NewDescribeTagsPaginator(req DescribeTagsRequest) DescribeTagsPaginator { return DescribeTagsPaginator{ Pager: aws.Pager{ NewRequest: func(ctx context.Context) (*aws.Request, error) { var inCpy *DescribeTagsInput if req.Input != nil { tmp := *req.Input inCpy = &tmp } newReq := req.Copy(inCpy) newReq.SetContext(ctx) return newReq.Request, nil }, }, } } // DescribeTagsPaginator is used to paginate the request. This can be done by // calling Next and CurrentPage. type DescribeTagsPaginator struct { aws.Pager } func (p *DescribeTagsPaginator) CurrentPage() *DescribeTagsOutput { return p.Pager.CurrentPage().(*DescribeTagsOutput) } // DescribeTagsResponse is the response type for the // DescribeTags API operation. type DescribeTagsResponse struct { *DescribeTagsOutput response *aws.Response } // SDKResponseMetdata returns the response metadata for the // DescribeTags request. func (r *DescribeTagsResponse) SDKResponseMetdata() *aws.Response { return r.response }