// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package quicksight 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 ListGroupMembershipsInput struct { _ struct{} `type:"structure"` // The ID for the AWS account that the group is in. Currently, you use the ID // for the AWS account that contains your Amazon QuickSight account. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` // The name of the group that you want to see a membership list of. // // GroupName is a required field GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` // The maximum number of results to return from this request. MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` // The namespace. Currently, you should set this to default. // // Namespace is a required field Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` // A pagination token that can be used in a subsequent request. NextToken *string `location:"querystring" locationName:"next-token" type:"string"` } // String returns the string representation func (s ListGroupMembershipsInput) String() string { return awsutil.Prettify(s) } // Validate inspects the fields of the type to determine if they are valid. func (s *ListGroupMembershipsInput) Validate() error { invalidParams := aws.ErrInvalidParams{Context: "ListGroupMembershipsInput"} if s.AwsAccountId == nil { invalidParams.Add(aws.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(aws.NewErrParamMinLen("AwsAccountId", 12)) } if s.GroupName == nil { invalidParams.Add(aws.NewErrParamRequired("GroupName")) } if s.GroupName != nil && len(*s.GroupName) < 1 { invalidParams.Add(aws.NewErrParamMinLen("GroupName", 1)) } if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(aws.NewErrParamMinValue("MaxResults", 1)) } if s.Namespace == nil { invalidParams.Add(aws.NewErrParamRequired("Namespace")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s ListGroupMembershipsInput) MarshalFields(e protocol.FieldEncoder) error { e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{}) if s.AwsAccountId != nil { v := *s.AwsAccountId metadata := protocol.Metadata{} e.SetValue(protocol.PathTarget, "AwsAccountId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.GroupName != nil { v := *s.GroupName metadata := protocol.Metadata{} e.SetValue(protocol.PathTarget, "GroupName", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.Namespace != nil { v := *s.Namespace metadata := protocol.Metadata{} e.SetValue(protocol.PathTarget, "Namespace", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.MaxResults != nil { v := *s.MaxResults metadata := protocol.Metadata{} e.SetValue(protocol.QueryTarget, "max-results", protocol.Int64Value(v), metadata) } if s.NextToken != nil { v := *s.NextToken metadata := protocol.Metadata{} e.SetValue(protocol.QueryTarget, "next-token", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } return nil } type ListGroupMembershipsOutput struct { _ struct{} `type:"structure"` // The list of the members of the group. GroupMemberList []GroupMember `type:"list"` // A pagination token that can be used in a subsequent request. NextToken *string `type:"string"` // The AWS request ID for this operation. RequestId *string `type:"string"` // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` } // String returns the string representation func (s ListGroupMembershipsOutput) String() string { return awsutil.Prettify(s) } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s ListGroupMembershipsOutput) MarshalFields(e protocol.FieldEncoder) error { if s.GroupMemberList != nil { v := s.GroupMemberList metadata := protocol.Metadata{} ls0 := e.List(protocol.BodyTarget, "GroupMemberList", metadata) ls0.Start() for _, v1 := range v { ls0.ListAddFields(v1) } ls0.End() } if s.NextToken != nil { v := *s.NextToken metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "NextToken", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.RequestId != nil { v := *s.RequestId metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "RequestId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } // ignoring invalid encode state, StatusCode. Status return nil } const opListGroupMemberships = "ListGroupMemberships" // ListGroupMembershipsRequest returns a request value for making API operation for // Amazon QuickSight. // // Lists member users in a group. // // // Example sending a request using ListGroupMembershipsRequest. // req := client.ListGroupMembershipsRequest(params) // resp, err := req.Send(context.TODO()) // if err == nil { // fmt.Println(resp) // } // // Please also see https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListGroupMemberships func (c *Client) ListGroupMembershipsRequest(input *ListGroupMembershipsInput) ListGroupMembershipsRequest { op := &aws.Operation{ Name: opListGroupMemberships, HTTPMethod: "GET", HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members", } if input == nil { input = &ListGroupMembershipsInput{} } req := c.newRequest(op, input, &ListGroupMembershipsOutput{}) return ListGroupMembershipsRequest{Request: req, Input: input, Copy: c.ListGroupMembershipsRequest} } // ListGroupMembershipsRequest is the request type for the // ListGroupMemberships API operation. type ListGroupMembershipsRequest struct { *aws.Request Input *ListGroupMembershipsInput Copy func(*ListGroupMembershipsInput) ListGroupMembershipsRequest } // Send marshals and sends the ListGroupMemberships API request. func (r ListGroupMembershipsRequest) Send(ctx context.Context) (*ListGroupMembershipsResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &ListGroupMembershipsResponse{ ListGroupMembershipsOutput: r.Request.Data.(*ListGroupMembershipsOutput), response: &aws.Response{Request: r.Request}, } return resp, nil } // ListGroupMembershipsResponse is the response type for the // ListGroupMemberships API operation. type ListGroupMembershipsResponse struct { *ListGroupMembershipsOutput response *aws.Response } // SDKResponseMetdata returns the response metadata for the // ListGroupMemberships request. func (r *ListGroupMembershipsResponse) SDKResponseMetdata() *aws.Response { return r.response }