// Code generated by smithy-go-codegen DO NOT EDIT. package ram import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/ram/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpAcceptResourceShareInvitation struct { } func (*awsRestjson1_serializeOpAcceptResourceShareInvitation) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAcceptResourceShareInvitation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AcceptResourceShareInvitationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/acceptresourceshareinvitation") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentAcceptResourceShareInvitationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsAcceptResourceShareInvitationInput(v *AcceptResourceShareInvitationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentAcceptResourceShareInvitationInput(v *AcceptResourceShareInvitationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.ResourceShareInvitationArn != nil { ok := object.Key("resourceShareInvitationArn") ok.String(*v.ResourceShareInvitationArn) } return nil } type awsRestjson1_serializeOpAssociateResourceShare struct { } func (*awsRestjson1_serializeOpAssociateResourceShare) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAssociateResourceShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AssociateResourceShareInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/associateresourceshare") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentAssociateResourceShareInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsAssociateResourceShareInput(v *AssociateResourceShareInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentAssociateResourceShareInput(v *AssociateResourceShareInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Principals != nil { ok := object.Key("principals") if err := awsRestjson1_serializeDocumentPrincipalArnOrIdList(v.Principals, ok); err != nil { return err } } if v.ResourceArns != nil { ok := object.Key("resourceArns") if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil { return err } } if v.ResourceShareArn != nil { ok := object.Key("resourceShareArn") ok.String(*v.ResourceShareArn) } return nil } type awsRestjson1_serializeOpAssociateResourceSharePermission struct { } func (*awsRestjson1_serializeOpAssociateResourceSharePermission) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAssociateResourceSharePermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AssociateResourceSharePermissionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/associateresourcesharepermission") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentAssociateResourceSharePermissionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsAssociateResourceSharePermissionInput(v *AssociateResourceSharePermissionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentAssociateResourceSharePermissionInput(v *AssociateResourceSharePermissionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.PermissionArn != nil { ok := object.Key("permissionArn") ok.String(*v.PermissionArn) } if v.PermissionVersion != nil { ok := object.Key("permissionVersion") ok.Integer(*v.PermissionVersion) } if v.Replace != nil { ok := object.Key("replace") ok.Boolean(*v.Replace) } if v.ResourceShareArn != nil { ok := object.Key("resourceShareArn") ok.String(*v.ResourceShareArn) } return nil } type awsRestjson1_serializeOpCreateResourceShare struct { } func (*awsRestjson1_serializeOpCreateResourceShare) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateResourceShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateResourceShareInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createresourceshare") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateResourceShareInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateResourceShareInput(v *CreateResourceShareInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateResourceShareInput(v *CreateResourceShareInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AllowExternalPrincipals != nil { ok := object.Key("allowExternalPrincipals") ok.Boolean(*v.AllowExternalPrincipals) } if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.PermissionArns != nil { ok := object.Key("permissionArns") if err := awsRestjson1_serializeDocumentPermissionArnList(v.PermissionArns, ok); err != nil { return err } } if v.Principals != nil { ok := object.Key("principals") if err := awsRestjson1_serializeDocumentPrincipalArnOrIdList(v.Principals, ok); err != nil { return err } } if v.ResourceArns != nil { ok := object.Key("resourceArns") if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteResourceShare struct { } func (*awsRestjson1_serializeOpDeleteResourceShare) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteResourceShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteResourceShareInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/deleteresourceshare") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteResourceShareInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteResourceShareInput(v *DeleteResourceShareInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil { encoder.SetQuery("clientToken").String(*v.ClientToken) } if v.ResourceShareArn != nil { encoder.SetQuery("resourceShareArn").String(*v.ResourceShareArn) } return nil } type awsRestjson1_serializeOpDisassociateResourceShare struct { } func (*awsRestjson1_serializeOpDisassociateResourceShare) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateResourceShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateResourceShareInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/disassociateresourceshare") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDisassociateResourceShareInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDisassociateResourceShareInput(v *DisassociateResourceShareInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDisassociateResourceShareInput(v *DisassociateResourceShareInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Principals != nil { ok := object.Key("principals") if err := awsRestjson1_serializeDocumentPrincipalArnOrIdList(v.Principals, ok); err != nil { return err } } if v.ResourceArns != nil { ok := object.Key("resourceArns") if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil { return err } } if v.ResourceShareArn != nil { ok := object.Key("resourceShareArn") ok.String(*v.ResourceShareArn) } return nil } type awsRestjson1_serializeOpDisassociateResourceSharePermission struct { } func (*awsRestjson1_serializeOpDisassociateResourceSharePermission) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateResourceSharePermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateResourceSharePermissionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/disassociateresourcesharepermission") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDisassociateResourceSharePermissionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDisassociateResourceSharePermissionInput(v *DisassociateResourceSharePermissionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentDisassociateResourceSharePermissionInput(v *DisassociateResourceSharePermissionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.PermissionArn != nil { ok := object.Key("permissionArn") ok.String(*v.PermissionArn) } if v.ResourceShareArn != nil { ok := object.Key("resourceShareArn") ok.String(*v.ResourceShareArn) } return nil } type awsRestjson1_serializeOpEnableSharingWithAwsOrganization struct { } func (*awsRestjson1_serializeOpEnableSharingWithAwsOrganization) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpEnableSharingWithAwsOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableSharingWithAwsOrganizationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/enablesharingwithawsorganization") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsEnableSharingWithAwsOrganizationInput(v *EnableSharingWithAwsOrganizationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetPermission struct { } func (*awsRestjson1_serializeOpGetPermission) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetPermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetPermissionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/getpermission") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentGetPermissionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetPermissionInput(v *GetPermissionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetPermissionInput(v *GetPermissionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.PermissionArn != nil { ok := object.Key("permissionArn") ok.String(*v.PermissionArn) } if v.PermissionVersion != nil { ok := object.Key("permissionVersion") ok.Integer(*v.PermissionVersion) } return nil } type awsRestjson1_serializeOpGetResourcePolicies struct { } func (*awsRestjson1_serializeOpGetResourcePolicies) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetResourcePolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetResourcePoliciesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/getresourcepolicies") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentGetResourcePoliciesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetResourcePoliciesInput(v *GetResourcePoliciesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetResourcePoliciesInput(v *GetResourcePoliciesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.Principal != nil { ok := object.Key("principal") ok.String(*v.Principal) } if v.ResourceArns != nil { ok := object.Key("resourceArns") if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetResourceShareAssociations struct { } func (*awsRestjson1_serializeOpGetResourceShareAssociations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetResourceShareAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetResourceShareAssociationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/getresourceshareassociations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentGetResourceShareAssociationsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetResourceShareAssociationsInput(v *GetResourceShareAssociationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetResourceShareAssociationsInput(v *GetResourceShareAssociationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AssociationStatus) > 0 { ok := object.Key("associationStatus") ok.String(string(v.AssociationStatus)) } if len(v.AssociationType) > 0 { ok := object.Key("associationType") ok.String(string(v.AssociationType)) } if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.Principal != nil { ok := object.Key("principal") ok.String(*v.Principal) } if v.ResourceArn != nil { ok := object.Key("resourceArn") ok.String(*v.ResourceArn) } if v.ResourceShareArns != nil { ok := object.Key("resourceShareArns") if err := awsRestjson1_serializeDocumentResourceShareArnList(v.ResourceShareArns, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetResourceShareInvitations struct { } func (*awsRestjson1_serializeOpGetResourceShareInvitations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetResourceShareInvitations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetResourceShareInvitationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/getresourceshareinvitations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentGetResourceShareInvitationsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetResourceShareInvitationsInput(v *GetResourceShareInvitationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetResourceShareInvitationsInput(v *GetResourceShareInvitationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.ResourceShareArns != nil { ok := object.Key("resourceShareArns") if err := awsRestjson1_serializeDocumentResourceShareArnList(v.ResourceShareArns, ok); err != nil { return err } } if v.ResourceShareInvitationArns != nil { ok := object.Key("resourceShareInvitationArns") if err := awsRestjson1_serializeDocumentResourceShareInvitationArnList(v.ResourceShareInvitationArns, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetResourceShares struct { } func (*awsRestjson1_serializeOpGetResourceShares) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetResourceShares) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetResourceSharesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/getresourceshares") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentGetResourceSharesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetResourceSharesInput(v *GetResourceSharesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentGetResourceSharesInput(v *GetResourceSharesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.PermissionArn != nil { ok := object.Key("permissionArn") ok.String(*v.PermissionArn) } if len(v.ResourceOwner) > 0 { ok := object.Key("resourceOwner") ok.String(string(v.ResourceOwner)) } if v.ResourceShareArns != nil { ok := object.Key("resourceShareArns") if err := awsRestjson1_serializeDocumentResourceShareArnList(v.ResourceShareArns, ok); err != nil { return err } } if len(v.ResourceShareStatus) > 0 { ok := object.Key("resourceShareStatus") ok.String(string(v.ResourceShareStatus)) } if v.TagFilters != nil { ok := object.Key("tagFilters") if err := awsRestjson1_serializeDocumentTagFilters(v.TagFilters, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpListPendingInvitationResources struct { } func (*awsRestjson1_serializeOpListPendingInvitationResources) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListPendingInvitationResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListPendingInvitationResourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listpendinginvitationresources") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListPendingInvitationResourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListPendingInvitationResourcesInput(v *ListPendingInvitationResourcesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListPendingInvitationResourcesInput(v *ListPendingInvitationResourcesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.ResourceShareInvitationArn != nil { ok := object.Key("resourceShareInvitationArn") ok.String(*v.ResourceShareInvitationArn) } return nil } type awsRestjson1_serializeOpListPermissions struct { } func (*awsRestjson1_serializeOpListPermissions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListPermissionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listpermissions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListPermissionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListPermissionsInput(v *ListPermissionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListPermissionsInput(v *ListPermissionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.ResourceType != nil { ok := object.Key("resourceType") ok.String(*v.ResourceType) } return nil } type awsRestjson1_serializeOpListPrincipals struct { } func (*awsRestjson1_serializeOpListPrincipals) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListPrincipals) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListPrincipalsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listprincipals") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListPrincipalsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListPrincipalsInput(v *ListPrincipalsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListPrincipalsInput(v *ListPrincipalsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.Principals != nil { ok := object.Key("principals") if err := awsRestjson1_serializeDocumentPrincipalArnOrIdList(v.Principals, ok); err != nil { return err } } if v.ResourceArn != nil { ok := object.Key("resourceArn") ok.String(*v.ResourceArn) } if len(v.ResourceOwner) > 0 { ok := object.Key("resourceOwner") ok.String(string(v.ResourceOwner)) } if v.ResourceShareArns != nil { ok := object.Key("resourceShareArns") if err := awsRestjson1_serializeDocumentResourceShareArnList(v.ResourceShareArns, ok); err != nil { return err } } if v.ResourceType != nil { ok := object.Key("resourceType") ok.String(*v.ResourceType) } return nil } type awsRestjson1_serializeOpListResources struct { } func (*awsRestjson1_serializeOpListResources) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListResourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listresources") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListResourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListResourcesInput(v *ListResourcesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListResourcesInput(v *ListResourcesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.Principal != nil { ok := object.Key("principal") ok.String(*v.Principal) } if v.ResourceArns != nil { ok := object.Key("resourceArns") if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil { return err } } if len(v.ResourceOwner) > 0 { ok := object.Key("resourceOwner") ok.String(string(v.ResourceOwner)) } if v.ResourceShareArns != nil { ok := object.Key("resourceShareArns") if err := awsRestjson1_serializeDocumentResourceShareArnList(v.ResourceShareArns, ok); err != nil { return err } } if v.ResourceType != nil { ok := object.Key("resourceType") ok.String(*v.ResourceType) } return nil } type awsRestjson1_serializeOpListResourceSharePermissions struct { } func (*awsRestjson1_serializeOpListResourceSharePermissions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListResourceSharePermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListResourceSharePermissionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listresourcesharepermissions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListResourceSharePermissionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListResourceSharePermissionsInput(v *ListResourceSharePermissionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListResourceSharePermissionsInput(v *ListResourceSharePermissionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.ResourceShareArn != nil { ok := object.Key("resourceShareArn") ok.String(*v.ResourceShareArn) } return nil } type awsRestjson1_serializeOpListResourceTypes struct { } func (*awsRestjson1_serializeOpListResourceTypes) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListResourceTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListResourceTypesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listresourcetypes") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentListResourceTypesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListResourceTypesInput(v *ListResourceTypesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentListResourceTypesInput(v *ListResourceTypesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } type awsRestjson1_serializeOpPromoteResourceShareCreatedFromPolicy struct { } func (*awsRestjson1_serializeOpPromoteResourceShareCreatedFromPolicy) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPromoteResourceShareCreatedFromPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PromoteResourceShareCreatedFromPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/promoteresourcesharecreatedfrompolicy") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsPromoteResourceShareCreatedFromPolicyInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsPromoteResourceShareCreatedFromPolicyInput(v *PromoteResourceShareCreatedFromPolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceShareArn != nil { encoder.SetQuery("resourceShareArn").String(*v.ResourceShareArn) } return nil } type awsRestjson1_serializeOpRejectResourceShareInvitation struct { } func (*awsRestjson1_serializeOpRejectResourceShareInvitation) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRejectResourceShareInvitation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RejectResourceShareInvitationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/rejectresourceshareinvitation") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentRejectResourceShareInvitationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsRejectResourceShareInvitationInput(v *RejectResourceShareInvitationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentRejectResourceShareInvitationInput(v *RejectResourceShareInvitationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.ResourceShareInvitationArn != nil { ok := object.Key("resourceShareInvitationArn") ok.String(*v.ResourceShareInvitationArn) } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tagresource") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceShareArn != nil { ok := object.Key("resourceShareArn") ok.String(*v.ResourceShareArn) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/untagresource") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceShareArn != nil { ok := object.Key("resourceShareArn") ok.String(*v.ResourceShareArn) } if v.TagKeys != nil { ok := object.Key("tagKeys") if err := awsRestjson1_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateResourceShare struct { } func (*awsRestjson1_serializeOpUpdateResourceShare) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateResourceShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateResourceShareInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/updateresourceshare") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateResourceShareInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateResourceShareInput(v *UpdateResourceShareInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentUpdateResourceShareInput(v *UpdateResourceShareInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AllowExternalPrincipals != nil { ok := object.Key("allowExternalPrincipals") ok.Boolean(*v.AllowExternalPrincipals) } if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.ResourceShareArn != nil { ok := object.Key("resourceShareArn") ok.String(*v.ResourceShareArn) } return nil } func awsRestjson1_serializeDocumentPermissionArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentPrincipalArnOrIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentResourceArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentResourceShareArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentResourceShareInvitationArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("value") ok.String(*v.Value) } return nil } func awsRestjson1_serializeDocumentTagFilter(v *types.TagFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.TagKey != nil { ok := object.Key("tagKey") ok.String(*v.TagKey) } if v.TagValues != nil { ok := object.Key("tagValues") if err := awsRestjson1_serializeDocumentTagValueList(v.TagValues, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentTagFilters(v []types.TagFilter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTagFilter(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentTagValueList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil }