repo_name stringlengths 1 52 | repo_creator stringclasses 6
values | programming_language stringclasses 4
values | code stringlengths 0 9.68M | num_lines int64 1 234k |
|---|---|---|---|---|
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexruntimeservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
)
// Creates a new session or modifies an existing session with an Amazon Lex bot.
// Use this operation to enable your application to set the state of the bot. For
// more information, see Managing Sessions (https://docs.aws.amazon.com/lex/latest/dg/how-session-api.html)
// .
func (c *Client) PutSession(ctx context.Context, params *PutSessionInput, optFns ...func(*Options)) (*PutSessionOutput, error) {
if params == nil {
params = &PutSessionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutSession", params, optFns, c.addOperationPutSessionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutSessionOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutSessionInput struct {
// The alias in use for the bot that contains the session data.
//
// This member is required.
BotAlias *string
// The name of the bot that contains the session data.
//
// This member is required.
BotName *string
// The ID of the client application user. Amazon Lex uses this to identify a
// user's conversation with your bot.
//
// This member is required.
UserId *string
// The message that Amazon Lex returns in the response can be either text or
// speech based depending on the value of this field.
// - If the value is text/plain; charset=utf-8 , Amazon Lex returns text in the
// response.
// - If the value begins with audio/ , Amazon Lex returns speech in the response.
// Amazon Lex uses Amazon Polly to generate the speech in the configuration that
// you specify. For example, if you specify audio/mpeg as the value, Amazon Lex
// returns speech in the MPEG format.
// - If the value is audio/pcm , the speech is returned as audio/pcm in 16-bit,
// little endian format.
// - The following are the accepted values:
// - audio/mpeg
// - audio/ogg
// - audio/pcm
// - audio/* (defaults to mpeg)
// - text/plain; charset=utf-8
Accept *string
// A list of contexts active for the request. A context can be activated when a
// previous intent is fulfilled, or by including the context in the request, If you
// don't specify a list of contexts, Amazon Lex will use the current list of
// contexts for the session. If you specify an empty list, all contexts for the
// session are cleared.
ActiveContexts []types.ActiveContext
// Sets the next action that the bot should take to fulfill the conversation.
DialogAction *types.DialogAction
// A summary of the recent intents for the bot. You can use the intent summary
// view to set a checkpoint label on an intent and modify attributes of intents.
// You can also use it to remove or add intent summary objects to the list. An
// intent that you modify or add to the list must make sense for the bot. For
// example, the intent name must be valid for the bot. You must provide valid
// values for:
// - intentName
// - slot names
// - slotToElict
// If you send the recentIntentSummaryView parameter in a PutSession request, the
// contents of the new summary view replaces the old summary view. For example, if
// a GetSession request returns three intents in the summary view and you call
// PutSession with one intent in the summary view, the next call to GetSession
// will only return one intent.
RecentIntentSummaryView []types.IntentSummary
// Map of key/value pairs representing the session-specific context information.
// It contains application information passed between Amazon Lex and a client
// application.
SessionAttributes map[string]string
noSmithyDocumentSerde
}
type PutSessionOutput struct {
// A list of active contexts for the session.
//
// This value conforms to the media type: application/json
ActiveContexts *string
// The audio version of the message to convey to the user.
AudioStream io.ReadCloser
// Content type as specified in the Accept HTTP header in the request.
ContentType *string
// - ConfirmIntent - Amazon Lex is expecting a "yes" or "no" response to confirm
// the intent before fulfilling an intent.
// - ElicitIntent - Amazon Lex wants to elicit the user's intent.
// - ElicitSlot - Amazon Lex is expecting the value of a slot for the current
// intent.
// - Failed - Conveys that the conversation with the user has failed. This can
// happen for various reasons, including the user does not provide an appropriate
// response to prompts from the service, or if the Lambda function fails to fulfill
// the intent.
// - Fulfilled - Conveys that the Lambda function has sucessfully fulfilled the
// intent.
// - ReadyForFulfillment - Conveys that the client has to fulfill the intent.
DialogState types.DialogState
// The next message that should be presented to the user. The encodedMessage field
// is base-64 encoded. You must decode the field before you can use the value.
EncodedMessage *string
// The name of the current intent.
IntentName *string
// The next message that should be presented to the user. You can only use this
// field in the de-DE, en-AU, en-GB, en-US, es-419, es-ES, es-US, fr-CA, fr-FR, and
// it-IT locales. In all other locales, the message field is null. You should use
// the encodedMessage field instead.
//
// Deprecated: The message field is deprecated, use the encodedMessage field
// instead. The message field is available only in the de-DE, en-AU, en-GB, en-US,
// es-419, es-ES, es-US, fr-CA, fr-FR and it-IT locales.
Message *string
// The format of the response message. One of the following values:
// - PlainText - The message contains plain UTF-8 text.
// - CustomPayload - The message is a custom format for the client.
// - SSML - The message contains text formatted for voice output.
// - Composite - The message contains an escaped JSON object containing one or
// more messages from the groups that messages were assigned to when the intent was
// created.
MessageFormat types.MessageFormatType
// Map of key/value pairs representing session-specific context information.
//
// This value conforms to the media type: application/json
SessionAttributes *string
// A unique identifier for the session.
SessionId *string
// If the dialogState is ElicitSlot , returns the name of the slot for which Amazon
// Lex is eliciting a value.
SlotToElicit *string
// Map of zero or more intent slots Amazon Lex detected from the user input during
// the conversation. Amazon Lex creates a resolution list containing likely values
// for a slot. The value that it returns is determined by the
// valueSelectionStrategy selected when the slot type was created or updated. If
// valueSelectionStrategy is set to ORIGINAL_VALUE , the value provided by the user
// is returned, if the user value is similar to the slot values. If
// valueSelectionStrategy is set to TOP_RESOLUTION Amazon Lex returns the first
// value in the resolution list or, if there is no resolution list, null. If you
// don't specify a valueSelectionStrategy the default is ORIGINAL_VALUE .
//
// This value conforms to the media type: application/json
Slots *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSession{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSession{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutSessionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSession(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPutSession(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "PutSession",
}
}
| 259 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/lexruntimeservice/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"math"
"strings"
)
type awsRestjson1_deserializeOpDeleteSession struct {
}
func (*awsRestjson1_deserializeOpDeleteSession) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteSession(response, &metadata)
}
output := &DeleteSessionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDeleteSessionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteSession(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteSessionOutput(v **DeleteSessionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteSessionOutput
if *v == nil {
sv = &DeleteSessionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botAlias":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotAlias to be of type string, got %T instead", value)
}
sv.BotAlias = ptr.String(jtv)
}
case "botName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.BotName = ptr.String(jtv)
}
case "sessionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SessionId = ptr.String(jtv)
}
case "userId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserId to be of type string, got %T instead", value)
}
sv.UserId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetSession struct {
}
func (*awsRestjson1_deserializeOpGetSession) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetSession(response, &metadata)
}
output := &GetSessionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetSessionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetSession(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSessionOutput
if *v == nil {
sv = &GetSessionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "activeContexts":
if err := awsRestjson1_deserializeDocumentActiveContextsList(&sv.ActiveContexts, value); err != nil {
return err
}
case "dialogAction":
if err := awsRestjson1_deserializeDocumentDialogAction(&sv.DialogAction, value); err != nil {
return err
}
case "recentIntentSummaryView":
if err := awsRestjson1_deserializeDocumentIntentSummaryList(&sv.RecentIntentSummaryView, value); err != nil {
return err
}
case "sessionAttributes":
if err := awsRestjson1_deserializeDocumentStringMap(&sv.SessionAttributes, value); err != nil {
return err
}
case "sessionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SessionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPostContent struct {
}
func (*awsRestjson1_deserializeOpPostContent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPostContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorPostContent(response, &metadata)
}
output := &PostContentOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsPostContentOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
err = awsRestjson1_deserializeOpDocumentPostContentOutput(output, response.Body)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPostContent(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadGatewayException", errorCode):
return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("DependencyFailedException", errorCode):
return awsRestjson1_deserializeErrorDependencyFailedException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("LoopDetectedException", errorCode):
return awsRestjson1_deserializeErrorLoopDetectedException(response, errorBody)
case strings.EqualFold("NotAcceptableException", errorCode):
return awsRestjson1_deserializeErrorNotAcceptableException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("RequestTimeoutException", errorCode):
return awsRestjson1_deserializeErrorRequestTimeoutException(response, errorBody)
case strings.EqualFold("UnsupportedMediaTypeException", errorCode):
return awsRestjson1_deserializeErrorUnsupportedMediaTypeException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsPostContentOutput(v *PostContentOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("x-amz-lex-active-contexts"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
b, err := base64.StdEncoding.DecodeString(headerValues[0])
if err != nil {
return err
}
v.ActiveContexts = ptr.String(string(b))
}
if headerValues := response.Header.Values("x-amz-lex-alternative-intents"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
b, err := base64.StdEncoding.DecodeString(headerValues[0])
if err != nil {
return err
}
v.AlternativeIntents = ptr.String(string(b))
}
if headerValues := response.Header.Values("x-amz-lex-bot-version"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.BotVersion = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentType = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-dialog-state"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.DialogState = types.DialogState(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-encoded-input-transcript"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.EncodedInputTranscript = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-encoded-message"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.EncodedMessage = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-input-transcript"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.InputTranscript = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-intent-name"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.IntentName = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-message"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.Message = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-message-format"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.MessageFormat = types.MessageFormatType(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-nlu-intent-confidence"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
b, err := base64.StdEncoding.DecodeString(headerValues[0])
if err != nil {
return err
}
v.NluIntentConfidence = ptr.String(string(b))
}
if headerValues := response.Header.Values("x-amz-lex-sentiment"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SentimentResponse = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-session-attributes"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
b, err := base64.StdEncoding.DecodeString(headerValues[0])
if err != nil {
return err
}
v.SessionAttributes = ptr.String(string(b))
}
if headerValues := response.Header.Values("x-amz-lex-session-id"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SessionId = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-slots"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
b, err := base64.StdEncoding.DecodeString(headerValues[0])
if err != nil {
return err
}
v.Slots = ptr.String(string(b))
}
if headerValues := response.Header.Values("x-amz-lex-slot-to-elicit"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SlotToElicit = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeOpDocumentPostContentOutput(v *PostContentOutput, body io.ReadCloser) error {
if v == nil {
return fmt.Errorf("unsupported deserialization of nil %T", v)
}
v.AudioStream = body
return nil
}
type awsRestjson1_deserializeOpPostText struct {
}
func (*awsRestjson1_deserializeOpPostText) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPostText) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorPostText(response, &metadata)
}
output := &PostTextOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentPostTextOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPostText(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadGatewayException", errorCode):
return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("DependencyFailedException", errorCode):
return awsRestjson1_deserializeErrorDependencyFailedException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("LoopDetectedException", errorCode):
return awsRestjson1_deserializeErrorLoopDetectedException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPostTextOutput(v **PostTextOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PostTextOutput
if *v == nil {
sv = &PostTextOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "activeContexts":
if err := awsRestjson1_deserializeDocumentActiveContextsList(&sv.ActiveContexts, value); err != nil {
return err
}
case "alternativeIntents":
if err := awsRestjson1_deserializeDocumentIntentList(&sv.AlternativeIntents, value); err != nil {
return err
}
case "botVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotVersion to be of type string, got %T instead", value)
}
sv.BotVersion = ptr.String(jtv)
}
case "dialogState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DialogState to be of type string, got %T instead", value)
}
sv.DialogState = types.DialogState(jtv)
}
case "intentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentName to be of type string, got %T instead", value)
}
sv.IntentName = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "messageFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MessageFormatType to be of type string, got %T instead", value)
}
sv.MessageFormat = types.MessageFormatType(jtv)
}
case "nluIntentConfidence":
if err := awsRestjson1_deserializeDocumentIntentConfidence(&sv.NluIntentConfidence, value); err != nil {
return err
}
case "responseCard":
if err := awsRestjson1_deserializeDocumentResponseCard(&sv.ResponseCard, value); err != nil {
return err
}
case "sentimentResponse":
if err := awsRestjson1_deserializeDocumentSentimentResponse(&sv.SentimentResponse, value); err != nil {
return err
}
case "sessionAttributes":
if err := awsRestjson1_deserializeDocumentStringMap(&sv.SessionAttributes, value); err != nil {
return err
}
case "sessionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SessionId = ptr.String(jtv)
}
case "slots":
if err := awsRestjson1_deserializeDocumentStringMap(&sv.Slots, value); err != nil {
return err
}
case "slotToElicit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SlotToElicit = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutSession struct {
}
func (*awsRestjson1_deserializeOpPutSession) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorPutSession(response, &metadata)
}
output := &PutSessionOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsPutSessionOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
err = awsRestjson1_deserializeOpDocumentPutSessionOutput(output, response.Body)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutSession(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadGatewayException", errorCode):
return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("DependencyFailedException", errorCode):
return awsRestjson1_deserializeErrorDependencyFailedException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotAcceptableException", errorCode):
return awsRestjson1_deserializeErrorNotAcceptableException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsPutSessionOutput(v *PutSessionOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("x-amz-lex-active-contexts"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
b, err := base64.StdEncoding.DecodeString(headerValues[0])
if err != nil {
return err
}
v.ActiveContexts = ptr.String(string(b))
}
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentType = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-dialog-state"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.DialogState = types.DialogState(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-encoded-message"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.EncodedMessage = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-intent-name"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.IntentName = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-message"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.Message = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-message-format"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.MessageFormat = types.MessageFormatType(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-session-attributes"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
b, err := base64.StdEncoding.DecodeString(headerValues[0])
if err != nil {
return err
}
v.SessionAttributes = ptr.String(string(b))
}
if headerValues := response.Header.Values("x-amz-lex-session-id"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SessionId = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-slots"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
b, err := base64.StdEncoding.DecodeString(headerValues[0])
if err != nil {
return err
}
v.Slots = ptr.String(string(b))
}
if headerValues := response.Header.Values("x-amz-lex-slot-to-elicit"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SlotToElicit = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeOpDocumentPutSessionOutput(v *PutSessionOutput, body io.ReadCloser) error {
if v == nil {
return fmt.Errorf("unsupported deserialization of nil %T", v)
}
v.AudioStream = body
return nil
}
func awsRestjson1_deserializeOpHttpBindingsLimitExceededException(v *types.LimitExceededException, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.RetryAfterSeconds = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeErrorBadGatewayException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.BadGatewayException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentBadGatewayException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.BadRequestException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ConflictException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentConflictException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorDependencyFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.DependencyFailedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentDependencyFailedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalFailureException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.LimitExceededException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if err := awsRestjson1_deserializeOpHttpBindingsLimitExceededException(output, response); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)}
}
return output
}
func awsRestjson1_deserializeErrorLoopDetectedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.LoopDetectedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentLoopDetectedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorNotAcceptableException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.NotAcceptableException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentNotAcceptableException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.NotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorRequestTimeoutException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.RequestTimeoutException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentRequestTimeoutException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorUnsupportedMediaTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.UnsupportedMediaTypeException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentUnsupportedMediaTypeException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeDocumentActiveContext(v **types.ActiveContext, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActiveContext
if *v == nil {
sv = &types.ActiveContext{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActiveContextName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "parameters":
if err := awsRestjson1_deserializeDocumentActiveContextParametersMap(&sv.Parameters, value); err != nil {
return err
}
case "timeToLive":
if err := awsRestjson1_deserializeDocumentActiveContextTimeToLive(&sv.TimeToLive, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentActiveContextParametersMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentActiveContextsList(v *[]types.ActiveContext, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ActiveContext
if *v == nil {
cv = []types.ActiveContext{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ActiveContext
destAddr := &col
if err := awsRestjson1_deserializeDocumentActiveContext(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentActiveContextTimeToLive(v **types.ActiveContextTimeToLive, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActiveContextTimeToLive
if *v == nil {
sv = &types.ActiveContextTimeToLive{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "timeToLiveInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ActiveContextTimeToLiveInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeToLiveInSeconds = ptr.Int32(int32(i64))
}
case "turnsToLive":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ActiveContextTurnsToLive to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TurnsToLive = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBadGatewayException(v **types.BadGatewayException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BadGatewayException
if *v == nil {
sv = &types.BadGatewayException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BadRequestException
if *v == nil {
sv = &types.BadRequestException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentButton(v **types.Button, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Button
if *v == nil {
sv = &types.Button{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "text":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ButtonTextStringWithLength to be of type string, got %T instead", value)
}
sv.Text = ptr.String(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ButtonValueStringWithLength to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDependencyFailedException(v **types.DependencyFailedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DependencyFailedException
if *v == nil {
sv = &types.DependencyFailedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDialogAction(v **types.DialogAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DialogAction
if *v == nil {
sv = &types.DialogAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "fulfillmentState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FulfillmentState to be of type string, got %T instead", value)
}
sv.FulfillmentState = types.FulfillmentState(jtv)
}
case "intentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentName to be of type string, got %T instead", value)
}
sv.IntentName = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "messageFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MessageFormatType to be of type string, got %T instead", value)
}
sv.MessageFormat = types.MessageFormatType(jtv)
}
case "slots":
if err := awsRestjson1_deserializeDocumentStringMap(&sv.Slots, value); err != nil {
return err
}
case "slotToElicit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SlotToElicit = ptr.String(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DialogActionType to be of type string, got %T instead", value)
}
sv.Type = types.DialogActionType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentGenericAttachment(v **types.GenericAttachment, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.GenericAttachment
if *v == nil {
sv = &types.GenericAttachment{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "attachmentLinkUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StringUrlWithLength to be of type string, got %T instead", value)
}
sv.AttachmentLinkUrl = ptr.String(jtv)
}
case "buttons":
if err := awsRestjson1_deserializeDocumentListOfButtons(&sv.Buttons, value); err != nil {
return err
}
case "imageUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StringUrlWithLength to be of type string, got %T instead", value)
}
sv.ImageUrl = ptr.String(jtv)
}
case "subTitle":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StringWithLength to be of type string, got %T instead", value)
}
sv.SubTitle = ptr.String(jtv)
}
case "title":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StringWithLength to be of type string, got %T instead", value)
}
sv.Title = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentGenericAttachmentList(v *[]types.GenericAttachment, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.GenericAttachment
if *v == nil {
cv = []types.GenericAttachment{}
} else {
cv = *v
}
for _, value := range shape {
var col types.GenericAttachment
destAddr := &col
if err := awsRestjson1_deserializeDocumentGenericAttachment(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentIntentConfidence(v **types.IntentConfidence, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IntentConfidence
if *v == nil {
sv = &types.IntentConfidence{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "score":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Score = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Score = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIntentList(v *[]types.PredictedIntent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.PredictedIntent
if *v == nil {
cv = []types.PredictedIntent{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PredictedIntent
destAddr := &col
if err := awsRestjson1_deserializeDocumentPredictedIntent(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentIntentSummary(v **types.IntentSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IntentSummary
if *v == nil {
sv = &types.IntentSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "checkpointLabel":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentSummaryCheckpointLabel to be of type string, got %T instead", value)
}
sv.CheckpointLabel = ptr.String(jtv)
}
case "confirmationStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConfirmationStatus to be of type string, got %T instead", value)
}
sv.ConfirmationStatus = types.ConfirmationStatus(jtv)
}
case "dialogActionType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DialogActionType to be of type string, got %T instead", value)
}
sv.DialogActionType = types.DialogActionType(jtv)
}
case "fulfillmentState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FulfillmentState to be of type string, got %T instead", value)
}
sv.FulfillmentState = types.FulfillmentState(jtv)
}
case "intentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentName to be of type string, got %T instead", value)
}
sv.IntentName = ptr.String(jtv)
}
case "slots":
if err := awsRestjson1_deserializeDocumentStringMap(&sv.Slots, value); err != nil {
return err
}
case "slotToElicit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SlotToElicit = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIntentSummaryList(v *[]types.IntentSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.IntentSummary
if *v == nil {
cv = []types.IntentSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.IntentSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentIntentSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalFailureException
if *v == nil {
sv = &types.InternalFailureException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LimitExceededException
if *v == nil {
sv = &types.LimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "retryAfterSeconds":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RetryAfterSeconds = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListOfButtons(v *[]types.Button, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Button
if *v == nil {
cv = []types.Button{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Button
destAddr := &col
if err := awsRestjson1_deserializeDocumentButton(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLoopDetectedException(v **types.LoopDetectedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LoopDetectedException
if *v == nil {
sv = &types.LoopDetectedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentNotAcceptableException(v **types.NotAcceptableException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NotAcceptableException
if *v == nil {
sv = &types.NotAcceptableException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NotFoundException
if *v == nil {
sv = &types.NotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPredictedIntent(v **types.PredictedIntent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PredictedIntent
if *v == nil {
sv = &types.PredictedIntent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "intentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentName to be of type string, got %T instead", value)
}
sv.IntentName = ptr.String(jtv)
}
case "nluIntentConfidence":
if err := awsRestjson1_deserializeDocumentIntentConfidence(&sv.NluIntentConfidence, value); err != nil {
return err
}
case "slots":
if err := awsRestjson1_deserializeDocumentStringMap(&sv.Slots, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRequestTimeoutException(v **types.RequestTimeoutException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RequestTimeoutException
if *v == nil {
sv = &types.RequestTimeoutException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResponseCard(v **types.ResponseCard, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResponseCard
if *v == nil {
sv = &types.ResponseCard{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "contentType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContentType to be of type string, got %T instead", value)
}
sv.ContentType = types.ContentType(jtv)
}
case "genericAttachments":
if err := awsRestjson1_deserializeDocumentGenericAttachmentList(&sv.GenericAttachments, value); err != nil {
return err
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSentimentResponse(v **types.SentimentResponse, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SentimentResponse
if *v == nil {
sv = &types.SentimentResponse{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "sentimentLabel":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SentimentLabel to be of type string, got %T instead", value)
}
sv.SentimentLabel = ptr.String(jtv)
}
case "sentimentScore":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SentimentScore to be of type string, got %T instead", value)
}
sv.SentimentScore = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentStringMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentUnsupportedMediaTypeException(v **types.UnsupportedMediaTypeException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.UnsupportedMediaTypeException
if *v == nil {
sv = &types.UnsupportedMediaTypeException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 2,823 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package lexruntimeservice provides the API client, operations, and parameter
// types for Amazon Lex Runtime Service.
//
// Amazon Lex provides both build and runtime endpoints. Each endpoint provides a
// set of operations (API). Your conversational bot uses the runtime API to
// understand user utterances (user input text or voice). For example, suppose a
// user says "I want pizza", your bot sends this input to Amazon Lex using the
// runtime API. Amazon Lex recognizes that the user request is for the OrderPizza
// intent (one of the intents defined in the bot). Then Amazon Lex engages in user
// conversation on behalf of the bot to elicit required information (slot values,
// such as pizza size and crust type), and then performs fulfillment activity (that
// you configured when you created the bot). You use the build-time API to create
// and manage your Amazon Lex bot. For a list of build-time operations, see the
// build-time API, .
package lexruntimeservice
| 18 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/lexruntimeservice/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "lex"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package lexruntimeservice
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.13.12"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"bytes"
"context"
"encoding/base64"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lexruntimeservice/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"
"github.com/aws/smithy-go/ptr"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpDeleteSession struct {
}
func (*awsRestjson1_serializeOpDeleteSession) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSession) 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.(*DeleteSessionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bot/{botName}/alias/{botAlias}/user/{userId}/session")
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_serializeOpHttpBindingsDeleteSessionInput(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_serializeOpHttpBindingsDeleteSessionInput(v *DeleteSessionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAlias == nil || len(*v.BotAlias) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")}
}
if v.BotAlias != nil {
if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil {
return err
}
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetSession struct {
}
func (*awsRestjson1_serializeOpGetSession) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetSession) 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.(*GetSessionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bot/{botName}/alias/{botAlias}/user/{userId}/session")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
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_serializeOpHttpBindingsGetSessionInput(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_serializeOpHttpBindingsGetSessionInput(v *GetSessionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAlias == nil || len(*v.BotAlias) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")}
}
if v.BotAlias != nil {
if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil {
return err
}
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.CheckpointLabelFilter != nil {
encoder.SetQuery("checkpointLabelFilter").String(*v.CheckpointLabelFilter)
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPostContent struct {
}
func (*awsRestjson1_serializeOpPostContent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPostContent) 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.(*PostContentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bot/{botName}/alias/{botAlias}/user/{userId}/content")
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_serializeOpHttpBindingsPostContentInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/octet-stream")
}
if input.InputStream != nil {
payload := input.InputStream
if request, err = request.SetStream(payload); 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_serializeOpHttpBindingsPostContentInput(v *PostContentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Accept != nil && len(*v.Accept) > 0 {
locationName := "Accept"
encoder.SetHeader(locationName).String(*v.Accept)
}
if v.ActiveContexts != nil && len(*v.ActiveContexts) > 0 {
locationName := "X-Amz-Lex-Active-Contexts"
encodedVal := base64.StdEncoding.EncodeToString([]byte(*v.ActiveContexts))
encodedPtr := ptr.String(encodedVal)
encoder.SetHeader(locationName).String(*encodedPtr)
}
if v.BotAlias == nil || len(*v.BotAlias) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")}
}
if v.BotAlias != nil {
if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil {
return err
}
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.ContentType != nil && len(*v.ContentType) > 0 {
locationName := "Content-Type"
encoder.SetHeader(locationName).String(*v.ContentType)
}
if v.RequestAttributes != nil && len(*v.RequestAttributes) > 0 {
locationName := "X-Amz-Lex-Request-Attributes"
encodedVal := base64.StdEncoding.EncodeToString([]byte(*v.RequestAttributes))
encodedPtr := ptr.String(encodedVal)
encoder.SetHeader(locationName).String(*encodedPtr)
}
if v.SessionAttributes != nil && len(*v.SessionAttributes) > 0 {
locationName := "X-Amz-Lex-Session-Attributes"
encodedVal := base64.StdEncoding.EncodeToString([]byte(*v.SessionAttributes))
encodedPtr := ptr.String(encodedVal)
encoder.SetHeader(locationName).String(*encodedPtr)
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPostText struct {
}
func (*awsRestjson1_serializeOpPostText) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPostText) 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.(*PostTextInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bot/{botName}/alias/{botAlias}/user/{userId}/text")
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_serializeOpHttpBindingsPostTextInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPostTextInput(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_serializeOpHttpBindingsPostTextInput(v *PostTextInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAlias == nil || len(*v.BotAlias) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")}
}
if v.BotAlias != nil {
if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil {
return err
}
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPostTextInput(v *PostTextInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActiveContexts != nil {
ok := object.Key("activeContexts")
if err := awsRestjson1_serializeDocumentActiveContextsList(v.ActiveContexts, ok); err != nil {
return err
}
}
if v.InputText != nil {
ok := object.Key("inputText")
ok.String(*v.InputText)
}
if v.RequestAttributes != nil {
ok := object.Key("requestAttributes")
if err := awsRestjson1_serializeDocumentStringMap(v.RequestAttributes, ok); err != nil {
return err
}
}
if v.SessionAttributes != nil {
ok := object.Key("sessionAttributes")
if err := awsRestjson1_serializeDocumentStringMap(v.SessionAttributes, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutSession struct {
}
func (*awsRestjson1_serializeOpPutSession) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutSession) 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.(*PutSessionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bot/{botName}/alias/{botAlias}/user/{userId}/session")
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_serializeOpHttpBindingsPutSessionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutSessionInput(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_serializeOpHttpBindingsPutSessionInput(v *PutSessionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Accept != nil && len(*v.Accept) > 0 {
locationName := "Accept"
encoder.SetHeader(locationName).String(*v.Accept)
}
if v.BotAlias == nil || len(*v.BotAlias) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")}
}
if v.BotAlias != nil {
if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil {
return err
}
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutSessionInput(v *PutSessionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActiveContexts != nil {
ok := object.Key("activeContexts")
if err := awsRestjson1_serializeDocumentActiveContextsList(v.ActiveContexts, ok); err != nil {
return err
}
}
if v.DialogAction != nil {
ok := object.Key("dialogAction")
if err := awsRestjson1_serializeDocumentDialogAction(v.DialogAction, ok); err != nil {
return err
}
}
if v.RecentIntentSummaryView != nil {
ok := object.Key("recentIntentSummaryView")
if err := awsRestjson1_serializeDocumentIntentSummaryList(v.RecentIntentSummaryView, ok); err != nil {
return err
}
}
if v.SessionAttributes != nil {
ok := object.Key("sessionAttributes")
if err := awsRestjson1_serializeDocumentStringMap(v.SessionAttributes, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentActiveContext(v *types.ActiveContext, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Parameters != nil {
ok := object.Key("parameters")
if err := awsRestjson1_serializeDocumentActiveContextParametersMap(v.Parameters, ok); err != nil {
return err
}
}
if v.TimeToLive != nil {
ok := object.Key("timeToLive")
if err := awsRestjson1_serializeDocumentActiveContextTimeToLive(v.TimeToLive, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentActiveContextParametersMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentActiveContextsList(v []types.ActiveContext, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentActiveContext(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentActiveContextTimeToLive(v *types.ActiveContextTimeToLive, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TimeToLiveInSeconds != nil {
ok := object.Key("timeToLiveInSeconds")
ok.Integer(*v.TimeToLiveInSeconds)
}
if v.TurnsToLive != nil {
ok := object.Key("turnsToLive")
ok.Integer(*v.TurnsToLive)
}
return nil
}
func awsRestjson1_serializeDocumentDialogAction(v *types.DialogAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.FulfillmentState) > 0 {
ok := object.Key("fulfillmentState")
ok.String(string(v.FulfillmentState))
}
if v.IntentName != nil {
ok := object.Key("intentName")
ok.String(*v.IntentName)
}
if v.Message != nil {
ok := object.Key("message")
ok.String(*v.Message)
}
if len(v.MessageFormat) > 0 {
ok := object.Key("messageFormat")
ok.String(string(v.MessageFormat))
}
if v.Slots != nil {
ok := object.Key("slots")
if err := awsRestjson1_serializeDocumentStringMap(v.Slots, ok); err != nil {
return err
}
}
if v.SlotToElicit != nil {
ok := object.Key("slotToElicit")
ok.String(*v.SlotToElicit)
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentIntentSummary(v *types.IntentSummary, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CheckpointLabel != nil {
ok := object.Key("checkpointLabel")
ok.String(*v.CheckpointLabel)
}
if len(v.ConfirmationStatus) > 0 {
ok := object.Key("confirmationStatus")
ok.String(string(v.ConfirmationStatus))
}
if len(v.DialogActionType) > 0 {
ok := object.Key("dialogActionType")
ok.String(string(v.DialogActionType))
}
if len(v.FulfillmentState) > 0 {
ok := object.Key("fulfillmentState")
ok.String(string(v.FulfillmentState))
}
if v.IntentName != nil {
ok := object.Key("intentName")
ok.String(*v.IntentName)
}
if v.Slots != nil {
ok := object.Key("slots")
if err := awsRestjson1_serializeDocumentStringMap(v.Slots, ok); err != nil {
return err
}
}
if v.SlotToElicit != nil {
ok := object.Key("slotToElicit")
ok.String(*v.SlotToElicit)
}
return nil
}
func awsRestjson1_serializeDocumentIntentSummaryList(v []types.IntentSummary, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentIntentSummary(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentStringMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
| 719 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimeservice
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lexruntimeservice/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpDeleteSession struct {
}
func (*validateOpDeleteSession) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSessionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSessionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSession struct {
}
func (*validateOpGetSession) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSessionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSessionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPostContent struct {
}
func (*validateOpPostContent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPostContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PostContentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPostContentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPostText struct {
}
func (*validateOpPostText) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPostText) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PostTextInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPostTextInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutSession struct {
}
func (*validateOpPutSession) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutSessionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutSessionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpDeleteSessionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSession{}, middleware.After)
}
func addOpGetSessionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSession{}, middleware.After)
}
func addOpPostContentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPostContent{}, middleware.After)
}
func addOpPostTextValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPostText{}, middleware.After)
}
func addOpPutSessionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutSession{}, middleware.After)
}
func validateActiveContext(v *types.ActiveContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ActiveContext"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.TimeToLive == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeToLive"))
}
if v.Parameters == nil {
invalidParams.Add(smithy.NewErrParamRequired("Parameters"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateActiveContextsList(v []types.ActiveContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ActiveContextsList"}
for i := range v {
if err := validateActiveContext(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDialogAction(v *types.DialogAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DialogAction"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIntentSummary(v *types.IntentSummary) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IntentSummary"}
if len(v.DialogActionType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DialogActionType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIntentSummaryList(v []types.IntentSummary) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IntentSummaryList"}
for i := range v {
if err := validateIntentSummary(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSessionInput(v *DeleteSessionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSessionInput"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.BotAlias == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAlias"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSessionInput(v *GetSessionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSessionInput"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.BotAlias == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAlias"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPostContentInput(v *PostContentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PostContentInput"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.BotAlias == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAlias"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if v.ContentType == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContentType"))
}
if v.InputStream == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputStream"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPostTextInput(v *PostTextInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PostTextInput"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.BotAlias == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAlias"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if v.InputText == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputText"))
}
if v.ActiveContexts != nil {
if err := validateActiveContextsList(v.ActiveContexts); err != nil {
invalidParams.AddNested("ActiveContexts", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutSessionInput(v *PutSessionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutSessionInput"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.BotAlias == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAlias"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if v.DialogAction != nil {
if err := validateDialogAction(v.DialogAction); err != nil {
invalidParams.AddNested("DialogAction", err.(smithy.InvalidParamsError))
}
}
if v.RecentIntentSummaryView != nil {
if err := validateIntentSummaryList(v.RecentIntentSummaryView); err != nil {
invalidParams.AddNested("RecentIntentSummaryView", err.(smithy.InvalidParamsError))
}
}
if v.ActiveContexts != nil {
if err := validateActiveContextsList(v.ActiveContexts); err != nil {
invalidParams.AddNested("ActiveContexts", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 351 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver Lex Runtime Service endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "runtime.lex.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-fips.lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "runtime.lex-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: 0,
}: {
Hostname: "runtime.lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-fips.lex.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-1-fips",
}: endpoints.Endpoint{
Hostname: "runtime-fips.lex.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-fips.lex.us-west-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2-fips",
}: endpoints.Endpoint{
Hostname: "runtime-fips.lex.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "runtime.lex.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime.lex-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "runtime.lex-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime.lex.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime.lex-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime.lex.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime.lex-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime.lex.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime.lex-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime.lex.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime.lex-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime.lex.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "runtime.lex.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-fips.lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "runtime.lex-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: 0,
}: {
Hostname: "runtime.lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-fips.lex.us-gov-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1-fips",
}: endpoints.Endpoint{
Hostname: "runtime-fips.lex.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
},
},
}
| 397 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type ConfirmationStatus string
// Enum values for ConfirmationStatus
const (
ConfirmationStatusNone ConfirmationStatus = "None"
ConfirmationStatusConfirmed ConfirmationStatus = "Confirmed"
ConfirmationStatusDenied ConfirmationStatus = "Denied"
)
// Values returns all known values for ConfirmationStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ConfirmationStatus) Values() []ConfirmationStatus {
return []ConfirmationStatus{
"None",
"Confirmed",
"Denied",
}
}
type ContentType string
// Enum values for ContentType
const (
ContentTypeGeneric ContentType = "application/vnd.amazonaws.card.generic"
)
// Values returns all known values for ContentType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (ContentType) Values() []ContentType {
return []ContentType{
"application/vnd.amazonaws.card.generic",
}
}
type DialogActionType string
// Enum values for DialogActionType
const (
DialogActionTypeElicitIntent DialogActionType = "ElicitIntent"
DialogActionTypeConfirmIntent DialogActionType = "ConfirmIntent"
DialogActionTypeElicitSlot DialogActionType = "ElicitSlot"
DialogActionTypeClose DialogActionType = "Close"
DialogActionTypeDelegate DialogActionType = "Delegate"
)
// Values returns all known values for DialogActionType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (DialogActionType) Values() []DialogActionType {
return []DialogActionType{
"ElicitIntent",
"ConfirmIntent",
"ElicitSlot",
"Close",
"Delegate",
}
}
type DialogState string
// Enum values for DialogState
const (
DialogStateElicitIntent DialogState = "ElicitIntent"
DialogStateConfirmIntent DialogState = "ConfirmIntent"
DialogStateElicitSlot DialogState = "ElicitSlot"
DialogStateFulfilled DialogState = "Fulfilled"
DialogStateReadyForFulfillment DialogState = "ReadyForFulfillment"
DialogStateFailed DialogState = "Failed"
)
// Values returns all known values for DialogState. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (DialogState) Values() []DialogState {
return []DialogState{
"ElicitIntent",
"ConfirmIntent",
"ElicitSlot",
"Fulfilled",
"ReadyForFulfillment",
"Failed",
}
}
type FulfillmentState string
// Enum values for FulfillmentState
const (
FulfillmentStateFulfilled FulfillmentState = "Fulfilled"
FulfillmentStateFailed FulfillmentState = "Failed"
FulfillmentStateReadyForFulfillment FulfillmentState = "ReadyForFulfillment"
)
// Values returns all known values for FulfillmentState. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (FulfillmentState) Values() []FulfillmentState {
return []FulfillmentState{
"Fulfilled",
"Failed",
"ReadyForFulfillment",
}
}
type MessageFormatType string
// Enum values for MessageFormatType
const (
MessageFormatTypePlainText MessageFormatType = "PlainText"
MessageFormatTypeCustomPayload MessageFormatType = "CustomPayload"
MessageFormatTypeSsml MessageFormatType = "SSML"
MessageFormatTypeComposite MessageFormatType = "Composite"
)
// Values returns all known values for MessageFormatType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (MessageFormatType) Values() []MessageFormatType {
return []MessageFormatType{
"PlainText",
"CustomPayload",
"SSML",
"Composite",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// Either the Amazon Lex bot is still building, or one of the dependent services
// (Amazon Polly, AWS Lambda) failed with an internal service error.
type BadGatewayException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *BadGatewayException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *BadGatewayException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *BadGatewayException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "BadGatewayException"
}
return *e.ErrorCodeOverride
}
func (e *BadGatewayException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Request validation failed, there is no usable message in the context, or the
// bot build failed, is still in progress, or contains unbuilt changes.
type BadRequestException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *BadRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *BadRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *BadRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "BadRequestException"
}
return *e.ErrorCodeOverride
}
func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Two clients are using the same AWS account, Amazon Lex bot, and user ID.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// One of the dependencies, such as AWS Lambda or Amazon Polly, threw an
// exception. For example,
// - If Amazon Lex does not have sufficient permissions to call a Lambda
// function.
// - If a Lambda function takes longer than 30 seconds to execute.
// - If a fulfillment Lambda function returns a Delegate dialog action without
// removing any slot values.
type DependencyFailedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *DependencyFailedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *DependencyFailedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *DependencyFailedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "DependencyFailedException"
}
return *e.ErrorCodeOverride
}
func (e *DependencyFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Internal service error. Retry the call.
type InternalFailureException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalFailureException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalFailureException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalFailureException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalFailureException"
}
return *e.ErrorCodeOverride
}
func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Exceeded a limit.
type LimitExceededException struct {
Message *string
ErrorCodeOverride *string
RetryAfterSeconds *string
noSmithyDocumentSerde
}
func (e *LimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// This exception is not used.
type LoopDetectedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *LoopDetectedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LoopDetectedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LoopDetectedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LoopDetectedException"
}
return *e.ErrorCodeOverride
}
func (e *LoopDetectedException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The accept header in the request does not have a valid value.
type NotAcceptableException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *NotAcceptableException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NotAcceptableException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NotAcceptableException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NotAcceptableException"
}
return *e.ErrorCodeOverride
}
func (e *NotAcceptableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource (such as the Amazon Lex bot or an alias) that is referred to is
// not found.
type NotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *NotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The input speech is too long.
type RequestTimeoutException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *RequestTimeoutException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *RequestTimeoutException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *RequestTimeoutException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "RequestTimeoutException"
}
return *e.ErrorCodeOverride
}
func (e *RequestTimeoutException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The Content-Type header ( PostContent API) has an invalid value.
type UnsupportedMediaTypeException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *UnsupportedMediaTypeException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnsupportedMediaTypeException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnsupportedMediaTypeException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnsupportedMediaTypeException"
}
return *e.ErrorCodeOverride
}
func (e *UnsupportedMediaTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 306 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
)
// A context is a variable that contains information about the current state of
// the conversation between a user and Amazon Lex. Context can be set automatically
// by Amazon Lex when an intent is fulfilled, or it can be set at runtime using the
// PutContent , PutText , or PutSession operation.
type ActiveContext struct {
// The name of the context.
//
// This member is required.
Name *string
// State variables for the current context. You can use these values as default
// values for slots in subsequent events.
//
// This member is required.
Parameters map[string]string
// The length of time or number of turns that a context remains active.
//
// This member is required.
TimeToLive *ActiveContextTimeToLive
noSmithyDocumentSerde
}
// The length of time or number of turns that a context remains active.
type ActiveContextTimeToLive struct {
// The number of seconds that the context should be active after it is first sent
// in a PostContent or PostText response. You can set the value between 5 and
// 86,400 seconds (24 hours).
TimeToLiveInSeconds *int32
// The number of conversation turns that the context should be active. A
// conversation turn is one PostContent or PostText request and the corresponding
// response from Amazon Lex.
TurnsToLive *int32
noSmithyDocumentSerde
}
// Represents an option to be shown on the client platform (Facebook, Slack, etc.)
type Button struct {
// Text that is visible to the user on the button.
//
// This member is required.
Text *string
// The value sent to Amazon Lex when a user chooses the button. For example,
// consider button text "NYC." When the user chooses the button, the value sent can
// be "New York City."
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// Describes the next action that the bot should take in its interaction with the
// user and provides information about the context in which the action takes place.
// Use the DialogAction data type to set the interaction to a specific state, or
// to return the interaction to a previous state.
type DialogAction struct {
// The next action that the bot should take in its interaction with the user. The
// possible values are:
// - ConfirmIntent - The next action is asking the user if the intent is complete
// and ready to be fulfilled. This is a yes/no question such as "Place the order?"
// - Close - Indicates that the there will not be a response from the user. For
// example, the statement "Your order has been placed" does not require a response.
//
// - Delegate - The next action is determined by Amazon Lex.
// - ElicitIntent - The next action is to determine the intent that the user
// wants to fulfill.
// - ElicitSlot - The next action is to elicit a slot value from the user.
//
// This member is required.
Type DialogActionType
// The fulfillment state of the intent. The possible values are:
// - Failed - The Lambda function associated with the intent failed to fulfill
// the intent.
// - Fulfilled - The intent has fulfilled by the Lambda function associated with
// the intent.
// - ReadyForFulfillment - All of the information necessary for the intent is
// present and the intent ready to be fulfilled by the client application.
FulfillmentState FulfillmentState
// The name of the intent.
IntentName *string
// The message that should be shown to the user. If you don't specify a message,
// Amazon Lex will use the message configured for the intent.
Message *string
// - PlainText - The message contains plain UTF-8 text.
// - CustomPayload - The message is a custom format for the client.
// - SSML - The message contains text formatted for voice output.
// - Composite - The message contains an escaped JSON object containing one or
// more messages. For more information, see Message Groups (https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html)
// .
MessageFormat MessageFormatType
// The name of the slot that should be elicited from the user.
SlotToElicit *string
// Map of the slots that have been gathered and their values.
Slots map[string]string
noSmithyDocumentSerde
}
// Represents an option rendered to the user when a prompt is shown. It could be
// an image, a button, a link, or text.
type GenericAttachment struct {
// The URL of an attachment to the response card.
AttachmentLinkUrl *string
// The list of options to show to the user.
Buttons []Button
// The URL of an image that is displayed to the user.
ImageUrl *string
// The subtitle shown below the title.
SubTitle *string
// The title of the option.
Title *string
noSmithyDocumentSerde
}
// Provides a score that indicates the confidence that Amazon Lex has that an
// intent is the one that satisfies the user's intent.
type IntentConfidence struct {
// A score that indicates how confident Amazon Lex is that an intent satisfies the
// user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher
// confidence.
Score float64
noSmithyDocumentSerde
}
// Provides information about the state of an intent. You can use this information
// to get the current state of an intent so that you can process the intent, or so
// that you can return the intent to its previous state.
type IntentSummary struct {
// The next action that the bot should take in its interaction with the user. The
// possible values are:
// - ConfirmIntent - The next action is asking the user if the intent is complete
// and ready to be fulfilled. This is a yes/no question such as "Place the order?"
// - Close - Indicates that the there will not be a response from the user. For
// example, the statement "Your order has been placed" does not require a response.
//
// - ElicitIntent - The next action is to determine the intent that the user
// wants to fulfill.
// - ElicitSlot - The next action is to elicit a slot value from the user.
//
// This member is required.
DialogActionType DialogActionType
// A user-defined label that identifies a particular intent. You can use this
// label to return to a previous intent. Use the checkpointLabelFilter parameter
// of the GetSessionRequest operation to filter the intents returned by the
// operation to those with only the specified label.
CheckpointLabel *string
// The status of the intent after the user responds to the confirmation prompt. If
// the user confirms the intent, Amazon Lex sets this field to Confirmed . If the
// user denies the intent, Amazon Lex sets this value to Denied . The possible
// values are:
// - Confirmed - The user has responded "Yes" to the confirmation prompt,
// confirming that the intent is complete and that it is ready to be fulfilled.
// - Denied - The user has responded "No" to the confirmation prompt.
// - None - The user has never been prompted for confirmation; or, the user was
// prompted but did not confirm or deny the prompt.
ConfirmationStatus ConfirmationStatus
// The fulfillment state of the intent. The possible values are:
// - Failed - The Lambda function associated with the intent failed to fulfill
// the intent.
// - Fulfilled - The intent has fulfilled by the Lambda function associated with
// the intent.
// - ReadyForFulfillment - All of the information necessary for the intent is
// present and the intent ready to be fulfilled by the client application.
FulfillmentState FulfillmentState
// The name of the intent.
IntentName *string
// The next slot to elicit from the user. If there is not slot to elicit, the
// field is blank.
SlotToElicit *string
// Map of the slots that have been gathered and their values.
Slots map[string]string
noSmithyDocumentSerde
}
// An intent that Amazon Lex suggests satisfies the user's intent. Includes the
// name of the intent, the confidence that Amazon Lex has that the user's intent is
// satisfied, and the slots defined for the intent.
type PredictedIntent struct {
// The name of the intent that Amazon Lex suggests satisfies the user's intent.
IntentName *string
// Indicates how confident Amazon Lex is that an intent satisfies the user's
// intent.
NluIntentConfidence *IntentConfidence
// The slot and slot values associated with the predicted intent.
Slots map[string]string
noSmithyDocumentSerde
}
// If you configure a response card when creating your bots, Amazon Lex
// substitutes the session attributes and slot values that are available, and then
// returns it. The response card can also come from a Lambda function (
// dialogCodeHook and fulfillmentActivity on an intent).
type ResponseCard struct {
// The content type of the response.
ContentType ContentType
// An array of attachment objects representing options.
GenericAttachments []GenericAttachment
// The version of the response card format.
Version *string
noSmithyDocumentSerde
}
// The sentiment expressed in an utterance. When the bot is configured to send
// utterances to Amazon Comprehend for sentiment analysis, this field structure
// contains the result of the analysis.
type SentimentResponse struct {
// The inferred sentiment that Amazon Comprehend has the highest confidence in.
SentimentLabel *string
// The likelihood that the sentiment was correctly inferred.
SentimentScore *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 265 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "Lex Runtime V2"
const ServiceAPIVersion = "2020-08-07"
// Client provides the API client to make operations call for Amazon Lex Runtime
// V2.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
setSafeEventStreamClientLogMode(&options, opID)
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "lexruntimev2", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 437 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes session information for a specified bot, alias, and user ID. You can
// use this operation to restart a conversation with a bot. When you remove a
// session, the entire history of the session is removed so that you can start
// again. You don't need to delete a session. Sessions have a time limit and will
// expire. Set the session time limit when you create the bot. The default is 5
// minutes, but you can specify anything between 1 minute and 24 hours. If you
// specify a bot or alias ID that doesn't exist, you receive a BadRequestException.
// If the locale doesn't exist in the bot, or if the locale hasn't been enables for
// the alias, you receive a BadRequestException .
func (c *Client) DeleteSession(ctx context.Context, params *DeleteSessionInput, optFns ...func(*Options)) (*DeleteSessionOutput, error) {
if params == nil {
params = &DeleteSessionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSession", params, optFns, c.addOperationDeleteSessionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSessionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSessionInput struct {
// The alias identifier in use for the bot that contains the session data.
//
// This member is required.
BotAliasId *string
// The identifier of the bot that contains the session data.
//
// This member is required.
BotId *string
// The locale where the session is in use.
//
// This member is required.
LocaleId *string
// The identifier of the session to delete.
//
// This member is required.
SessionId *string
noSmithyDocumentSerde
}
type DeleteSessionOutput struct {
// The alias identifier in use for the bot that contained the session data.
BotAliasId *string
// The identifier of the bot that contained the session data.
BotId *string
// The locale where the session was used.
LocaleId *string
// The identifier of the deleted session.
SessionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSession{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSession{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSessionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSession(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteSession(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteSession",
}
}
| 156 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexruntimev2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns session information for a specified bot, alias, and user. For example,
// you can use this operation to retrieve session information for a user that has
// left a long-running session in use. If the bot, alias, or session identifier
// doesn't exist, Amazon Lex V2 returns a BadRequestException . If the locale
// doesn't exist or is not enabled for the alias, you receive a BadRequestException
// .
func (c *Client) GetSession(ctx context.Context, params *GetSessionInput, optFns ...func(*Options)) (*GetSessionOutput, error) {
if params == nil {
params = &GetSessionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSession", params, optFns, c.addOperationGetSessionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSessionOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSessionInput struct {
// The alias identifier in use for the bot that contains the session data.
//
// This member is required.
BotAliasId *string
// The identifier of the bot that contains the session data.
//
// This member is required.
BotId *string
// The locale where the session is in use.
//
// This member is required.
LocaleId *string
// The identifier of the session to return.
//
// This member is required.
SessionId *string
noSmithyDocumentSerde
}
type GetSessionOutput struct {
// A list of intents that Amazon Lex V2 determined might satisfy the user's
// utterance. Each interpretation includes the intent, a score that indicates how
// confident Amazon Lex V2 is that the interpretation is the correct one, and an
// optional sentiment response that indicates the sentiment expressed in the
// utterance.
Interpretations []types.Interpretation
// A list of messages that were last sent to the user. The messages are ordered
// based on the order that your returned the messages from your Lambda function or
// the order that messages are defined in the bot.
Messages []types.Message
// The identifier of the returned session.
SessionId *string
// Represents the current state of the dialog between the user and the bot. You
// can use this to determine the progress of the conversation and what the next
// action might be.
SessionState *types.SessionState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSession{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSession{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetSessionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSession(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetSession(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetSession",
}
}
| 162 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexruntimev2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
)
// Creates a new session or modifies an existing session with an Amazon Lex V2
// bot. Use this operation to enable your application to set the state of the bot.
func (c *Client) PutSession(ctx context.Context, params *PutSessionInput, optFns ...func(*Options)) (*PutSessionOutput, error) {
if params == nil {
params = &PutSessionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutSession", params, optFns, c.addOperationPutSessionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutSessionOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutSessionInput struct {
// The alias identifier of the bot that receives the session data.
//
// This member is required.
BotAliasId *string
// The identifier of the bot that receives the session data.
//
// This member is required.
BotId *string
// The locale where the session is in use.
//
// This member is required.
LocaleId *string
// The identifier of the session that receives the session data.
//
// This member is required.
SessionId *string
// Sets the state of the session with the user. You can use this to set the
// current intent, attributes, context, and dialog action. Use the dialog action to
// determine the next step that Amazon Lex V2 should use in the conversation with
// the user.
//
// This member is required.
SessionState *types.SessionState
// A list of messages to send to the user. Messages are sent in the order that
// they are defined in the list.
Messages []types.Message
// Request-specific information passed between Amazon Lex V2 and the client
// application. The namespace x-amz-lex: is reserved for special attributes. Don't
// create any request attributes with the prefix x-amz-lex: .
RequestAttributes map[string]string
// The message that Amazon Lex V2 returns in the response can be either text or
// speech depending on the value of this parameter.
// - If the value is text/plain; charset=utf-8 , Amazon Lex V2 returns text in
// the response.
ResponseContentType *string
noSmithyDocumentSerde
}
type PutSessionOutput struct {
// If the requested content type was audio, the audio version of the message to
// convey to the user.
AudioStream io.ReadCloser
// The type of response. Same as the type specified in the responseContentType
// field in the request.
ContentType *string
// A list of messages that were last sent to the user. The messages are ordered
// based on how you return the messages from you Lambda function or the order that
// the messages are defined in the bot.
Messages *string
// Request-specific information passed between the client application and Amazon
// Lex V2. These are the same as the requestAttribute parameter in the call to the
// PutSession operation.
RequestAttributes *string
// The identifier of the session that received the data.
SessionId *string
// Represents the current state of the dialog between the user and the bot. Use
// this to determine the progress of the conversation and what the next action may
// be.
SessionState *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSession{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSession{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutSessionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSession(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPutSession(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "PutSession",
}
}
| 185 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexruntimev2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sends user input to Amazon Lex V2. Client applications use this API to send
// requests to Amazon Lex V2 at runtime. Amazon Lex V2 then interprets the user
// input using the machine learning model that it build for the bot. In response,
// Amazon Lex V2 returns the next message to convey to the user and an optional
// response card to display. If the optional post-fulfillment response is
// specified, the messages are returned as follows. For more information, see
// PostFulfillmentStatusSpecification (https://docs.aws.amazon.com/lexv2/latest/dg/API_PostFulfillmentStatusSpecification.html)
// .
// - Success message - Returned if the Lambda function completes successfully
// and the intent state is fulfilled or ready fulfillment if the message is
// present.
// - Failed message - The failed message is returned if the Lambda function
// throws an exception or if the Lambda function returns a failed intent state
// without a message.
// - Timeout message - If you don't configure a timeout message and a timeout,
// and the Lambda function doesn't return within 30 seconds, the timeout message is
// returned. If you configure a timeout, the timeout message is returned when the
// period times out.
//
// For more information, see Completion message (https://docs.aws.amazon.com/lexv2/latest/dg/streaming-progress.html#progress-complete.html)
// .
func (c *Client) RecognizeText(ctx context.Context, params *RecognizeTextInput, optFns ...func(*Options)) (*RecognizeTextOutput, error) {
if params == nil {
params = &RecognizeTextInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RecognizeText", params, optFns, c.addOperationRecognizeTextMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RecognizeTextOutput)
out.ResultMetadata = metadata
return out, nil
}
type RecognizeTextInput struct {
// The alias identifier in use for the bot that processes the request.
//
// This member is required.
BotAliasId *string
// The identifier of the bot that processes the request.
//
// This member is required.
BotId *string
// The locale where the session is in use.
//
// This member is required.
LocaleId *string
// The identifier of the user session that is having the conversation.
//
// This member is required.
SessionId *string
// The text that the user entered. Amazon Lex V2 interprets this text.
//
// This member is required.
Text *string
// Request-specific information passed between the client application and Amazon
// Lex V2 The namespace x-amz-lex: is reserved for special attributes. Don't
// create any request attributes with the prefix x-amz-lex: .
RequestAttributes map[string]string
// The current state of the dialog between the user and the bot.
SessionState *types.SessionState
noSmithyDocumentSerde
}
type RecognizeTextOutput struct {
// A list of intents that Amazon Lex V2 determined might satisfy the user's
// utterance. Each interpretation includes the intent, a score that indicates now
// confident Amazon Lex V2 is that the interpretation is the correct one, and an
// optional sentiment response that indicates the sentiment expressed in the
// utterance.
Interpretations []types.Interpretation
// A list of messages last sent to the user. The messages are ordered based on the
// order that you returned the messages from your Lambda function or the order that
// the messages are defined in the bot.
Messages []types.Message
// The bot member that recognized the text.
RecognizedBotMember *types.RecognizedBotMember
// The attributes sent in the request.
RequestAttributes map[string]string
// The identifier of the session in use.
SessionId *string
// Represents the current state of the dialog between the user and the bot. Use
// this to determine the progress of the conversation and what the next action may
// be.
SessionState *types.SessionState
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRecognizeTextMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpRecognizeText{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRecognizeText{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRecognizeTextValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRecognizeText(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opRecognizeText(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "RecognizeText",
}
}
| 196 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
)
// Sends user input to Amazon Lex V2. You can send text or speech. Clients use
// this API to send text and audio requests to Amazon Lex V2 at runtime. Amazon Lex
// V2 interprets the user input using the machine learning model built for the bot.
// The following request fields must be compressed with gzip and then base64
// encoded before you send them to Amazon Lex V2.
// - requestAttributes
// - sessionState
//
// The following response fields are compressed using gzip and then base64 encoded
// by Amazon Lex V2. Before you can use these fields, you must decode and
// decompress them.
// - inputTranscript
// - interpretations
// - messages
// - requestAttributes
// - sessionState
//
// The example contains a Java application that compresses and encodes a Java
// object to send to Amazon Lex V2, and a second that decodes and decompresses a
// response from Amazon Lex V2. If the optional post-fulfillment response is
// specified, the messages are returned as follows. For more information, see
// PostFulfillmentStatusSpecification (https://docs.aws.amazon.com/lexv2/latest/dg/API_PostFulfillmentStatusSpecification.html)
// .
// - Success message - Returned if the Lambda function completes successfully
// and the intent state is fulfilled or ready fulfillment if the message is
// present.
// - Failed message - The failed message is returned if the Lambda function
// throws an exception or if the Lambda function returns a failed intent state
// without a message.
// - Timeout message - If you don't configure a timeout message and a timeout,
// and the Lambda function doesn't return within 30 seconds, the timeout message is
// returned. If you configure a timeout, the timeout message is returned when the
// period times out.
//
// For more information, see Completion message (https://docs.aws.amazon.com/lexv2/latest/dg/streaming-progress.html#progress-complete.html)
// .
func (c *Client) RecognizeUtterance(ctx context.Context, params *RecognizeUtteranceInput, optFns ...func(*Options)) (*RecognizeUtteranceOutput, error) {
if params == nil {
params = &RecognizeUtteranceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RecognizeUtterance", params, optFns, c.addOperationRecognizeUtteranceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RecognizeUtteranceOutput)
out.ResultMetadata = metadata
return out, nil
}
type RecognizeUtteranceInput struct {
// The alias identifier in use for the bot that should receive the request.
//
// This member is required.
BotAliasId *string
// The identifier of the bot that should receive the request.
//
// This member is required.
BotId *string
// The locale where the session is in use.
//
// This member is required.
LocaleId *string
// Indicates the format for audio input or that the content is text. The header
// must start with one of the following prefixes:
// - PCM format, audio data must be in little-endian byte order.
// - audio/l16; rate=16000; channels=1
// - audio/x-l16; sample-rate=16000; channel-count=1
// - audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1;
// is-big-endian=false
// - Opus format
// -
// audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4
//
// - Text format
// - text/plain; charset=utf-8
//
// This member is required.
RequestContentType *string
// The identifier of the session in use.
//
// This member is required.
SessionId *string
// User input in PCM or Opus audio format or text format as described in the
// requestContentType parameter.
InputStream io.Reader
// Request-specific information passed between the client application and Amazon
// Lex V2 The namespace x-amz-lex: is reserved for special attributes. Don't
// create any request attributes for prefix x-amz-lex: . The requestAttributes
// field must be compressed using gzip and then base64 encoded before sending to
// Amazon Lex V2.
RequestAttributes *string
// The message that Amazon Lex V2 returns in the response can be either text or
// speech based on the responseContentType value.
// - If the value is text/plain;charset=utf-8 , Amazon Lex V2 returns text in the
// response.
// - If the value begins with audio/ , Amazon Lex V2 returns speech in the
// response. Amazon Lex V2 uses Amazon Polly to generate the speech using the
// configuration that you specified in the responseContentType parameter. For
// example, if you specify audio/mpeg as the value, Amazon Lex V2 returns speech
// in the MPEG format.
// - If the value is audio/pcm , the speech returned is audio/pcm at 16 KHz in
// 16-bit, little-endian format.
// - The following are the accepted values:
// - audio/mpeg
// - audio/ogg
// - audio/pcm (16 KHz)
// - audio/* (defaults to mpeg)
// - text/plain; charset=utf-8
ResponseContentType *string
// Sets the state of the session with the user. You can use this to set the
// current intent, attributes, context, and dialog action. Use the dialog action to
// determine the next step that Amazon Lex V2 should use in the conversation with
// the user. The sessionState field must be compressed using gzip and then base64
// encoded before sending to Amazon Lex V2.
SessionState *string
noSmithyDocumentSerde
}
type RecognizeUtteranceOutput struct {
// The prompt or statement to send to the user. This is based on the bot
// configuration and context. For example, if Amazon Lex V2 did not understand the
// user intent, it sends the clarificationPrompt configured for the bot. If the
// intent requires confirmation before taking the fulfillment action, it sends the
// confirmationPrompt . Another example: Suppose that the Lambda function
// successfully fulfilled the intent, and sent a message to convey to the user.
// Then Amazon Lex V2 sends that message in the response.
AudioStream io.ReadCloser
// Content type as specified in the responseContentType in the request.
ContentType *string
// Indicates whether the input mode to the operation was text or speech.
InputMode *string
// The text used to process the request. If the input was an audio stream, the
// inputTranscript field contains the text extracted from the audio stream. This is
// the text that is actually processed to recognize intents and slot values. You
// can use this information to determine if Amazon Lex V2 is correctly processing
// the audio that you send. The inputTranscript field is compressed with gzip and
// then base64 encoded. Before you can use the contents of the field, you must
// decode and decompress the contents. See the example for a simple function to
// decode and decompress the contents.
InputTranscript *string
// A list of intents that Amazon Lex V2 determined might satisfy the user's
// utterance. Each interpretation includes the intent, a score that indicates how
// confident Amazon Lex V2 is that the interpretation is the correct one, and an
// optional sentiment response that indicates the sentiment expressed in the
// utterance. The interpretations field is compressed with gzip and then base64
// encoded. Before you can use the contents of the field, you must decode and
// decompress the contents. See the example for a simple function to decode and
// decompress the contents.
Interpretations *string
// A list of messages that were last sent to the user. The messages are ordered
// based on the order that you returned the messages from your Lambda function or
// the order that the messages are defined in the bot. The messages field is
// compressed with gzip and then base64 encoded. Before you can use the contents of
// the field, you must decode and decompress the contents. See the example for a
// simple function to decode and decompress the contents.
Messages *string
// The bot member that recognized the utterance.
RecognizedBotMember *string
// The attributes sent in the request. The requestAttributes field is compressed
// with gzip and then base64 encoded. Before you can use the contents of the field,
// you must decode and decompress the contents.
RequestAttributes *string
// The identifier of the session in use.
SessionId *string
// Represents the current state of the dialog between the user and the bot. Use
// this to determine the progress of the conversation and what the next action
// might be. The sessionState field is compressed with gzip and then base64
// encoded. Before you can use the contents of the field, you must decode and
// decompress the contents. See the example for a simple function to decode and
// decompress the contents.
SessionState *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRecognizeUtteranceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpRecognizeUtterance{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRecognizeUtterance{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddUnsignedPayloadMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRecognizeUtteranceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRecognizeUtterance(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opRecognizeUtterance(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "RecognizeUtterance",
}
}
| 288 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexruntimev2/types"
"github.com/aws/smithy-go/middleware"
smithysync "github.com/aws/smithy-go/sync"
smithyhttp "github.com/aws/smithy-go/transport/http"
"sync"
"time"
)
// Starts an HTTP/2 bidirectional event stream that enables you to send audio,
// text, or DTMF input in real time. After your application starts a conversation,
// users send input to Amazon Lex V2 as a stream of events. Amazon Lex V2 processes
// the incoming events and responds with streaming text or audio events. Audio
// input must be in the following format: audio/lpcm sample-rate=8000
// sample-size-bits=16 channel-count=1; is-big-endian=false . If the optional
// post-fulfillment response is specified, the messages are returned as follows.
// For more information, see PostFulfillmentStatusSpecification (https://docs.aws.amazon.com/lexv2/latest/dg/API_PostFulfillmentStatusSpecification.html)
// .
// - Success message - Returned if the Lambda function completes successfully
// and the intent state is fulfilled or ready fulfillment if the message is
// present.
// - Failed message - The failed message is returned if the Lambda function
// throws an exception or if the Lambda function returns a failed intent state
// without a message.
// - Timeout message - If you don't configure a timeout message and a timeout,
// and the Lambda function doesn't return within 30 seconds, the timeout message is
// returned. If you configure a timeout, the timeout message is returned when the
// period times out.
//
// For more information, see Completion message (https://docs.aws.amazon.com/lexv2/latest/dg/streaming-progress.html#progress-complete.html)
// . If the optional update message is configured, it is played at the specified
// frequency while the Lambda function is running and the update message state is
// active. If the fulfillment update message is not active, the Lambda function
// runs with a 30 second timeout. For more information, see Update message (https://docs.aws.amazon.com/lexv2/latest/dg/streaming-progress.html#progress-update.html)
// The StartConversation operation is supported only in the following SDKs:
// - AWS SDK for C++ (https://docs.aws.amazon.com/goto/SdkForCpp/runtime.lex.v2-2020-08-07/StartConversation)
// - AWS SDK for Java V2 (https://docs.aws.amazon.com/goto/SdkForJavaV2/runtime.lex.v2-2020-08-07/StartConversation)
// - AWS SDK for Ruby V3 (https://docs.aws.amazon.com/goto/SdkForRubyV3/runtime.lex.v2-2020-08-07/StartConversation)
func (c *Client) StartConversation(ctx context.Context, params *StartConversationInput, optFns ...func(*Options)) (*StartConversationOutput, error) {
if params == nil {
params = &StartConversationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartConversation", params, optFns, c.addOperationStartConversationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartConversationOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartConversationInput struct {
// The alias identifier in use for the bot that processes the request.
//
// This member is required.
BotAliasId *string
// The identifier of the bot to process the request.
//
// This member is required.
BotId *string
// The locale where the session is in use.
//
// This member is required.
LocaleId *string
// The identifier of the user session that is having the conversation.
//
// This member is required.
SessionId *string
// The conversation type that you are using the Amazon Lex V2. If the conversation
// mode is AUDIO you can send both audio and DTMF information. If the mode is TEXT
// you can only send text.
ConversationMode types.ConversationMode
noSmithyDocumentSerde
}
type StartConversationOutput struct {
eventStream *StartConversationEventStream
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
// GetStream returns the type to interact with the event stream.
func (o *StartConversationOutput) GetStream() *StartConversationEventStream {
return o.eventStream
}
func (c *Client) addOperationStartConversationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartConversation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartConversation{}, middleware.After)
if err != nil {
return err
}
if err = addEventStreamStartConversationMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddRequireMinimumProtocol(stack, 2, 0); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddStreamingEventsPayload(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = eventstreamapi.AddInitializeStreamWriter(stack); err != nil {
return err
}
if err = addOpStartConversationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartConversation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartConversation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "StartConversation",
}
}
// StartConversationEventStream provides the event stream handling for the StartConversation operation.
//
// For testing and mocking the event stream this type should be initialized via
// the NewStartConversationEventStream constructor function. Using the functional options
// to pass in nested mock behavior.
type StartConversationEventStream struct {
// StartConversationRequestEventStreamWriter is the EventStream writer for the
// StartConversationRequestEventStream events. This value is automatically set by
// the SDK when the API call is made Use this member when unit testing your code
// with the SDK to mock out the EventStream Writer.
//
// Must not be nil.
Writer StartConversationRequestEventStreamWriter
// StartConversationResponseEventStreamReader is the EventStream reader for the
// StartConversationResponseEventStream events. This value is automatically set by
// the SDK when the API call is made Use this member when unit testing your code
// with the SDK to mock out the EventStream Reader.
//
// Must not be nil.
Reader StartConversationResponseEventStreamReader
done chan struct{}
closeOnce sync.Once
err *smithysync.OnceErr
}
// NewStartConversationEventStream initializes an StartConversationEventStream.
// This function should only be used for testing and mocking the StartConversationEventStream
// stream within your application.
//
// The Writer member must be set before writing events to the stream.
//
// The Reader member must be set before reading events from the stream.
func NewStartConversationEventStream(optFns ...func(*StartConversationEventStream)) *StartConversationEventStream {
es := &StartConversationEventStream{
done: make(chan struct{}),
err: smithysync.NewOnceErr(),
}
for _, fn := range optFns {
fn(es)
}
return es
}
// Send writes the event to the stream blocking until the event is written.
// Returns an error if the event was not written.
func (es *StartConversationEventStream) Send(ctx context.Context, event types.StartConversationRequestEventStream) error {
return es.Writer.Send(ctx, event)
}
// Events returns a channel to read events from.
func (es *StartConversationEventStream) Events() <-chan types.StartConversationResponseEventStream {
return es.Reader.Events()
}
// Close closes the stream. This will also cause the stream to be closed.
// Close must be called when done using the stream API. Not calling Close
// may result in resource leaks.
//
// Will close the underlying EventStream writer and reader, and no more events can be
// sent or received.
func (es *StartConversationEventStream) Close() error {
es.closeOnce.Do(es.safeClose)
return es.Err()
}
func (es *StartConversationEventStream) safeClose() {
close(es.done)
t := time.NewTicker(time.Second)
defer t.Stop()
writeCloseDone := make(chan error)
go func() {
if err := es.Writer.Close(); err != nil {
es.err.SetError(err)
}
close(writeCloseDone)
}()
select {
case <-t.C:
case <-writeCloseDone:
}
es.Reader.Close()
}
// Err returns any error that occurred while reading or writing EventStream Events
// from the service API's response. Returns nil if there were no errors.
func (es *StartConversationEventStream) Err() error {
if err := es.err.Err(); err != nil {
return err
}
if err := es.Writer.Err(); err != nil {
return err
}
if err := es.Reader.Err(); err != nil {
return err
}
return nil
}
func (es *StartConversationEventStream) waitStreamClose() {
type errorSet interface {
ErrorSet() <-chan struct{}
}
var inputErrCh <-chan struct{}
if v, ok := es.Writer.(errorSet); ok {
inputErrCh = v.ErrorSet()
}
var outputErrCh <-chan struct{}
if v, ok := es.Reader.(errorSet); ok {
outputErrCh = v.ErrorSet()
}
var outputClosedCh <-chan struct{}
if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok {
outputClosedCh = v.Closed()
}
select {
case <-es.done:
case <-inputErrCh:
es.err.SetError(es.Writer.Err())
es.Close()
case <-outputErrCh:
es.err.SetError(es.Reader.Err())
es.Close()
case <-outputClosedCh:
if err := es.Reader.Err(); err != nil {
es.err.SetError(es.Reader.Err())
}
es.Close()
}
}
| 326 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/lexruntimev2/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"math"
"strings"
)
type awsRestjson1_deserializeOpDeleteSession struct {
}
func (*awsRestjson1_deserializeOpDeleteSession) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteSession(response, &metadata)
}
output := &DeleteSessionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDeleteSessionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteSession(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteSessionOutput(v **DeleteSessionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteSessionOutput
if *v == nil {
sv = &DeleteSessionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botAliasId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotAliasIdentifier to be of type string, got %T instead", value)
}
sv.BotAliasId = ptr.String(jtv)
}
case "botId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotIdentifier to be of type string, got %T instead", value)
}
sv.BotId = ptr.String(jtv)
}
case "localeId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LocaleId to be of type string, got %T instead", value)
}
sv.LocaleId = ptr.String(jtv)
}
case "sessionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SessionId to be of type string, got %T instead", value)
}
sv.SessionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetSession struct {
}
func (*awsRestjson1_deserializeOpGetSession) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetSession(response, &metadata)
}
output := &GetSessionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetSessionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetSession(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetSessionOutput(v **GetSessionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSessionOutput
if *v == nil {
sv = &GetSessionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "interpretations":
if err := awsRestjson1_deserializeDocumentInterpretations(&sv.Interpretations, value); err != nil {
return err
}
case "messages":
if err := awsRestjson1_deserializeDocumentMessages(&sv.Messages, value); err != nil {
return err
}
case "sessionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.SessionId = ptr.String(jtv)
}
case "sessionState":
if err := awsRestjson1_deserializeDocumentSessionState(&sv.SessionState, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutSession struct {
}
func (*awsRestjson1_deserializeOpPutSession) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorPutSession(response, &metadata)
}
output := &PutSessionOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsPutSessionOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
err = awsRestjson1_deserializeOpDocumentPutSessionOutput(output, response.Body)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutSession(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadGatewayException", errorCode):
return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("DependencyFailedException", errorCode):
return awsRestjson1_deserializeErrorDependencyFailedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsPutSessionOutput(v *PutSessionOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentType = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-messages"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.Messages = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-request-attributes"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.RequestAttributes = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-session-id"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SessionId = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-session-state"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SessionState = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeOpDocumentPutSessionOutput(v *PutSessionOutput, body io.ReadCloser) error {
if v == nil {
return fmt.Errorf("unsupported deserialization of nil %T", v)
}
v.AudioStream = body
return nil
}
type awsRestjson1_deserializeOpRecognizeText struct {
}
func (*awsRestjson1_deserializeOpRecognizeText) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpRecognizeText) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorRecognizeText(response, &metadata)
}
output := &RecognizeTextOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentRecognizeTextOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorRecognizeText(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadGatewayException", errorCode):
return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("DependencyFailedException", errorCode):
return awsRestjson1_deserializeErrorDependencyFailedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentRecognizeTextOutput(v **RecognizeTextOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RecognizeTextOutput
if *v == nil {
sv = &RecognizeTextOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "interpretations":
if err := awsRestjson1_deserializeDocumentInterpretations(&sv.Interpretations, value); err != nil {
return err
}
case "messages":
if err := awsRestjson1_deserializeDocumentMessages(&sv.Messages, value); err != nil {
return err
}
case "recognizedBotMember":
if err := awsRestjson1_deserializeDocumentRecognizedBotMember(&sv.RecognizedBotMember, value); err != nil {
return err
}
case "requestAttributes":
if err := awsRestjson1_deserializeDocumentStringMap(&sv.RequestAttributes, value); err != nil {
return err
}
case "sessionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SessionId to be of type string, got %T instead", value)
}
sv.SessionId = ptr.String(jtv)
}
case "sessionState":
if err := awsRestjson1_deserializeDocumentSessionState(&sv.SessionState, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpRecognizeUtterance struct {
}
func (*awsRestjson1_deserializeOpRecognizeUtterance) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpRecognizeUtterance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorRecognizeUtterance(response, &metadata)
}
output := &RecognizeUtteranceOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsRecognizeUtteranceOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
err = awsRestjson1_deserializeOpDocumentRecognizeUtteranceOutput(output, response.Body)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorRecognizeUtterance(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadGatewayException", errorCode):
return awsRestjson1_deserializeErrorBadGatewayException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("DependencyFailedException", errorCode):
return awsRestjson1_deserializeErrorDependencyFailedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsRecognizeUtteranceOutput(v *RecognizeUtteranceOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentType = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-input-mode"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.InputMode = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-input-transcript"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.InputTranscript = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-interpretations"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.Interpretations = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-messages"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.Messages = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-recognized-bot-member"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.RecognizedBotMember = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-request-attributes"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.RequestAttributes = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-session-id"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SessionId = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("x-amz-lex-session-state"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.SessionState = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeOpDocumentRecognizeUtteranceOutput(v *RecognizeUtteranceOutput, body io.ReadCloser) error {
if v == nil {
return fmt.Errorf("unsupported deserialization of nil %T", v)
}
v.AudioStream = body
return nil
}
type awsRestjson1_deserializeOpStartConversation struct {
}
func (*awsRestjson1_deserializeOpStartConversation) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartConversation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorStartConversation(response, &metadata)
}
output := &StartConversationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorStartConversation(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeEventStreamStartConversationResponseEventStream(v *types.StartConversationResponseEventStream, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader)
if eventType == nil {
return fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader)
}
switch {
case strings.EqualFold("AudioResponseEvent", eventType.String()):
vv := &types.StartConversationResponseEventStreamMemberAudioResponseEvent{}
if err := awsRestjson1_deserializeEventMessageAudioResponseEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
case strings.EqualFold("HeartbeatEvent", eventType.String()):
vv := &types.StartConversationResponseEventStreamMemberHeartbeatEvent{}
if err := awsRestjson1_deserializeEventMessageHeartbeatEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
case strings.EqualFold("IntentResultEvent", eventType.String()):
vv := &types.StartConversationResponseEventStreamMemberIntentResultEvent{}
if err := awsRestjson1_deserializeEventMessageIntentResultEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
case strings.EqualFold("PlaybackInterruptionEvent", eventType.String()):
vv := &types.StartConversationResponseEventStreamMemberPlaybackInterruptionEvent{}
if err := awsRestjson1_deserializeEventMessagePlaybackInterruptionEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
case strings.EqualFold("TextResponseEvent", eventType.String()):
vv := &types.StartConversationResponseEventStreamMemberTextResponseEvent{}
if err := awsRestjson1_deserializeEventMessageTextResponseEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
case strings.EqualFold("TranscriptEvent", eventType.String()):
vv := &types.StartConversationResponseEventStreamMemberTranscriptEvent{}
if err := awsRestjson1_deserializeEventMessageTranscriptEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
default:
buffer := bytes.NewBuffer(nil)
eventstream.NewEncoder().Encode(buffer, *msg)
*v = &types.UnknownUnionMember{
Tag: eventType.String(),
Value: buffer.Bytes(),
}
return nil
}
}
func awsRestjson1_deserializeEventStreamExceptionStartConversationResponseEventStream(msg *eventstream.Message) error {
exceptionType := msg.Headers.Get(eventstreamapi.ExceptionTypeHeader)
if exceptionType == nil {
return fmt.Errorf("%s event header not present", eventstreamapi.ExceptionTypeHeader)
}
switch {
case strings.EqualFold("AccessDeniedException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionAccessDeniedException(msg)
case strings.EqualFold("BadGatewayException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionBadGatewayException(msg)
case strings.EqualFold("ConflictException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionConflictException(msg)
case strings.EqualFold("DependencyFailedException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionDependencyFailedException(msg)
case strings.EqualFold("InternalServerException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionInternalServerException(msg)
case strings.EqualFold("ResourceNotFoundException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionResourceNotFoundException(msg)
case strings.EqualFold("ThrottlingException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg)
case strings.EqualFold("ValidationException", exceptionType.String()):
return awsRestjson1_deserializeEventMessageExceptionValidationException(msg)
default:
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
code, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
return err
}
errorCode := "UnknownError"
errorMessage := errorCode
if ev := exceptionType.String(); len(ev) > 0 {
errorCode = ev
} else if ev := code; len(ev) > 0 {
errorCode = ev
}
if ev := message; len(ev) > 0 {
errorMessage = ev
}
return &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
}
}
func awsRestjson1_deserializeEventMessagePlaybackInterruptionEvent(v *types.PlaybackInterruptionEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
if err := awsRestjson1_deserializeDocumentPlaybackInterruptionEvent(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return nil
}
func awsRestjson1_deserializeEventMessageTranscriptEvent(v *types.TranscriptEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
if err := awsRestjson1_deserializeDocumentTranscriptEvent(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return nil
}
func awsRestjson1_deserializeEventMessageIntentResultEvent(v *types.IntentResultEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
if err := awsRestjson1_deserializeDocumentIntentResultEvent(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return nil
}
func awsRestjson1_deserializeEventMessageTextResponseEvent(v *types.TextResponseEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
if err := awsRestjson1_deserializeDocumentTextResponseEvent(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return nil
}
func awsRestjson1_deserializeEventMessageAudioResponseEvent(v *types.AudioResponseEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
if err := awsRestjson1_deserializeDocumentAudioResponseEvent(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return nil
}
func awsRestjson1_deserializeEventMessageHeartbeatEvent(v *types.HeartbeatEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
if err := awsRestjson1_deserializeDocumentHeartbeatEvent(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return nil
}
func awsRestjson1_deserializeEventMessageExceptionAccessDeniedException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.AccessDeniedException{}
if err := awsRestjson1_deserializeDocumentAccessDeniedException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionResourceNotFoundException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.ResourceNotFoundException{}
if err := awsRestjson1_deserializeDocumentResourceNotFoundException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionValidationException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.ValidationException{}
if err := awsRestjson1_deserializeDocumentValidationException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionThrottlingException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.ThrottlingException{}
if err := awsRestjson1_deserializeDocumentThrottlingException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionInternalServerException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.InternalServerException{}
if err := awsRestjson1_deserializeDocumentInternalServerException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionConflictException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.ConflictException{}
if err := awsRestjson1_deserializeDocumentConflictException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionDependencyFailedException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.DependencyFailedException{}
if err := awsRestjson1_deserializeDocumentDependencyFailedException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsRestjson1_deserializeEventMessageExceptionBadGatewayException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.BadGatewayException{}
if err := awsRestjson1_deserializeDocumentBadGatewayException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AccessDeniedException
if *v == nil {
sv = &types.AccessDeniedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentActiveContext(v **types.ActiveContext, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActiveContext
if *v == nil {
sv = &types.ActiveContext{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "contextAttributes":
if err := awsRestjson1_deserializeDocumentActiveContextParametersMap(&sv.ContextAttributes, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActiveContextName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "timeToLive":
if err := awsRestjson1_deserializeDocumentActiveContextTimeToLive(&sv.TimeToLive, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentActiveContextParametersMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentActiveContextsList(v *[]types.ActiveContext, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ActiveContext
if *v == nil {
cv = []types.ActiveContext{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ActiveContext
destAddr := &col
if err := awsRestjson1_deserializeDocumentActiveContext(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentActiveContextTimeToLive(v **types.ActiveContextTimeToLive, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActiveContextTimeToLive
if *v == nil {
sv = &types.ActiveContextTimeToLive{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "timeToLiveInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ActiveContextTimeToLiveInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeToLiveInSeconds = ptr.Int32(int32(i64))
}
case "turnsToLive":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ActiveContextTurnsToLive to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TurnsToLive = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAudioResponseEvent(v **types.AudioResponseEvent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AudioResponseEvent
if *v == nil {
sv = &types.AudioResponseEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "audioChunk":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AudioChunk to be []byte, got %T instead", value)
}
dv, err := base64.StdEncoding.DecodeString(jtv)
if err != nil {
return fmt.Errorf("failed to base64 decode AudioChunk, %w", err)
}
sv.AudioChunk = dv
}
case "contentType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.ContentType = ptr.String(jtv)
}
case "eventId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EventId to be of type string, got %T instead", value)
}
sv.EventId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBadGatewayException(v **types.BadGatewayException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BadGatewayException
if *v == nil {
sv = &types.BadGatewayException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentButton(v **types.Button, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Button
if *v == nil {
sv = &types.Button{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "text":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ButtonText to be of type string, got %T instead", value)
}
sv.Text = ptr.String(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ButtonValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentButtonsList(v *[]types.Button, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Button
if *v == nil {
cv = []types.Button{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Button
destAddr := &col
if err := awsRestjson1_deserializeDocumentButton(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentConfidenceScore(v **types.ConfidenceScore, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConfidenceScore
if *v == nil {
sv = &types.ConfidenceScore{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "score":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Score = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Score = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDependencyFailedException(v **types.DependencyFailedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DependencyFailedException
if *v == nil {
sv = &types.DependencyFailedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDialogAction(v **types.DialogAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DialogAction
if *v == nil {
sv = &types.DialogAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "slotElicitationStyle":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StyleType to be of type string, got %T instead", value)
}
sv.SlotElicitationStyle = types.StyleType(jtv)
}
case "slotToElicit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.SlotToElicit = ptr.String(jtv)
}
case "subSlotToElicit":
if err := awsRestjson1_deserializeDocumentElicitSubSlot(&sv.SubSlotToElicit, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DialogActionType to be of type string, got %T instead", value)
}
sv.Type = types.DialogActionType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentElicitSubSlot(v **types.ElicitSubSlot, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ElicitSubSlot
if *v == nil {
sv = &types.ElicitSubSlot{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "subSlotToElicit":
if err := awsRestjson1_deserializeDocumentElicitSubSlot(&sv.SubSlotToElicit, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentHeartbeatEvent(v **types.HeartbeatEvent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HeartbeatEvent
if *v == nil {
sv = &types.HeartbeatEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "eventId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EventId to be of type string, got %T instead", value)
}
sv.EventId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImageResponseCard(v **types.ImageResponseCard, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ImageResponseCard
if *v == nil {
sv = &types.ImageResponseCard{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "buttons":
if err := awsRestjson1_deserializeDocumentButtonsList(&sv.Buttons, value); err != nil {
return err
}
case "imageUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttachmentUrl to be of type string, got %T instead", value)
}
sv.ImageUrl = ptr.String(jtv)
}
case "subtitle":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttachmentTitle to be of type string, got %T instead", value)
}
sv.Subtitle = ptr.String(jtv)
}
case "title":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttachmentTitle to be of type string, got %T instead", value)
}
sv.Title = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIntent(v **types.Intent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Intent
if *v == nil {
sv = &types.Intent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "confirmationState":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConfirmationState to be of type string, got %T instead", value)
}
sv.ConfirmationState = types.ConfirmationState(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "slots":
if err := awsRestjson1_deserializeDocumentSlots(&sv.Slots, value); err != nil {
return err
}
case "state":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentState to be of type string, got %T instead", value)
}
sv.State = types.IntentState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIntentResultEvent(v **types.IntentResultEvent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IntentResultEvent
if *v == nil {
sv = &types.IntentResultEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "eventId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EventId to be of type string, got %T instead", value)
}
sv.EventId = ptr.String(jtv)
}
case "inputMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InputMode to be of type string, got %T instead", value)
}
sv.InputMode = types.InputMode(jtv)
}
case "interpretations":
if err := awsRestjson1_deserializeDocumentInterpretations(&sv.Interpretations, value); err != nil {
return err
}
case "recognizedBotMember":
if err := awsRestjson1_deserializeDocumentRecognizedBotMember(&sv.RecognizedBotMember, value); err != nil {
return err
}
case "requestAttributes":
if err := awsRestjson1_deserializeDocumentStringMap(&sv.RequestAttributes, value); err != nil {
return err
}
case "sessionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SessionId to be of type string, got %T instead", value)
}
sv.SessionId = ptr.String(jtv)
}
case "sessionState":
if err := awsRestjson1_deserializeDocumentSessionState(&sv.SessionState, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerException
if *v == nil {
sv = &types.InternalServerException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInterpretation(v **types.Interpretation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Interpretation
if *v == nil {
sv = &types.Interpretation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "intent":
if err := awsRestjson1_deserializeDocumentIntent(&sv.Intent, value); err != nil {
return err
}
case "nluConfidence":
if err := awsRestjson1_deserializeDocumentConfidenceScore(&sv.NluConfidence, value); err != nil {
return err
}
case "sentimentResponse":
if err := awsRestjson1_deserializeDocumentSentimentResponse(&sv.SentimentResponse, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInterpretations(v *[]types.Interpretation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Interpretation
if *v == nil {
cv = []types.Interpretation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Interpretation
destAddr := &col
if err := awsRestjson1_deserializeDocumentInterpretation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMessage(v **types.Message, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Message
if *v == nil {
sv = &types.Message{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "content":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Text to be of type string, got %T instead", value)
}
sv.Content = ptr.String(jtv)
}
case "contentType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MessageContentType to be of type string, got %T instead", value)
}
sv.ContentType = types.MessageContentType(jtv)
}
case "imageResponseCard":
if err := awsRestjson1_deserializeDocumentImageResponseCard(&sv.ImageResponseCard, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMessages(v *[]types.Message, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Message
if *v == nil {
cv = []types.Message{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Message
destAddr := &col
if err := awsRestjson1_deserializeDocumentMessage(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentPlaybackInterruptionEvent(v **types.PlaybackInterruptionEvent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PlaybackInterruptionEvent
if *v == nil {
sv = &types.PlaybackInterruptionEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "causedByEventId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EventId to be of type string, got %T instead", value)
}
sv.CausedByEventId = ptr.String(jtv)
}
case "eventId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EventId to be of type string, got %T instead", value)
}
sv.EventId = ptr.String(jtv)
}
case "eventReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PlaybackInterruptionReason to be of type string, got %T instead", value)
}
sv.EventReason = types.PlaybackInterruptionReason(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRecognizedBotMember(v **types.RecognizedBotMember, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RecognizedBotMember
if *v == nil {
sv = &types.RecognizedBotMember{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotIdentifier to be of type string, got %T instead", value)
}
sv.BotId = ptr.String(jtv)
}
case "botName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.BotName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFoundException
if *v == nil {
sv = &types.ResourceNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRuntimeHintDetails(v **types.RuntimeHintDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuntimeHintDetails
if *v == nil {
sv = &types.RuntimeHintDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "runtimeHintValues":
if err := awsRestjson1_deserializeDocumentRuntimeHintValuesList(&sv.RuntimeHintValues, value); err != nil {
return err
}
case "subSlotHints":
if err := awsRestjson1_deserializeDocumentSlotHintsSlotMap(&sv.SubSlotHints, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRuntimeHints(v **types.RuntimeHints, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuntimeHints
if *v == nil {
sv = &types.RuntimeHints{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "slotHints":
if err := awsRestjson1_deserializeDocumentSlotHintsIntentMap(&sv.SlotHints, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRuntimeHintValue(v **types.RuntimeHintValue, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuntimeHintValue
if *v == nil {
sv = &types.RuntimeHintValue{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "phrase":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RuntimeHintPhrase to be of type string, got %T instead", value)
}
sv.Phrase = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRuntimeHintValuesList(v *[]types.RuntimeHintValue, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RuntimeHintValue
if *v == nil {
cv = []types.RuntimeHintValue{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RuntimeHintValue
destAddr := &col
if err := awsRestjson1_deserializeDocumentRuntimeHintValue(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSentimentResponse(v **types.SentimentResponse, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SentimentResponse
if *v == nil {
sv = &types.SentimentResponse{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "sentiment":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SentimentType to be of type string, got %T instead", value)
}
sv.Sentiment = types.SentimentType(jtv)
}
case "sentimentScore":
if err := awsRestjson1_deserializeDocumentSentimentScore(&sv.SentimentScore, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSentimentScore(v **types.SentimentScore, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SentimentScore
if *v == nil {
sv = &types.SentimentScore{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "mixed":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Mixed = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Mixed = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "negative":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Negative = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Negative = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "neutral":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Neutral = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Neutral = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "positive":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Positive = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Positive = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSessionState(v **types.SessionState, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SessionState
if *v == nil {
sv = &types.SessionState{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "activeContexts":
if err := awsRestjson1_deserializeDocumentActiveContextsList(&sv.ActiveContexts, value); err != nil {
return err
}
case "dialogAction":
if err := awsRestjson1_deserializeDocumentDialogAction(&sv.DialogAction, value); err != nil {
return err
}
case "intent":
if err := awsRestjson1_deserializeDocumentIntent(&sv.Intent, value); err != nil {
return err
}
case "originatingRequestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.OriginatingRequestId = ptr.String(jtv)
}
case "runtimeHints":
if err := awsRestjson1_deserializeDocumentRuntimeHints(&sv.RuntimeHints, value); err != nil {
return err
}
case "sessionAttributes":
if err := awsRestjson1_deserializeDocumentStringMap(&sv.SessionAttributes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlot(v **types.Slot, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Slot
if *v == nil {
sv = &types.Slot{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "shape":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Shape to be of type string, got %T instead", value)
}
sv.Shape = types.Shape(jtv)
}
case "subSlots":
if err := awsRestjson1_deserializeDocumentSlots(&sv.SubSlots, value); err != nil {
return err
}
case "value":
if err := awsRestjson1_deserializeDocumentValue(&sv.Value, value); err != nil {
return err
}
case "values":
if err := awsRestjson1_deserializeDocumentValues(&sv.Values, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlotHintsIntentMap(v *map[string]map[string]types.RuntimeHintDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]map[string]types.RuntimeHintDetails
if *v == nil {
mv = map[string]map[string]types.RuntimeHintDetails{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal map[string]types.RuntimeHintDetails
mapVar := parsedVal
if err := awsRestjson1_deserializeDocumentSlotHintsSlotMap(&mapVar, value); err != nil {
return err
}
parsedVal = mapVar
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentSlotHintsSlotMap(v *map[string]types.RuntimeHintDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.RuntimeHintDetails
if *v == nil {
mv = map[string]types.RuntimeHintDetails{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.RuntimeHintDetails
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentRuntimeHintDetails(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentSlots(v *map[string]types.Slot, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.Slot
if *v == nil {
mv = map[string]types.Slot{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.Slot
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentSlot(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentStringMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentTextResponseEvent(v **types.TextResponseEvent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TextResponseEvent
if *v == nil {
sv = &types.TextResponseEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "eventId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EventId to be of type string, got %T instead", value)
}
sv.EventId = ptr.String(jtv)
}
case "messages":
if err := awsRestjson1_deserializeDocumentMessages(&sv.Messages, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ThrottlingException
if *v == nil {
sv = &types.ThrottlingException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTranscriptEvent(v **types.TranscriptEvent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TranscriptEvent
if *v == nil {
sv = &types.TranscriptEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "eventId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EventId to be of type string, got %T instead", value)
}
sv.EventId = ptr.String(jtv)
}
case "transcript":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Transcript = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationException
if *v == nil {
sv = &types.ValidationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentValue(v **types.Value, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Value
if *v == nil {
sv = &types.Value{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "interpretedValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.InterpretedValue = ptr.String(jtv)
}
case "originalValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.OriginalValue = ptr.String(jtv)
}
case "resolvedValues":
if err := awsRestjson1_deserializeDocumentStringList(&sv.ResolvedValues, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentValues(v *[]types.Slot, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Slot
if *v == nil {
cv = []types.Slot{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Slot
destAddr := &col
if err := awsRestjson1_deserializeDocumentSlot(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.AccessDeniedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorBadGatewayException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.BadGatewayException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentBadGatewayException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ConflictException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentConflictException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorDependencyFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.DependencyFailedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentDependencyFailedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServerException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceNotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ThrottlingException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ValidationException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentValidationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
| 4,117 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package lexruntimev2 provides the API client, operations, and parameter types
// for Amazon Lex Runtime V2.
//
// This section contains documentation for the Amazon Lex V2 Runtime V2 API
// operations.
package lexruntimev2
| 9 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/lexruntimev2/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "lex"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/lexruntimev2/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithysync "github.com/aws/smithy-go/sync"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"io/ioutil"
"sync"
"time"
)
// StartConversationRequestEventStreamWriter provides the interface for writing
// events to a stream.
//
// The writer's Close method must allow multiple concurrent calls.
type StartConversationRequestEventStreamWriter interface {
Send(context.Context, types.StartConversationRequestEventStream) error
Close() error
Err() error
}
// StartConversationResponseEventStreamReader provides the interface for reading
// events from a stream.
//
// The writer's Close method must allow multiple concurrent calls.
type StartConversationResponseEventStreamReader interface {
Events() <-chan types.StartConversationResponseEventStream
Close() error
Err() error
}
type eventStreamSigner interface {
GetSignature(ctx context.Context, headers, payload []byte, signingTime time.Time, optFns ...func(*v4.StreamSignerOptions)) ([]byte, error)
}
type asyncStartConversationRequestEventStream struct {
Event types.StartConversationRequestEventStream
Result chan<- error
}
func (e asyncStartConversationRequestEventStream) ReportResult(cancel <-chan struct{}, err error) bool {
select {
case e.Result <- err:
return true
case <-cancel:
return false
}
}
type startConversationRequestEventStreamWriter struct {
encoder *eventstream.Encoder
signer eventStreamSigner
stream chan asyncStartConversationRequestEventStream
serializationBuffer *bytes.Buffer
signingBuffer *bytes.Buffer
eventStream io.WriteCloser
done chan struct{}
closeOnce sync.Once
err *smithysync.OnceErr
}
func newStartConversationRequestEventStreamWriter(stream io.WriteCloser, encoder *eventstream.Encoder, signer eventStreamSigner) *startConversationRequestEventStreamWriter {
w := &startConversationRequestEventStreamWriter{
encoder: encoder,
signer: signer,
stream: make(chan asyncStartConversationRequestEventStream),
eventStream: stream,
done: make(chan struct{}),
err: smithysync.NewOnceErr(),
serializationBuffer: bytes.NewBuffer(nil),
signingBuffer: bytes.NewBuffer(nil),
}
go w.writeStream()
return w
}
func (w *startConversationRequestEventStreamWriter) Send(ctx context.Context, event types.StartConversationRequestEventStream) error {
return w.send(ctx, event)
}
func (w *startConversationRequestEventStreamWriter) send(ctx context.Context, event types.StartConversationRequestEventStream) error {
if err := w.err.Err(); err != nil {
return err
}
resultCh := make(chan error)
wrapped := asyncStartConversationRequestEventStream{
Event: event,
Result: resultCh,
}
select {
case w.stream <- wrapped:
case <-ctx.Done():
return ctx.Err()
case <-w.done:
return fmt.Errorf("stream closed, unable to send event")
}
select {
case err := <-resultCh:
return err
case <-ctx.Done():
return ctx.Err()
case <-w.done:
return fmt.Errorf("stream closed, unable to send event")
}
}
func (w *startConversationRequestEventStreamWriter) writeStream() {
defer w.Close()
for {
select {
case wrapper := <-w.stream:
err := w.writeEvent(wrapper.Event)
wrapper.ReportResult(w.done, err)
if err != nil {
w.err.SetError(err)
return
}
case <-w.done:
if err := w.closeStream(); err != nil {
w.err.SetError(err)
}
return
}
}
}
func (w *startConversationRequestEventStreamWriter) writeEvent(event types.StartConversationRequestEventStream) error {
// serializedEvent returned bytes refers to an underlying byte buffer and must not
// escape this writeEvent scope without first copying. Any previous bytes stored in
// the buffer are cleared by this call.
serializedEvent, err := w.serializeEvent(event)
if err != nil {
return err
}
// signedEvent returned bytes refers to an underlying byte buffer and must not
// escape this writeEvent scope without first copying. Any previous bytes stored in
// the buffer are cleared by this call.
signedEvent, err := w.signEvent(serializedEvent)
if err != nil {
return err
}
// bytes are now copied to the underlying stream writer
_, err = io.Copy(w.eventStream, bytes.NewReader(signedEvent))
return err
}
func (w *startConversationRequestEventStreamWriter) serializeEvent(event types.StartConversationRequestEventStream) ([]byte, error) {
w.serializationBuffer.Reset()
eventMessage := eventstream.Message{}
if err := awsRestjson1_serializeEventStreamStartConversationRequestEventStream(event, &eventMessage); err != nil {
return nil, err
}
if err := w.encoder.Encode(w.serializationBuffer, eventMessage); err != nil {
return nil, err
}
return w.serializationBuffer.Bytes(), nil
}
func (w *startConversationRequestEventStreamWriter) signEvent(payload []byte) ([]byte, error) {
w.signingBuffer.Reset()
date := time.Now().UTC()
var msg eventstream.Message
msg.Headers.Set(eventstreamapi.DateHeader, eventstream.TimestampValue(date))
msg.Payload = payload
var headers bytes.Buffer
if err := eventstream.EncodeHeaders(&headers, msg.Headers); err != nil {
return nil, err
}
sig, err := w.signer.GetSignature(context.Background(), headers.Bytes(), msg.Payload, date)
if err != nil {
return nil, err
}
msg.Headers.Set(eventstreamapi.ChunkSignatureHeader, eventstream.BytesValue(sig))
if err := w.encoder.Encode(w.signingBuffer, msg); err != nil {
return nil, err
}
return w.signingBuffer.Bytes(), nil
}
func (w *startConversationRequestEventStreamWriter) closeStream() (err error) {
defer func() {
if cErr := w.eventStream.Close(); cErr != nil && err == nil {
err = cErr
}
}()
// Per the protocol, a signed empty message is used to indicate the end of the stream,
// and that no subsequent events will be sent.
signedEvent, err := w.signEvent([]byte{})
if err != nil {
return err
}
_, err = io.Copy(w.eventStream, bytes.NewReader(signedEvent))
return err
}
func (w *startConversationRequestEventStreamWriter) ErrorSet() <-chan struct{} {
return w.err.ErrorSet()
}
func (w *startConversationRequestEventStreamWriter) Close() error {
w.closeOnce.Do(w.safeClose)
return w.Err()
}
func (w *startConversationRequestEventStreamWriter) safeClose() {
close(w.done)
}
func (w *startConversationRequestEventStreamWriter) Err() error {
return w.err.Err()
}
type startConversationResponseEventStreamReader struct {
stream chan types.StartConversationResponseEventStream
decoder *eventstream.Decoder
eventStream io.ReadCloser
err *smithysync.OnceErr
payloadBuf []byte
done chan struct{}
closeOnce sync.Once
}
func newStartConversationResponseEventStreamReader(readCloser io.ReadCloser, decoder *eventstream.Decoder) *startConversationResponseEventStreamReader {
w := &startConversationResponseEventStreamReader{
stream: make(chan types.StartConversationResponseEventStream),
decoder: decoder,
eventStream: readCloser,
err: smithysync.NewOnceErr(),
done: make(chan struct{}),
payloadBuf: make([]byte, 10*1024),
}
go w.readEventStream()
return w
}
func (r *startConversationResponseEventStreamReader) Events() <-chan types.StartConversationResponseEventStream {
return r.stream
}
func (r *startConversationResponseEventStreamReader) readEventStream() {
defer r.Close()
defer close(r.stream)
for {
r.payloadBuf = r.payloadBuf[0:0]
decodedMessage, err := r.decoder.Decode(r.eventStream, r.payloadBuf)
if err != nil {
if err == io.EOF {
return
}
select {
case <-r.done:
return
default:
r.err.SetError(err)
return
}
}
event, err := r.deserializeEventMessage(&decodedMessage)
if err != nil {
r.err.SetError(err)
return
}
select {
case r.stream <- event:
case <-r.done:
return
}
}
}
func (r *startConversationResponseEventStreamReader) deserializeEventMessage(msg *eventstream.Message) (types.StartConversationResponseEventStream, error) {
messageType := msg.Headers.Get(eventstreamapi.MessageTypeHeader)
if messageType == nil {
return nil, fmt.Errorf("%s event header not present", eventstreamapi.MessageTypeHeader)
}
switch messageType.String() {
case eventstreamapi.EventMessageType:
var v types.StartConversationResponseEventStream
if err := awsRestjson1_deserializeEventStreamStartConversationResponseEventStream(&v, msg); err != nil {
return nil, err
}
return v, nil
case eventstreamapi.ExceptionMessageType:
return nil, awsRestjson1_deserializeEventStreamExceptionStartConversationResponseEventStream(msg)
case eventstreamapi.ErrorMessageType:
errorCode := "UnknownError"
errorMessage := errorCode
if header := msg.Headers.Get(eventstreamapi.ErrorCodeHeader); header != nil {
errorCode = header.String()
}
if header := msg.Headers.Get(eventstreamapi.ErrorMessageHeader); header != nil {
errorMessage = header.String()
}
return nil, &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
default:
mc := msg.Clone()
return nil, &UnknownEventMessageError{
Type: messageType.String(),
Message: &mc,
}
}
}
func (r *startConversationResponseEventStreamReader) ErrorSet() <-chan struct{} {
return r.err.ErrorSet()
}
func (r *startConversationResponseEventStreamReader) Close() error {
r.closeOnce.Do(r.safeClose)
return r.Err()
}
func (r *startConversationResponseEventStreamReader) safeClose() {
close(r.done)
r.eventStream.Close()
}
func (r *startConversationResponseEventStreamReader) Err() error {
return r.err.Err()
}
func (r *startConversationResponseEventStreamReader) Closed() <-chan struct{} {
return r.done
}
type awsRestjson1_deserializeOpEventStreamStartConversation struct {
LogEventStreamWrites bool
LogEventStreamReads bool
}
func (*awsRestjson1_deserializeOpEventStreamStartConversation) ID() string {
return "OperationEventStreamDeserializer"
}
func (m *awsRestjson1_deserializeOpEventStreamStartConversation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
defer func() {
if err == nil {
return
}
m.closeResponseBody(out)
}()
logger := middleware.GetLogger(ctx)
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", in.Request)
}
_ = request
if err := eventstreamapi.ApplyHTTPTransportFixes(request); err != nil {
return out, metadata, err
}
requestSignature, err := v4.GetSignedRequestSignature(request.Request)
if err != nil {
return out, metadata, fmt.Errorf("failed to get event stream seed signature: %v", err)
}
signer := v4.NewStreamSigner(
awsmiddleware.GetSigningCredentials(ctx),
awsmiddleware.GetSigningName(ctx),
awsmiddleware.GetSigningRegion(ctx),
requestSignature,
)
eventWriter := newStartConversationRequestEventStreamWriter(
eventstreamapi.GetInputStreamWriter(ctx),
eventstream.NewEncoder(func(options *eventstream.EncoderOptions) {
options.Logger = logger
options.LogMessages = m.LogEventStreamWrites
}),
signer,
)
defer func() {
if err == nil {
return
}
_ = eventWriter.Close()
}()
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
deserializeOutput, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", out.RawResponse)
}
_ = deserializeOutput
output, ok := out.Result.(*StartConversationOutput)
if out.Result != nil && !ok {
return out, metadata, fmt.Errorf("unexpected output result type: %T", out.Result)
} else if out.Result == nil {
output = &StartConversationOutput{}
out.Result = output
}
eventReader := newStartConversationResponseEventStreamReader(
deserializeOutput.Body,
eventstream.NewDecoder(func(options *eventstream.DecoderOptions) {
options.Logger = logger
options.LogMessages = m.LogEventStreamReads
}),
)
defer func() {
if err == nil {
return
}
_ = eventReader.Close()
}()
output.eventStream = NewStartConversationEventStream(func(stream *StartConversationEventStream) {
stream.Writer = eventWriter
stream.Reader = eventReader
})
go output.eventStream.waitStreamClose()
return out, metadata, nil
}
func (*awsRestjson1_deserializeOpEventStreamStartConversation) closeResponseBody(out middleware.DeserializeOutput) {
if resp, ok := out.RawResponse.(*smithyhttp.Response); ok && resp != nil && resp.Body != nil {
_, _ = io.Copy(ioutil.Discard, resp.Body)
_ = resp.Body.Close()
}
}
func addEventStreamStartConversationMiddleware(stack *middleware.Stack, options Options) error {
if err := stack.Deserialize.Insert(&awsRestjson1_deserializeOpEventStreamStartConversation{
LogEventStreamWrites: options.ClientLogMode.IsRequestEventMessage(),
LogEventStreamReads: options.ClientLogMode.IsResponseEventMessage(),
}, "OperationDeserializer", middleware.Before); err != nil {
return err
}
return nil
}
// UnknownEventMessageError provides an error when a message is received from the stream,
// but the reader is unable to determine what kind of message it is.
type UnknownEventMessageError struct {
Type string
Message *eventstream.Message
}
// Error retruns the error message string.
func (e *UnknownEventMessageError) Error() string {
return "unknown event stream message type, " + e.Type
}
func setSafeEventStreamClientLogMode(o *Options, operation string) {
switch operation {
case "StartConversation":
toggleEventStreamClientLogMode(o, true, true)
return
default:
return
}
}
func toggleEventStreamClientLogMode(o *Options, request, response bool) {
mode := o.ClientLogMode
if request && mode.IsRequestWithBody() {
mode.ClearRequestWithBody()
mode |= aws.LogRequest
}
if response && mode.IsResponseWithBody() {
mode.ClearResponseWithBody()
mode |= aws.LogResponse
}
o.ClientLogMode = mode
}
| 544 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package lexruntimev2
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.17.11"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/service/lexruntimev2/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_serializeOpDeleteSession struct {
}
func (*awsRestjson1_serializeOpDeleteSession) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSession) 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.(*DeleteSessionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}")
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_serializeOpHttpBindingsDeleteSessionInput(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_serializeOpHttpBindingsDeleteSessionInput(v *DeleteSessionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAliasId == nil || len(*v.BotAliasId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAliasId must not be empty")}
}
if v.BotAliasId != nil {
if err := encoder.SetURI("botAliasId").String(*v.BotAliasId); err != nil {
return err
}
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.SessionId == nil || len(*v.SessionId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")}
}
if v.SessionId != nil {
if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetSession struct {
}
func (*awsRestjson1_serializeOpGetSession) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetSession) 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.(*GetSessionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
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_serializeOpHttpBindingsGetSessionInput(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_serializeOpHttpBindingsGetSessionInput(v *GetSessionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAliasId == nil || len(*v.BotAliasId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAliasId must not be empty")}
}
if v.BotAliasId != nil {
if err := encoder.SetURI("botAliasId").String(*v.BotAliasId); err != nil {
return err
}
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.SessionId == nil || len(*v.SessionId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")}
}
if v.SessionId != nil {
if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutSession struct {
}
func (*awsRestjson1_serializeOpPutSession) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutSession) 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.(*PutSessionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}")
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_serializeOpHttpBindingsPutSessionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutSessionInput(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_serializeOpHttpBindingsPutSessionInput(v *PutSessionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAliasId == nil || len(*v.BotAliasId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAliasId must not be empty")}
}
if v.BotAliasId != nil {
if err := encoder.SetURI("botAliasId").String(*v.BotAliasId); err != nil {
return err
}
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.ResponseContentType != nil && len(*v.ResponseContentType) > 0 {
locationName := "Responsecontenttype"
encoder.SetHeader(locationName).String(*v.ResponseContentType)
}
if v.SessionId == nil || len(*v.SessionId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")}
}
if v.SessionId != nil {
if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutSessionInput(v *PutSessionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Messages != nil {
ok := object.Key("messages")
if err := awsRestjson1_serializeDocumentMessages(v.Messages, ok); err != nil {
return err
}
}
if v.RequestAttributes != nil {
ok := object.Key("requestAttributes")
if err := awsRestjson1_serializeDocumentStringMap(v.RequestAttributes, ok); err != nil {
return err
}
}
if v.SessionState != nil {
ok := object.Key("sessionState")
if err := awsRestjson1_serializeDocumentSessionState(v.SessionState, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpRecognizeText struct {
}
func (*awsRestjson1_serializeOpRecognizeText) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRecognizeText) 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.(*RecognizeTextInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/text")
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_serializeOpHttpBindingsRecognizeTextInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentRecognizeTextInput(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_serializeOpHttpBindingsRecognizeTextInput(v *RecognizeTextInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAliasId == nil || len(*v.BotAliasId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAliasId must not be empty")}
}
if v.BotAliasId != nil {
if err := encoder.SetURI("botAliasId").String(*v.BotAliasId); err != nil {
return err
}
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.SessionId == nil || len(*v.SessionId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")}
}
if v.SessionId != nil {
if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentRecognizeTextInput(v *RecognizeTextInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RequestAttributes != nil {
ok := object.Key("requestAttributes")
if err := awsRestjson1_serializeDocumentStringMap(v.RequestAttributes, ok); err != nil {
return err
}
}
if v.SessionState != nil {
ok := object.Key("sessionState")
if err := awsRestjson1_serializeDocumentSessionState(v.SessionState, ok); err != nil {
return err
}
}
if v.Text != nil {
ok := object.Key("text")
ok.String(*v.Text)
}
return nil
}
type awsRestjson1_serializeOpRecognizeUtterance struct {
}
func (*awsRestjson1_serializeOpRecognizeUtterance) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRecognizeUtterance) 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.(*RecognizeUtteranceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/utterance")
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_serializeOpHttpBindingsRecognizeUtteranceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/octet-stream")
}
if input.InputStream != nil {
payload := input.InputStream
if request, err = request.SetStream(payload); 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_serializeOpHttpBindingsRecognizeUtteranceInput(v *RecognizeUtteranceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAliasId == nil || len(*v.BotAliasId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAliasId must not be empty")}
}
if v.BotAliasId != nil {
if err := encoder.SetURI("botAliasId").String(*v.BotAliasId); err != nil {
return err
}
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.RequestAttributes != nil && len(*v.RequestAttributes) > 0 {
locationName := "X-Amz-Lex-Request-Attributes"
encoder.SetHeader(locationName).String(*v.RequestAttributes)
}
if v.RequestContentType != nil && len(*v.RequestContentType) > 0 {
locationName := "Content-Type"
encoder.SetHeader(locationName).String(*v.RequestContentType)
}
if v.ResponseContentType != nil && len(*v.ResponseContentType) > 0 {
locationName := "Response-Content-Type"
encoder.SetHeader(locationName).String(*v.ResponseContentType)
}
if v.SessionId == nil || len(*v.SessionId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")}
}
if v.SessionId != nil {
if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil {
return err
}
}
if v.SessionState != nil && len(*v.SessionState) > 0 {
locationName := "X-Amz-Lex-Session-State"
encoder.SetHeader(locationName).String(*v.SessionState)
}
return nil
}
type awsRestjson1_serializeOpStartConversation struct {
}
func (*awsRestjson1_serializeOpStartConversation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartConversation) 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.(*StartConversationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/conversation")
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_serializeOpHttpBindingsStartConversationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/vnd.amazon.eventstream")
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_serializeOpHttpBindingsStartConversationInput(v *StartConversationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAliasId == nil || len(*v.BotAliasId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAliasId must not be empty")}
}
if v.BotAliasId != nil {
if err := encoder.SetURI("botAliasId").String(*v.BotAliasId); err != nil {
return err
}
}
if v.BotId == nil || len(*v.BotId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botId must not be empty")}
}
if v.BotId != nil {
if err := encoder.SetURI("botId").String(*v.BotId); err != nil {
return err
}
}
if len(v.ConversationMode) > 0 {
locationName := "X-Amz-Lex-Conversation-Mode"
encoder.SetHeader(locationName).String(string(v.ConversationMode))
}
if v.LocaleId == nil || len(*v.LocaleId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member localeId must not be empty")}
}
if v.LocaleId != nil {
if err := encoder.SetURI("localeId").String(*v.LocaleId); err != nil {
return err
}
}
if v.SessionId == nil || len(*v.SessionId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member sessionId must not be empty")}
}
if v.SessionId != nil {
if err := encoder.SetURI("sessionId").String(*v.SessionId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeEventStreamStartConversationRequestEventStream(v types.StartConversationRequestEventStream, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
switch vv := v.(type) {
case *types.StartConversationRequestEventStreamMemberConfigurationEvent:
msg.Headers.Set(eventstreamapi.EventTypeHeader, eventstream.StringValue("ConfigurationEvent"))
return awsRestjson1_serializeEventMessageConfigurationEvent(&vv.Value, msg)
case *types.StartConversationRequestEventStreamMemberAudioInputEvent:
msg.Headers.Set(eventstreamapi.EventTypeHeader, eventstream.StringValue("AudioInputEvent"))
return awsRestjson1_serializeEventMessageAudioInputEvent(&vv.Value, msg)
case *types.StartConversationRequestEventStreamMemberDTMFInputEvent:
msg.Headers.Set(eventstreamapi.EventTypeHeader, eventstream.StringValue("DTMFInputEvent"))
return awsRestjson1_serializeEventMessageDTMFInputEvent(&vv.Value, msg)
case *types.StartConversationRequestEventStreamMemberTextInputEvent:
msg.Headers.Set(eventstreamapi.EventTypeHeader, eventstream.StringValue("TextInputEvent"))
return awsRestjson1_serializeEventMessageTextInputEvent(&vv.Value, msg)
case *types.StartConversationRequestEventStreamMemberPlaybackCompletionEvent:
msg.Headers.Set(eventstreamapi.EventTypeHeader, eventstream.StringValue("PlaybackCompletionEvent"))
return awsRestjson1_serializeEventMessagePlaybackCompletionEvent(&vv.Value, msg)
case *types.StartConversationRequestEventStreamMemberDisconnectionEvent:
msg.Headers.Set(eventstreamapi.EventTypeHeader, eventstream.StringValue("DisconnectionEvent"))
return awsRestjson1_serializeEventMessageDisconnectionEvent(&vv.Value, msg)
default:
return fmt.Errorf("unexpected event message type: %v", v)
}
}
func awsRestjson1_serializeEventMessageAudioInputEvent(v *types.AudioInputEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
msg.Headers.Set(eventstreamapi.ContentTypeHeader, eventstream.StringValue("application/json"))
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentAudioInputEvent(v, jsonEncoder.Value); err != nil {
return err
}
msg.Payload = jsonEncoder.Bytes()
return nil
}
func awsRestjson1_serializeEventMessageConfigurationEvent(v *types.ConfigurationEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
msg.Headers.Set(eventstreamapi.ContentTypeHeader, eventstream.StringValue("application/json"))
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentConfigurationEvent(v, jsonEncoder.Value); err != nil {
return err
}
msg.Payload = jsonEncoder.Bytes()
return nil
}
func awsRestjson1_serializeEventMessageDisconnectionEvent(v *types.DisconnectionEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
msg.Headers.Set(eventstreamapi.ContentTypeHeader, eventstream.StringValue("application/json"))
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentDisconnectionEvent(v, jsonEncoder.Value); err != nil {
return err
}
msg.Payload = jsonEncoder.Bytes()
return nil
}
func awsRestjson1_serializeEventMessageDTMFInputEvent(v *types.DTMFInputEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
msg.Headers.Set(eventstreamapi.ContentTypeHeader, eventstream.StringValue("application/json"))
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentDTMFInputEvent(v, jsonEncoder.Value); err != nil {
return err
}
msg.Payload = jsonEncoder.Bytes()
return nil
}
func awsRestjson1_serializeEventMessagePlaybackCompletionEvent(v *types.PlaybackCompletionEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
msg.Headers.Set(eventstreamapi.ContentTypeHeader, eventstream.StringValue("application/json"))
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentPlaybackCompletionEvent(v, jsonEncoder.Value); err != nil {
return err
}
msg.Payload = jsonEncoder.Bytes()
return nil
}
func awsRestjson1_serializeEventMessageTextInputEvent(v *types.TextInputEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
msg.Headers.Set(eventstreamapi.ContentTypeHeader, eventstream.StringValue("application/json"))
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeDocumentTextInputEvent(v, jsonEncoder.Value); err != nil {
return err
}
msg.Payload = jsonEncoder.Bytes()
return nil
}
func awsRestjson1_serializeDocumentActiveContext(v *types.ActiveContext, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContextAttributes != nil {
ok := object.Key("contextAttributes")
if err := awsRestjson1_serializeDocumentActiveContextParametersMap(v.ContextAttributes, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.TimeToLive != nil {
ok := object.Key("timeToLive")
if err := awsRestjson1_serializeDocumentActiveContextTimeToLive(v.TimeToLive, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentActiveContextParametersMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentActiveContextsList(v []types.ActiveContext, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentActiveContext(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentActiveContextTimeToLive(v *types.ActiveContextTimeToLive, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TimeToLiveInSeconds != nil {
ok := object.Key("timeToLiveInSeconds")
ok.Integer(*v.TimeToLiveInSeconds)
}
if v.TurnsToLive != nil {
ok := object.Key("turnsToLive")
ok.Integer(*v.TurnsToLive)
}
return nil
}
func awsRestjson1_serializeDocumentAudioInputEvent(v *types.AudioInputEvent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AudioChunk != nil {
ok := object.Key("audioChunk")
ok.Base64EncodeBytes(v.AudioChunk)
}
if v.ClientTimestampMillis != 0 {
ok := object.Key("clientTimestampMillis")
ok.Long(v.ClientTimestampMillis)
}
if v.ContentType != nil {
ok := object.Key("contentType")
ok.String(*v.ContentType)
}
if v.EventId != nil {
ok := object.Key("eventId")
ok.String(*v.EventId)
}
return nil
}
func awsRestjson1_serializeDocumentButton(v *types.Button, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Text != nil {
ok := object.Key("text")
ok.String(*v.Text)
}
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentButtonsList(v []types.Button, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentButton(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentConfigurationEvent(v *types.ConfigurationEvent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientTimestampMillis != 0 {
ok := object.Key("clientTimestampMillis")
ok.Long(v.ClientTimestampMillis)
}
if v.DisablePlayback {
ok := object.Key("disablePlayback")
ok.Boolean(v.DisablePlayback)
}
if v.EventId != nil {
ok := object.Key("eventId")
ok.String(*v.EventId)
}
if v.RequestAttributes != nil {
ok := object.Key("requestAttributes")
if err := awsRestjson1_serializeDocumentStringMap(v.RequestAttributes, ok); err != nil {
return err
}
}
if v.ResponseContentType != nil {
ok := object.Key("responseContentType")
ok.String(*v.ResponseContentType)
}
if v.SessionState != nil {
ok := object.Key("sessionState")
if err := awsRestjson1_serializeDocumentSessionState(v.SessionState, ok); err != nil {
return err
}
}
if v.WelcomeMessages != nil {
ok := object.Key("welcomeMessages")
if err := awsRestjson1_serializeDocumentMessages(v.WelcomeMessages, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDialogAction(v *types.DialogAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.SlotElicitationStyle) > 0 {
ok := object.Key("slotElicitationStyle")
ok.String(string(v.SlotElicitationStyle))
}
if v.SlotToElicit != nil {
ok := object.Key("slotToElicit")
ok.String(*v.SlotToElicit)
}
if v.SubSlotToElicit != nil {
ok := object.Key("subSlotToElicit")
if err := awsRestjson1_serializeDocumentElicitSubSlot(v.SubSlotToElicit, ok); err != nil {
return err
}
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentDisconnectionEvent(v *types.DisconnectionEvent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientTimestampMillis != 0 {
ok := object.Key("clientTimestampMillis")
ok.Long(v.ClientTimestampMillis)
}
if v.EventId != nil {
ok := object.Key("eventId")
ok.String(*v.EventId)
}
return nil
}
func awsRestjson1_serializeDocumentDTMFInputEvent(v *types.DTMFInputEvent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientTimestampMillis != 0 {
ok := object.Key("clientTimestampMillis")
ok.Long(v.ClientTimestampMillis)
}
if v.EventId != nil {
ok := object.Key("eventId")
ok.String(*v.EventId)
}
if v.InputCharacter != nil {
ok := object.Key("inputCharacter")
ok.String(*v.InputCharacter)
}
return nil
}
func awsRestjson1_serializeDocumentElicitSubSlot(v *types.ElicitSubSlot, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.SubSlotToElicit != nil {
ok := object.Key("subSlotToElicit")
if err := awsRestjson1_serializeDocumentElicitSubSlot(v.SubSlotToElicit, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentImageResponseCard(v *types.ImageResponseCard, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Buttons != nil {
ok := object.Key("buttons")
if err := awsRestjson1_serializeDocumentButtonsList(v.Buttons, ok); err != nil {
return err
}
}
if v.ImageUrl != nil {
ok := object.Key("imageUrl")
ok.String(*v.ImageUrl)
}
if v.Subtitle != nil {
ok := object.Key("subtitle")
ok.String(*v.Subtitle)
}
if v.Title != nil {
ok := object.Key("title")
ok.String(*v.Title)
}
return nil
}
func awsRestjson1_serializeDocumentIntent(v *types.Intent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ConfirmationState) > 0 {
ok := object.Key("confirmationState")
ok.String(string(v.ConfirmationState))
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Slots != nil {
ok := object.Key("slots")
if err := awsRestjson1_serializeDocumentSlots(v.Slots, ok); err != nil {
return err
}
}
if len(v.State) > 0 {
ok := object.Key("state")
ok.String(string(v.State))
}
return nil
}
func awsRestjson1_serializeDocumentMessage(v *types.Message, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Content != nil {
ok := object.Key("content")
ok.String(*v.Content)
}
if len(v.ContentType) > 0 {
ok := object.Key("contentType")
ok.String(string(v.ContentType))
}
if v.ImageResponseCard != nil {
ok := object.Key("imageResponseCard")
if err := awsRestjson1_serializeDocumentImageResponseCard(v.ImageResponseCard, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMessages(v []types.Message, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentMessage(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPlaybackCompletionEvent(v *types.PlaybackCompletionEvent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientTimestampMillis != 0 {
ok := object.Key("clientTimestampMillis")
ok.Long(v.ClientTimestampMillis)
}
if v.EventId != nil {
ok := object.Key("eventId")
ok.String(*v.EventId)
}
return nil
}
func awsRestjson1_serializeDocumentRuntimeHintDetails(v *types.RuntimeHintDetails, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RuntimeHintValues != nil {
ok := object.Key("runtimeHintValues")
if err := awsRestjson1_serializeDocumentRuntimeHintValuesList(v.RuntimeHintValues, ok); err != nil {
return err
}
}
if v.SubSlotHints != nil {
ok := object.Key("subSlotHints")
if err := awsRestjson1_serializeDocumentSlotHintsSlotMap(v.SubSlotHints, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentRuntimeHints(v *types.RuntimeHints, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SlotHints != nil {
ok := object.Key("slotHints")
if err := awsRestjson1_serializeDocumentSlotHintsIntentMap(v.SlotHints, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentRuntimeHintValue(v *types.RuntimeHintValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Phrase != nil {
ok := object.Key("phrase")
ok.String(*v.Phrase)
}
return nil
}
func awsRestjson1_serializeDocumentRuntimeHintValuesList(v []types.RuntimeHintValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentRuntimeHintValue(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSessionState(v *types.SessionState, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActiveContexts != nil {
ok := object.Key("activeContexts")
if err := awsRestjson1_serializeDocumentActiveContextsList(v.ActiveContexts, ok); err != nil {
return err
}
}
if v.DialogAction != nil {
ok := object.Key("dialogAction")
if err := awsRestjson1_serializeDocumentDialogAction(v.DialogAction, ok); err != nil {
return err
}
}
if v.Intent != nil {
ok := object.Key("intent")
if err := awsRestjson1_serializeDocumentIntent(v.Intent, ok); err != nil {
return err
}
}
if v.OriginatingRequestId != nil {
ok := object.Key("originatingRequestId")
ok.String(*v.OriginatingRequestId)
}
if v.RuntimeHints != nil {
ok := object.Key("runtimeHints")
if err := awsRestjson1_serializeDocumentRuntimeHints(v.RuntimeHints, ok); err != nil {
return err
}
}
if v.SessionAttributes != nil {
ok := object.Key("sessionAttributes")
if err := awsRestjson1_serializeDocumentStringMap(v.SessionAttributes, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlot(v *types.Slot, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Shape) > 0 {
ok := object.Key("shape")
ok.String(string(v.Shape))
}
if v.SubSlots != nil {
ok := object.Key("subSlots")
if err := awsRestjson1_serializeDocumentSlots(v.SubSlots, ok); err != nil {
return err
}
}
if v.Value != nil {
ok := object.Key("value")
if err := awsRestjson1_serializeDocumentValue(v.Value, ok); err != nil {
return err
}
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotHintsIntentMap(v map[string]map[string]types.RuntimeHintDetails, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentSlotHintsSlotMap(v[key], om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotHintsSlotMap(v map[string]types.RuntimeHintDetails, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentRuntimeHintDetails(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlots(v map[string]types.Slot, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentSlot(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentStringList(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_serializeDocumentStringMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentTextInputEvent(v *types.TextInputEvent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientTimestampMillis != 0 {
ok := object.Key("clientTimestampMillis")
ok.Long(v.ClientTimestampMillis)
}
if v.EventId != nil {
ok := object.Key("eventId")
ok.String(*v.EventId)
}
if v.Text != nil {
ok := object.Key("text")
ok.String(*v.Text)
}
return nil
}
func awsRestjson1_serializeDocumentValue(v *types.Value, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InterpretedValue != nil {
ok := object.Key("interpretedValue")
ok.String(*v.InterpretedValue)
}
if v.OriginalValue != nil {
ok := object.Key("originalValue")
ok.String(*v.OriginalValue)
}
if v.ResolvedValues != nil {
ok := object.Key("resolvedValues")
if err := awsRestjson1_serializeDocumentStringList(v.ResolvedValues, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentValues(v []types.Slot, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSlot(&v[i], av); err != nil {
return err
}
}
return nil
}
| 1,409 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexruntimev2
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lexruntimev2/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpDeleteSession struct {
}
func (*validateOpDeleteSession) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSessionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSessionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSession struct {
}
func (*validateOpGetSession) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSessionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSessionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutSession struct {
}
func (*validateOpPutSession) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutSessionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutSessionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRecognizeText struct {
}
func (*validateOpRecognizeText) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRecognizeText) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RecognizeTextInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRecognizeTextInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRecognizeUtterance struct {
}
func (*validateOpRecognizeUtterance) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRecognizeUtterance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RecognizeUtteranceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRecognizeUtteranceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartConversation struct {
}
func (*validateOpStartConversation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartConversation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartConversationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartConversationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpDeleteSessionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSession{}, middleware.After)
}
func addOpGetSessionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSession{}, middleware.After)
}
func addOpPutSessionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutSession{}, middleware.After)
}
func addOpRecognizeTextValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRecognizeText{}, middleware.After)
}
func addOpRecognizeUtteranceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRecognizeUtterance{}, middleware.After)
}
func addOpStartConversationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartConversation{}, middleware.After)
}
func validateActiveContext(v *types.ActiveContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ActiveContext"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.TimeToLive == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeToLive"))
} else if v.TimeToLive != nil {
if err := validateActiveContextTimeToLive(v.TimeToLive); err != nil {
invalidParams.AddNested("TimeToLive", err.(smithy.InvalidParamsError))
}
}
if v.ContextAttributes == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContextAttributes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateActiveContextsList(v []types.ActiveContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ActiveContextsList"}
for i := range v {
if err := validateActiveContext(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateActiveContextTimeToLive(v *types.ActiveContextTimeToLive) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ActiveContextTimeToLive"}
if v.TimeToLiveInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeToLiveInSeconds"))
}
if v.TurnsToLive == nil {
invalidParams.Add(smithy.NewErrParamRequired("TurnsToLive"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAudioInputEvent(v *types.AudioInputEvent) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AudioInputEvent"}
if v.ContentType == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContentType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateButton(v *types.Button) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Button"}
if v.Text == nil {
invalidParams.Add(smithy.NewErrParamRequired("Text"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateButtonsList(v []types.Button) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ButtonsList"}
for i := range v {
if err := validateButton(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConfigurationEvent(v *types.ConfigurationEvent) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConfigurationEvent"}
if v.ResponseContentType == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResponseContentType"))
}
if v.SessionState != nil {
if err := validateSessionState(v.SessionState); err != nil {
invalidParams.AddNested("SessionState", err.(smithy.InvalidParamsError))
}
}
if v.WelcomeMessages != nil {
if err := validateMessages(v.WelcomeMessages); err != nil {
invalidParams.AddNested("WelcomeMessages", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDialogAction(v *types.DialogAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DialogAction"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.SubSlotToElicit != nil {
if err := validateElicitSubSlot(v.SubSlotToElicit); err != nil {
invalidParams.AddNested("SubSlotToElicit", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDTMFInputEvent(v *types.DTMFInputEvent) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DTMFInputEvent"}
if v.InputCharacter == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputCharacter"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateElicitSubSlot(v *types.ElicitSubSlot) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ElicitSubSlot"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.SubSlotToElicit != nil {
if err := validateElicitSubSlot(v.SubSlotToElicit); err != nil {
invalidParams.AddNested("SubSlotToElicit", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImageResponseCard(v *types.ImageResponseCard) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImageResponseCard"}
if v.Title == nil {
invalidParams.Add(smithy.NewErrParamRequired("Title"))
}
if v.Buttons != nil {
if err := validateButtonsList(v.Buttons); err != nil {
invalidParams.AddNested("Buttons", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIntent(v *types.Intent) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Intent"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Slots != nil {
if err := validateSlots(v.Slots); err != nil {
invalidParams.AddNested("Slots", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMessage(v *types.Message) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Message"}
if len(v.ContentType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ContentType"))
}
if v.ImageResponseCard != nil {
if err := validateImageResponseCard(v.ImageResponseCard); err != nil {
invalidParams.AddNested("ImageResponseCard", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMessages(v []types.Message) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Messages"}
for i := range v {
if err := validateMessage(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuntimeHintDetails(v *types.RuntimeHintDetails) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuntimeHintDetails"}
if v.RuntimeHintValues != nil {
if err := validateRuntimeHintValuesList(v.RuntimeHintValues); err != nil {
invalidParams.AddNested("RuntimeHintValues", err.(smithy.InvalidParamsError))
}
}
if v.SubSlotHints != nil {
if err := validateSlotHintsSlotMap(v.SubSlotHints); err != nil {
invalidParams.AddNested("SubSlotHints", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuntimeHints(v *types.RuntimeHints) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuntimeHints"}
if v.SlotHints != nil {
if err := validateSlotHintsIntentMap(v.SlotHints); err != nil {
invalidParams.AddNested("SlotHints", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuntimeHintValue(v *types.RuntimeHintValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuntimeHintValue"}
if v.Phrase == nil {
invalidParams.Add(smithy.NewErrParamRequired("Phrase"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuntimeHintValuesList(v []types.RuntimeHintValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuntimeHintValuesList"}
for i := range v {
if err := validateRuntimeHintValue(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSessionState(v *types.SessionState) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SessionState"}
if v.DialogAction != nil {
if err := validateDialogAction(v.DialogAction); err != nil {
invalidParams.AddNested("DialogAction", err.(smithy.InvalidParamsError))
}
}
if v.Intent != nil {
if err := validateIntent(v.Intent); err != nil {
invalidParams.AddNested("Intent", err.(smithy.InvalidParamsError))
}
}
if v.ActiveContexts != nil {
if err := validateActiveContextsList(v.ActiveContexts); err != nil {
invalidParams.AddNested("ActiveContexts", err.(smithy.InvalidParamsError))
}
}
if v.RuntimeHints != nil {
if err := validateRuntimeHints(v.RuntimeHints); err != nil {
invalidParams.AddNested("RuntimeHints", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlot(v *types.Slot) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Slot"}
if v.Value != nil {
if err := validateValue(v.Value); err != nil {
invalidParams.AddNested("Value", err.(smithy.InvalidParamsError))
}
}
if v.Values != nil {
if err := validateValues(v.Values); err != nil {
invalidParams.AddNested("Values", err.(smithy.InvalidParamsError))
}
}
if v.SubSlots != nil {
if err := validateSlots(v.SubSlots); err != nil {
invalidParams.AddNested("SubSlots", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotHintsIntentMap(v map[string]map[string]types.RuntimeHintDetails) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotHintsIntentMap"}
for key := range v {
if err := validateSlotHintsSlotMap(v[key]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotHintsSlotMap(v map[string]types.RuntimeHintDetails) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotHintsSlotMap"}
for key := range v {
value := v[key]
if err := validateRuntimeHintDetails(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlots(v map[string]types.Slot) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Slots"}
for key := range v {
value := v[key]
if err := validateSlot(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStartConversationRequestEventStream(v types.StartConversationRequestEventStream) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartConversationRequestEventStream"}
switch uv := v.(type) {
case *types.StartConversationRequestEventStreamMemberAudioInputEvent:
if err := validateAudioInputEvent(&uv.Value); err != nil {
invalidParams.AddNested("[AudioInputEvent]", err.(smithy.InvalidParamsError))
}
case *types.StartConversationRequestEventStreamMemberConfigurationEvent:
if err := validateConfigurationEvent(&uv.Value); err != nil {
invalidParams.AddNested("[ConfigurationEvent]", err.(smithy.InvalidParamsError))
}
case *types.StartConversationRequestEventStreamMemberDTMFInputEvent:
if err := validateDTMFInputEvent(&uv.Value); err != nil {
invalidParams.AddNested("[DTMFInputEvent]", err.(smithy.InvalidParamsError))
}
case *types.StartConversationRequestEventStreamMemberTextInputEvent:
if err := validateTextInputEvent(&uv.Value); err != nil {
invalidParams.AddNested("[TextInputEvent]", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTextInputEvent(v *types.TextInputEvent) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TextInputEvent"}
if v.Text == nil {
invalidParams.Add(smithy.NewErrParamRequired("Text"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateValue(v *types.Value) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Value"}
if v.InterpretedValue == nil {
invalidParams.Add(smithy.NewErrParamRequired("InterpretedValue"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateValues(v []types.Slot) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Values"}
for i := range v {
if err := validateSlot(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSessionInput(v *DeleteSessionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSessionInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.SessionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SessionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSessionInput(v *GetSessionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSessionInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.SessionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SessionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutSessionInput(v *PutSessionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutSessionInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.SessionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SessionId"))
}
if v.Messages != nil {
if err := validateMessages(v.Messages); err != nil {
invalidParams.AddNested("Messages", err.(smithy.InvalidParamsError))
}
}
if v.SessionState == nil {
invalidParams.Add(smithy.NewErrParamRequired("SessionState"))
} else if v.SessionState != nil {
if err := validateSessionState(v.SessionState); err != nil {
invalidParams.AddNested("SessionState", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRecognizeTextInput(v *RecognizeTextInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RecognizeTextInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.SessionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SessionId"))
}
if v.Text == nil {
invalidParams.Add(smithy.NewErrParamRequired("Text"))
}
if v.SessionState != nil {
if err := validateSessionState(v.SessionState); err != nil {
invalidParams.AddNested("SessionState", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRecognizeUtteranceInput(v *RecognizeUtteranceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RecognizeUtteranceInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.SessionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SessionId"))
}
if v.RequestContentType == nil {
invalidParams.Add(smithy.NewErrParamRequired("RequestContentType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartConversationInput(v *StartConversationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartConversationInput"}
if v.BotId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotId"))
}
if v.BotAliasId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAliasId"))
}
if v.LocaleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocaleId"))
}
if v.SessionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SessionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 854 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver Lex Runtime V2 endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "runtime-v2-lex.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-v2-lex-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "runtime-v2-lex-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime-v2-lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "runtime-v2-lex.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-v2-lex-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "runtime-v2-lex-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime-v2-lex.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-v2-lex-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime-v2-lex.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-v2-lex-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime-v2-lex.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-v2-lex-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime-v2-lex.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-v2-lex-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime-v2-lex.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "runtime-v2-lex.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "runtime-v2-lex-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "runtime-v2-lex-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "runtime-v2-lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 332 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type ConfirmationState string
// Enum values for ConfirmationState
const (
ConfirmationStateConfirmed ConfirmationState = "Confirmed"
ConfirmationStateDenied ConfirmationState = "Denied"
ConfirmationStateNone ConfirmationState = "None"
)
// Values returns all known values for ConfirmationState. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ConfirmationState) Values() []ConfirmationState {
return []ConfirmationState{
"Confirmed",
"Denied",
"None",
}
}
type ConversationMode string
// Enum values for ConversationMode
const (
ConversationModeAudio ConversationMode = "AUDIO"
ConversationModeText ConversationMode = "TEXT"
)
// Values returns all known values for ConversationMode. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ConversationMode) Values() []ConversationMode {
return []ConversationMode{
"AUDIO",
"TEXT",
}
}
type DialogActionType string
// Enum values for DialogActionType
const (
DialogActionTypeClose DialogActionType = "Close"
DialogActionTypeConfirmIntent DialogActionType = "ConfirmIntent"
DialogActionTypeDelegate DialogActionType = "Delegate"
DialogActionTypeElicitIntent DialogActionType = "ElicitIntent"
DialogActionTypeElicitSlot DialogActionType = "ElicitSlot"
DialogActionTypeNone DialogActionType = "None"
)
// Values returns all known values for DialogActionType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (DialogActionType) Values() []DialogActionType {
return []DialogActionType{
"Close",
"ConfirmIntent",
"Delegate",
"ElicitIntent",
"ElicitSlot",
"None",
}
}
type InputMode string
// Enum values for InputMode
const (
InputModeText InputMode = "Text"
InputModeSpeech InputMode = "Speech"
InputModeDtmf InputMode = "DTMF"
)
// Values returns all known values for InputMode. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (InputMode) Values() []InputMode {
return []InputMode{
"Text",
"Speech",
"DTMF",
}
}
type IntentState string
// Enum values for IntentState
const (
IntentStateFailed IntentState = "Failed"
IntentStateFulfilled IntentState = "Fulfilled"
IntentStateInProgress IntentState = "InProgress"
IntentStateReadyForFulfillment IntentState = "ReadyForFulfillment"
IntentStateWaiting IntentState = "Waiting"
IntentStateFulfillmentInProgress IntentState = "FulfillmentInProgress"
)
// Values returns all known values for IntentState. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (IntentState) Values() []IntentState {
return []IntentState{
"Failed",
"Fulfilled",
"InProgress",
"ReadyForFulfillment",
"Waiting",
"FulfillmentInProgress",
}
}
type MessageContentType string
// Enum values for MessageContentType
const (
MessageContentTypeCustomPayload MessageContentType = "CustomPayload"
MessageContentTypeImageResponseCard MessageContentType = "ImageResponseCard"
MessageContentTypePlainText MessageContentType = "PlainText"
MessageContentTypeSsml MessageContentType = "SSML"
)
// Values returns all known values for MessageContentType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (MessageContentType) Values() []MessageContentType {
return []MessageContentType{
"CustomPayload",
"ImageResponseCard",
"PlainText",
"SSML",
}
}
type PlaybackInterruptionReason string
// Enum values for PlaybackInterruptionReason
const (
PlaybackInterruptionReasonDtmfStartDetected PlaybackInterruptionReason = "DTMF_START_DETECTED"
PlaybackInterruptionReasonTextDetected PlaybackInterruptionReason = "TEXT_DETECTED"
PlaybackInterruptionReasonVoiceStartDetected PlaybackInterruptionReason = "VOICE_START_DETECTED"
)
// Values returns all known values for PlaybackInterruptionReason. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (PlaybackInterruptionReason) Values() []PlaybackInterruptionReason {
return []PlaybackInterruptionReason{
"DTMF_START_DETECTED",
"TEXT_DETECTED",
"VOICE_START_DETECTED",
}
}
type SentimentType string
// Enum values for SentimentType
const (
SentimentTypeMixed SentimentType = "MIXED"
SentimentTypeNegative SentimentType = "NEGATIVE"
SentimentTypeNeutral SentimentType = "NEUTRAL"
SentimentTypePositive SentimentType = "POSITIVE"
)
// Values returns all known values for SentimentType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SentimentType) Values() []SentimentType {
return []SentimentType{
"MIXED",
"NEGATIVE",
"NEUTRAL",
"POSITIVE",
}
}
type Shape string
// Enum values for Shape
const (
ShapeScalar Shape = "Scalar"
ShapeList Shape = "List"
ShapeComposite Shape = "Composite"
)
// Values returns all known values for Shape. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (Shape) Values() []Shape {
return []Shape{
"Scalar",
"List",
"Composite",
}
}
type StyleType string
// Enum values for StyleType
const (
StyleTypeDefault StyleType = "Default"
StyleTypeSpellByLetter StyleType = "SpellByLetter"
StyleTypeSpellByWord StyleType = "SpellByWord"
)
// Values returns all known values for StyleType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (StyleType) Values() []StyleType {
return []StyleType{
"Default",
"SpellByLetter",
"SpellByWord",
}
}
| 218 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type BadGatewayException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *BadGatewayException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *BadGatewayException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *BadGatewayException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "BadGatewayException"
}
return *e.ErrorCodeOverride
}
func (e *BadGatewayException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
type ConflictException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type DependencyFailedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *DependencyFailedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *DependencyFailedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *DependencyFailedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "DependencyFailedException"
}
return *e.ErrorCodeOverride
}
func (e *DependencyFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type InternalServerException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type ThrottlingException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ThrottlingException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ThrottlingException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ThrottlingException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ThrottlingException"
}
return *e.ErrorCodeOverride
}
func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type ValidationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ValidationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ValidationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ValidationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ValidationException"
}
return *e.ErrorCodeOverride
}
func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 209 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
)
// Contains information about the contexts that a user is using in a session. You
// can configure Amazon Lex V2 to set a context when an intent is fulfilled, or you
// can set a context using the , , or operations. Use a context to indicate to
// Amazon Lex V2 intents that should be used as follow-up intents. For example, if
// the active context is order-fulfilled , only intents that have order-fulfilled
// configured as a trigger are considered for follow up.
type ActiveContext struct {
// A list of contexts active for the request. A context can be activated when a
// previous intent is fulfilled, or by including the context in the request. If you
// don't specify a list of contexts, Amazon Lex V2 will use the current list of
// contexts for the session. If you specify an empty list, all contexts for the
// session are cleared.
//
// This member is required.
ContextAttributes map[string]string
// The name of the context.
//
// This member is required.
Name *string
// Indicates the number of turns or seconds that the context is active. Once the
// time to live expires, the context is no longer returned in a response.
//
// This member is required.
TimeToLive *ActiveContextTimeToLive
noSmithyDocumentSerde
}
// The time that a context is active. You can specify the time to live in seconds
// or in conversation turns.
type ActiveContextTimeToLive struct {
// The number of seconds that the context is active. You can specify between 5 and
// 86400 seconds (24 hours).
//
// This member is required.
TimeToLiveInSeconds *int32
// The number of turns that the context is active. You can specify up to 20 turns.
// Each request and response from the bot is a turn.
//
// This member is required.
TurnsToLive *int32
noSmithyDocumentSerde
}
// Represents a chunk of audio sent from the client application to Amazon Lex V2.
// The audio is all or part of an utterance from the user. Amazon Lex V2
// accumulates audio chunks until it recognizes a natural pause in speech before
// processing the input.
type AudioInputEvent struct {
// The encoding used for the audio chunk. You must use 8 KHz PCM 16-bit
// mono-channel little-endian format. The value of the field should be:
// audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1;
// is-big-endian=false
//
// This member is required.
ContentType *string
// An encoded stream of audio.
AudioChunk []byte
// A timestamp set by the client of the date and time that the event was sent to
// Amazon Lex V2.
ClientTimestampMillis int64
// A unique identifier that your application assigns to the event. You can use
// this to identify events in logs.
EventId *string
noSmithyDocumentSerde
}
// An event sent from Amazon Lex V2 to your client application containing audio to
// play to the user.
type AudioResponseEvent struct {
// A chunk of the audio to play.
AudioChunk []byte
// The encoding of the audio chunk. This is the same as the encoding configure in
// the contentType field of the ConfigurationEvent .
ContentType *string
// A unique identifier of the event sent by Amazon Lex V2. The identifier is in
// the form RESPONSE-N , where N is a number starting with one and incremented for
// each event sent by Amazon Lex V2 in the current session.
EventId *string
noSmithyDocumentSerde
}
// A button that appears on a response card show to the user.
type Button struct {
// The text that is displayed on the button.
//
// This member is required.
Text *string
// The value returned to Amazon Lex V2 when a user chooses the button.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// Provides a score that indicates the confidence that Amazon Lex V2 has that an
// intent is the one that satisfies the user's intent.
type ConfidenceScore struct {
// A score that indicates how confident Amazon Lex V2 is that an intent satisfies
// the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher
// confidence.
Score float64
noSmithyDocumentSerde
}
// The initial event sent from the application to Amazon Lex V2 to configure the
// conversation, including session and request attributes and the response content
// type.
type ConfigurationEvent struct {
// The message that Amazon Lex V2 returns in the response can be either text or
// speech based on the responseContentType value.
// - If the value is text/plain;charset=utf-8 , Amazon Lex V2 returns text in the
// response.
// - If the value begins with audio/ , Amazon Lex V2 returns speech in the
// response. Amazon Lex V2 uses Amazon Polly to generate the speech using the
// configuration that you specified in the requestContentType parameter. For
// example, if you specify audio/mpeg as the value, Amazon Lex V2 returns speech
// in the MPEG format.
// - If the value is audio/pcm , the speech returned is audio/pcm in 16-bit,
// little-endian format.
// - The following are the accepted values:
// - audio/mpeg
// - audio/ogg
// - audio/pcm
// - audio/* (defaults to mpeg)
// - text/plain; charset=utf-8
//
// This member is required.
ResponseContentType *string
// A timestamp set by the client of the date and time that the event was sent to
// Amazon Lex V2.
ClientTimestampMillis int64
// Determines whether Amazon Lex V2 should send audio responses to the client
// application. Set this field to false when the client is operating in a playback
// mode where audio responses are played to the user. If the client isn't operating
// in playback mode, such as a text chat application, set this to true so that
// Amazon Lex V2 doesn't wait for the prompt to finish playing on the client.
DisablePlayback bool
// A unique identifier that your application assigns to the event. You can use
// this to identify events in logs.
EventId *string
// Request-specific information passed between the client application and Amazon
// Lex V2. The namespace x-amz-lex: is reserved for special attributes. Don't
// create any request attributes for prefix x-amz-lex: .
RequestAttributes map[string]string
// The state of the user's session with Amazon Lex V2.
SessionState *SessionState
// A list of messages to send to the user. If you set the welcomeMessage field,
// you must also set the DialogAction (https://docs.aws.amazon.com/lexv2/latest/dg/API_runtime_DialogAction.html)
// structure's type (https://docs.aws.amazon.com/lexv2/latest/dg/API_runtime_DialogAction.html#lexv2-Type-runtime_DialogAction-type)
// field.
WelcomeMessages []Message
noSmithyDocumentSerde
}
// The next action that Amazon Lex V2 should take.
type DialogAction struct {
// The next action that the bot should take in its interaction with the user. The
// possible values are:
// - Close - Indicates that there will not be a response from the user. For
// example, the statement "Your order has been placed" does not require a response.
//
// - ConfirmIntent - The next action is asking the user if the intent is complete
// and ready to be fulfilled. This is a yes/no question such as "Place the order?"
// - Delegate - The next action is determined by Amazon Lex V2.
// - ElicitIntent - The next action is to elicit an intent from the user.
// - ElicitSlot - The next action is to elicit a slot value from the user.
//
// This member is required.
Type DialogActionType
// Configures the slot to use spell-by-letter or spell-by-word style. When you use
// a style on a slot, users can spell out their input to make it clear to your bot.
//
// - Spell by letter - "b" "o" "b"
// - Spell by word - "b as in boy" "o as in oscar" "b as in boy"
// For more information, see Using spelling to enter slot values (https://docs.aws.amazon.com/lexv2/latest/dg/using-spelling.html)
// .
SlotElicitationStyle StyleType
// The name of the slot that should be elicited from the user.
SlotToElicit *string
// The name of the constituent sub slot of the composite slot specified in
// slotToElicit that should be elicited from the user.
SubSlotToElicit *ElicitSubSlot
noSmithyDocumentSerde
}
// A notification from the client that it is disconnecting from Amazon Lex V2.
// Sending a DisconnectionEvent event is optional, but can help identify a
// conversation in logs.
type DisconnectionEvent struct {
// A timestamp set by the client of the date and time that the event was sent to
// Amazon Lex V2.
ClientTimestampMillis int64
// A unique identifier that your application assigns to the event. You can use
// this to identify events in logs.
EventId *string
noSmithyDocumentSerde
}
// A DTMF character sent from the client application. DTMF characters are
// typically sent from a phone keypad to represent numbers. For example, you can
// have Amazon Lex V2 process a credit card number input from a phone.
type DTMFInputEvent struct {
// The DTMF character that the user pressed. The allowed characters are A - D, 0 -
// 9, # and *.
//
// This member is required.
InputCharacter *string
// A timestamp set by the client of the date and time that the event was sent to
// Amazon Lex V2.
ClientTimestampMillis int64
// A unique identifier that your application assigns to the event. You can use
// this to identify events in logs.
EventId *string
noSmithyDocumentSerde
}
// The specific constituent sub slot of the composite slot to elicit in dialog
// action.
type ElicitSubSlot struct {
// The name of the slot that should be elicited from the user.
//
// This member is required.
Name *string
// The field is not supported.
SubSlotToElicit *ElicitSubSlot
noSmithyDocumentSerde
}
// Event that Amazon Lex V2 sends to indicate that the stream is still open
// between the client application and Amazon Lex V2
type HeartbeatEvent struct {
// A unique identifier of the event sent by Amazon Lex V2. The identifier is in
// the form RESPONSE-N , where N is a number starting with one and incremented for
// each event sent by Amazon Lex V2 in the current session.
EventId *string
noSmithyDocumentSerde
}
// A card that is shown to the user by a messaging platform. You define the
// contents of the card, the card is displayed by the platform. When you use a
// response card, the response from the user is constrained to the text associated
// with a button on the card.
type ImageResponseCard struct {
// The title to display on the response card. The format of the title is
// determined by the platform displaying the response card.
//
// This member is required.
Title *string
// A list of buttons that should be displayed on the response card. The
// arrangement of the buttons is determined by the platform that displays the
// button.
Buttons []Button
// The URL of an image to display on the response card. The image URL must be
// publicly available so that the platform displaying the response card has access
// to the image.
ImageUrl *string
// The subtitle to display on the response card. The format of the subtitle is
// determined by the platform displaying the response card.
Subtitle *string
noSmithyDocumentSerde
}
// The current intent that Amazon Lex V2 is attempting to fulfill.
type Intent struct {
// The name of the intent.
//
// This member is required.
Name *string
// Contains information about whether fulfillment of the intent has been confirmed.
ConfirmationState ConfirmationState
// A map of all of the slots for the intent. The name of the slot maps to the
// value of the slot. If a slot has not been filled, the value is null.
Slots map[string]Slot
// Contains fulfillment information for the intent.
State IntentState
noSmithyDocumentSerde
}
// Contains the current state of the conversation between the client application
// and Amazon Lex V2.
type IntentResultEvent struct {
// A unique identifier of the event sent by Amazon Lex V2. The identifier is in
// the form RESPONSE-N , where N is a number starting with one and incremented for
// each event sent by Amazon Lex V2 in the current session.
EventId *string
// Indicates whether the input to the operation was text or speech.
InputMode InputMode
// A list of intents that Amazon Lex V2 determined might satisfy the user's
// utterance. Each interpretation includes the intent, a score that indicates how
// confident Amazon Lex V2 is that the interpretation is the correct one, and an
// optional sentiment response that indicates the sentiment expressed in the
// utterance.
Interpretations []Interpretation
// The bot member that is processing the intent.
RecognizedBotMember *RecognizedBotMember
// The attributes sent in the request.
RequestAttributes map[string]string
// The identifier of the session in use.
SessionId *string
// The state of the user's session with Amazon Lex V2.
SessionState *SessionState
noSmithyDocumentSerde
}
// An intent that Amazon Lex V2 determined might satisfy the user's utterance. The
// intents are ordered by the confidence score.
type Interpretation struct {
// A list of intents that might satisfy the user's utterance. The intents are
// ordered by the confidence score.
Intent *Intent
// Determines the threshold where Amazon Lex V2 will insert the
// AMAZON.FallbackIntent , AMAZON.KendraSearchIntent , or both when returning
// alternative intents in a response. AMAZON.FallbackIntent and
// AMAZON.KendraSearchIntent are only inserted if they are configured for the bot.
NluConfidence *ConfidenceScore
// The sentiment expressed in an utterance. When the bot is configured to send
// utterances to Amazon Comprehend for sentiment analysis, this field contains the
// result of the analysis.
SentimentResponse *SentimentResponse
noSmithyDocumentSerde
}
// Container for text that is returned to the customer..
type Message struct {
// Indicates the type of response.
//
// This member is required.
ContentType MessageContentType
// The text of the message.
Content *string
// A card that is shown to the user by a messaging platform. You define the
// contents of the card, the card is displayed by the platform. When you use a
// response card, the response from the user is constrained to the text associated
// with a button on the card.
ImageResponseCard *ImageResponseCard
noSmithyDocumentSerde
}
// Event sent from the client application to Amazon Lex V2 to indicate that
// playback of audio is complete and that Amazon Lex V2 should start processing the
// user's input.
type PlaybackCompletionEvent struct {
// A timestamp set by the client of the date and time that the event was sent to
// Amazon Lex V2.
ClientTimestampMillis int64
// A unique identifier that your application assigns to the event. You can use
// this to identify events in logs.
EventId *string
noSmithyDocumentSerde
}
// Event sent from Amazon Lex V2 to indicate to the client application should stop
// playback of audio. For example, if the client is playing a prompt that asks for
// the user's telephone number, the user might start to say the phone number before
// the prompt is complete. Amazon Lex V2 sends this event to the client application
// to indicate that the user is responding and that Amazon Lex V2 is processing
// their input.
type PlaybackInterruptionEvent struct {
// The identifier of the event that contained the audio, DTMF, or text that caused
// the interruption.
CausedByEventId *string
// A unique identifier of the event sent by Amazon Lex V2. The identifier is in
// the form RESPONSE-N , where N is a number starting with one and incremented for
// each event sent by Amazon Lex V2 in the current session.
EventId *string
// Indicates the type of user input that Amazon Lex V2 detected.
EventReason PlaybackInterruptionReason
noSmithyDocumentSerde
}
// The bot member that processes the request.
type RecognizedBotMember struct {
// The identifier of the bot member that processes the request.
//
// This member is required.
BotId *string
// The name of the bot member that processes the request.
BotName *string
noSmithyDocumentSerde
}
// Provides an array of phrases that should be given preference when resolving
// values for a slot.
type RuntimeHintDetails struct {
// One or more strings that Amazon Lex V2 should look for in the input to the bot.
// Each phrase is given preference when deciding on slot values.
RuntimeHintValues []RuntimeHintValue
// A map of constituent sub slot names inside a composite slot in the intent and
// the phrases that should be added for each sub slot. Inside each composite slot
// hints, this structure provides a mechanism to add granular sub slot phrases.
// Only sub slot hints are supported for composite slots. The intent name,
// composite slot name and the constituent sub slot names must exist.
SubSlotHints map[string]RuntimeHintDetails
noSmithyDocumentSerde
}
// You can provide Amazon Lex V2 with hints to the phrases that a customer is
// likely to use for a slot. When a slot with hints is resolved, the phrases in the
// runtime hints are preferred in the resolution. You can provide hints for a
// maximum of 100 intents. You can provide a maximum of 100 slots. Before you can
// use runtime hints with an existing bot, you must first rebuild the bot. For more
// information, see Using runtime hints to improve recognition of slot values (https://docs.aws.amazon.com/lexv2/latest/dg/using-hints.html)
// .
type RuntimeHints struct {
// A list of the slots in the intent that should have runtime hints added, and the
// phrases that should be added for each slot. The first level of the slotHints
// map is the name of the intent. The second level is the name of the slot within
// the intent. For more information, see Using hints to improve accuracy (https://docs.aws.amazon.com/lexv2/latest/dg/using-hints.html)
// . The intent name and slot name must exist.
SlotHints map[string]map[string]RuntimeHintDetails
noSmithyDocumentSerde
}
// Provides the phrase that Amazon Lex V2 should look for in the user's input to
// the bot.
type RuntimeHintValue struct {
// The phrase that Amazon Lex V2 should look for in the user's input to the bot.
//
// This member is required.
Phrase *string
noSmithyDocumentSerde
}
// Provides information about the sentiment expressed in a user's response in a
// conversation. Sentiments are determined using Amazon Comprehend. Sentiments are
// only returned if they are enabled for the bot. For more information, see
// Determine Sentiment (https://docs.aws.amazon.com/comprehend/latest/dg/how-sentiment.html)
// in the Amazon Comprehend developer guide.
type SentimentResponse struct {
// The overall sentiment expressed in the user's response. This is the sentiment
// most likely expressed by the user based on the analysis by Amazon Comprehend.
Sentiment SentimentType
// The individual sentiment responses for the utterance.
SentimentScore *SentimentScore
noSmithyDocumentSerde
}
// The individual sentiment responses for the utterance.
type SentimentScore struct {
// The level of confidence that Amazon Comprehend has in the accuracy of its
// detection of the MIXED sentiment.
Mixed float64
// The level of confidence that Amazon Comprehend has in the accuracy of its
// detection of the NEGATIVE sentiment.
Negative float64
// The level of confidence that Amazon Comprehend has in the accuracy of its
// detection of the NEUTRAL sentiment.
Neutral float64
// The level of confidence that Amazon Comprehend has in the accuracy of its
// detection of the POSITIVE sentiment.
Positive float64
noSmithyDocumentSerde
}
// The state of the user's session with Amazon Lex V2.
type SessionState struct {
// One or more contexts that indicate to Amazon Lex V2 the context of a request.
// When a context is active, Amazon Lex V2 considers intents with the matching
// context as a trigger as the next intent in a session.
ActiveContexts []ActiveContext
// The next step that Amazon Lex V2 should take in the conversation with a user.
DialogAction *DialogAction
// The active intent that Amazon Lex V2 is processing.
Intent *Intent
// A unique identifier for a specific request.
OriginatingRequestId *string
// Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2
// uses the hints to help determine the correct value of a slot.
RuntimeHints *RuntimeHints
// Map of key/value pairs representing session-specific context information. It
// contains application information passed between Amazon Lex V2 and a client
// application.
SessionAttributes map[string]string
noSmithyDocumentSerde
}
// A value that Amazon Lex V2 uses to fulfill an intent.
type Slot struct {
// When the shape value is List , it indicates that the values field contains a
// list of slot values. When the value is Scalar , it indicates that the value
// field contains a single value.
Shape Shape
// The constituent sub slots of a composite slot.
SubSlots map[string]Slot
// The current value of the slot.
Value *Value
// A list of one or more values that the user provided for the slot. For example,
// if a for a slot that elicits pizza toppings, the values might be "pepperoni" and
// "pineapple."
Values []Slot
noSmithyDocumentSerde
}
// Represents a stream of events between your application and Amazon Lex V2.
//
// The following types satisfy this interface:
//
// StartConversationRequestEventStreamMemberAudioInputEvent
// StartConversationRequestEventStreamMemberConfigurationEvent
// StartConversationRequestEventStreamMemberDisconnectionEvent
// StartConversationRequestEventStreamMemberDTMFInputEvent
// StartConversationRequestEventStreamMemberPlaybackCompletionEvent
// StartConversationRequestEventStreamMemberTextInputEvent
type StartConversationRequestEventStream interface {
isStartConversationRequestEventStream()
}
// Speech audio sent from your client application to Amazon Lex V2. Audio starts
// accumulating when Amazon Lex V2 identifies a voice and continues until a natural
// pause in the speech is found before processing.
type StartConversationRequestEventStreamMemberAudioInputEvent struct {
Value AudioInputEvent
noSmithyDocumentSerde
}
func (*StartConversationRequestEventStreamMemberAudioInputEvent) isStartConversationRequestEventStream() {
}
// Configuration information sent from your client application to Amazon Lex V2
type StartConversationRequestEventStreamMemberConfigurationEvent struct {
Value ConfigurationEvent
noSmithyDocumentSerde
}
func (*StartConversationRequestEventStreamMemberConfigurationEvent) isStartConversationRequestEventStream() {
}
// Event sent from the client application to indicate to Amazon Lex V2 that the
// conversation is over.
type StartConversationRequestEventStreamMemberDisconnectionEvent struct {
Value DisconnectionEvent
noSmithyDocumentSerde
}
func (*StartConversationRequestEventStreamMemberDisconnectionEvent) isStartConversationRequestEventStream() {
}
// DTMF information sent to Amazon Lex V2 by your application. Amazon Lex V2
// accumulates the DMTF information from when the user sends the first character
// and ends
// - when there's a pause longer that the value configured for the end timeout.
// - when there's a digit that is the configured end character.
// - when Amazon Lex V2 accumulates characters equal to the maximum DTMF
// character configuration.
type StartConversationRequestEventStreamMemberDTMFInputEvent struct {
Value DTMFInputEvent
noSmithyDocumentSerde
}
func (*StartConversationRequestEventStreamMemberDTMFInputEvent) isStartConversationRequestEventStream() {
}
// Event sent from the client application to Amazon Lex V2 to indicate that it has
// finished playing audio and that Amazon Lex V2 should start listening for user
// input.
type StartConversationRequestEventStreamMemberPlaybackCompletionEvent struct {
Value PlaybackCompletionEvent
noSmithyDocumentSerde
}
func (*StartConversationRequestEventStreamMemberPlaybackCompletionEvent) isStartConversationRequestEventStream() {
}
// Text sent from your client application to Amazon Lex V2. Each TextInputEvent is
// processed individually.
type StartConversationRequestEventStreamMemberTextInputEvent struct {
Value TextInputEvent
noSmithyDocumentSerde
}
func (*StartConversationRequestEventStreamMemberTextInputEvent) isStartConversationRequestEventStream() {
}
// Represents a stream of events between Amazon Lex V2 and your application.
//
// The following types satisfy this interface:
//
// StartConversationResponseEventStreamMemberAudioResponseEvent
// StartConversationResponseEventStreamMemberHeartbeatEvent
// StartConversationResponseEventStreamMemberIntentResultEvent
// StartConversationResponseEventStreamMemberPlaybackInterruptionEvent
// StartConversationResponseEventStreamMemberTextResponseEvent
// StartConversationResponseEventStreamMemberTranscriptEvent
type StartConversationResponseEventStream interface {
isStartConversationResponseEventStream()
}
// An event sent from Amazon Lex V2 to your client application containing audio to
// play to the user.
type StartConversationResponseEventStreamMemberAudioResponseEvent struct {
Value AudioResponseEvent
noSmithyDocumentSerde
}
func (*StartConversationResponseEventStreamMemberAudioResponseEvent) isStartConversationResponseEventStream() {
}
// Event that Amazon Lex V2 sends to indicate that the stream is still open
// between the client application and Amazon Lex V2
type StartConversationResponseEventStreamMemberHeartbeatEvent struct {
Value HeartbeatEvent
noSmithyDocumentSerde
}
func (*StartConversationResponseEventStreamMemberHeartbeatEvent) isStartConversationResponseEventStream() {
}
// Event sent from Amazon Lex V2 to the client application containing the current
// state of the conversation between the user and Amazon Lex V2.
type StartConversationResponseEventStreamMemberIntentResultEvent struct {
Value IntentResultEvent
noSmithyDocumentSerde
}
func (*StartConversationResponseEventStreamMemberIntentResultEvent) isStartConversationResponseEventStream() {
}
// Event sent from Amazon Lex V2 to indicate to the client application should stop
// playback of audio. For example, if the client is playing a prompt that asks for
// the user's telephone number, the user might start to say the phone number before
// the prompt is complete. Amazon Lex V2 sends this event to the client application
// to indicate that the user is responding and that Amazon Lex V2 is processing
// their input.
type StartConversationResponseEventStreamMemberPlaybackInterruptionEvent struct {
Value PlaybackInterruptionEvent
noSmithyDocumentSerde
}
func (*StartConversationResponseEventStreamMemberPlaybackInterruptionEvent) isStartConversationResponseEventStream() {
}
// The event sent from Amazon Lex V2 to your application with text to present to
// the user.
type StartConversationResponseEventStreamMemberTextResponseEvent struct {
Value TextResponseEvent
noSmithyDocumentSerde
}
func (*StartConversationResponseEventStreamMemberTextResponseEvent) isStartConversationResponseEventStream() {
}
// Event sent from Amazon Lex V2 to your client application that contains a
// transcript of voice audio.
type StartConversationResponseEventStreamMemberTranscriptEvent struct {
Value TranscriptEvent
noSmithyDocumentSerde
}
func (*StartConversationResponseEventStreamMemberTranscriptEvent) isStartConversationResponseEventStream() {
}
// The event sent from your client application to Amazon Lex V2 with text input
// from the user.
type TextInputEvent struct {
// The text from the user. Amazon Lex V2 processes this as a complete statement.
//
// This member is required.
Text *string
// A timestamp set by the client of the date and time that the event was sent to
// Amazon Lex V2.
ClientTimestampMillis int64
// A unique identifier that your application assigns to the event. You can use
// this to identify events in logs.
EventId *string
noSmithyDocumentSerde
}
// The event sent from Amazon Lex V2 to your application with text to present to
// the user.
type TextResponseEvent struct {
// A unique identifier of the event sent by Amazon Lex V2. The identifier is in
// the form RESPONSE-N , where N is a number starting with one and incremented for
// each event sent by Amazon Lex V2 in the current session.
EventId *string
// A list of messages to send to the user. Messages are ordered based on the order
// that you returned the messages from your Lambda function or the order that the
// messages are defined in the bot.
Messages []Message
noSmithyDocumentSerde
}
// Event sent from Amazon Lex V2 to your client application that contains a
// transcript of voice audio.
type TranscriptEvent struct {
// A unique identifier of the event sent by Amazon Lex V2. The identifier is in
// the form RESPONSE-N , where N is a number starting with one and incremented for
// each event sent by Amazon Lex V2 in the current session.
EventId *string
// The transcript of the voice audio from the user.
Transcript *string
noSmithyDocumentSerde
}
// The value of a slot.
type Value struct {
// The value that Amazon Lex V2 determines for the slot. The actual value depends
// on the setting of the value selection strategy for the bot. You can choose to
// use the value entered by the user, or you can have Amazon Lex V2 choose the
// first value in the resolvedValues list.
//
// This member is required.
InterpretedValue *string
// The text of the utterance from the user that was entered for the slot.
OriginalValue *string
// A list of additional values that have been recognized for the slot.
ResolvedValues []string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
// UnknownUnionMember is returned when a union member is returned over the wire,
// but has an unknown tag.
type UnknownUnionMember struct {
Tag string
Value []byte
noSmithyDocumentSerde
}
func (*UnknownUnionMember) isStartConversationRequestEventStream() {}
func (*UnknownUnionMember) isStartConversationResponseEventStream() {}
| 866 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types_test
import (
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lexruntimev2/types"
)
func ExampleStartConversationRequestEventStream_outputUsage() {
var union types.StartConversationRequestEventStream
// type switches can be used to check the union value
switch v := union.(type) {
case *types.StartConversationRequestEventStreamMemberAudioInputEvent:
_ = v.Value // Value is types.AudioInputEvent
case *types.StartConversationRequestEventStreamMemberConfigurationEvent:
_ = v.Value // Value is types.ConfigurationEvent
case *types.StartConversationRequestEventStreamMemberDisconnectionEvent:
_ = v.Value // Value is types.DisconnectionEvent
case *types.StartConversationRequestEventStreamMemberDTMFInputEvent:
_ = v.Value // Value is types.DTMFInputEvent
case *types.StartConversationRequestEventStreamMemberPlaybackCompletionEvent:
_ = v.Value // Value is types.PlaybackCompletionEvent
case *types.StartConversationRequestEventStreamMemberTextInputEvent:
_ = v.Value // Value is types.TextInputEvent
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.AudioInputEvent
var _ *types.TextInputEvent
var _ *types.ConfigurationEvent
var _ *types.DisconnectionEvent
var _ *types.DTMFInputEvent
var _ *types.PlaybackCompletionEvent
func ExampleStartConversationResponseEventStream_outputUsage() {
var union types.StartConversationResponseEventStream
// type switches can be used to check the union value
switch v := union.(type) {
case *types.StartConversationResponseEventStreamMemberAudioResponseEvent:
_ = v.Value // Value is types.AudioResponseEvent
case *types.StartConversationResponseEventStreamMemberHeartbeatEvent:
_ = v.Value // Value is types.HeartbeatEvent
case *types.StartConversationResponseEventStreamMemberIntentResultEvent:
_ = v.Value // Value is types.IntentResultEvent
case *types.StartConversationResponseEventStreamMemberPlaybackInterruptionEvent:
_ = v.Value // Value is types.PlaybackInterruptionEvent
case *types.StartConversationResponseEventStreamMemberTextResponseEvent:
_ = v.Value // Value is types.TextResponseEvent
case *types.StartConversationResponseEventStreamMemberTranscriptEvent:
_ = v.Value // Value is types.TranscriptEvent
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.IntentResultEvent
var _ *types.HeartbeatEvent
var _ *types.AudioResponseEvent
var _ *types.PlaybackInterruptionEvent
var _ *types.TranscriptEvent
var _ *types.TextResponseEvent
| 85 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "License Manager"
const ServiceAPIVersion = "2018-08-01"
// Client provides the API client to make operations call for AWS License Manager.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "licensemanager", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Accepts the specified grant.
func (c *Client) AcceptGrant(ctx context.Context, params *AcceptGrantInput, optFns ...func(*Options)) (*AcceptGrantOutput, error) {
if params == nil {
params = &AcceptGrantInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AcceptGrant", params, optFns, c.addOperationAcceptGrantMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AcceptGrantOutput)
out.ResultMetadata = metadata
return out, nil
}
type AcceptGrantInput struct {
// Amazon Resource Name (ARN) of the grant.
//
// This member is required.
GrantArn *string
noSmithyDocumentSerde
}
type AcceptGrantOutput struct {
// Grant ARN.
GrantArn *string
// Grant status.
Status types.GrantStatus
// Grant version.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAcceptGrantMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAcceptGrant{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAcceptGrant{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAcceptGrantValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptGrant(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAcceptGrant(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "AcceptGrant",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Checks in the specified license. Check in a license when it is no longer in use.
func (c *Client) CheckInLicense(ctx context.Context, params *CheckInLicenseInput, optFns ...func(*Options)) (*CheckInLicenseOutput, error) {
if params == nil {
params = &CheckInLicenseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CheckInLicense", params, optFns, c.addOperationCheckInLicenseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CheckInLicenseOutput)
out.ResultMetadata = metadata
return out, nil
}
type CheckInLicenseInput struct {
// License consumption token.
//
// This member is required.
LicenseConsumptionToken *string
// License beneficiary.
Beneficiary *string
noSmithyDocumentSerde
}
type CheckInLicenseOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCheckInLicenseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCheckInLicense{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCheckInLicense{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCheckInLicenseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCheckInLicense(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCheckInLicense(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CheckInLicense",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Checks out the specified license for offline use.
func (c *Client) CheckoutBorrowLicense(ctx context.Context, params *CheckoutBorrowLicenseInput, optFns ...func(*Options)) (*CheckoutBorrowLicenseOutput, error) {
if params == nil {
params = &CheckoutBorrowLicenseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CheckoutBorrowLicense", params, optFns, c.addOperationCheckoutBorrowLicenseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CheckoutBorrowLicenseOutput)
out.ResultMetadata = metadata
return out, nil
}
type CheckoutBorrowLicenseInput struct {
// Unique, case-sensitive identifier that you provide to ensure the idempotency of
// the request.
//
// This member is required.
ClientToken *string
// Digital signature method. The possible value is JSON Web Signature (JWS)
// algorithm PS384. For more information, see RFC 7518 Digital Signature with
// RSASSA-PSS (https://tools.ietf.org/html/rfc7518#section-3.5) .
//
// This member is required.
DigitalSignatureMethod types.DigitalSignatureMethod
// License entitlements. Partial checkouts are not supported.
//
// This member is required.
Entitlements []types.EntitlementData
// Amazon Resource Name (ARN) of the license. The license must use the borrow
// consumption configuration.
//
// This member is required.
LicenseArn *string
// Information about constraints.
CheckoutMetadata []types.Metadata
// Node ID.
NodeId *string
noSmithyDocumentSerde
}
type CheckoutBorrowLicenseOutput struct {
// Information about constraints.
CheckoutMetadata []types.Metadata
// Allowed license entitlements.
EntitlementsAllowed []types.EntitlementData
// Date and time at which the license checkout expires.
Expiration *string
// Date and time at which the license checkout is issued.
IssuedAt *string
// Amazon Resource Name (ARN) of the license.
LicenseArn *string
// License consumption token.
LicenseConsumptionToken *string
// Node ID.
NodeId *string
// Signed token.
SignedToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCheckoutBorrowLicenseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCheckoutBorrowLicense{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCheckoutBorrowLicense{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCheckoutBorrowLicenseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCheckoutBorrowLicense(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCheckoutBorrowLicense(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CheckoutBorrowLicense",
}
}
| 171 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Checks out the specified license. If the account that created the license is
// the same that is performing the check out, you must specify the account as the
// beneficiary.
func (c *Client) CheckoutLicense(ctx context.Context, params *CheckoutLicenseInput, optFns ...func(*Options)) (*CheckoutLicenseOutput, error) {
if params == nil {
params = &CheckoutLicenseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CheckoutLicense", params, optFns, c.addOperationCheckoutLicenseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CheckoutLicenseOutput)
out.ResultMetadata = metadata
return out, nil
}
type CheckoutLicenseInput struct {
// Checkout type.
//
// This member is required.
CheckoutType types.CheckoutType
// Unique, case-sensitive identifier that you provide to ensure the idempotency of
// the request.
//
// This member is required.
ClientToken *string
// License entitlements.
//
// This member is required.
Entitlements []types.EntitlementData
// Key fingerprint identifying the license.
//
// This member is required.
KeyFingerprint *string
// Product SKU.
//
// This member is required.
ProductSKU *string
// License beneficiary.
Beneficiary *string
// Node ID.
NodeId *string
noSmithyDocumentSerde
}
type CheckoutLicenseOutput struct {
// Checkout type.
CheckoutType types.CheckoutType
// Allowed license entitlements.
EntitlementsAllowed []types.EntitlementData
// Date and time at which the license checkout expires.
Expiration *string
// Date and time at which the license checkout is issued.
IssuedAt *string
// Amazon Resource Name (ARN) of the checkout license.
LicenseArn *string
// License consumption token.
LicenseConsumptionToken *string
// Node ID.
NodeId *string
// Signed token.
SignedToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCheckoutLicenseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCheckoutLicense{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCheckoutLicense{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCheckoutLicenseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCheckoutLicense(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCheckoutLicense(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CheckoutLicense",
}
}
| 175 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a grant for the specified license. A grant shares the use of license
// entitlements with a specific Amazon Web Services account, an organization, or an
// organizational unit (OU). For more information, see Granted licenses in License
// Manager (https://docs.aws.amazon.com/license-manager/latest/userguide/granted-licenses.html)
// in the License Manager User Guide.
func (c *Client) CreateGrant(ctx context.Context, params *CreateGrantInput, optFns ...func(*Options)) (*CreateGrantOutput, error) {
if params == nil {
params = &CreateGrantInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateGrant", params, optFns, c.addOperationCreateGrantMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateGrantOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateGrantInput struct {
// Allowed operations for the grant.
//
// This member is required.
AllowedOperations []types.AllowedOperation
// Unique, case-sensitive identifier that you provide to ensure the idempotency of
// the request.
//
// This member is required.
ClientToken *string
// Grant name.
//
// This member is required.
GrantName *string
// Home Region of the grant.
//
// This member is required.
HomeRegion *string
// Amazon Resource Name (ARN) of the license.
//
// This member is required.
LicenseArn *string
// The grant principals. You can specify one of the following as an Amazon
// Resource Name (ARN):
// - An Amazon Web Services account, which includes only the account specified.
//
// - An organizational unit (OU), which includes all accounts in the OU.
//
// - An organization, which will include all accounts across your organization.
//
// This member is required.
Principals []string
noSmithyDocumentSerde
}
type CreateGrantOutput struct {
// Grant ARN.
GrantArn *string
// Grant status.
Status types.GrantStatus
// Grant version.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateGrantMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateGrant{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateGrant{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateGrantValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateGrant(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateGrant(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CreateGrant",
}
}
| 167 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new version of the specified grant. For more information, see Granted
// licenses in License Manager (https://docs.aws.amazon.com/license-manager/latest/userguide/granted-licenses.html)
// in the License Manager User Guide.
func (c *Client) CreateGrantVersion(ctx context.Context, params *CreateGrantVersionInput, optFns ...func(*Options)) (*CreateGrantVersionOutput, error) {
if params == nil {
params = &CreateGrantVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateGrantVersion", params, optFns, c.addOperationCreateGrantVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateGrantVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateGrantVersionInput struct {
// Unique, case-sensitive identifier that you provide to ensure the idempotency of
// the request.
//
// This member is required.
ClientToken *string
// Amazon Resource Name (ARN) of the grant.
//
// This member is required.
GrantArn *string
// Allowed operations for the grant.
AllowedOperations []types.AllowedOperation
// Grant name.
GrantName *string
// The options specified for the grant.
Options *types.Options
// Current version of the grant.
SourceVersion *string
// Grant status.
Status types.GrantStatus
// Grant status reason.
StatusReason *string
noSmithyDocumentSerde
}
type CreateGrantVersionOutput struct {
// Grant ARN.
GrantArn *string
// Grant status.
Status types.GrantStatus
// New version of the grant.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateGrantVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateGrantVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateGrantVersion{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateGrantVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateGrantVersion(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateGrantVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CreateGrantVersion",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a license.
func (c *Client) CreateLicense(ctx context.Context, params *CreateLicenseInput, optFns ...func(*Options)) (*CreateLicenseOutput, error) {
if params == nil {
params = &CreateLicenseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLicense", params, optFns, c.addOperationCreateLicenseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLicenseOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLicenseInput struct {
// License beneficiary.
//
// This member is required.
Beneficiary *string
// Unique, case-sensitive identifier that you provide to ensure the idempotency of
// the request.
//
// This member is required.
ClientToken *string
// Configuration for consumption of the license. Choose a provisional
// configuration for workloads running with continuous connectivity. Choose a
// borrow configuration for workloads with offline usage.
//
// This member is required.
ConsumptionConfiguration *types.ConsumptionConfiguration
// License entitlements.
//
// This member is required.
Entitlements []types.Entitlement
// Home Region for the license.
//
// This member is required.
HomeRegion *string
// License issuer.
//
// This member is required.
Issuer *types.Issuer
// License name.
//
// This member is required.
LicenseName *string
// Product name.
//
// This member is required.
ProductName *string
// Product SKU.
//
// This member is required.
ProductSKU *string
// Date and time range during which the license is valid, in ISO8601-UTC format.
//
// This member is required.
Validity *types.DatetimeRange
// Information about the license.
LicenseMetadata []types.Metadata
noSmithyDocumentSerde
}
type CreateLicenseOutput struct {
// Amazon Resource Name (ARN) of the license.
LicenseArn *string
// License status.
Status types.LicenseStatus
// License version.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLicenseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLicense{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLicense{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateLicenseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLicense(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateLicense(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CreateLicense",
}
}
| 182 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a license configuration. A license configuration is an abstraction of a
// customer license agreement that can be consumed and enforced by License Manager.
// Components include specifications for the license type (licensing by instance,
// socket, CPU, or vCPU), allowed tenancy (shared tenancy, Dedicated Instance,
// Dedicated Host, or all of these), license affinity to host (how long a license
// must be associated with a host), and the number of licenses purchased and used.
func (c *Client) CreateLicenseConfiguration(ctx context.Context, params *CreateLicenseConfigurationInput, optFns ...func(*Options)) (*CreateLicenseConfigurationOutput, error) {
if params == nil {
params = &CreateLicenseConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLicenseConfiguration", params, optFns, c.addOperationCreateLicenseConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLicenseConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLicenseConfigurationInput struct {
// Dimension used to track the license inventory.
//
// This member is required.
LicenseCountingType types.LicenseCountingType
// Name of the license configuration.
//
// This member is required.
Name *string
// Description of the license configuration.
Description *string
// When true, disassociates a resource when software is uninstalled.
DisassociateWhenNotFound *bool
// Number of licenses managed by the license configuration.
LicenseCount *int64
// Indicates whether hard or soft license enforcement is used. Exceeding a hard
// limit blocks the launch of new instances.
LicenseCountHardLimit *bool
// License rules. The syntax is #name=value (for example,
// #allowedTenancy=EC2-DedicatedHost). The available rules vary by dimension, as
// follows.
// - Cores dimension: allowedTenancy | licenseAffinityToHost | maximumCores |
// minimumCores
// - Instances dimension: allowedTenancy | maximumCores | minimumCores |
// maximumSockets | minimumSockets | maximumVcpus | minimumVcpus
// - Sockets dimension: allowedTenancy | licenseAffinityToHost | maximumSockets |
// minimumSockets
// - vCPUs dimension: allowedTenancy | honorVcpuOptimization | maximumVcpus |
// minimumVcpus
// The unit for licenseAffinityToHost is days and the range is 1 to 180. The
// possible values for allowedTenancy are EC2-Default , EC2-DedicatedHost , and
// EC2-DedicatedInstance . The possible values for honorVcpuOptimization are True
// and False .
LicenseRules []string
// Product information.
ProductInformationList []types.ProductInformation
// Tags to add to the license configuration.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateLicenseConfigurationOutput struct {
// Amazon Resource Name (ARN) of the license configuration.
LicenseConfigurationArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLicenseConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateLicenseConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLicenseConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateLicenseConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CreateLicenseConfiguration",
}
}
| 171 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new license conversion task.
func (c *Client) CreateLicenseConversionTaskForResource(ctx context.Context, params *CreateLicenseConversionTaskForResourceInput, optFns ...func(*Options)) (*CreateLicenseConversionTaskForResourceOutput, error) {
if params == nil {
params = &CreateLicenseConversionTaskForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLicenseConversionTaskForResource", params, optFns, c.addOperationCreateLicenseConversionTaskForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLicenseConversionTaskForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLicenseConversionTaskForResourceInput struct {
// Information that identifies the license type you are converting to. For the
// structure of the destination license, see Convert a license type using the CLI (https://docs.aws.amazon.com/license-manager/latest/userguide/conversion-procedures.html#conversion-cli)
// in the License Manager User Guide.
//
// This member is required.
DestinationLicenseContext *types.LicenseConversionContext
// Amazon Resource Name (ARN) of the resource you are converting the license type
// for.
//
// This member is required.
ResourceArn *string
// Information that identifies the license type you are converting from. For the
// structure of the source license, see Convert a license type using the CLI (https://docs.aws.amazon.com/license-manager/latest/userguide/conversion-procedures.html#conversion-cli)
// in the License Manager User Guide.
//
// This member is required.
SourceLicenseContext *types.LicenseConversionContext
noSmithyDocumentSerde
}
type CreateLicenseConversionTaskForResourceOutput struct {
// The ID of the created license type conversion task.
LicenseConversionTaskId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLicenseConversionTaskForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLicenseConversionTaskForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLicenseConversionTaskForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateLicenseConversionTaskForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLicenseConversionTaskForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateLicenseConversionTaskForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CreateLicenseConversionTaskForResource",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a report generator.
func (c *Client) CreateLicenseManagerReportGenerator(ctx context.Context, params *CreateLicenseManagerReportGeneratorInput, optFns ...func(*Options)) (*CreateLicenseManagerReportGeneratorOutput, error) {
if params == nil {
params = &CreateLicenseManagerReportGeneratorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLicenseManagerReportGenerator", params, optFns, c.addOperationCreateLicenseManagerReportGeneratorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLicenseManagerReportGeneratorOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLicenseManagerReportGeneratorInput struct {
// Unique, case-sensitive identifier that you provide to ensure the idempotency of
// the request.
//
// This member is required.
ClientToken *string
// Defines the type of license configuration the report generator tracks.
//
// This member is required.
ReportContext *types.ReportContext
// Frequency by which reports are generated. Reports can be generated daily,
// monthly, or weekly.
//
// This member is required.
ReportFrequency *types.ReportFrequency
// Name of the report generator.
//
// This member is required.
ReportGeneratorName *string
// Type of reports to generate. The following report types an be generated:
// - License configuration report - Reports the number and details of consumed
// licenses for a license configuration.
// - Resource report - Reports the tracked licenses and resource consumption for
// a license configuration.
//
// This member is required.
Type []types.ReportType
// Description of the report generator.
Description *string
// Tags to add to the report generator.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateLicenseManagerReportGeneratorOutput struct {
// The Amazon Resource Name (ARN) of the new report generator.
LicenseManagerReportGeneratorArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLicenseManagerReportGeneratorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLicenseManagerReportGenerator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLicenseManagerReportGenerator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateLicenseManagerReportGeneratorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLicenseManagerReportGenerator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateLicenseManagerReportGenerator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CreateLicenseManagerReportGenerator",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new version of the specified license.
func (c *Client) CreateLicenseVersion(ctx context.Context, params *CreateLicenseVersionInput, optFns ...func(*Options)) (*CreateLicenseVersionOutput, error) {
if params == nil {
params = &CreateLicenseVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLicenseVersion", params, optFns, c.addOperationCreateLicenseVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLicenseVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLicenseVersionInput struct {
// Unique, case-sensitive identifier that you provide to ensure the idempotency of
// the request.
//
// This member is required.
ClientToken *string
// Configuration for consumption of the license. Choose a provisional
// configuration for workloads running with continuous connectivity. Choose a
// borrow configuration for workloads with offline usage.
//
// This member is required.
ConsumptionConfiguration *types.ConsumptionConfiguration
// License entitlements.
//
// This member is required.
Entitlements []types.Entitlement
// Home Region of the license.
//
// This member is required.
HomeRegion *string
// License issuer.
//
// This member is required.
Issuer *types.Issuer
// Amazon Resource Name (ARN) of the license.
//
// This member is required.
LicenseArn *string
// License name.
//
// This member is required.
LicenseName *string
// Product name.
//
// This member is required.
ProductName *string
// License status.
//
// This member is required.
Status types.LicenseStatus
// Date and time range during which the license is valid, in ISO8601-UTC format.
//
// This member is required.
Validity *types.DatetimeRange
// Information about the license.
LicenseMetadata []types.Metadata
// Current version of the license.
SourceVersion *string
noSmithyDocumentSerde
}
type CreateLicenseVersionOutput struct {
// License ARN.
LicenseArn *string
// License status.
Status types.LicenseStatus
// New version of the license.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLicenseVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLicenseVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLicenseVersion{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateLicenseVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLicenseVersion(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateLicenseVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CreateLicenseVersion",
}
}
| 185 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a long-lived token. A refresh token is a JWT token used to get an
// access token. With an access token, you can call AssumeRoleWithWebIdentity to
// get role credentials that you can use to call License Manager to manage the
// specified license.
func (c *Client) CreateToken(ctx context.Context, params *CreateTokenInput, optFns ...func(*Options)) (*CreateTokenOutput, error) {
if params == nil {
params = &CreateTokenInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateToken", params, optFns, c.addOperationCreateTokenMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateTokenOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateTokenInput struct {
// Idempotency token, valid for 10 minutes.
//
// This member is required.
ClientToken *string
// Amazon Resource Name (ARN) of the license. The ARN is mapped to the aud claim
// of the JWT token.
//
// This member is required.
LicenseArn *string
// Token expiration, in days, counted from token creation. The default is 365 days.
ExpirationInDays *int32
// Amazon Resource Name (ARN) of the IAM roles to embed in the token. License
// Manager does not check whether the roles are in use.
RoleArns []string
// Data specified by the caller to be included in the JWT token. The data is
// mapped to the amr claim of the JWT token.
TokenProperties []string
noSmithyDocumentSerde
}
type CreateTokenOutput struct {
// Refresh token, encoded as a JWT token.
Token *string
// Token ID.
TokenId *string
// Token type.
TokenType types.TokenType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateToken{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateToken{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateTokenValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateToken(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateToken(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "CreateToken",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified grant.
func (c *Client) DeleteGrant(ctx context.Context, params *DeleteGrantInput, optFns ...func(*Options)) (*DeleteGrantOutput, error) {
if params == nil {
params = &DeleteGrantInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteGrant", params, optFns, c.addOperationDeleteGrantMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteGrantOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteGrantInput struct {
// Amazon Resource Name (ARN) of the grant.
//
// This member is required.
GrantArn *string
// Current version of the grant.
//
// This member is required.
Version *string
// The Status reason for the delete request.
StatusReason *string
noSmithyDocumentSerde
}
type DeleteGrantOutput struct {
// Grant ARN.
GrantArn *string
// Grant status.
Status types.GrantStatus
// Grant version.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteGrantMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteGrant{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteGrant{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteGrantValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteGrant(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteGrant(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "DeleteGrant",
}
}
| 139 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified license.
func (c *Client) DeleteLicense(ctx context.Context, params *DeleteLicenseInput, optFns ...func(*Options)) (*DeleteLicenseOutput, error) {
if params == nil {
params = &DeleteLicenseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLicense", params, optFns, c.addOperationDeleteLicenseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLicenseOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLicenseInput struct {
// Amazon Resource Name (ARN) of the license.
//
// This member is required.
LicenseArn *string
// Current version of the license.
//
// This member is required.
SourceVersion *string
noSmithyDocumentSerde
}
type DeleteLicenseOutput struct {
// Date when the license is deleted.
DeletionDate *string
// License status.
Status types.LicenseDeletionStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLicenseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLicense{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteLicense{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteLicenseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLicense(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteLicense(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "DeleteLicense",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified license configuration. You cannot delete a license
// configuration that is in use.
func (c *Client) DeleteLicenseConfiguration(ctx context.Context, params *DeleteLicenseConfigurationInput, optFns ...func(*Options)) (*DeleteLicenseConfigurationOutput, error) {
if params == nil {
params = &DeleteLicenseConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLicenseConfiguration", params, optFns, c.addOperationDeleteLicenseConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLicenseConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLicenseConfigurationInput struct {
// ID of the license configuration.
//
// This member is required.
LicenseConfigurationArn *string
noSmithyDocumentSerde
}
type DeleteLicenseConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLicenseConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteLicenseConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLicenseConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteLicenseConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "DeleteLicenseConfiguration",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified report generator. This action deletes the report
// generator, which stops it from generating future reports. The action cannot be
// reversed. It has no effect on the previous reports from this generator.
func (c *Client) DeleteLicenseManagerReportGenerator(ctx context.Context, params *DeleteLicenseManagerReportGeneratorInput, optFns ...func(*Options)) (*DeleteLicenseManagerReportGeneratorOutput, error) {
if params == nil {
params = &DeleteLicenseManagerReportGeneratorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLicenseManagerReportGenerator", params, optFns, c.addOperationDeleteLicenseManagerReportGeneratorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLicenseManagerReportGeneratorOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLicenseManagerReportGeneratorInput struct {
// Amazon Resource Name (ARN) of the report generator to be deleted.
//
// This member is required.
LicenseManagerReportGeneratorArn *string
noSmithyDocumentSerde
}
type DeleteLicenseManagerReportGeneratorOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLicenseManagerReportGeneratorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLicenseManagerReportGenerator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteLicenseManagerReportGenerator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteLicenseManagerReportGeneratorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLicenseManagerReportGenerator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteLicenseManagerReportGenerator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "DeleteLicenseManagerReportGenerator",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified token. Must be called in the license home Region.
func (c *Client) DeleteToken(ctx context.Context, params *DeleteTokenInput, optFns ...func(*Options)) (*DeleteTokenOutput, error) {
if params == nil {
params = &DeleteTokenInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteToken", params, optFns, c.addOperationDeleteTokenMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteTokenOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteTokenInput struct {
// Token ID.
//
// This member is required.
TokenId *string
noSmithyDocumentSerde
}
type DeleteTokenOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteToken{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteToken{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteTokenValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteToken(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteToken(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "DeleteToken",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Extends the expiration date for license consumption.
func (c *Client) ExtendLicenseConsumption(ctx context.Context, params *ExtendLicenseConsumptionInput, optFns ...func(*Options)) (*ExtendLicenseConsumptionOutput, error) {
if params == nil {
params = &ExtendLicenseConsumptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ExtendLicenseConsumption", params, optFns, c.addOperationExtendLicenseConsumptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ExtendLicenseConsumptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type ExtendLicenseConsumptionInput struct {
// License consumption token.
//
// This member is required.
LicenseConsumptionToken *string
// Checks whether you have the required permissions for the action, without
// actually making the request. Provides an error response if you do not have the
// required permissions.
DryRun bool
noSmithyDocumentSerde
}
type ExtendLicenseConsumptionOutput struct {
// Date and time at which the license consumption expires.
Expiration *string
// License consumption token.
LicenseConsumptionToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationExtendLicenseConsumptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpExtendLicenseConsumption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpExtendLicenseConsumption{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpExtendLicenseConsumptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExtendLicenseConsumption(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opExtendLicenseConsumption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ExtendLicenseConsumption",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a temporary access token to use with AssumeRoleWithWebIdentity. Access
// tokens are valid for one hour.
func (c *Client) GetAccessToken(ctx context.Context, params *GetAccessTokenInput, optFns ...func(*Options)) (*GetAccessTokenOutput, error) {
if params == nil {
params = &GetAccessTokenInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetAccessToken", params, optFns, c.addOperationGetAccessTokenMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetAccessTokenOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetAccessTokenInput struct {
// Refresh token, encoded as a JWT token.
//
// This member is required.
Token *string
// Token properties to validate against those present in the JWT token.
TokenProperties []string
noSmithyDocumentSerde
}
type GetAccessTokenOutput struct {
// Temporary access token.
AccessToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetAccessTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAccessToken{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAccessToken{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetAccessTokenValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessToken(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetAccessToken(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "GetAccessToken",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets detailed information about the specified grant.
func (c *Client) GetGrant(ctx context.Context, params *GetGrantInput, optFns ...func(*Options)) (*GetGrantOutput, error) {
if params == nil {
params = &GetGrantInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetGrant", params, optFns, c.addOperationGetGrantMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetGrantOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetGrantInput struct {
// Amazon Resource Name (ARN) of the grant.
//
// This member is required.
GrantArn *string
// Grant version.
Version *string
noSmithyDocumentSerde
}
type GetGrantOutput struct {
// Grant details.
Grant *types.Grant
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetGrantMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetGrant{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetGrant{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetGrantValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetGrant(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetGrant(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "GetGrant",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets detailed information about the specified license.
func (c *Client) GetLicense(ctx context.Context, params *GetLicenseInput, optFns ...func(*Options)) (*GetLicenseOutput, error) {
if params == nil {
params = &GetLicenseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetLicense", params, optFns, c.addOperationGetLicenseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetLicenseOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetLicenseInput struct {
// Amazon Resource Name (ARN) of the license.
//
// This member is required.
LicenseArn *string
// License version.
Version *string
noSmithyDocumentSerde
}
type GetLicenseOutput struct {
// License details.
License *types.License
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetLicenseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLicense{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLicense{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetLicenseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLicense(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetLicense(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "GetLicense",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets detailed information about the specified license configuration.
func (c *Client) GetLicenseConfiguration(ctx context.Context, params *GetLicenseConfigurationInput, optFns ...func(*Options)) (*GetLicenseConfigurationOutput, error) {
if params == nil {
params = &GetLicenseConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetLicenseConfiguration", params, optFns, c.addOperationGetLicenseConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetLicenseConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetLicenseConfigurationInput struct {
// Amazon Resource Name (ARN) of the license configuration.
//
// This member is required.
LicenseConfigurationArn *string
noSmithyDocumentSerde
}
type GetLicenseConfigurationOutput struct {
// Automated discovery information.
AutomatedDiscoveryInformation *types.AutomatedDiscoveryInformation
// Summaries of the licenses consumed by resources.
ConsumedLicenseSummaryList []types.ConsumedLicenseSummary
// Number of licenses assigned to resources.
ConsumedLicenses *int64
// Description of the license configuration.
Description *string
// When true, disassociates a resource when software is uninstalled.
DisassociateWhenNotFound *bool
// Amazon Resource Name (ARN) of the license configuration.
LicenseConfigurationArn *string
// Unique ID for the license configuration.
LicenseConfigurationId *string
// Number of available licenses.
LicenseCount *int64
// Sets the number of available licenses as a hard limit.
LicenseCountHardLimit *bool
// Dimension for which the licenses are counted.
LicenseCountingType types.LicenseCountingType
// License rules.
LicenseRules []string
// Summaries of the managed resources.
ManagedResourceSummaryList []types.ManagedResourceSummary
// Name of the license configuration.
Name *string
// Account ID of the owner of the license configuration.
OwnerAccountId *string
// Product information.
ProductInformationList []types.ProductInformation
// License configuration status.
Status *string
// Tags for the license configuration.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetLicenseConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetLicenseConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLicenseConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetLicenseConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "GetLicenseConfiguration",
}
}
| 173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets information about the specified license type conversion task.
func (c *Client) GetLicenseConversionTask(ctx context.Context, params *GetLicenseConversionTaskInput, optFns ...func(*Options)) (*GetLicenseConversionTaskOutput, error) {
if params == nil {
params = &GetLicenseConversionTaskInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetLicenseConversionTask", params, optFns, c.addOperationGetLicenseConversionTaskMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetLicenseConversionTaskOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetLicenseConversionTaskInput struct {
// ID of the license type conversion task to retrieve information on.
//
// This member is required.
LicenseConversionTaskId *string
noSmithyDocumentSerde
}
type GetLicenseConversionTaskOutput struct {
// Information about the license type converted to.
DestinationLicenseContext *types.LicenseConversionContext
// Time at which the license type conversion task was completed.
EndTime *time.Time
// ID of the license type conversion task.
LicenseConversionTaskId *string
// Amount of time to complete the license type conversion.
LicenseConversionTime *time.Time
// Amazon Resource Names (ARN) of the resources the license conversion task is
// associated with.
ResourceArn *string
// Information about the license type converted from.
SourceLicenseContext *types.LicenseConversionContext
// Time at which the license type conversion task was started .
StartTime *time.Time
// Status of the license type conversion task.
Status types.LicenseConversionTaskStatus
// The status message for the conversion task.
StatusMessage *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetLicenseConversionTaskMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLicenseConversionTask{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLicenseConversionTask{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetLicenseConversionTaskValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLicenseConversionTask(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetLicenseConversionTask(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "GetLicenseConversionTask",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about the specified report generator.
func (c *Client) GetLicenseManagerReportGenerator(ctx context.Context, params *GetLicenseManagerReportGeneratorInput, optFns ...func(*Options)) (*GetLicenseManagerReportGeneratorOutput, error) {
if params == nil {
params = &GetLicenseManagerReportGeneratorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetLicenseManagerReportGenerator", params, optFns, c.addOperationGetLicenseManagerReportGeneratorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetLicenseManagerReportGeneratorOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetLicenseManagerReportGeneratorInput struct {
// Amazon Resource Name (ARN) of the report generator.
//
// This member is required.
LicenseManagerReportGeneratorArn *string
noSmithyDocumentSerde
}
type GetLicenseManagerReportGeneratorOutput struct {
// A report generator that creates periodic reports about your license
// configurations.
ReportGenerator *types.ReportGenerator
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetLicenseManagerReportGeneratorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLicenseManagerReportGenerator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLicenseManagerReportGenerator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetLicenseManagerReportGeneratorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLicenseManagerReportGenerator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetLicenseManagerReportGenerator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "GetLicenseManagerReportGenerator",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets detailed information about the usage of the specified license.
func (c *Client) GetLicenseUsage(ctx context.Context, params *GetLicenseUsageInput, optFns ...func(*Options)) (*GetLicenseUsageOutput, error) {
if params == nil {
params = &GetLicenseUsageInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetLicenseUsage", params, optFns, c.addOperationGetLicenseUsageMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetLicenseUsageOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetLicenseUsageInput struct {
// Amazon Resource Name (ARN) of the license.
//
// This member is required.
LicenseArn *string
noSmithyDocumentSerde
}
type GetLicenseUsageOutput struct {
// License usage details.
LicenseUsage *types.LicenseUsage
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetLicenseUsageMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLicenseUsage{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLicenseUsage{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetLicenseUsageValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLicenseUsage(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetLicenseUsage(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "GetLicenseUsage",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets the License Manager settings for the current Region.
func (c *Client) GetServiceSettings(ctx context.Context, params *GetServiceSettingsInput, optFns ...func(*Options)) (*GetServiceSettingsOutput, error) {
if params == nil {
params = &GetServiceSettingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetServiceSettings", params, optFns, c.addOperationGetServiceSettingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetServiceSettingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetServiceSettingsInput struct {
noSmithyDocumentSerde
}
type GetServiceSettingsOutput struct {
// Indicates whether cross-account discovery is enabled.
EnableCrossAccountsDiscovery *bool
// Amazon Resource Name (ARN) of the resource share. The License Manager
// management account provides member accounts with access to this share.
LicenseManagerResourceShareArn *string
// Indicates whether Organizations is integrated with License Manager for
// cross-account discovery.
OrganizationConfiguration *types.OrganizationConfiguration
// Regional S3 bucket path for storing reports, license trail event data,
// discovery data, and so on.
S3BucketArn *string
// SNS topic configured to receive notifications from License Manager.
SnsTopicArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetServiceSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetServiceSettings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetServiceSettings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetServiceSettings(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetServiceSettings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "GetServiceSettings",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the resource associations for the specified license configuration.
// Resource associations need not consume licenses from a license configuration.
// For example, an AMI or a stopped instance might not consume a license (depending
// on the license rules).
func (c *Client) ListAssociationsForLicenseConfiguration(ctx context.Context, params *ListAssociationsForLicenseConfigurationInput, optFns ...func(*Options)) (*ListAssociationsForLicenseConfigurationOutput, error) {
if params == nil {
params = &ListAssociationsForLicenseConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssociationsForLicenseConfiguration", params, optFns, c.addOperationListAssociationsForLicenseConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssociationsForLicenseConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssociationsForLicenseConfigurationInput struct {
// Amazon Resource Name (ARN) of a license configuration.
//
// This member is required.
LicenseConfigurationArn *string
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAssociationsForLicenseConfigurationOutput struct {
// Information about the associations for the license configuration.
LicenseConfigurationAssociations []types.LicenseConfigurationAssociation
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssociationsForLicenseConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAssociationsForLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAssociationsForLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListAssociationsForLicenseConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssociationsForLicenseConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListAssociationsForLicenseConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListAssociationsForLicenseConfiguration",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the grants distributed for the specified license.
func (c *Client) ListDistributedGrants(ctx context.Context, params *ListDistributedGrantsInput, optFns ...func(*Options)) (*ListDistributedGrantsOutput, error) {
if params == nil {
params = &ListDistributedGrantsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDistributedGrants", params, optFns, c.addOperationListDistributedGrantsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDistributedGrantsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListDistributedGrantsInput struct {
// Filters to scope the results. The following filters are supported:
// - LicenseArn
// - GrantStatus
// - GranteePrincipalARN
// - ProductSKU
// - LicenseIssuerName
Filters []types.Filter
// Amazon Resource Names (ARNs) of the grants.
GrantArns []string
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListDistributedGrantsOutput struct {
// Distributed grant details.
Grants []types.Grant
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDistributedGrantsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDistributedGrants{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDistributedGrants{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDistributedGrants(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListDistributedGrants(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListDistributedGrants",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the license configuration operations that failed.
func (c *Client) ListFailuresForLicenseConfigurationOperations(ctx context.Context, params *ListFailuresForLicenseConfigurationOperationsInput, optFns ...func(*Options)) (*ListFailuresForLicenseConfigurationOperationsOutput, error) {
if params == nil {
params = &ListFailuresForLicenseConfigurationOperationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListFailuresForLicenseConfigurationOperations", params, optFns, c.addOperationListFailuresForLicenseConfigurationOperationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListFailuresForLicenseConfigurationOperationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListFailuresForLicenseConfigurationOperationsInput struct {
// Amazon Resource Name of the license configuration.
//
// This member is required.
LicenseConfigurationArn *string
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListFailuresForLicenseConfigurationOperationsOutput struct {
// License configuration operations that failed.
LicenseOperationFailureList []types.LicenseOperationFailure
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListFailuresForLicenseConfigurationOperationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListFailuresForLicenseConfigurationOperations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListFailuresForLicenseConfigurationOperations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListFailuresForLicenseConfigurationOperationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFailuresForLicenseConfigurationOperations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListFailuresForLicenseConfigurationOperations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListFailuresForLicenseConfigurationOperations",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the license configurations for your account.
func (c *Client) ListLicenseConfigurations(ctx context.Context, params *ListLicenseConfigurationsInput, optFns ...func(*Options)) (*ListLicenseConfigurationsOutput, error) {
if params == nil {
params = &ListLicenseConfigurationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLicenseConfigurations", params, optFns, c.addOperationListLicenseConfigurationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLicenseConfigurationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLicenseConfigurationsInput struct {
// Filters to scope the results. The following filters and logical operators are
// supported:
// - licenseCountingType - The dimension for which licenses are counted. Possible
// values are vCPU | Instance | Core | Socket . Logical operators are EQUALS |
// NOT_EQUALS .
// - enforceLicenseCount - A Boolean value that indicates whether hard license
// enforcement is used. Logical operators are EQUALS | NOT_EQUALS .
// - usagelimitExceeded - A Boolean value that indicates whether the available
// licenses have been exceeded. Logical operators are EQUALS | NOT_EQUALS .
Filters []types.Filter
// Amazon Resource Names (ARN) of the license configurations.
LicenseConfigurationArns []string
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListLicenseConfigurationsOutput struct {
// Information about the license configurations.
LicenseConfigurations []types.LicenseConfiguration
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLicenseConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLicenseConfigurations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLicenseConfigurations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLicenseConfigurations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListLicenseConfigurations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListLicenseConfigurations",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the license type conversion tasks for your account.
func (c *Client) ListLicenseConversionTasks(ctx context.Context, params *ListLicenseConversionTasksInput, optFns ...func(*Options)) (*ListLicenseConversionTasksOutput, error) {
if params == nil {
params = &ListLicenseConversionTasksInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLicenseConversionTasks", params, optFns, c.addOperationListLicenseConversionTasksMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLicenseConversionTasksOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLicenseConversionTasksInput struct {
// Filters to scope the results. Valid filters are ResourceArns and Status .
Filters []types.Filter
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListLicenseConversionTasksOutput struct {
// Information about the license configuration tasks for your account.
LicenseConversionTasks []types.LicenseConversionTask
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLicenseConversionTasksMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLicenseConversionTasks{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLicenseConversionTasks{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLicenseConversionTasks(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListLicenseConversionTasks(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListLicenseConversionTasks",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the report generators for your account.
func (c *Client) ListLicenseManagerReportGenerators(ctx context.Context, params *ListLicenseManagerReportGeneratorsInput, optFns ...func(*Options)) (*ListLicenseManagerReportGeneratorsOutput, error) {
if params == nil {
params = &ListLicenseManagerReportGeneratorsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLicenseManagerReportGenerators", params, optFns, c.addOperationListLicenseManagerReportGeneratorsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLicenseManagerReportGeneratorsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLicenseManagerReportGeneratorsInput struct {
// Filters to scope the results. The following filters are supported:
// - LicenseConfigurationArn
Filters []types.Filter
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListLicenseManagerReportGeneratorsOutput struct {
// Token for the next set of results.
NextToken *string
// A report generator that creates periodic reports about your license
// configurations.
ReportGenerators []types.ReportGenerator
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLicenseManagerReportGeneratorsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLicenseManagerReportGenerators{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLicenseManagerReportGenerators{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLicenseManagerReportGenerators(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListLicenseManagerReportGenerators(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListLicenseManagerReportGenerators",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the licenses for your account.
func (c *Client) ListLicenses(ctx context.Context, params *ListLicensesInput, optFns ...func(*Options)) (*ListLicensesOutput, error) {
if params == nil {
params = &ListLicensesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLicenses", params, optFns, c.addOperationListLicensesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLicensesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLicensesInput struct {
// Filters to scope the results. The following filters are supported:
// - Beneficiary
// - ProductSKU
// - Fingerprint
// - Status
Filters []types.Filter
// Amazon Resource Names (ARNs) of the licenses.
LicenseArns []string
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListLicensesOutput struct {
// License details.
Licenses []types.License
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLicensesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLicenses{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLicenses{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLicenses(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListLicenses(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListLicenses",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the license configurations for the specified resource.
func (c *Client) ListLicenseSpecificationsForResource(ctx context.Context, params *ListLicenseSpecificationsForResourceInput, optFns ...func(*Options)) (*ListLicenseSpecificationsForResourceOutput, error) {
if params == nil {
params = &ListLicenseSpecificationsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLicenseSpecificationsForResource", params, optFns, c.addOperationListLicenseSpecificationsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLicenseSpecificationsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLicenseSpecificationsForResourceInput struct {
// Amazon Resource Name (ARN) of a resource that has an associated license
// configuration.
//
// This member is required.
ResourceArn *string
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListLicenseSpecificationsForResourceOutput struct {
// License configurations associated with a resource.
LicenseSpecifications []types.LicenseSpecification
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLicenseSpecificationsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLicenseSpecificationsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLicenseSpecificationsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListLicenseSpecificationsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLicenseSpecificationsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListLicenseSpecificationsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListLicenseSpecificationsForResource",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all versions of the specified license.
func (c *Client) ListLicenseVersions(ctx context.Context, params *ListLicenseVersionsInput, optFns ...func(*Options)) (*ListLicenseVersionsOutput, error) {
if params == nil {
params = &ListLicenseVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLicenseVersions", params, optFns, c.addOperationListLicenseVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLicenseVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLicenseVersionsInput struct {
// Amazon Resource Name (ARN) of the license.
//
// This member is required.
LicenseArn *string
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListLicenseVersionsOutput struct {
// License details.
Licenses []types.License
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLicenseVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLicenseVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLicenseVersions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListLicenseVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLicenseVersions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListLicenseVersions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListLicenseVersions",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists grants that are received. Received grants are grants created while
// specifying the recipient as this Amazon Web Services account, your organization,
// or an organizational unit (OU) to which this member account belongs.
func (c *Client) ListReceivedGrants(ctx context.Context, params *ListReceivedGrantsInput, optFns ...func(*Options)) (*ListReceivedGrantsOutput, error) {
if params == nil {
params = &ListReceivedGrantsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListReceivedGrants", params, optFns, c.addOperationListReceivedGrantsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListReceivedGrantsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListReceivedGrantsInput struct {
// Filters to scope the results. The following filters are supported:
// - ProductSKU
// - LicenseIssuerName
// - LicenseArn
// - GrantStatus
// - GranterAccountId
Filters []types.Filter
// Amazon Resource Names (ARNs) of the grants.
GrantArns []string
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListReceivedGrantsOutput struct {
// Received grant details.
Grants []types.Grant
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListReceivedGrantsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListReceivedGrants{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListReceivedGrants{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReceivedGrants(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListReceivedGrants(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListReceivedGrants",
}
}
| 139 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the grants received for all accounts in the organization.
func (c *Client) ListReceivedGrantsForOrganization(ctx context.Context, params *ListReceivedGrantsForOrganizationInput, optFns ...func(*Options)) (*ListReceivedGrantsForOrganizationOutput, error) {
if params == nil {
params = &ListReceivedGrantsForOrganizationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListReceivedGrantsForOrganization", params, optFns, c.addOperationListReceivedGrantsForOrganizationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListReceivedGrantsForOrganizationOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListReceivedGrantsForOrganizationInput struct {
// The Amazon Resource Name (ARN) of the received license.
//
// This member is required.
LicenseArn *string
// Filters to scope the results. The following filters are supported:
// - ParentArn
// - GranteePrincipalArn
Filters []types.Filter
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListReceivedGrantsForOrganizationOutput struct {
// Lists the grants the organization has received.
Grants []types.Grant
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListReceivedGrantsForOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListReceivedGrantsForOrganization{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListReceivedGrantsForOrganization{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListReceivedGrantsForOrganizationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReceivedGrantsForOrganization(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListReceivedGrantsForOrganization(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListReceivedGrantsForOrganization",
}
}
| 139 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists received licenses.
func (c *Client) ListReceivedLicenses(ctx context.Context, params *ListReceivedLicensesInput, optFns ...func(*Options)) (*ListReceivedLicensesOutput, error) {
if params == nil {
params = &ListReceivedLicensesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListReceivedLicenses", params, optFns, c.addOperationListReceivedLicensesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListReceivedLicensesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListReceivedLicensesInput struct {
// Filters to scope the results. The following filters are supported:
// - ProductSKU
// - Status
// - Fingerprint
// - IssuerName
// - Beneficiary
Filters []types.Filter
// Amazon Resource Names (ARNs) of the licenses.
LicenseArns []string
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListReceivedLicensesOutput struct {
// Received license details.
Licenses []types.GrantedLicense
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListReceivedLicensesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListReceivedLicenses{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListReceivedLicenses{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReceivedLicenses(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListReceivedLicenses(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListReceivedLicenses",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the licenses received for all accounts in the organization.
func (c *Client) ListReceivedLicensesForOrganization(ctx context.Context, params *ListReceivedLicensesForOrganizationInput, optFns ...func(*Options)) (*ListReceivedLicensesForOrganizationOutput, error) {
if params == nil {
params = &ListReceivedLicensesForOrganizationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListReceivedLicensesForOrganization", params, optFns, c.addOperationListReceivedLicensesForOrganizationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListReceivedLicensesForOrganizationOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListReceivedLicensesForOrganizationInput struct {
// Filters to scope the results. The following filters are supported:
// - Beneficiary
// - ProductSKU
Filters []types.Filter
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListReceivedLicensesForOrganizationOutput struct {
// Lists the licenses the organization has received.
Licenses []types.GrantedLicense
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListReceivedLicensesForOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListReceivedLicensesForOrganization{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListReceivedLicensesForOrganization{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListReceivedLicensesForOrganization(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListReceivedLicensesForOrganization(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListReceivedLicensesForOrganization",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists resources managed using Systems Manager inventory.
func (c *Client) ListResourceInventory(ctx context.Context, params *ListResourceInventoryInput, optFns ...func(*Options)) (*ListResourceInventoryOutput, error) {
if params == nil {
params = &ListResourceInventoryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListResourceInventory", params, optFns, c.addOperationListResourceInventoryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListResourceInventoryOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListResourceInventoryInput struct {
// Filters to scope the results. The following filters and logical operators are
// supported:
// - account_id - The ID of the Amazon Web Services account that owns the
// resource. Logical operators are EQUALS | NOT_EQUALS .
// - application_name - The name of the application. Logical operators are EQUALS
// | BEGINS_WITH .
// - license_included - The type of license included. Logical operators are
// EQUALS | NOT_EQUALS . Possible values are sql-server-enterprise |
// sql-server-standard | sql-server-web | windows-server-datacenter .
// - platform - The platform of the resource. Logical operators are EQUALS |
// BEGINS_WITH .
// - resource_id - The ID of the resource. Logical operators are EQUALS |
// NOT_EQUALS .
// - tag: - The key/value combination of a tag assigned to the resource. Logical
// operators are EQUALS (single account) or EQUALS | NOT_EQUALS (cross account).
Filters []types.InventoryFilter
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListResourceInventoryOutput struct {
// Token for the next set of results.
NextToken *string
// Information about the resources.
ResourceInventoryList []types.ResourceInventory
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListResourceInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListResourceInventory{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListResourceInventory{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListResourceInventoryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceInventory(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListResourceInventory(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListResourceInventory",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the tags for the specified license configuration.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// Amazon Resource Name (ARN) of the license configuration.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// Information about the tags.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListTagsForResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists your tokens.
func (c *Client) ListTokens(ctx context.Context, params *ListTokensInput, optFns ...func(*Options)) (*ListTokensOutput, error) {
if params == nil {
params = &ListTokensInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTokens", params, optFns, c.addOperationListTokensMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTokensOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTokensInput struct {
// Filters to scope the results. The following filter is supported:
// - LicenseArns
Filters []types.Filter
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
// Token IDs.
TokenIds []string
noSmithyDocumentSerde
}
type ListTokensOutput struct {
// Token for the next set of results.
NextToken *string
// Received token details.
Tokens []types.TokenData
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTokensMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTokens{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTokens{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTokens(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTokens(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListTokens",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all license usage records for a license configuration, displaying license
// consumption details by resource at a selected point in time. Use this action to
// audit the current license consumption for any license inventory and
// configuration.
func (c *Client) ListUsageForLicenseConfiguration(ctx context.Context, params *ListUsageForLicenseConfigurationInput, optFns ...func(*Options)) (*ListUsageForLicenseConfigurationOutput, error) {
if params == nil {
params = &ListUsageForLicenseConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListUsageForLicenseConfiguration", params, optFns, c.addOperationListUsageForLicenseConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListUsageForLicenseConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListUsageForLicenseConfigurationInput struct {
// Amazon Resource Name (ARN) of the license configuration.
//
// This member is required.
LicenseConfigurationArn *string
// Filters to scope the results. The following filters and logical operators are
// supported:
// - resourceArn - The ARN of the license configuration resource. Logical
// operators are EQUALS | NOT_EQUALS .
// - resourceType - The resource type ( EC2_INSTANCE | EC2_HOST | EC2_AMI |
// SYSTEMS_MANAGER_MANAGED_INSTANCE ). Logical operators are EQUALS | NOT_EQUALS
// .
// - resourceAccount - The ID of the account that owns the resource. Logical
// operators are EQUALS | NOT_EQUALS .
Filters []types.Filter
// Maximum number of results to return in a single call.
MaxResults *int32
// Token for the next set of results.
NextToken *string
noSmithyDocumentSerde
}
type ListUsageForLicenseConfigurationOutput struct {
// Information about the license configurations.
LicenseConfigurationUsageList []types.LicenseConfigurationUsage
// Token for the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListUsageForLicenseConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListUsageForLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListUsageForLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListUsageForLicenseConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListUsageForLicenseConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListUsageForLicenseConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "ListUsageForLicenseConfiguration",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Rejects the specified grant.
func (c *Client) RejectGrant(ctx context.Context, params *RejectGrantInput, optFns ...func(*Options)) (*RejectGrantOutput, error) {
if params == nil {
params = &RejectGrantInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RejectGrant", params, optFns, c.addOperationRejectGrantMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RejectGrantOutput)
out.ResultMetadata = metadata
return out, nil
}
type RejectGrantInput struct {
// Amazon Resource Name (ARN) of the grant.
//
// This member is required.
GrantArn *string
noSmithyDocumentSerde
}
type RejectGrantOutput struct {
// Grant ARN.
GrantArn *string
// Grant status.
Status types.GrantStatus
// Grant version.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRejectGrantMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRejectGrant{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRejectGrant{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRejectGrantValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectGrant(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opRejectGrant(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "RejectGrant",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds the specified tags to the specified license configuration.
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// Amazon Resource Name (ARN) of the license configuration.
//
// This member is required.
ResourceArn *string
// One or more tags.
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "TagResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes the specified tags from the specified license configuration.
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// Amazon Resource Name (ARN) of the license configuration.
//
// This member is required.
ResourceArn *string
// Keys identifying the tags to remove.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "UntagResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Modifies the attributes of an existing license configuration.
func (c *Client) UpdateLicenseConfiguration(ctx context.Context, params *UpdateLicenseConfigurationInput, optFns ...func(*Options)) (*UpdateLicenseConfigurationOutput, error) {
if params == nil {
params = &UpdateLicenseConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateLicenseConfiguration", params, optFns, c.addOperationUpdateLicenseConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateLicenseConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateLicenseConfigurationInput struct {
// Amazon Resource Name (ARN) of the license configuration.
//
// This member is required.
LicenseConfigurationArn *string
// New description of the license configuration.
Description *string
// When true, disassociates a resource when software is uninstalled.
DisassociateWhenNotFound *bool
// New status of the license configuration.
LicenseConfigurationStatus types.LicenseConfigurationStatus
// New number of licenses managed by the license configuration.
LicenseCount *int64
// New hard limit of the number of available licenses.
LicenseCountHardLimit *bool
// New license rule. The only rule that you can add after you create a license
// configuration is licenseAffinityToHost.
LicenseRules []string
// New name of the license configuration.
Name *string
// New product information.
ProductInformationList []types.ProductInformation
noSmithyDocumentSerde
}
type UpdateLicenseConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateLicenseConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateLicenseConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateLicenseConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLicenseConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateLicenseConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "UpdateLicenseConfiguration",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a report generator. After you make changes to a report generator, it
// starts generating new reports within 60 minutes of being updated.
func (c *Client) UpdateLicenseManagerReportGenerator(ctx context.Context, params *UpdateLicenseManagerReportGeneratorInput, optFns ...func(*Options)) (*UpdateLicenseManagerReportGeneratorOutput, error) {
if params == nil {
params = &UpdateLicenseManagerReportGeneratorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateLicenseManagerReportGenerator", params, optFns, c.addOperationUpdateLicenseManagerReportGeneratorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateLicenseManagerReportGeneratorOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateLicenseManagerReportGeneratorInput struct {
// Unique, case-sensitive identifier that you provide to ensure the idempotency of
// the request.
//
// This member is required.
ClientToken *string
// Amazon Resource Name (ARN) of the report generator to update.
//
// This member is required.
LicenseManagerReportGeneratorArn *string
// The report context.
//
// This member is required.
ReportContext *types.ReportContext
// Frequency by which reports are generated.
//
// This member is required.
ReportFrequency *types.ReportFrequency
// Name of the report generator.
//
// This member is required.
ReportGeneratorName *string
// Type of reports to generate. The following report types are supported:
// - License configuration report - Reports the number and details of consumed
// licenses for a license configuration.
// - Resource report - Reports the tracked licenses and resource consumption for
// a license configuration.
//
// This member is required.
Type []types.ReportType
// Description of the report generator.
Description *string
noSmithyDocumentSerde
}
type UpdateLicenseManagerReportGeneratorOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateLicenseManagerReportGeneratorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateLicenseManagerReportGenerator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateLicenseManagerReportGenerator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateLicenseManagerReportGeneratorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLicenseManagerReportGenerator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateLicenseManagerReportGenerator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "UpdateLicenseManagerReportGenerator",
}
}
| 155 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds or removes the specified license configurations for the specified Amazon
// Web Services resource. You can update the license specifications of AMIs,
// instances, and hosts. You cannot update the license specifications for launch
// templates and CloudFormation templates, as they send license configurations to
// the operation that creates the resource.
func (c *Client) UpdateLicenseSpecificationsForResource(ctx context.Context, params *UpdateLicenseSpecificationsForResourceInput, optFns ...func(*Options)) (*UpdateLicenseSpecificationsForResourceOutput, error) {
if params == nil {
params = &UpdateLicenseSpecificationsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateLicenseSpecificationsForResource", params, optFns, c.addOperationUpdateLicenseSpecificationsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateLicenseSpecificationsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateLicenseSpecificationsForResourceInput struct {
// Amazon Resource Name (ARN) of the Amazon Web Services resource.
//
// This member is required.
ResourceArn *string
// ARNs of the license configurations to add.
AddLicenseSpecifications []types.LicenseSpecification
// ARNs of the license configurations to remove.
RemoveLicenseSpecifications []types.LicenseSpecification
noSmithyDocumentSerde
}
type UpdateLicenseSpecificationsForResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateLicenseSpecificationsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateLicenseSpecificationsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateLicenseSpecificationsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateLicenseSpecificationsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLicenseSpecificationsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateLicenseSpecificationsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "UpdateLicenseSpecificationsForResource",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates License Manager settings for the current Region.
func (c *Client) UpdateServiceSettings(ctx context.Context, params *UpdateServiceSettingsInput, optFns ...func(*Options)) (*UpdateServiceSettingsOutput, error) {
if params == nil {
params = &UpdateServiceSettingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateServiceSettings", params, optFns, c.addOperationUpdateServiceSettingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateServiceSettingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateServiceSettingsInput struct {
// Activates cross-account discovery.
EnableCrossAccountsDiscovery *bool
// Enables integration with Organizations for cross-account discovery.
OrganizationConfiguration *types.OrganizationConfiguration
// Amazon Resource Name (ARN) of the Amazon S3 bucket where the License Manager
// information is stored.
S3BucketArn *string
// Amazon Resource Name (ARN) of the Amazon SNS topic used for License Manager
// alerts.
SnsTopicArn *string
noSmithyDocumentSerde
}
type UpdateServiceSettingsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateServiceSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateServiceSettings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateServiceSettings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateServiceSettingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateServiceSettings(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateServiceSettings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "license-manager",
OperationName: "UpdateServiceSettings",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
)
type awsAwsjson11_deserializeOpAcceptGrant struct {
}
func (*awsAwsjson11_deserializeOpAcceptGrant) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAcceptGrant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorAcceptGrant(response, &metadata)
}
output := &AcceptGrantOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentAcceptGrantOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorAcceptGrant(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCheckInLicense struct {
}
func (*awsAwsjson11_deserializeOpCheckInLicense) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCheckInLicense) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCheckInLicense(response, &metadata)
}
output := &CheckInLicenseOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCheckInLicenseOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCheckInLicense(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCheckoutBorrowLicense struct {
}
func (*awsAwsjson11_deserializeOpCheckoutBorrowLicense) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCheckoutBorrowLicense) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCheckoutBorrowLicense(response, &metadata)
}
output := &CheckoutBorrowLicenseOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCheckoutBorrowLicenseOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCheckoutBorrowLicense(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("EntitlementNotAllowedException", errorCode):
return awsAwsjson11_deserializeErrorEntitlementNotAllowedException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("NoEntitlementsAllowedException", errorCode):
return awsAwsjson11_deserializeErrorNoEntitlementsAllowedException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("RedirectException", errorCode):
return awsAwsjson11_deserializeErrorRedirectException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("UnsupportedDigitalSignatureMethodException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedDigitalSignatureMethodException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCheckoutLicense struct {
}
func (*awsAwsjson11_deserializeOpCheckoutLicense) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCheckoutLicense) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCheckoutLicense(response, &metadata)
}
output := &CheckoutLicenseOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCheckoutLicenseOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCheckoutLicense(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("NoEntitlementsAllowedException", errorCode):
return awsAwsjson11_deserializeErrorNoEntitlementsAllowedException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("RedirectException", errorCode):
return awsAwsjson11_deserializeErrorRedirectException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("UnsupportedDigitalSignatureMethodException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedDigitalSignatureMethodException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateGrant struct {
}
func (*awsAwsjson11_deserializeOpCreateGrant) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateGrant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateGrant(response, &metadata)
}
output := &CreateGrantOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateGrantOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateGrant(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateGrantVersion struct {
}
func (*awsAwsjson11_deserializeOpCreateGrantVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateGrantVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateGrantVersion(response, &metadata)
}
output := &CreateGrantVersionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateGrantVersionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateGrantVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateLicense struct {
}
func (*awsAwsjson11_deserializeOpCreateLicense) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateLicense) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateLicense(response, &metadata)
}
output := &CreateLicenseOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateLicenseOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateLicense(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("RedirectException", errorCode):
return awsAwsjson11_deserializeErrorRedirectException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateLicenseConfiguration struct {
}
func (*awsAwsjson11_deserializeOpCreateLicenseConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateLicenseConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateLicenseConfiguration(response, &metadata)
}
output := &CreateLicenseConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateLicenseConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateLicenseConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateLicenseConversionTaskForResource struct {
}
func (*awsAwsjson11_deserializeOpCreateLicenseConversionTaskForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateLicenseConversionTaskForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateLicenseConversionTaskForResource(response, &metadata)
}
output := &CreateLicenseConversionTaskForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateLicenseConversionTaskForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateLicenseConversionTaskForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateLicenseManagerReportGenerator struct {
}
func (*awsAwsjson11_deserializeOpCreateLicenseManagerReportGenerator) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateLicenseManagerReportGenerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateLicenseManagerReportGenerator(response, &metadata)
}
output := &CreateLicenseManagerReportGeneratorOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateLicenseManagerReportGeneratorOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateLicenseManagerReportGenerator(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateLicenseVersion struct {
}
func (*awsAwsjson11_deserializeOpCreateLicenseVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateLicenseVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateLicenseVersion(response, &metadata)
}
output := &CreateLicenseVersionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateLicenseVersionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateLicenseVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("RedirectException", errorCode):
return awsAwsjson11_deserializeErrorRedirectException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateToken struct {
}
func (*awsAwsjson11_deserializeOpCreateToken) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateToken(response, &metadata)
}
output := &CreateTokenOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateTokenOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("RedirectException", errorCode):
return awsAwsjson11_deserializeErrorRedirectException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteGrant struct {
}
func (*awsAwsjson11_deserializeOpDeleteGrant) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteGrant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteGrant(response, &metadata)
}
output := &DeleteGrantOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteGrantOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteGrant(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteLicense struct {
}
func (*awsAwsjson11_deserializeOpDeleteLicense) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteLicense) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLicense(response, &metadata)
}
output := &DeleteLicenseOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteLicenseOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteLicense(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsAwsjson11_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("RedirectException", errorCode):
return awsAwsjson11_deserializeErrorRedirectException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteLicenseConfiguration struct {
}
func (*awsAwsjson11_deserializeOpDeleteLicenseConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteLicenseConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLicenseConfiguration(response, &metadata)
}
output := &DeleteLicenseConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteLicenseConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteLicenseConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteLicenseManagerReportGenerator struct {
}
func (*awsAwsjson11_deserializeOpDeleteLicenseManagerReportGenerator) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteLicenseManagerReportGenerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLicenseManagerReportGenerator(response, &metadata)
}
output := &DeleteLicenseManagerReportGeneratorOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteLicenseManagerReportGeneratorOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteLicenseManagerReportGenerator(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteToken struct {
}
func (*awsAwsjson11_deserializeOpDeleteToken) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteToken(response, &metadata)
}
output := &DeleteTokenOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteTokenOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("RedirectException", errorCode):
return awsAwsjson11_deserializeErrorRedirectException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpExtendLicenseConsumption struct {
}
func (*awsAwsjson11_deserializeOpExtendLicenseConsumption) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpExtendLicenseConsumption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorExtendLicenseConsumption(response, &metadata)
}
output := &ExtendLicenseConsumptionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentExtendLicenseConsumptionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorExtendLicenseConsumption(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetAccessToken struct {
}
func (*awsAwsjson11_deserializeOpGetAccessToken) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetAccessToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetAccessToken(response, &metadata)
}
output := &GetAccessTokenOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetAccessTokenOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetAccessToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetGrant struct {
}
func (*awsAwsjson11_deserializeOpGetGrant) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetGrant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetGrant(response, &metadata)
}
output := &GetGrantOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetGrantOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetGrant(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetLicense struct {
}
func (*awsAwsjson11_deserializeOpGetLicense) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetLicense) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetLicense(response, &metadata)
}
output := &GetLicenseOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetLicenseOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetLicense(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetLicenseConfiguration struct {
}
func (*awsAwsjson11_deserializeOpGetLicenseConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetLicenseConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetLicenseConfiguration(response, &metadata)
}
output := &GetLicenseConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetLicenseConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetLicenseConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetLicenseConversionTask struct {
}
func (*awsAwsjson11_deserializeOpGetLicenseConversionTask) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetLicenseConversionTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetLicenseConversionTask(response, &metadata)
}
output := &GetLicenseConversionTaskOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetLicenseConversionTaskOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetLicenseConversionTask(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetLicenseManagerReportGenerator struct {
}
func (*awsAwsjson11_deserializeOpGetLicenseManagerReportGenerator) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetLicenseManagerReportGenerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetLicenseManagerReportGenerator(response, &metadata)
}
output := &GetLicenseManagerReportGeneratorOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetLicenseManagerReportGeneratorOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetLicenseManagerReportGenerator(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetLicenseUsage struct {
}
func (*awsAwsjson11_deserializeOpGetLicenseUsage) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetLicenseUsage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetLicenseUsage(response, &metadata)
}
output := &GetLicenseUsageOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetLicenseUsageOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetLicenseUsage(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetServiceSettings struct {
}
func (*awsAwsjson11_deserializeOpGetServiceSettings) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetServiceSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetServiceSettings(response, &metadata)
}
output := &GetServiceSettingsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetServiceSettingsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetServiceSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListAssociationsForLicenseConfiguration struct {
}
func (*awsAwsjson11_deserializeOpListAssociationsForLicenseConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListAssociationsForLicenseConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListAssociationsForLicenseConfiguration(response, &metadata)
}
output := &ListAssociationsForLicenseConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListAssociationsForLicenseConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListAssociationsForLicenseConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("FilterLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorFilterLimitExceededException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListDistributedGrants struct {
}
func (*awsAwsjson11_deserializeOpListDistributedGrants) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListDistributedGrants) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListDistributedGrants(response, &metadata)
}
output := &ListDistributedGrantsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListDistributedGrantsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListDistributedGrants(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListFailuresForLicenseConfigurationOperations struct {
}
func (*awsAwsjson11_deserializeOpListFailuresForLicenseConfigurationOperations) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListFailuresForLicenseConfigurationOperations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListFailuresForLicenseConfigurationOperations(response, &metadata)
}
output := &ListFailuresForLicenseConfigurationOperationsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListFailuresForLicenseConfigurationOperationsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListFailuresForLicenseConfigurationOperations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListLicenseConfigurations struct {
}
func (*awsAwsjson11_deserializeOpListLicenseConfigurations) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListLicenseConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListLicenseConfigurations(response, &metadata)
}
output := &ListLicenseConfigurationsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListLicenseConfigurationsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListLicenseConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("FilterLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorFilterLimitExceededException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListLicenseConversionTasks struct {
}
func (*awsAwsjson11_deserializeOpListLicenseConversionTasks) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListLicenseConversionTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListLicenseConversionTasks(response, &metadata)
}
output := &ListLicenseConversionTasksOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListLicenseConversionTasksOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListLicenseConversionTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListLicenseManagerReportGenerators struct {
}
func (*awsAwsjson11_deserializeOpListLicenseManagerReportGenerators) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListLicenseManagerReportGenerators) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListLicenseManagerReportGenerators(response, &metadata)
}
output := &ListLicenseManagerReportGeneratorsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListLicenseManagerReportGeneratorsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListLicenseManagerReportGenerators(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListLicenses struct {
}
func (*awsAwsjson11_deserializeOpListLicenses) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListLicenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListLicenses(response, &metadata)
}
output := &ListLicensesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListLicensesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListLicenses(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListLicenseSpecificationsForResource struct {
}
func (*awsAwsjson11_deserializeOpListLicenseSpecificationsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListLicenseSpecificationsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListLicenseSpecificationsForResource(response, &metadata)
}
output := &ListLicenseSpecificationsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListLicenseSpecificationsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListLicenseSpecificationsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListLicenseVersions struct {
}
func (*awsAwsjson11_deserializeOpListLicenseVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListLicenseVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListLicenseVersions(response, &metadata)
}
output := &ListLicenseVersionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListLicenseVersionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListLicenseVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListReceivedGrants struct {
}
func (*awsAwsjson11_deserializeOpListReceivedGrants) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListReceivedGrants) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListReceivedGrants(response, &metadata)
}
output := &ListReceivedGrantsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListReceivedGrantsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListReceivedGrants(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListReceivedGrantsForOrganization struct {
}
func (*awsAwsjson11_deserializeOpListReceivedGrantsForOrganization) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListReceivedGrantsForOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListReceivedGrantsForOrganization(response, &metadata)
}
output := &ListReceivedGrantsForOrganizationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListReceivedGrantsForOrganizationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListReceivedGrantsForOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListReceivedLicenses struct {
}
func (*awsAwsjson11_deserializeOpListReceivedLicenses) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListReceivedLicenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListReceivedLicenses(response, &metadata)
}
output := &ListReceivedLicensesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListReceivedLicensesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListReceivedLicenses(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListReceivedLicensesForOrganization struct {
}
func (*awsAwsjson11_deserializeOpListReceivedLicensesForOrganization) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListReceivedLicensesForOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListReceivedLicensesForOrganization(response, &metadata)
}
output := &ListReceivedLicensesForOrganizationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListReceivedLicensesForOrganizationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListReceivedLicensesForOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListResourceInventory struct {
}
func (*awsAwsjson11_deserializeOpListResourceInventory) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListResourceInventory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListResourceInventory(response, &metadata)
}
output := &ListResourceInventoryOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListResourceInventoryOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListResourceInventory(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("FailedDependencyException", errorCode):
return awsAwsjson11_deserializeErrorFailedDependencyException(response, errorBody)
case strings.EqualFold("FilterLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorFilterLimitExceededException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTagsForResource struct {
}
func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTokens struct {
}
func (*awsAwsjson11_deserializeOpListTokens) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTokens) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListTokens(response, &metadata)
}
output := &ListTokensOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListTokensOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListTokens(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListUsageForLicenseConfiguration struct {
}
func (*awsAwsjson11_deserializeOpListUsageForLicenseConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListUsageForLicenseConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListUsageForLicenseConfiguration(response, &metadata)
}
output := &ListUsageForLicenseConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListUsageForLicenseConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListUsageForLicenseConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("FilterLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorFilterLimitExceededException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpRejectGrant struct {
}
func (*awsAwsjson11_deserializeOpRejectGrant) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRejectGrant) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorRejectGrant(response, &metadata)
}
output := &RejectGrantOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentRejectGrantOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorRejectGrant(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpTagResource struct {
}
func (*awsAwsjson11_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUntagResource struct {
}
func (*awsAwsjson11_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateLicenseConfiguration struct {
}
func (*awsAwsjson11_deserializeOpUpdateLicenseConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateLicenseConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateLicenseConfiguration(response, &metadata)
}
output := &UpdateLicenseConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateLicenseConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateLicenseConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateLicenseManagerReportGenerator struct {
}
func (*awsAwsjson11_deserializeOpUpdateLicenseManagerReportGenerator) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateLicenseManagerReportGenerator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateLicenseManagerReportGenerator(response, &metadata)
}
output := &UpdateLicenseManagerReportGeneratorOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateLicenseManagerReportGeneratorOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateLicenseManagerReportGenerator(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateLicenseSpecificationsForResource struct {
}
func (*awsAwsjson11_deserializeOpUpdateLicenseSpecificationsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateLicenseSpecificationsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateLicenseSpecificationsForResource(response, &metadata)
}
output := &UpdateLicenseSpecificationsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateLicenseSpecificationsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateLicenseSpecificationsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("InvalidResourceStateException", errorCode):
return awsAwsjson11_deserializeErrorInvalidResourceStateException(response, errorBody)
case strings.EqualFold("LicenseUsageException", errorCode):
return awsAwsjson11_deserializeErrorLicenseUsageException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateServiceSettings struct {
}
func (*awsAwsjson11_deserializeOpUpdateServiceSettings) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateServiceSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateServiceSettings(response, &metadata)
}
output := &UpdateServiceSettingsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateServiceSettingsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateServiceSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("AuthorizationException", errorCode):
return awsAwsjson11_deserializeErrorAuthorizationException(response, errorBody)
case strings.EqualFold("InvalidParameterValueException", errorCode):
return awsAwsjson11_deserializeErrorInvalidParameterValueException(response, errorBody)
case strings.EqualFold("RateLimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorRateLimitExceededException(response, errorBody)
case strings.EqualFold("ServerInternalException", errorCode):
return awsAwsjson11_deserializeErrorServerInternalException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.AccessDeniedException{}
err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorAuthorizationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.AuthorizationException{}
err := awsAwsjson11_deserializeDocumentAuthorizationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ConflictException{}
err := awsAwsjson11_deserializeDocumentConflictException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorEntitlementNotAllowedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.EntitlementNotAllowedException{}
err := awsAwsjson11_deserializeDocumentEntitlementNotAllowedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorFailedDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.FailedDependencyException{}
err := awsAwsjson11_deserializeDocumentFailedDependencyException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorFilterLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.FilterLimitExceededException{}
err := awsAwsjson11_deserializeDocumentFilterLimitExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.InvalidParameterValueException{}
err := awsAwsjson11_deserializeDocumentInvalidParameterValueException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorInvalidResourceStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.InvalidResourceStateException{}
err := awsAwsjson11_deserializeDocumentInvalidResourceStateException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorLicenseUsageException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.LicenseUsageException{}
err := awsAwsjson11_deserializeDocumentLicenseUsageException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorNoEntitlementsAllowedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.NoEntitlementsAllowedException{}
err := awsAwsjson11_deserializeDocumentNoEntitlementsAllowedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorRateLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.RateLimitExceededException{}
err := awsAwsjson11_deserializeDocumentRateLimitExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorRedirectException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.RedirectException{}
err := awsAwsjson11_deserializeDocumentRedirectException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ResourceLimitExceededException{}
err := awsAwsjson11_deserializeDocumentResourceLimitExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ResourceNotFoundException{}
err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorServerInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ServerInternalException{}
err := awsAwsjson11_deserializeDocumentServerInternalException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorUnsupportedDigitalSignatureMethodException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.UnsupportedDigitalSignatureMethodException{}
err := awsAwsjson11_deserializeDocumentUnsupportedDigitalSignatureMethodException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ValidationException{}
err := awsAwsjson11_deserializeDocumentValidationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AccessDeniedException
if *v == nil {
sv = &types.AccessDeniedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAllowedOperationList(v *[]types.AllowedOperation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.AllowedOperation
if *v == nil {
cv = []types.AllowedOperation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AllowedOperation
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AllowedOperation to be of type string, got %T instead", value)
}
col = types.AllowedOperation(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentArnList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAuthorizationException(v **types.AuthorizationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AuthorizationException
if *v == nil {
sv = &types.AuthorizationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAutomatedDiscoveryInformation(v **types.AutomatedDiscoveryInformation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AutomatedDiscoveryInformation
if *v == nil {
sv = &types.AutomatedDiscoveryInformation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LastRunTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastRunTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentBorrowConfiguration(v **types.BorrowConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BorrowConfiguration
if *v == nil {
sv = &types.BorrowConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AllowEarlyCheckIn":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BoxBoolean to be of type *bool, got %T instead", value)
}
sv.AllowEarlyCheckIn = ptr.Bool(jtv)
}
case "MaxTimeToLiveInMinutes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BoxInteger to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxTimeToLiveInMinutes = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentConsumedLicenseSummary(v **types.ConsumedLicenseSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConsumedLicenseSummary
if *v == nil {
sv = &types.ConsumedLicenseSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ConsumedLicenses":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BoxLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ConsumedLicenses = ptr.Int64(i64)
}
case "ResourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = types.ResourceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentConsumedLicenseSummaryList(v *[]types.ConsumedLicenseSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ConsumedLicenseSummary
if *v == nil {
cv = []types.ConsumedLicenseSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ConsumedLicenseSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentConsumedLicenseSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentConsumptionConfiguration(v **types.ConsumptionConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConsumptionConfiguration
if *v == nil {
sv = &types.ConsumptionConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BorrowConfiguration":
if err := awsAwsjson11_deserializeDocumentBorrowConfiguration(&sv.BorrowConfiguration, value); err != nil {
return err
}
case "ProvisionalConfiguration":
if err := awsAwsjson11_deserializeDocumentProvisionalConfiguration(&sv.ProvisionalConfiguration, value); err != nil {
return err
}
case "RenewType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RenewType to be of type string, got %T instead", value)
}
sv.RenewType = types.RenewType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDatetimeRange(v **types.DatetimeRange, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DatetimeRange
if *v == nil {
sv = &types.DatetimeRange{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Begin":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.Begin = ptr.String(jtv)
}
case "End":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.End = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEntitlement(v **types.Entitlement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Entitlement
if *v == nil {
sv = &types.Entitlement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AllowCheckIn":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BoxBoolean to be of type *bool, got %T instead", value)
}
sv.AllowCheckIn = ptr.Bool(jtv)
}
case "MaxCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxCount = ptr.Int64(i64)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Overage":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BoxBoolean to be of type *bool, got %T instead", value)
}
sv.Overage = ptr.Bool(jtv)
}
case "Unit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntitlementUnit to be of type string, got %T instead", value)
}
sv.Unit = types.EntitlementUnit(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEntitlementData(v **types.EntitlementData, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.EntitlementData
if *v == nil {
sv = &types.EntitlementData{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Unit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntitlementDataUnit to be of type string, got %T instead", value)
}
sv.Unit = types.EntitlementDataUnit(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEntitlementDataList(v *[]types.EntitlementData, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.EntitlementData
if *v == nil {
cv = []types.EntitlementData{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EntitlementData
destAddr := &col
if err := awsAwsjson11_deserializeDocumentEntitlementData(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentEntitlementList(v *[]types.Entitlement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Entitlement
if *v == nil {
cv = []types.Entitlement{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Entitlement
destAddr := &col
if err := awsAwsjson11_deserializeDocumentEntitlement(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentEntitlementNotAllowedException(v **types.EntitlementNotAllowedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.EntitlementNotAllowedException
if *v == nil {
sv = &types.EntitlementNotAllowedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEntitlementUsage(v **types.EntitlementUsage, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.EntitlementUsage
if *v == nil {
sv = &types.EntitlementUsage{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ConsumedValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ConsumedValue = ptr.String(jtv)
}
case "MaxCount":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.MaxCount = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Unit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntitlementDataUnit to be of type string, got %T instead", value)
}
sv.Unit = types.EntitlementDataUnit(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEntitlementUsageList(v *[]types.EntitlementUsage, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.EntitlementUsage
if *v == nil {
cv = []types.EntitlementUsage{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EntitlementUsage
destAddr := &col
if err := awsAwsjson11_deserializeDocumentEntitlementUsage(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentFailedDependencyException(v **types.FailedDependencyException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.FailedDependencyException
if *v == nil {
sv = &types.FailedDependencyException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ErrorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ErrorCode_ = ptr.String(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFilterLimitExceededException(v **types.FilterLimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.FilterLimitExceededException
if *v == nil {
sv = &types.FilterLimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentGrant(v **types.Grant, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Grant
if *v == nil {
sv = &types.Grant{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "GrantArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.GrantArn = ptr.String(jtv)
}
case "GrantedOperations":
if err := awsAwsjson11_deserializeDocumentAllowedOperationList(&sv.GrantedOperations, value); err != nil {
return err
}
case "GranteePrincipalArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.GranteePrincipalArn = ptr.String(jtv)
}
case "GrantName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.GrantName = ptr.String(jtv)
}
case "GrantStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GrantStatus to be of type string, got %T instead", value)
}
sv.GrantStatus = types.GrantStatus(jtv)
}
case "HomeRegion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.HomeRegion = ptr.String(jtv)
}
case "LicenseArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.LicenseArn = ptr.String(jtv)
}
case "Options":
if err := awsAwsjson11_deserializeDocumentOptions(&sv.Options, value); err != nil {
return err
}
case "ParentArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.ParentArn = ptr.String(jtv)
}
case "StatusReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StatusReasonMessage to be of type string, got %T instead", value)
}
sv.StatusReason = ptr.String(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentGrantedLicense(v **types.GrantedLicense, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.GrantedLicense
if *v == nil {
sv = &types.GrantedLicense{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Beneficiary":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Beneficiary = ptr.String(jtv)
}
case "ConsumptionConfiguration":
if err := awsAwsjson11_deserializeDocumentConsumptionConfiguration(&sv.ConsumptionConfiguration, value); err != nil {
return err
}
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.CreateTime = ptr.String(jtv)
}
case "Entitlements":
if err := awsAwsjson11_deserializeDocumentEntitlementList(&sv.Entitlements, value); err != nil {
return err
}
case "HomeRegion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.HomeRegion = ptr.String(jtv)
}
case "Issuer":
if err := awsAwsjson11_deserializeDocumentIssuerDetails(&sv.Issuer, value); err != nil {
return err
}
case "LicenseArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.LicenseArn = ptr.String(jtv)
}
case "LicenseMetadata":
if err := awsAwsjson11_deserializeDocumentMetadataList(&sv.LicenseMetadata, value); err != nil {
return err
}
case "LicenseName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseName = ptr.String(jtv)
}
case "ProductName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ProductName = ptr.String(jtv)
}
case "ProductSKU":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ProductSKU = ptr.String(jtv)
}
case "ReceivedMetadata":
if err := awsAwsjson11_deserializeDocumentReceivedMetadata(&sv.ReceivedMetadata, value); err != nil {
return err
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseStatus to be of type string, got %T instead", value)
}
sv.Status = types.LicenseStatus(jtv)
}
case "Validity":
if err := awsAwsjson11_deserializeDocumentDatetimeRange(&sv.Validity, value); err != nil {
return err
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentGrantedLicenseList(v *[]types.GrantedLicense, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.GrantedLicense
if *v == nil {
cv = []types.GrantedLicense{}
} else {
cv = *v
}
for _, value := range shape {
var col types.GrantedLicense
destAddr := &col
if err := awsAwsjson11_deserializeDocumentGrantedLicense(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentGrantList(v *[]types.Grant, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Grant
if *v == nil {
cv = []types.Grant{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Grant
destAddr := &col
if err := awsAwsjson11_deserializeDocumentGrant(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidParameterValueException(v **types.InvalidParameterValueException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidParameterValueException
if *v == nil {
sv = &types.InvalidParameterValueException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidResourceStateException(v **types.InvalidResourceStateException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidResourceStateException
if *v == nil {
sv = &types.InvalidResourceStateException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentIssuerDetails(v **types.IssuerDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IssuerDetails
if *v == nil {
sv = &types.IssuerDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "KeyFingerprint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.KeyFingerprint = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "SignKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SignKey = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLicense(v **types.License, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.License
if *v == nil {
sv = &types.License{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Beneficiary":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Beneficiary = ptr.String(jtv)
}
case "ConsumptionConfiguration":
if err := awsAwsjson11_deserializeDocumentConsumptionConfiguration(&sv.ConsumptionConfiguration, value); err != nil {
return err
}
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.CreateTime = ptr.String(jtv)
}
case "Entitlements":
if err := awsAwsjson11_deserializeDocumentEntitlementList(&sv.Entitlements, value); err != nil {
return err
}
case "HomeRegion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.HomeRegion = ptr.String(jtv)
}
case "Issuer":
if err := awsAwsjson11_deserializeDocumentIssuerDetails(&sv.Issuer, value); err != nil {
return err
}
case "LicenseArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.LicenseArn = ptr.String(jtv)
}
case "LicenseMetadata":
if err := awsAwsjson11_deserializeDocumentMetadataList(&sv.LicenseMetadata, value); err != nil {
return err
}
case "LicenseName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseName = ptr.String(jtv)
}
case "ProductName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ProductName = ptr.String(jtv)
}
case "ProductSKU":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ProductSKU = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseStatus to be of type string, got %T instead", value)
}
sv.Status = types.LicenseStatus(jtv)
}
case "Validity":
if err := awsAwsjson11_deserializeDocumentDatetimeRange(&sv.Validity, value); err != nil {
return err
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseConfiguration(v **types.LicenseConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LicenseConfiguration
if *v == nil {
sv = &types.LicenseConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AutomatedDiscoveryInformation":
if err := awsAwsjson11_deserializeDocumentAutomatedDiscoveryInformation(&sv.AutomatedDiscoveryInformation, value); err != nil {
return err
}
case "ConsumedLicenses":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BoxLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ConsumedLicenses = ptr.Int64(i64)
}
case "ConsumedLicenseSummaryList":
if err := awsAwsjson11_deserializeDocumentConsumedLicenseSummaryList(&sv.ConsumedLicenseSummaryList, value); err != nil {
return err
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "DisassociateWhenNotFound":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BoxBoolean to be of type *bool, got %T instead", value)
}
sv.DisassociateWhenNotFound = ptr.Bool(jtv)
}
case "LicenseConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseConfigurationArn = ptr.String(jtv)
}
case "LicenseConfigurationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseConfigurationId = ptr.String(jtv)
}
case "LicenseCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BoxLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LicenseCount = ptr.Int64(i64)
}
case "LicenseCountHardLimit":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BoxBoolean to be of type *bool, got %T instead", value)
}
sv.LicenseCountHardLimit = ptr.Bool(jtv)
}
case "LicenseCountingType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseCountingType to be of type string, got %T instead", value)
}
sv.LicenseCountingType = types.LicenseCountingType(jtv)
}
case "LicenseRules":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.LicenseRules, value); err != nil {
return err
}
case "ManagedResourceSummaryList":
if err := awsAwsjson11_deserializeDocumentManagedResourceSummaryList(&sv.ManagedResourceSummaryList, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "OwnerAccountId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.OwnerAccountId = ptr.String(jtv)
}
case "ProductInformationList":
if err := awsAwsjson11_deserializeDocumentProductInformationList(&sv.ProductInformationList, value); err != nil {
return err
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Status = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseConfigurationAssociation(v **types.LicenseConfigurationAssociation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LicenseConfigurationAssociation
if *v == nil {
sv = &types.LicenseConfigurationAssociation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AmiAssociationScope":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.AmiAssociationScope = ptr.String(jtv)
}
case "AssociationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.AssociationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "ResourceOwnerId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceOwnerId = ptr.String(jtv)
}
case "ResourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = types.ResourceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseConfigurationAssociations(v *[]types.LicenseConfigurationAssociation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LicenseConfigurationAssociation
if *v == nil {
cv = []types.LicenseConfigurationAssociation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LicenseConfigurationAssociation
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLicenseConfigurationAssociation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseConfigurations(v *[]types.LicenseConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LicenseConfiguration
if *v == nil {
cv = []types.LicenseConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LicenseConfiguration
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLicenseConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseConfigurationUsage(v **types.LicenseConfigurationUsage, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LicenseConfigurationUsage
if *v == nil {
sv = &types.LicenseConfigurationUsage{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AssociationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.AssociationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "ConsumedLicenses":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BoxLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ConsumedLicenses = ptr.Int64(i64)
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "ResourceOwnerId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceOwnerId = ptr.String(jtv)
}
case "ResourceStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceStatus = ptr.String(jtv)
}
case "ResourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = types.ResourceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseConfigurationUsageList(v *[]types.LicenseConfigurationUsage, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LicenseConfigurationUsage
if *v == nil {
cv = []types.LicenseConfigurationUsage{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LicenseConfigurationUsage
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLicenseConfigurationUsage(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseConversionContext(v **types.LicenseConversionContext, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LicenseConversionContext
if *v == nil {
sv = &types.LicenseConversionContext{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "UsageOperation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UsageOperation to be of type string, got %T instead", value)
}
sv.UsageOperation = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseConversionTask(v **types.LicenseConversionTask, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LicenseConversionTask
if *v == nil {
sv = &types.LicenseConversionTask{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DestinationLicenseContext":
if err := awsAwsjson11_deserializeDocumentLicenseConversionContext(&sv.DestinationLicenseContext, value); err != nil {
return err
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "LicenseConversionTaskId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseConversionTaskId to be of type string, got %T instead", value)
}
sv.LicenseConversionTaskId = ptr.String(jtv)
}
case "LicenseConversionTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LicenseConversionTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "SourceLicenseContext":
if err := awsAwsjson11_deserializeDocumentLicenseConversionContext(&sv.SourceLicenseContext, value); err != nil {
return err
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseConversionTaskStatus to be of type string, got %T instead", value)
}
sv.Status = types.LicenseConversionTaskStatus(jtv)
}
case "StatusMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.StatusMessage = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseConversionTasks(v *[]types.LicenseConversionTask, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LicenseConversionTask
if *v == nil {
cv = []types.LicenseConversionTask{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LicenseConversionTask
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLicenseConversionTask(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseList(v *[]types.License, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.License
if *v == nil {
cv = []types.License{}
} else {
cv = *v
}
for _, value := range shape {
var col types.License
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLicense(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseOperationFailure(v **types.LicenseOperationFailure, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LicenseOperationFailure
if *v == nil {
sv = &types.LicenseOperationFailure{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ErrorMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ErrorMessage = ptr.String(jtv)
}
case "FailureTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.FailureTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "MetadataList":
if err := awsAwsjson11_deserializeDocumentMetadataList(&sv.MetadataList, value); err != nil {
return err
}
case "OperationName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.OperationName = ptr.String(jtv)
}
case "OperationRequestedBy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.OperationRequestedBy = ptr.String(jtv)
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "ResourceOwnerId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceOwnerId = ptr.String(jtv)
}
case "ResourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = types.ResourceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseOperationFailureList(v *[]types.LicenseOperationFailure, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LicenseOperationFailure
if *v == nil {
cv = []types.LicenseOperationFailure{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LicenseOperationFailure
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLicenseOperationFailure(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseSpecification(v **types.LicenseSpecification, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LicenseSpecification
if *v == nil {
sv = &types.LicenseSpecification{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AmiAssociationScope":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.AmiAssociationScope = ptr.String(jtv)
}
case "LicenseConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseConfigurationArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseSpecifications(v *[]types.LicenseSpecification, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LicenseSpecification
if *v == nil {
cv = []types.LicenseSpecification{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LicenseSpecification
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLicenseSpecification(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseUsage(v **types.LicenseUsage, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LicenseUsage
if *v == nil {
sv = &types.LicenseUsage{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EntitlementUsages":
if err := awsAwsjson11_deserializeDocumentEntitlementUsageList(&sv.EntitlementUsages, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLicenseUsageException(v **types.LicenseUsageException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LicenseUsageException
if *v == nil {
sv = &types.LicenseUsageException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentManagedResourceSummary(v **types.ManagedResourceSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ManagedResourceSummary
if *v == nil {
sv = &types.ManagedResourceSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AssociationCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BoxLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.AssociationCount = ptr.Int64(i64)
}
case "ResourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = types.ResourceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentManagedResourceSummaryList(v *[]types.ManagedResourceSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ManagedResourceSummary
if *v == nil {
cv = []types.ManagedResourceSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ManagedResourceSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentManagedResourceSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentMaxSize3StringList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentMetadata(v **types.Metadata, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Metadata
if *v == nil {
sv = &types.Metadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMetadataList(v *[]types.Metadata, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Metadata
if *v == nil {
cv = []types.Metadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Metadata
destAddr := &col
if err := awsAwsjson11_deserializeDocumentMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentNoEntitlementsAllowedException(v **types.NoEntitlementsAllowedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NoEntitlementsAllowedException
if *v == nil {
sv = &types.NoEntitlementsAllowedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOptions(v **types.Options, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Options
if *v == nil {
sv = &types.Options{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ActivationOverrideBehavior":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActivationOverrideBehavior to be of type string, got %T instead", value)
}
sv.ActivationOverrideBehavior = types.ActivationOverrideBehavior(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOrganizationConfiguration(v **types.OrganizationConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.OrganizationConfiguration
if *v == nil {
sv = &types.OrganizationConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EnableIntegration":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.EnableIntegration = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProductInformation(v **types.ProductInformation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ProductInformation
if *v == nil {
sv = &types.ProductInformation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ProductInformationFilterList":
if err := awsAwsjson11_deserializeDocumentProductInformationFilterList(&sv.ProductInformationFilterList, value); err != nil {
return err
}
case "ResourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProductInformationFilter(v **types.ProductInformationFilter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ProductInformationFilter
if *v == nil {
sv = &types.ProductInformationFilter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ProductInformationFilterComparator":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ProductInformationFilterComparator = ptr.String(jtv)
}
case "ProductInformationFilterName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ProductInformationFilterName = ptr.String(jtv)
}
case "ProductInformationFilterValue":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.ProductInformationFilterValue, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProductInformationFilterList(v *[]types.ProductInformationFilter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ProductInformationFilter
if *v == nil {
cv = []types.ProductInformationFilter{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ProductInformationFilter
destAddr := &col
if err := awsAwsjson11_deserializeDocumentProductInformationFilter(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentProductInformationList(v *[]types.ProductInformation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ProductInformation
if *v == nil {
cv = []types.ProductInformation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ProductInformation
destAddr := &col
if err := awsAwsjson11_deserializeDocumentProductInformation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentProvisionalConfiguration(v **types.ProvisionalConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ProvisionalConfiguration
if *v == nil {
sv = &types.ProvisionalConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MaxTimeToLiveInMinutes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BoxInteger to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxTimeToLiveInMinutes = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateLimitExceededException(v **types.RateLimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateLimitExceededException
if *v == nil {
sv = &types.RateLimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentReceivedMetadata(v **types.ReceivedMetadata, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ReceivedMetadata
if *v == nil {
sv = &types.ReceivedMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AllowedOperations":
if err := awsAwsjson11_deserializeDocumentAllowedOperationList(&sv.AllowedOperations, value); err != nil {
return err
}
case "ReceivedStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReceivedStatus to be of type string, got %T instead", value)
}
sv.ReceivedStatus = types.ReceivedStatus(jtv)
}
case "ReceivedStatusReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StatusReasonMessage to be of type string, got %T instead", value)
}
sv.ReceivedStatusReason = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRedirectException(v **types.RedirectException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RedirectException
if *v == nil {
sv = &types.RedirectException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Location":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Location to be of type string, got %T instead", value)
}
sv.Location = ptr.String(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentReportContext(v **types.ReportContext, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ReportContext
if *v == nil {
sv = &types.ReportContext{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "licenseConfigurationArns":
if err := awsAwsjson11_deserializeDocumentArnList(&sv.LicenseConfigurationArns, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentReportFrequency(v **types.ReportFrequency, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ReportFrequency
if *v == nil {
sv = &types.ReportFrequency{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "period":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReportFrequencyType to be of type string, got %T instead", value)
}
sv.Period = types.ReportFrequencyType(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Value = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentReportGenerator(v **types.ReportGenerator, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ReportGenerator
if *v == nil {
sv = &types.ReportGenerator{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.CreateTime = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "LastReportGenerationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LastReportGenerationTime = ptr.String(jtv)
}
case "LastRunFailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LastRunFailureReason = ptr.String(jtv)
}
case "LastRunStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LastRunStatus = ptr.String(jtv)
}
case "LicenseManagerReportGeneratorArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseManagerReportGeneratorArn = ptr.String(jtv)
}
case "ReportContext":
if err := awsAwsjson11_deserializeDocumentReportContext(&sv.ReportContext, value); err != nil {
return err
}
case "ReportCreatorAccount":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ReportCreatorAccount = ptr.String(jtv)
}
case "ReportFrequency":
if err := awsAwsjson11_deserializeDocumentReportFrequency(&sv.ReportFrequency, value); err != nil {
return err
}
case "ReportGeneratorName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ReportGeneratorName = ptr.String(jtv)
}
case "ReportType":
if err := awsAwsjson11_deserializeDocumentReportTypeList(&sv.ReportType, value); err != nil {
return err
}
case "S3Location":
if err := awsAwsjson11_deserializeDocumentS3Location(&sv.S3Location, value); err != nil {
return err
}
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentReportGeneratorList(v *[]types.ReportGenerator, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ReportGenerator
if *v == nil {
cv = []types.ReportGenerator{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ReportGenerator
destAddr := &col
if err := awsAwsjson11_deserializeDocumentReportGenerator(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentReportTypeList(v *[]types.ReportType, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ReportType
if *v == nil {
cv = []types.ReportType{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ReportType
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReportType to be of type string, got %T instead", value)
}
col = types.ReportType(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResourceInventory(v **types.ResourceInventory, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceInventory
if *v == nil {
sv = &types.ResourceInventory{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Platform":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Platform = ptr.String(jtv)
}
case "PlatformVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PlatformVersion = ptr.String(jtv)
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "ResourceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceId = ptr.String(jtv)
}
case "ResourceOwningAccountId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceOwningAccountId = ptr.String(jtv)
}
case "ResourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = types.ResourceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResourceInventoryList(v *[]types.ResourceInventory, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ResourceInventory
if *v == nil {
cv = []types.ResourceInventory{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ResourceInventory
destAddr := &col
if err := awsAwsjson11_deserializeDocumentResourceInventory(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceLimitExceededException
if *v == nil {
sv = &types.ResourceLimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFoundException
if *v == nil {
sv = &types.ResourceNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentS3Location(v **types.S3Location, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.S3Location
if *v == nil {
sv = &types.S3Location{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "bucket":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Bucket = ptr.String(jtv)
}
case "keyPrefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.KeyPrefix = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentServerInternalException(v **types.ServerInternalException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ServerInternalException
if *v == nil {
sv = &types.ServerInternalException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStringList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTokenData(v **types.TokenData, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TokenData
if *v == nil {
sv = &types.TokenData{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ExpirationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.ExpirationTime = ptr.String(jtv)
}
case "LicenseArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseArn = ptr.String(jtv)
}
case "RoleArns":
if err := awsAwsjson11_deserializeDocumentArnList(&sv.RoleArns, value); err != nil {
return err
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Status = ptr.String(jtv)
}
case "TokenId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.TokenId = ptr.String(jtv)
}
case "TokenProperties":
if err := awsAwsjson11_deserializeDocumentMaxSize3StringList(&sv.TokenProperties, value); err != nil {
return err
}
case "TokenType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.TokenType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTokenList(v *[]types.TokenData, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.TokenData
if *v == nil {
cv = []types.TokenData{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TokenData
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTokenData(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentUnsupportedDigitalSignatureMethodException(v **types.UnsupportedDigitalSignatureMethodException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.UnsupportedDigitalSignatureMethodException
if *v == nil {
sv = &types.UnsupportedDigitalSignatureMethodException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationException
if *v == nil {
sv = &types.ValidationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Message to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAcceptGrantOutput(v **AcceptGrantOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AcceptGrantOutput
if *v == nil {
sv = &AcceptGrantOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "GrantArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.GrantArn = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GrantStatus to be of type string, got %T instead", value)
}
sv.Status = types.GrantStatus(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCheckInLicenseOutput(v **CheckInLicenseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CheckInLicenseOutput
if *v == nil {
sv = &CheckInLicenseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCheckoutBorrowLicenseOutput(v **CheckoutBorrowLicenseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CheckoutBorrowLicenseOutput
if *v == nil {
sv = &CheckoutBorrowLicenseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CheckoutMetadata":
if err := awsAwsjson11_deserializeDocumentMetadataList(&sv.CheckoutMetadata, value); err != nil {
return err
}
case "EntitlementsAllowed":
if err := awsAwsjson11_deserializeDocumentEntitlementDataList(&sv.EntitlementsAllowed, value); err != nil {
return err
}
case "Expiration":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.Expiration = ptr.String(jtv)
}
case "IssuedAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.IssuedAt = ptr.String(jtv)
}
case "LicenseArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.LicenseArn = ptr.String(jtv)
}
case "LicenseConsumptionToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseConsumptionToken = ptr.String(jtv)
}
case "NodeId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NodeId = ptr.String(jtv)
}
case "SignedToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SignedToken to be of type string, got %T instead", value)
}
sv.SignedToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCheckoutLicenseOutput(v **CheckoutLicenseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CheckoutLicenseOutput
if *v == nil {
sv = &CheckoutLicenseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CheckoutType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CheckoutType to be of type string, got %T instead", value)
}
sv.CheckoutType = types.CheckoutType(jtv)
}
case "EntitlementsAllowed":
if err := awsAwsjson11_deserializeDocumentEntitlementDataList(&sv.EntitlementsAllowed, value); err != nil {
return err
}
case "Expiration":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.Expiration = ptr.String(jtv)
}
case "IssuedAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.IssuedAt = ptr.String(jtv)
}
case "LicenseArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseArn = ptr.String(jtv)
}
case "LicenseConsumptionToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseConsumptionToken = ptr.String(jtv)
}
case "NodeId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NodeId = ptr.String(jtv)
}
case "SignedToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SignedToken to be of type string, got %T instead", value)
}
sv.SignedToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateGrantOutput(v **CreateGrantOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateGrantOutput
if *v == nil {
sv = &CreateGrantOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "GrantArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.GrantArn = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GrantStatus to be of type string, got %T instead", value)
}
sv.Status = types.GrantStatus(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateGrantVersionOutput(v **CreateGrantVersionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateGrantVersionOutput
if *v == nil {
sv = &CreateGrantVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "GrantArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.GrantArn = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GrantStatus to be of type string, got %T instead", value)
}
sv.Status = types.GrantStatus(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateLicenseConfigurationOutput(v **CreateLicenseConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateLicenseConfigurationOutput
if *v == nil {
sv = &CreateLicenseConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseConfigurationArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateLicenseConversionTaskForResourceOutput(v **CreateLicenseConversionTaskForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateLicenseConversionTaskForResourceOutput
if *v == nil {
sv = &CreateLicenseConversionTaskForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseConversionTaskId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseConversionTaskId to be of type string, got %T instead", value)
}
sv.LicenseConversionTaskId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateLicenseManagerReportGeneratorOutput(v **CreateLicenseManagerReportGeneratorOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateLicenseManagerReportGeneratorOutput
if *v == nil {
sv = &CreateLicenseManagerReportGeneratorOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseManagerReportGeneratorArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseManagerReportGeneratorArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateLicenseOutput(v **CreateLicenseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateLicenseOutput
if *v == nil {
sv = &CreateLicenseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.LicenseArn = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseStatus to be of type string, got %T instead", value)
}
sv.Status = types.LicenseStatus(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateLicenseVersionOutput(v **CreateLicenseVersionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateLicenseVersionOutput
if *v == nil {
sv = &CreateLicenseVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.LicenseArn = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseStatus to be of type string, got %T instead", value)
}
sv.Status = types.LicenseStatus(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateTokenOutput(v **CreateTokenOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateTokenOutput
if *v == nil {
sv = &CreateTokenOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Token":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TokenString to be of type string, got %T instead", value)
}
sv.Token = ptr.String(jtv)
}
case "TokenId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.TokenId = ptr.String(jtv)
}
case "TokenType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TokenType to be of type string, got %T instead", value)
}
sv.TokenType = types.TokenType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteGrantOutput(v **DeleteGrantOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteGrantOutput
if *v == nil {
sv = &DeleteGrantOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "GrantArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.GrantArn = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GrantStatus to be of type string, got %T instead", value)
}
sv.Status = types.GrantStatus(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteLicenseConfigurationOutput(v **DeleteLicenseConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteLicenseConfigurationOutput
if *v == nil {
sv = &DeleteLicenseConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteLicenseManagerReportGeneratorOutput(v **DeleteLicenseManagerReportGeneratorOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteLicenseManagerReportGeneratorOutput
if *v == nil {
sv = &DeleteLicenseManagerReportGeneratorOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteLicenseOutput(v **DeleteLicenseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteLicenseOutput
if *v == nil {
sv = &DeleteLicenseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeletionDate":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.DeletionDate = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseDeletionStatus to be of type string, got %T instead", value)
}
sv.Status = types.LicenseDeletionStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteTokenOutput(v **DeleteTokenOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteTokenOutput
if *v == nil {
sv = &DeleteTokenOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentExtendLicenseConsumptionOutput(v **ExtendLicenseConsumptionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ExtendLicenseConsumptionOutput
if *v == nil {
sv = &ExtendLicenseConsumptionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Expiration":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ISO8601DateTime to be of type string, got %T instead", value)
}
sv.Expiration = ptr.String(jtv)
}
case "LicenseConsumptionToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseConsumptionToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetAccessTokenOutput(v **GetAccessTokenOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetAccessTokenOutput
if *v == nil {
sv = &GetAccessTokenOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AccessToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TokenString to be of type string, got %T instead", value)
}
sv.AccessToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetGrantOutput(v **GetGrantOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetGrantOutput
if *v == nil {
sv = &GetGrantOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Grant":
if err := awsAwsjson11_deserializeDocumentGrant(&sv.Grant, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetLicenseConfigurationOutput(v **GetLicenseConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetLicenseConfigurationOutput
if *v == nil {
sv = &GetLicenseConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AutomatedDiscoveryInformation":
if err := awsAwsjson11_deserializeDocumentAutomatedDiscoveryInformation(&sv.AutomatedDiscoveryInformation, value); err != nil {
return err
}
case "ConsumedLicenses":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BoxLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ConsumedLicenses = ptr.Int64(i64)
}
case "ConsumedLicenseSummaryList":
if err := awsAwsjson11_deserializeDocumentConsumedLicenseSummaryList(&sv.ConsumedLicenseSummaryList, value); err != nil {
return err
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "DisassociateWhenNotFound":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BoxBoolean to be of type *bool, got %T instead", value)
}
sv.DisassociateWhenNotFound = ptr.Bool(jtv)
}
case "LicenseConfigurationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseConfigurationArn = ptr.String(jtv)
}
case "LicenseConfigurationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseConfigurationId = ptr.String(jtv)
}
case "LicenseCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BoxLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LicenseCount = ptr.Int64(i64)
}
case "LicenseCountHardLimit":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BoxBoolean to be of type *bool, got %T instead", value)
}
sv.LicenseCountHardLimit = ptr.Bool(jtv)
}
case "LicenseCountingType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseCountingType to be of type string, got %T instead", value)
}
sv.LicenseCountingType = types.LicenseCountingType(jtv)
}
case "LicenseRules":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.LicenseRules, value); err != nil {
return err
}
case "ManagedResourceSummaryList":
if err := awsAwsjson11_deserializeDocumentManagedResourceSummaryList(&sv.ManagedResourceSummaryList, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "OwnerAccountId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.OwnerAccountId = ptr.String(jtv)
}
case "ProductInformationList":
if err := awsAwsjson11_deserializeDocumentProductInformationList(&sv.ProductInformationList, value); err != nil {
return err
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Status = ptr.String(jtv)
}
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetLicenseConversionTaskOutput(v **GetLicenseConversionTaskOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetLicenseConversionTaskOutput
if *v == nil {
sv = &GetLicenseConversionTaskOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DestinationLicenseContext":
if err := awsAwsjson11_deserializeDocumentLicenseConversionContext(&sv.DestinationLicenseContext, value); err != nil {
return err
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "LicenseConversionTaskId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseConversionTaskId to be of type string, got %T instead", value)
}
sv.LicenseConversionTaskId = ptr.String(jtv)
}
case "LicenseConversionTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LicenseConversionTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "SourceLicenseContext":
if err := awsAwsjson11_deserializeDocumentLicenseConversionContext(&sv.SourceLicenseContext, value); err != nil {
return err
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value)
}
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LicenseConversionTaskStatus to be of type string, got %T instead", value)
}
sv.Status = types.LicenseConversionTaskStatus(jtv)
}
case "StatusMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.StatusMessage = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetLicenseManagerReportGeneratorOutput(v **GetLicenseManagerReportGeneratorOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetLicenseManagerReportGeneratorOutput
if *v == nil {
sv = &GetLicenseManagerReportGeneratorOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ReportGenerator":
if err := awsAwsjson11_deserializeDocumentReportGenerator(&sv.ReportGenerator, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetLicenseOutput(v **GetLicenseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetLicenseOutput
if *v == nil {
sv = &GetLicenseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "License":
if err := awsAwsjson11_deserializeDocumentLicense(&sv.License, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetLicenseUsageOutput(v **GetLicenseUsageOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetLicenseUsageOutput
if *v == nil {
sv = &GetLicenseUsageOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseUsage":
if err := awsAwsjson11_deserializeDocumentLicenseUsage(&sv.LicenseUsage, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetServiceSettingsOutput(v **GetServiceSettingsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetServiceSettingsOutput
if *v == nil {
sv = &GetServiceSettingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EnableCrossAccountsDiscovery":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BoxBoolean to be of type *bool, got %T instead", value)
}
sv.EnableCrossAccountsDiscovery = ptr.Bool(jtv)
}
case "LicenseManagerResourceShareArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LicenseManagerResourceShareArn = ptr.String(jtv)
}
case "OrganizationConfiguration":
if err := awsAwsjson11_deserializeDocumentOrganizationConfiguration(&sv.OrganizationConfiguration, value); err != nil {
return err
}
case "S3BucketArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.S3BucketArn = ptr.String(jtv)
}
case "SnsTopicArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SnsTopicArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListAssociationsForLicenseConfigurationOutput(v **ListAssociationsForLicenseConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAssociationsForLicenseConfigurationOutput
if *v == nil {
sv = &ListAssociationsForLicenseConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseConfigurationAssociations":
if err := awsAwsjson11_deserializeDocumentLicenseConfigurationAssociations(&sv.LicenseConfigurationAssociations, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListDistributedGrantsOutput(v **ListDistributedGrantsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListDistributedGrantsOutput
if *v == nil {
sv = &ListDistributedGrantsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Grants":
if err := awsAwsjson11_deserializeDocumentGrantList(&sv.Grants, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListFailuresForLicenseConfigurationOperationsOutput(v **ListFailuresForLicenseConfigurationOperationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListFailuresForLicenseConfigurationOperationsOutput
if *v == nil {
sv = &ListFailuresForLicenseConfigurationOperationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseOperationFailureList":
if err := awsAwsjson11_deserializeDocumentLicenseOperationFailureList(&sv.LicenseOperationFailureList, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListLicenseConfigurationsOutput(v **ListLicenseConfigurationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListLicenseConfigurationsOutput
if *v == nil {
sv = &ListLicenseConfigurationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseConfigurations":
if err := awsAwsjson11_deserializeDocumentLicenseConfigurations(&sv.LicenseConfigurations, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListLicenseConversionTasksOutput(v **ListLicenseConversionTasksOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListLicenseConversionTasksOutput
if *v == nil {
sv = &ListLicenseConversionTasksOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseConversionTasks":
if err := awsAwsjson11_deserializeDocumentLicenseConversionTasks(&sv.LicenseConversionTasks, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListLicenseManagerReportGeneratorsOutput(v **ListLicenseManagerReportGeneratorsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListLicenseManagerReportGeneratorsOutput
if *v == nil {
sv = &ListLicenseManagerReportGeneratorsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "ReportGenerators":
if err := awsAwsjson11_deserializeDocumentReportGeneratorList(&sv.ReportGenerators, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListLicensesOutput(v **ListLicensesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListLicensesOutput
if *v == nil {
sv = &ListLicensesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Licenses":
if err := awsAwsjson11_deserializeDocumentLicenseList(&sv.Licenses, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListLicenseSpecificationsForResourceOutput(v **ListLicenseSpecificationsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListLicenseSpecificationsForResourceOutput
if *v == nil {
sv = &ListLicenseSpecificationsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseSpecifications":
if err := awsAwsjson11_deserializeDocumentLicenseSpecifications(&sv.LicenseSpecifications, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListLicenseVersionsOutput(v **ListLicenseVersionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListLicenseVersionsOutput
if *v == nil {
sv = &ListLicenseVersionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Licenses":
if err := awsAwsjson11_deserializeDocumentLicenseList(&sv.Licenses, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListReceivedGrantsForOrganizationOutput(v **ListReceivedGrantsForOrganizationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListReceivedGrantsForOrganizationOutput
if *v == nil {
sv = &ListReceivedGrantsForOrganizationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Grants":
if err := awsAwsjson11_deserializeDocumentGrantList(&sv.Grants, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListReceivedGrantsOutput(v **ListReceivedGrantsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListReceivedGrantsOutput
if *v == nil {
sv = &ListReceivedGrantsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Grants":
if err := awsAwsjson11_deserializeDocumentGrantList(&sv.Grants, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListReceivedLicensesForOrganizationOutput(v **ListReceivedLicensesForOrganizationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListReceivedLicensesForOrganizationOutput
if *v == nil {
sv = &ListReceivedLicensesForOrganizationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Licenses":
if err := awsAwsjson11_deserializeDocumentGrantedLicenseList(&sv.Licenses, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListReceivedLicensesOutput(v **ListReceivedLicensesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListReceivedLicensesOutput
if *v == nil {
sv = &ListReceivedLicensesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Licenses":
if err := awsAwsjson11_deserializeDocumentGrantedLicenseList(&sv.Licenses, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListResourceInventoryOutput(v **ListResourceInventoryOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListResourceInventoryOutput
if *v == nil {
sv = &ListResourceInventoryOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "ResourceInventoryList":
if err := awsAwsjson11_deserializeDocumentResourceInventoryList(&sv.ResourceInventoryList, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTokensOutput(v **ListTokensOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTokensOutput
if *v == nil {
sv = &ListTokensOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "Tokens":
if err := awsAwsjson11_deserializeDocumentTokenList(&sv.Tokens, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListUsageForLicenseConfigurationOutput(v **ListUsageForLicenseConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListUsageForLicenseConfigurationOutput
if *v == nil {
sv = &ListUsageForLicenseConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LicenseConfigurationUsageList":
if err := awsAwsjson11_deserializeDocumentLicenseConfigurationUsageList(&sv.LicenseConfigurationUsageList, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentRejectGrantOutput(v **RejectGrantOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RejectGrantOutput
if *v == nil {
sv = &RejectGrantOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "GrantArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.GrantArn = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GrantStatus to be of type string, got %T instead", value)
}
sv.Status = types.GrantStatus(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TagResourceOutput
if *v == nil {
sv = &TagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UntagResourceOutput
if *v == nil {
sv = &UntagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateLicenseConfigurationOutput(v **UpdateLicenseConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateLicenseConfigurationOutput
if *v == nil {
sv = &UpdateLicenseConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateLicenseManagerReportGeneratorOutput(v **UpdateLicenseManagerReportGeneratorOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateLicenseManagerReportGeneratorOutput
if *v == nil {
sv = &UpdateLicenseManagerReportGeneratorOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateLicenseSpecificationsForResourceOutput(v **UpdateLicenseSpecificationsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateLicenseSpecificationsForResourceOutput
if *v == nil {
sv = &UpdateLicenseSpecificationsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateServiceSettingsOutput(v **UpdateServiceSettingsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateServiceSettingsOutput
if *v == nil {
sv = &UpdateServiceSettingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 13,571 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package licensemanager provides the API client, operations, and parameter types
// for AWS License Manager.
//
// License Manager makes it easier to manage licenses from software vendors across
// multiple Amazon Web Services accounts and on-premises servers.
package licensemanager
| 9 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/licensemanager/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "license-manager"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package licensemanager
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.18.6"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/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"
"path"
)
type awsAwsjson11_serializeOpAcceptGrant struct {
}
func (*awsAwsjson11_serializeOpAcceptGrant) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAcceptGrant) 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.(*AcceptGrantInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.AcceptGrant")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAcceptGrantInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCheckInLicense struct {
}
func (*awsAwsjson11_serializeOpCheckInLicense) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCheckInLicense) 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.(*CheckInLicenseInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CheckInLicense")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCheckInLicenseInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCheckoutBorrowLicense struct {
}
func (*awsAwsjson11_serializeOpCheckoutBorrowLicense) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCheckoutBorrowLicense) 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.(*CheckoutBorrowLicenseInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CheckoutBorrowLicense")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCheckoutBorrowLicenseInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCheckoutLicense struct {
}
func (*awsAwsjson11_serializeOpCheckoutLicense) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCheckoutLicense) 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.(*CheckoutLicenseInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CheckoutLicense")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCheckoutLicenseInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateGrant struct {
}
func (*awsAwsjson11_serializeOpCreateGrant) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateGrant) 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.(*CreateGrantInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CreateGrant")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateGrantInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateGrantVersion struct {
}
func (*awsAwsjson11_serializeOpCreateGrantVersion) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateGrantVersion) 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.(*CreateGrantVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CreateGrantVersion")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateGrantVersionInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateLicense struct {
}
func (*awsAwsjson11_serializeOpCreateLicense) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateLicense) 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.(*CreateLicenseInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CreateLicense")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateLicenseInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateLicenseConfiguration struct {
}
func (*awsAwsjson11_serializeOpCreateLicenseConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateLicenseConfiguration) 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.(*CreateLicenseConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CreateLicenseConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateLicenseConfigurationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateLicenseConversionTaskForResource struct {
}
func (*awsAwsjson11_serializeOpCreateLicenseConversionTaskForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateLicenseConversionTaskForResource) 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.(*CreateLicenseConversionTaskForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CreateLicenseConversionTaskForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateLicenseConversionTaskForResourceInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateLicenseManagerReportGenerator struct {
}
func (*awsAwsjson11_serializeOpCreateLicenseManagerReportGenerator) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateLicenseManagerReportGenerator) 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.(*CreateLicenseManagerReportGeneratorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CreateLicenseManagerReportGenerator")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateLicenseManagerReportGeneratorInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateLicenseVersion struct {
}
func (*awsAwsjson11_serializeOpCreateLicenseVersion) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateLicenseVersion) 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.(*CreateLicenseVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CreateLicenseVersion")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateLicenseVersionInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateToken struct {
}
func (*awsAwsjson11_serializeOpCreateToken) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateToken) 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.(*CreateTokenInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.CreateToken")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateTokenInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteGrant struct {
}
func (*awsAwsjson11_serializeOpDeleteGrant) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteGrant) 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.(*DeleteGrantInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.DeleteGrant")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteGrantInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteLicense struct {
}
func (*awsAwsjson11_serializeOpDeleteLicense) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteLicense) 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.(*DeleteLicenseInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.DeleteLicense")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteLicenseInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteLicenseConfiguration struct {
}
func (*awsAwsjson11_serializeOpDeleteLicenseConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteLicenseConfiguration) 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.(*DeleteLicenseConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.DeleteLicenseConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteLicenseConfigurationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteLicenseManagerReportGenerator struct {
}
func (*awsAwsjson11_serializeOpDeleteLicenseManagerReportGenerator) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteLicenseManagerReportGenerator) 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.(*DeleteLicenseManagerReportGeneratorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.DeleteLicenseManagerReportGenerator")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteLicenseManagerReportGeneratorInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteToken struct {
}
func (*awsAwsjson11_serializeOpDeleteToken) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteToken) 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.(*DeleteTokenInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.DeleteToken")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteTokenInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpExtendLicenseConsumption struct {
}
func (*awsAwsjson11_serializeOpExtendLicenseConsumption) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpExtendLicenseConsumption) 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.(*ExtendLicenseConsumptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ExtendLicenseConsumption")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentExtendLicenseConsumptionInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetAccessToken struct {
}
func (*awsAwsjson11_serializeOpGetAccessToken) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetAccessToken) 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.(*GetAccessTokenInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.GetAccessToken")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetAccessTokenInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetGrant struct {
}
func (*awsAwsjson11_serializeOpGetGrant) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetGrant) 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.(*GetGrantInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.GetGrant")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetGrantInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetLicense struct {
}
func (*awsAwsjson11_serializeOpGetLicense) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLicense) 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.(*GetLicenseInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.GetLicense")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLicenseInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetLicenseConfiguration struct {
}
func (*awsAwsjson11_serializeOpGetLicenseConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLicenseConfiguration) 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.(*GetLicenseConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.GetLicenseConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLicenseConfigurationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetLicenseConversionTask struct {
}
func (*awsAwsjson11_serializeOpGetLicenseConversionTask) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLicenseConversionTask) 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.(*GetLicenseConversionTaskInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.GetLicenseConversionTask")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLicenseConversionTaskInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetLicenseManagerReportGenerator struct {
}
func (*awsAwsjson11_serializeOpGetLicenseManagerReportGenerator) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLicenseManagerReportGenerator) 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.(*GetLicenseManagerReportGeneratorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.GetLicenseManagerReportGenerator")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLicenseManagerReportGeneratorInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetLicenseUsage struct {
}
func (*awsAwsjson11_serializeOpGetLicenseUsage) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLicenseUsage) 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.(*GetLicenseUsageInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.GetLicenseUsage")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLicenseUsageInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetServiceSettings struct {
}
func (*awsAwsjson11_serializeOpGetServiceSettings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetServiceSettings) 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.(*GetServiceSettingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.GetServiceSettings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetServiceSettingsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListAssociationsForLicenseConfiguration struct {
}
func (*awsAwsjson11_serializeOpListAssociationsForLicenseConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListAssociationsForLicenseConfiguration) 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.(*ListAssociationsForLicenseConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListAssociationsForLicenseConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListAssociationsForLicenseConfigurationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListDistributedGrants struct {
}
func (*awsAwsjson11_serializeOpListDistributedGrants) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListDistributedGrants) 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.(*ListDistributedGrantsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListDistributedGrants")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListDistributedGrantsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListFailuresForLicenseConfigurationOperations struct {
}
func (*awsAwsjson11_serializeOpListFailuresForLicenseConfigurationOperations) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListFailuresForLicenseConfigurationOperations) 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.(*ListFailuresForLicenseConfigurationOperationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListFailuresForLicenseConfigurationOperations")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListFailuresForLicenseConfigurationOperationsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListLicenseConfigurations struct {
}
func (*awsAwsjson11_serializeOpListLicenseConfigurations) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListLicenseConfigurations) 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.(*ListLicenseConfigurationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListLicenseConfigurations")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListLicenseConfigurationsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListLicenseConversionTasks struct {
}
func (*awsAwsjson11_serializeOpListLicenseConversionTasks) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListLicenseConversionTasks) 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.(*ListLicenseConversionTasksInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListLicenseConversionTasks")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListLicenseConversionTasksInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListLicenseManagerReportGenerators struct {
}
func (*awsAwsjson11_serializeOpListLicenseManagerReportGenerators) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListLicenseManagerReportGenerators) 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.(*ListLicenseManagerReportGeneratorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListLicenseManagerReportGenerators")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListLicenseManagerReportGeneratorsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListLicenses struct {
}
func (*awsAwsjson11_serializeOpListLicenses) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListLicenses) 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.(*ListLicensesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListLicenses")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListLicensesInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListLicenseSpecificationsForResource struct {
}
func (*awsAwsjson11_serializeOpListLicenseSpecificationsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListLicenseSpecificationsForResource) 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.(*ListLicenseSpecificationsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListLicenseSpecificationsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListLicenseSpecificationsForResourceInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListLicenseVersions struct {
}
func (*awsAwsjson11_serializeOpListLicenseVersions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListLicenseVersions) 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.(*ListLicenseVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListLicenseVersions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListLicenseVersionsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListReceivedGrants struct {
}
func (*awsAwsjson11_serializeOpListReceivedGrants) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListReceivedGrants) 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.(*ListReceivedGrantsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListReceivedGrants")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListReceivedGrantsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListReceivedGrantsForOrganization struct {
}
func (*awsAwsjson11_serializeOpListReceivedGrantsForOrganization) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListReceivedGrantsForOrganization) 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.(*ListReceivedGrantsForOrganizationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListReceivedGrantsForOrganization")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListReceivedGrantsForOrganizationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListReceivedLicenses struct {
}
func (*awsAwsjson11_serializeOpListReceivedLicenses) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListReceivedLicenses) 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.(*ListReceivedLicensesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListReceivedLicenses")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListReceivedLicensesInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListReceivedLicensesForOrganization struct {
}
func (*awsAwsjson11_serializeOpListReceivedLicensesForOrganization) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListReceivedLicensesForOrganization) 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.(*ListReceivedLicensesForOrganizationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListReceivedLicensesForOrganization")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListReceivedLicensesForOrganizationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListResourceInventory struct {
}
func (*awsAwsjson11_serializeOpListResourceInventory) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListResourceInventory) 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.(*ListResourceInventoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListResourceInventory")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListResourceInventoryInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForResource struct {
}
func (*awsAwsjson11_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForResource) 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.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTokens struct {
}
func (*awsAwsjson11_serializeOpListTokens) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTokens) 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.(*ListTokensInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListTokens")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTokensInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListUsageForLicenseConfiguration struct {
}
func (*awsAwsjson11_serializeOpListUsageForLicenseConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListUsageForLicenseConfiguration) 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.(*ListUsageForLicenseConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.ListUsageForLicenseConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListUsageForLicenseConfigurationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpRejectGrant struct {
}
func (*awsAwsjson11_serializeOpRejectGrant) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRejectGrant) 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.(*RejectGrantInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.RejectGrant")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRejectGrantInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpTagResource struct {
}
func (*awsAwsjson11_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_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)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.TagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUntagResource struct {
}
func (*awsAwsjson11_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_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)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.UntagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateLicenseConfiguration struct {
}
func (*awsAwsjson11_serializeOpUpdateLicenseConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateLicenseConfiguration) 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.(*UpdateLicenseConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.UpdateLicenseConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateLicenseConfigurationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateLicenseManagerReportGenerator struct {
}
func (*awsAwsjson11_serializeOpUpdateLicenseManagerReportGenerator) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateLicenseManagerReportGenerator) 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.(*UpdateLicenseManagerReportGeneratorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.UpdateLicenseManagerReportGenerator")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateLicenseManagerReportGeneratorInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateLicenseSpecificationsForResource struct {
}
func (*awsAwsjson11_serializeOpUpdateLicenseSpecificationsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateLicenseSpecificationsForResource) 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.(*UpdateLicenseSpecificationsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.UpdateLicenseSpecificationsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateLicenseSpecificationsForResourceInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateServiceSettings struct {
}
func (*awsAwsjson11_serializeOpUpdateServiceSettings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateServiceSettings) 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.(*UpdateServiceSettingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLicenseManager.UpdateServiceSettings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateServiceSettingsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsAwsjson11_serializeDocumentAllowedOperationList(v []types.AllowedOperation, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentArnList(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 awsAwsjson11_serializeDocumentBorrowConfiguration(v *types.BorrowConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowEarlyCheckIn != nil {
ok := object.Key("AllowEarlyCheckIn")
ok.Boolean(*v.AllowEarlyCheckIn)
}
if v.MaxTimeToLiveInMinutes != nil {
ok := object.Key("MaxTimeToLiveInMinutes")
ok.Integer(*v.MaxTimeToLiveInMinutes)
}
return nil
}
func awsAwsjson11_serializeDocumentConsumptionConfiguration(v *types.ConsumptionConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BorrowConfiguration != nil {
ok := object.Key("BorrowConfiguration")
if err := awsAwsjson11_serializeDocumentBorrowConfiguration(v.BorrowConfiguration, ok); err != nil {
return err
}
}
if v.ProvisionalConfiguration != nil {
ok := object.Key("ProvisionalConfiguration")
if err := awsAwsjson11_serializeDocumentProvisionalConfiguration(v.ProvisionalConfiguration, ok); err != nil {
return err
}
}
if len(v.RenewType) > 0 {
ok := object.Key("RenewType")
ok.String(string(v.RenewType))
}
return nil
}
func awsAwsjson11_serializeDocumentDatetimeRange(v *types.DatetimeRange, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Begin != nil {
ok := object.Key("Begin")
ok.String(*v.Begin)
}
if v.End != nil {
ok := object.Key("End")
ok.String(*v.End)
}
return nil
}
func awsAwsjson11_serializeDocumentEntitlement(v *types.Entitlement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowCheckIn != nil {
ok := object.Key("AllowCheckIn")
ok.Boolean(*v.AllowCheckIn)
}
if v.MaxCount != nil {
ok := object.Key("MaxCount")
ok.Long(*v.MaxCount)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Overage != nil {
ok := object.Key("Overage")
ok.Boolean(*v.Overage)
}
if len(v.Unit) > 0 {
ok := object.Key("Unit")
ok.String(string(v.Unit))
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentEntitlementData(v *types.EntitlementData, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Unit) > 0 {
ok := object.Key("Unit")
ok.String(string(v.Unit))
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentEntitlementDataList(v []types.EntitlementData, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentEntitlementData(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentEntitlementList(v []types.Entitlement, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentEntitlement(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Values != nil {
ok := object.Key("Values")
if err := awsAwsjson11_serializeDocumentFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFilterList(v []types.Filter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFilters(v []types.Filter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFilterValues(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 awsAwsjson11_serializeDocumentInventoryFilter(v *types.InventoryFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Condition) > 0 {
ok := object.Key("Condition")
ok.String(string(v.Condition))
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentInventoryFilterList(v []types.InventoryFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentInventoryFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentIssuer(v *types.Issuer, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.SignKey != nil {
ok := object.Key("SignKey")
ok.String(*v.SignKey)
}
return nil
}
func awsAwsjson11_serializeDocumentLicenseConversionContext(v *types.LicenseConversionContext, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.UsageOperation != nil {
ok := object.Key("UsageOperation")
ok.String(*v.UsageOperation)
}
return nil
}
func awsAwsjson11_serializeDocumentLicenseSpecification(v *types.LicenseSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AmiAssociationScope != nil {
ok := object.Key("AmiAssociationScope")
ok.String(*v.AmiAssociationScope)
}
if v.LicenseConfigurationArn != nil {
ok := object.Key("LicenseConfigurationArn")
ok.String(*v.LicenseConfigurationArn)
}
return nil
}
func awsAwsjson11_serializeDocumentLicenseSpecifications(v []types.LicenseSpecification, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentLicenseSpecification(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentMaxSize3StringList(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 awsAwsjson11_serializeDocumentMetadata(v *types.Metadata, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentMetadataList(v []types.Metadata, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentMetadata(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentOptions(v *types.Options, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ActivationOverrideBehavior) > 0 {
ok := object.Key("ActivationOverrideBehavior")
ok.String(string(v.ActivationOverrideBehavior))
}
return nil
}
func awsAwsjson11_serializeDocumentOrganizationConfiguration(v *types.OrganizationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("EnableIntegration")
ok.Boolean(v.EnableIntegration)
}
return nil
}
func awsAwsjson11_serializeDocumentPrincipalArnList(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 awsAwsjson11_serializeDocumentProductInformation(v *types.ProductInformation, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProductInformationFilterList != nil {
ok := object.Key("ProductInformationFilterList")
if err := awsAwsjson11_serializeDocumentProductInformationFilterList(v.ProductInformationFilterList, ok); err != nil {
return err
}
}
if v.ResourceType != nil {
ok := object.Key("ResourceType")
ok.String(*v.ResourceType)
}
return nil
}
func awsAwsjson11_serializeDocumentProductInformationFilter(v *types.ProductInformationFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProductInformationFilterComparator != nil {
ok := object.Key("ProductInformationFilterComparator")
ok.String(*v.ProductInformationFilterComparator)
}
if v.ProductInformationFilterName != nil {
ok := object.Key("ProductInformationFilterName")
ok.String(*v.ProductInformationFilterName)
}
if v.ProductInformationFilterValue != nil {
ok := object.Key("ProductInformationFilterValue")
if err := awsAwsjson11_serializeDocumentStringList(v.ProductInformationFilterValue, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentProductInformationFilterList(v []types.ProductInformationFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentProductInformationFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentProductInformationList(v []types.ProductInformation, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentProductInformation(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentProvisionalConfiguration(v *types.ProvisionalConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxTimeToLiveInMinutes != nil {
ok := object.Key("MaxTimeToLiveInMinutes")
ok.Integer(*v.MaxTimeToLiveInMinutes)
}
return nil
}
func awsAwsjson11_serializeDocumentReportContext(v *types.ReportContext, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseConfigurationArns != nil {
ok := object.Key("licenseConfigurationArns")
if err := awsAwsjson11_serializeDocumentArnList(v.LicenseConfigurationArns, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentReportFrequency(v *types.ReportFrequency, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Period) > 0 {
ok := object.Key("period")
ok.String(string(v.Period))
}
if v.Value != nil {
ok := object.Key("value")
ok.Integer(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentReportTypeList(v []types.ReportType, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentStringList(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 awsAwsjson11_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 awsAwsjson11_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 awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAcceptGrantInput(v *AcceptGrantInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GrantArn != nil {
ok := object.Key("GrantArn")
ok.String(*v.GrantArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCheckInLicenseInput(v *CheckInLicenseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Beneficiary != nil {
ok := object.Key("Beneficiary")
ok.String(*v.Beneficiary)
}
if v.LicenseConsumptionToken != nil {
ok := object.Key("LicenseConsumptionToken")
ok.String(*v.LicenseConsumptionToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCheckoutBorrowLicenseInput(v *CheckoutBorrowLicenseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CheckoutMetadata != nil {
ok := object.Key("CheckoutMetadata")
if err := awsAwsjson11_serializeDocumentMetadataList(v.CheckoutMetadata, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if len(v.DigitalSignatureMethod) > 0 {
ok := object.Key("DigitalSignatureMethod")
ok.String(string(v.DigitalSignatureMethod))
}
if v.Entitlements != nil {
ok := object.Key("Entitlements")
if err := awsAwsjson11_serializeDocumentEntitlementDataList(v.Entitlements, ok); err != nil {
return err
}
}
if v.LicenseArn != nil {
ok := object.Key("LicenseArn")
ok.String(*v.LicenseArn)
}
if v.NodeId != nil {
ok := object.Key("NodeId")
ok.String(*v.NodeId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCheckoutLicenseInput(v *CheckoutLicenseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Beneficiary != nil {
ok := object.Key("Beneficiary")
ok.String(*v.Beneficiary)
}
if len(v.CheckoutType) > 0 {
ok := object.Key("CheckoutType")
ok.String(string(v.CheckoutType))
}
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.Entitlements != nil {
ok := object.Key("Entitlements")
if err := awsAwsjson11_serializeDocumentEntitlementDataList(v.Entitlements, ok); err != nil {
return err
}
}
if v.KeyFingerprint != nil {
ok := object.Key("KeyFingerprint")
ok.String(*v.KeyFingerprint)
}
if v.NodeId != nil {
ok := object.Key("NodeId")
ok.String(*v.NodeId)
}
if v.ProductSKU != nil {
ok := object.Key("ProductSKU")
ok.String(*v.ProductSKU)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateGrantInput(v *CreateGrantInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowedOperations != nil {
ok := object.Key("AllowedOperations")
if err := awsAwsjson11_serializeDocumentAllowedOperationList(v.AllowedOperations, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.GrantName != nil {
ok := object.Key("GrantName")
ok.String(*v.GrantName)
}
if v.HomeRegion != nil {
ok := object.Key("HomeRegion")
ok.String(*v.HomeRegion)
}
if v.LicenseArn != nil {
ok := object.Key("LicenseArn")
ok.String(*v.LicenseArn)
}
if v.Principals != nil {
ok := object.Key("Principals")
if err := awsAwsjson11_serializeDocumentPrincipalArnList(v.Principals, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateGrantVersionInput(v *CreateGrantVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowedOperations != nil {
ok := object.Key("AllowedOperations")
if err := awsAwsjson11_serializeDocumentAllowedOperationList(v.AllowedOperations, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.GrantArn != nil {
ok := object.Key("GrantArn")
ok.String(*v.GrantArn)
}
if v.GrantName != nil {
ok := object.Key("GrantName")
ok.String(*v.GrantName)
}
if v.Options != nil {
ok := object.Key("Options")
if err := awsAwsjson11_serializeDocumentOptions(v.Options, ok); err != nil {
return err
}
}
if v.SourceVersion != nil {
ok := object.Key("SourceVersion")
ok.String(*v.SourceVersion)
}
if len(v.Status) > 0 {
ok := object.Key("Status")
ok.String(string(v.Status))
}
if v.StatusReason != nil {
ok := object.Key("StatusReason")
ok.String(*v.StatusReason)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateLicenseConfigurationInput(v *CreateLicenseConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.DisassociateWhenNotFound != nil {
ok := object.Key("DisassociateWhenNotFound")
ok.Boolean(*v.DisassociateWhenNotFound)
}
if v.LicenseCount != nil {
ok := object.Key("LicenseCount")
ok.Long(*v.LicenseCount)
}
if v.LicenseCountHardLimit != nil {
ok := object.Key("LicenseCountHardLimit")
ok.Boolean(*v.LicenseCountHardLimit)
}
if len(v.LicenseCountingType) > 0 {
ok := object.Key("LicenseCountingType")
ok.String(string(v.LicenseCountingType))
}
if v.LicenseRules != nil {
ok := object.Key("LicenseRules")
if err := awsAwsjson11_serializeDocumentStringList(v.LicenseRules, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.ProductInformationList != nil {
ok := object.Key("ProductInformationList")
if err := awsAwsjson11_serializeDocumentProductInformationList(v.ProductInformationList, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateLicenseConversionTaskForResourceInput(v *CreateLicenseConversionTaskForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DestinationLicenseContext != nil {
ok := object.Key("DestinationLicenseContext")
if err := awsAwsjson11_serializeDocumentLicenseConversionContext(v.DestinationLicenseContext, ok); err != nil {
return err
}
}
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
if v.SourceLicenseContext != nil {
ok := object.Key("SourceLicenseContext")
if err := awsAwsjson11_serializeDocumentLicenseConversionContext(v.SourceLicenseContext, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateLicenseInput(v *CreateLicenseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Beneficiary != nil {
ok := object.Key("Beneficiary")
ok.String(*v.Beneficiary)
}
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.ConsumptionConfiguration != nil {
ok := object.Key("ConsumptionConfiguration")
if err := awsAwsjson11_serializeDocumentConsumptionConfiguration(v.ConsumptionConfiguration, ok); err != nil {
return err
}
}
if v.Entitlements != nil {
ok := object.Key("Entitlements")
if err := awsAwsjson11_serializeDocumentEntitlementList(v.Entitlements, ok); err != nil {
return err
}
}
if v.HomeRegion != nil {
ok := object.Key("HomeRegion")
ok.String(*v.HomeRegion)
}
if v.Issuer != nil {
ok := object.Key("Issuer")
if err := awsAwsjson11_serializeDocumentIssuer(v.Issuer, ok); err != nil {
return err
}
}
if v.LicenseMetadata != nil {
ok := object.Key("LicenseMetadata")
if err := awsAwsjson11_serializeDocumentMetadataList(v.LicenseMetadata, ok); err != nil {
return err
}
}
if v.LicenseName != nil {
ok := object.Key("LicenseName")
ok.String(*v.LicenseName)
}
if v.ProductName != nil {
ok := object.Key("ProductName")
ok.String(*v.ProductName)
}
if v.ProductSKU != nil {
ok := object.Key("ProductSKU")
ok.String(*v.ProductSKU)
}
if v.Validity != nil {
ok := object.Key("Validity")
if err := awsAwsjson11_serializeDocumentDatetimeRange(v.Validity, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateLicenseManagerReportGeneratorInput(v *CreateLicenseManagerReportGeneratorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.ReportContext != nil {
ok := object.Key("ReportContext")
if err := awsAwsjson11_serializeDocumentReportContext(v.ReportContext, ok); err != nil {
return err
}
}
if v.ReportFrequency != nil {
ok := object.Key("ReportFrequency")
if err := awsAwsjson11_serializeDocumentReportFrequency(v.ReportFrequency, ok); err != nil {
return err
}
}
if v.ReportGeneratorName != nil {
ok := object.Key("ReportGeneratorName")
ok.String(*v.ReportGeneratorName)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.Type != nil {
ok := object.Key("Type")
if err := awsAwsjson11_serializeDocumentReportTypeList(v.Type, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateLicenseVersionInput(v *CreateLicenseVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.ConsumptionConfiguration != nil {
ok := object.Key("ConsumptionConfiguration")
if err := awsAwsjson11_serializeDocumentConsumptionConfiguration(v.ConsumptionConfiguration, ok); err != nil {
return err
}
}
if v.Entitlements != nil {
ok := object.Key("Entitlements")
if err := awsAwsjson11_serializeDocumentEntitlementList(v.Entitlements, ok); err != nil {
return err
}
}
if v.HomeRegion != nil {
ok := object.Key("HomeRegion")
ok.String(*v.HomeRegion)
}
if v.Issuer != nil {
ok := object.Key("Issuer")
if err := awsAwsjson11_serializeDocumentIssuer(v.Issuer, ok); err != nil {
return err
}
}
if v.LicenseArn != nil {
ok := object.Key("LicenseArn")
ok.String(*v.LicenseArn)
}
if v.LicenseMetadata != nil {
ok := object.Key("LicenseMetadata")
if err := awsAwsjson11_serializeDocumentMetadataList(v.LicenseMetadata, ok); err != nil {
return err
}
}
if v.LicenseName != nil {
ok := object.Key("LicenseName")
ok.String(*v.LicenseName)
}
if v.ProductName != nil {
ok := object.Key("ProductName")
ok.String(*v.ProductName)
}
if v.SourceVersion != nil {
ok := object.Key("SourceVersion")
ok.String(*v.SourceVersion)
}
if len(v.Status) > 0 {
ok := object.Key("Status")
ok.String(string(v.Status))
}
if v.Validity != nil {
ok := object.Key("Validity")
if err := awsAwsjson11_serializeDocumentDatetimeRange(v.Validity, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateTokenInput(v *CreateTokenInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.ExpirationInDays != nil {
ok := object.Key("ExpirationInDays")
ok.Integer(*v.ExpirationInDays)
}
if v.LicenseArn != nil {
ok := object.Key("LicenseArn")
ok.String(*v.LicenseArn)
}
if v.RoleArns != nil {
ok := object.Key("RoleArns")
if err := awsAwsjson11_serializeDocumentArnList(v.RoleArns, ok); err != nil {
return err
}
}
if v.TokenProperties != nil {
ok := object.Key("TokenProperties")
if err := awsAwsjson11_serializeDocumentMaxSize3StringList(v.TokenProperties, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteGrantInput(v *DeleteGrantInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GrantArn != nil {
ok := object.Key("GrantArn")
ok.String(*v.GrantArn)
}
if v.StatusReason != nil {
ok := object.Key("StatusReason")
ok.String(*v.StatusReason)
}
if v.Version != nil {
ok := object.Key("Version")
ok.String(*v.Version)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteLicenseConfigurationInput(v *DeleteLicenseConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseConfigurationArn != nil {
ok := object.Key("LicenseConfigurationArn")
ok.String(*v.LicenseConfigurationArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteLicenseInput(v *DeleteLicenseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseArn != nil {
ok := object.Key("LicenseArn")
ok.String(*v.LicenseArn)
}
if v.SourceVersion != nil {
ok := object.Key("SourceVersion")
ok.String(*v.SourceVersion)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteLicenseManagerReportGeneratorInput(v *DeleteLicenseManagerReportGeneratorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseManagerReportGeneratorArn != nil {
ok := object.Key("LicenseManagerReportGeneratorArn")
ok.String(*v.LicenseManagerReportGeneratorArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteTokenInput(v *DeleteTokenInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TokenId != nil {
ok := object.Key("TokenId")
ok.String(*v.TokenId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentExtendLicenseConsumptionInput(v *ExtendLicenseConsumptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DryRun {
ok := object.Key("DryRun")
ok.Boolean(v.DryRun)
}
if v.LicenseConsumptionToken != nil {
ok := object.Key("LicenseConsumptionToken")
ok.String(*v.LicenseConsumptionToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetAccessTokenInput(v *GetAccessTokenInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Token != nil {
ok := object.Key("Token")
ok.String(*v.Token)
}
if v.TokenProperties != nil {
ok := object.Key("TokenProperties")
if err := awsAwsjson11_serializeDocumentMaxSize3StringList(v.TokenProperties, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetGrantInput(v *GetGrantInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GrantArn != nil {
ok := object.Key("GrantArn")
ok.String(*v.GrantArn)
}
if v.Version != nil {
ok := object.Key("Version")
ok.String(*v.Version)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLicenseConfigurationInput(v *GetLicenseConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseConfigurationArn != nil {
ok := object.Key("LicenseConfigurationArn")
ok.String(*v.LicenseConfigurationArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLicenseConversionTaskInput(v *GetLicenseConversionTaskInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseConversionTaskId != nil {
ok := object.Key("LicenseConversionTaskId")
ok.String(*v.LicenseConversionTaskId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLicenseInput(v *GetLicenseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseArn != nil {
ok := object.Key("LicenseArn")
ok.String(*v.LicenseArn)
}
if v.Version != nil {
ok := object.Key("Version")
ok.String(*v.Version)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLicenseManagerReportGeneratorInput(v *GetLicenseManagerReportGeneratorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseManagerReportGeneratorArn != nil {
ok := object.Key("LicenseManagerReportGeneratorArn")
ok.String(*v.LicenseManagerReportGeneratorArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLicenseUsageInput(v *GetLicenseUsageInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseArn != nil {
ok := object.Key("LicenseArn")
ok.String(*v.LicenseArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetServiceSettingsInput(v *GetServiceSettingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentListAssociationsForLicenseConfigurationInput(v *ListAssociationsForLicenseConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseConfigurationArn != nil {
ok := object.Key("LicenseConfigurationArn")
ok.String(*v.LicenseConfigurationArn)
}
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
}
func awsAwsjson11_serializeOpDocumentListDistributedGrantsInput(v *ListDistributedGrantsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.GrantArns != nil {
ok := object.Key("GrantArns")
if err := awsAwsjson11_serializeDocumentArnList(v.GrantArns, ok); err != nil {
return err
}
}
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
}
func awsAwsjson11_serializeOpDocumentListFailuresForLicenseConfigurationOperationsInput(v *ListFailuresForLicenseConfigurationOperationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseConfigurationArn != nil {
ok := object.Key("LicenseConfigurationArn")
ok.String(*v.LicenseConfigurationArn)
}
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
}
func awsAwsjson11_serializeOpDocumentListLicenseConfigurationsInput(v *ListLicenseConfigurationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilters(v.Filters, ok); err != nil {
return err
}
}
if v.LicenseConfigurationArns != nil {
ok := object.Key("LicenseConfigurationArns")
if err := awsAwsjson11_serializeDocumentStringList(v.LicenseConfigurationArns, ok); err != nil {
return err
}
}
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
}
func awsAwsjson11_serializeOpDocumentListLicenseConversionTasksInput(v *ListLicenseConversionTasksInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilters(v.Filters, ok); err != nil {
return err
}
}
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
}
func awsAwsjson11_serializeOpDocumentListLicenseManagerReportGeneratorsInput(v *ListLicenseManagerReportGeneratorsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
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
}
func awsAwsjson11_serializeOpDocumentListLicensesInput(v *ListLicensesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.LicenseArns != nil {
ok := object.Key("LicenseArns")
if err := awsAwsjson11_serializeDocumentArnList(v.LicenseArns, ok); err != nil {
return err
}
}
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
}
func awsAwsjson11_serializeOpDocumentListLicenseSpecificationsForResourceInput(v *ListLicenseSpecificationsForResourceInput, 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.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListLicenseVersionsInput(v *ListLicenseVersionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LicenseArn != nil {
ok := object.Key("LicenseArn")
ok.String(*v.LicenseArn)
}
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
}
func awsAwsjson11_serializeOpDocumentListReceivedGrantsForOrganizationInput(v *ListReceivedGrantsForOrganizationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.LicenseArn != nil {
ok := object.Key("LicenseArn")
ok.String(*v.LicenseArn)
}
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
}
func awsAwsjson11_serializeOpDocumentListReceivedGrantsInput(v *ListReceivedGrantsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.GrantArns != nil {
ok := object.Key("GrantArns")
if err := awsAwsjson11_serializeDocumentArnList(v.GrantArns, ok); err != nil {
return err
}
}
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
}
func awsAwsjson11_serializeOpDocumentListReceivedLicensesForOrganizationInput(v *ListReceivedLicensesForOrganizationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
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
}
func awsAwsjson11_serializeOpDocumentListReceivedLicensesInput(v *ListReceivedLicensesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
if v.LicenseArns != nil {
ok := object.Key("LicenseArns")
if err := awsAwsjson11_serializeDocumentArnList(v.LicenseArns, ok); err != nil {
return err
}
}
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
}
func awsAwsjson11_serializeOpDocumentListResourceInventoryInput(v *ListResourceInventoryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentInventoryFilterList(v.Filters, ok); err != nil {
return err
}
}
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
}
func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTokensInput(v *ListTokensInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
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.TokenIds != nil {
ok := object.Key("TokenIds")
if err := awsAwsjson11_serializeDocumentStringList(v.TokenIds, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentListUsageForLicenseConfigurationInput(v *ListUsageForLicenseConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilters(v.Filters, ok); err != nil {
return err
}
}
if v.LicenseConfigurationArn != nil {
ok := object.Key("LicenseConfigurationArn")
ok.String(*v.LicenseConfigurationArn)
}
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
}
func awsAwsjson11_serializeOpDocumentRejectGrantInput(v *RejectGrantInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GrantArn != nil {
ok := object.Key("GrantArn")
ok.String(*v.GrantArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateLicenseConfigurationInput(v *UpdateLicenseConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.DisassociateWhenNotFound != nil {
ok := object.Key("DisassociateWhenNotFound")
ok.Boolean(*v.DisassociateWhenNotFound)
}
if v.LicenseConfigurationArn != nil {
ok := object.Key("LicenseConfigurationArn")
ok.String(*v.LicenseConfigurationArn)
}
if len(v.LicenseConfigurationStatus) > 0 {
ok := object.Key("LicenseConfigurationStatus")
ok.String(string(v.LicenseConfigurationStatus))
}
if v.LicenseCount != nil {
ok := object.Key("LicenseCount")
ok.Long(*v.LicenseCount)
}
if v.LicenseCountHardLimit != nil {
ok := object.Key("LicenseCountHardLimit")
ok.Boolean(*v.LicenseCountHardLimit)
}
if v.LicenseRules != nil {
ok := object.Key("LicenseRules")
if err := awsAwsjson11_serializeDocumentStringList(v.LicenseRules, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.ProductInformationList != nil {
ok := object.Key("ProductInformationList")
if err := awsAwsjson11_serializeDocumentProductInformationList(v.ProductInformationList, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateLicenseManagerReportGeneratorInput(v *UpdateLicenseManagerReportGeneratorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.LicenseManagerReportGeneratorArn != nil {
ok := object.Key("LicenseManagerReportGeneratorArn")
ok.String(*v.LicenseManagerReportGeneratorArn)
}
if v.ReportContext != nil {
ok := object.Key("ReportContext")
if err := awsAwsjson11_serializeDocumentReportContext(v.ReportContext, ok); err != nil {
return err
}
}
if v.ReportFrequency != nil {
ok := object.Key("ReportFrequency")
if err := awsAwsjson11_serializeDocumentReportFrequency(v.ReportFrequency, ok); err != nil {
return err
}
}
if v.ReportGeneratorName != nil {
ok := object.Key("ReportGeneratorName")
ok.String(*v.ReportGeneratorName)
}
if v.Type != nil {
ok := object.Key("Type")
if err := awsAwsjson11_serializeDocumentReportTypeList(v.Type, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateLicenseSpecificationsForResourceInput(v *UpdateLicenseSpecificationsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AddLicenseSpecifications != nil {
ok := object.Key("AddLicenseSpecifications")
if err := awsAwsjson11_serializeDocumentLicenseSpecifications(v.AddLicenseSpecifications, ok); err != nil {
return err
}
}
if v.RemoveLicenseSpecifications != nil {
ok := object.Key("RemoveLicenseSpecifications")
if err := awsAwsjson11_serializeDocumentLicenseSpecifications(v.RemoveLicenseSpecifications, ok); err != nil {
return err
}
}
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateServiceSettingsInput(v *UpdateServiceSettingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EnableCrossAccountsDiscovery != nil {
ok := object.Key("EnableCrossAccountsDiscovery")
ok.Boolean(*v.EnableCrossAccountsDiscovery)
}
if v.OrganizationConfiguration != nil {
ok := object.Key("OrganizationConfiguration")
if err := awsAwsjson11_serializeDocumentOrganizationConfiguration(v.OrganizationConfiguration, ok); err != nil {
return err
}
}
if v.S3BucketArn != nil {
ok := object.Key("S3BucketArn")
ok.String(*v.S3BucketArn)
}
if v.SnsTopicArn != nil {
ok := object.Key("SnsTopicArn")
ok.String(*v.SnsTopicArn)
}
return nil
}
| 4,708 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanager
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/licensemanager/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAcceptGrant struct {
}
func (*validateOpAcceptGrant) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAcceptGrant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AcceptGrantInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAcceptGrantInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCheckInLicense struct {
}
func (*validateOpCheckInLicense) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCheckInLicense) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CheckInLicenseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCheckInLicenseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCheckoutBorrowLicense struct {
}
func (*validateOpCheckoutBorrowLicense) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCheckoutBorrowLicense) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CheckoutBorrowLicenseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCheckoutBorrowLicenseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCheckoutLicense struct {
}
func (*validateOpCheckoutLicense) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCheckoutLicense) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CheckoutLicenseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCheckoutLicenseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateGrant struct {
}
func (*validateOpCreateGrant) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateGrant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateGrantInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateGrantInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateGrantVersion struct {
}
func (*validateOpCreateGrantVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateGrantVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateGrantVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateGrantVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateLicenseConfiguration struct {
}
func (*validateOpCreateLicenseConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateLicenseConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateLicenseConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateLicenseConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateLicenseConversionTaskForResource struct {
}
func (*validateOpCreateLicenseConversionTaskForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateLicenseConversionTaskForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateLicenseConversionTaskForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateLicenseConversionTaskForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateLicense struct {
}
func (*validateOpCreateLicense) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateLicense) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateLicenseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateLicenseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateLicenseManagerReportGenerator struct {
}
func (*validateOpCreateLicenseManagerReportGenerator) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateLicenseManagerReportGenerator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateLicenseManagerReportGeneratorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateLicenseManagerReportGeneratorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateLicenseVersion struct {
}
func (*validateOpCreateLicenseVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateLicenseVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateLicenseVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateLicenseVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateToken struct {
}
func (*validateOpCreateToken) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateTokenInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateTokenInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteGrant struct {
}
func (*validateOpDeleteGrant) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteGrant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteGrantInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteGrantInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteLicenseConfiguration struct {
}
func (*validateOpDeleteLicenseConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteLicenseConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteLicenseConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteLicenseConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteLicense struct {
}
func (*validateOpDeleteLicense) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteLicense) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteLicenseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteLicenseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteLicenseManagerReportGenerator struct {
}
func (*validateOpDeleteLicenseManagerReportGenerator) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteLicenseManagerReportGenerator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteLicenseManagerReportGeneratorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteLicenseManagerReportGeneratorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteToken struct {
}
func (*validateOpDeleteToken) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteTokenInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteTokenInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpExtendLicenseConsumption struct {
}
func (*validateOpExtendLicenseConsumption) ID() string {
return "OperationInputValidation"
}
func (m *validateOpExtendLicenseConsumption) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ExtendLicenseConsumptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpExtendLicenseConsumptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAccessToken struct {
}
func (*validateOpGetAccessToken) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAccessToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAccessTokenInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAccessTokenInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetGrant struct {
}
func (*validateOpGetGrant) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetGrant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetGrantInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetGrantInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLicenseConfiguration struct {
}
func (*validateOpGetLicenseConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLicenseConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLicenseConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLicenseConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLicenseConversionTask struct {
}
func (*validateOpGetLicenseConversionTask) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLicenseConversionTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLicenseConversionTaskInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLicenseConversionTaskInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLicense struct {
}
func (*validateOpGetLicense) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLicense) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLicenseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLicenseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLicenseManagerReportGenerator struct {
}
func (*validateOpGetLicenseManagerReportGenerator) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLicenseManagerReportGenerator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLicenseManagerReportGeneratorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLicenseManagerReportGeneratorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLicenseUsage struct {
}
func (*validateOpGetLicenseUsage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLicenseUsage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLicenseUsageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLicenseUsageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAssociationsForLicenseConfiguration struct {
}
func (*validateOpListAssociationsForLicenseConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAssociationsForLicenseConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAssociationsForLicenseConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAssociationsForLicenseConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListFailuresForLicenseConfigurationOperations struct {
}
func (*validateOpListFailuresForLicenseConfigurationOperations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListFailuresForLicenseConfigurationOperations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListFailuresForLicenseConfigurationOperationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListFailuresForLicenseConfigurationOperationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListLicenseSpecificationsForResource struct {
}
func (*validateOpListLicenseSpecificationsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListLicenseSpecificationsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListLicenseSpecificationsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListLicenseSpecificationsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListLicenseVersions struct {
}
func (*validateOpListLicenseVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListLicenseVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListLicenseVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListLicenseVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListReceivedGrantsForOrganization struct {
}
func (*validateOpListReceivedGrantsForOrganization) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListReceivedGrantsForOrganization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListReceivedGrantsForOrganizationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListReceivedGrantsForOrganizationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListResourceInventory struct {
}
func (*validateOpListResourceInventory) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListResourceInventory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListResourceInventoryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListResourceInventoryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTagsForResource struct {
}
func (*validateOpListTagsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTagsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTagsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListUsageForLicenseConfiguration struct {
}
func (*validateOpListUsageForLicenseConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListUsageForLicenseConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListUsageForLicenseConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListUsageForLicenseConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRejectGrant struct {
}
func (*validateOpRejectGrant) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRejectGrant) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RejectGrantInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRejectGrantInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateLicenseConfiguration struct {
}
func (*validateOpUpdateLicenseConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateLicenseConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateLicenseConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateLicenseConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateLicenseManagerReportGenerator struct {
}
func (*validateOpUpdateLicenseManagerReportGenerator) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateLicenseManagerReportGenerator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateLicenseManagerReportGeneratorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateLicenseManagerReportGeneratorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateLicenseSpecificationsForResource struct {
}
func (*validateOpUpdateLicenseSpecificationsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateLicenseSpecificationsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateLicenseSpecificationsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateLicenseSpecificationsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateServiceSettings struct {
}
func (*validateOpUpdateServiceSettings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateServiceSettings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateServiceSettingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateServiceSettingsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAcceptGrantValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAcceptGrant{}, middleware.After)
}
func addOpCheckInLicenseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCheckInLicense{}, middleware.After)
}
func addOpCheckoutBorrowLicenseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCheckoutBorrowLicense{}, middleware.After)
}
func addOpCheckoutLicenseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCheckoutLicense{}, middleware.After)
}
func addOpCreateGrantValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateGrant{}, middleware.After)
}
func addOpCreateGrantVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateGrantVersion{}, middleware.After)
}
func addOpCreateLicenseConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateLicenseConfiguration{}, middleware.After)
}
func addOpCreateLicenseConversionTaskForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateLicenseConversionTaskForResource{}, middleware.After)
}
func addOpCreateLicenseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateLicense{}, middleware.After)
}
func addOpCreateLicenseManagerReportGeneratorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateLicenseManagerReportGenerator{}, middleware.After)
}
func addOpCreateLicenseVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateLicenseVersion{}, middleware.After)
}
func addOpCreateTokenValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateToken{}, middleware.After)
}
func addOpDeleteGrantValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteGrant{}, middleware.After)
}
func addOpDeleteLicenseConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteLicenseConfiguration{}, middleware.After)
}
func addOpDeleteLicenseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteLicense{}, middleware.After)
}
func addOpDeleteLicenseManagerReportGeneratorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteLicenseManagerReportGenerator{}, middleware.After)
}
func addOpDeleteTokenValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteToken{}, middleware.After)
}
func addOpExtendLicenseConsumptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpExtendLicenseConsumption{}, middleware.After)
}
func addOpGetAccessTokenValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAccessToken{}, middleware.After)
}
func addOpGetGrantValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetGrant{}, middleware.After)
}
func addOpGetLicenseConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLicenseConfiguration{}, middleware.After)
}
func addOpGetLicenseConversionTaskValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLicenseConversionTask{}, middleware.After)
}
func addOpGetLicenseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLicense{}, middleware.After)
}
func addOpGetLicenseManagerReportGeneratorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLicenseManagerReportGenerator{}, middleware.After)
}
func addOpGetLicenseUsageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLicenseUsage{}, middleware.After)
}
func addOpListAssociationsForLicenseConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAssociationsForLicenseConfiguration{}, middleware.After)
}
func addOpListFailuresForLicenseConfigurationOperationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListFailuresForLicenseConfigurationOperations{}, middleware.After)
}
func addOpListLicenseSpecificationsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListLicenseSpecificationsForResource{}, middleware.After)
}
func addOpListLicenseVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListLicenseVersions{}, middleware.After)
}
func addOpListReceivedGrantsForOrganizationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListReceivedGrantsForOrganization{}, middleware.After)
}
func addOpListResourceInventoryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListResourceInventory{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpListUsageForLicenseConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListUsageForLicenseConfiguration{}, middleware.After)
}
func addOpRejectGrantValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRejectGrant{}, middleware.After)
}
func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagResource{}, middleware.After)
}
func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)
}
func addOpUpdateLicenseConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateLicenseConfiguration{}, middleware.After)
}
func addOpUpdateLicenseManagerReportGeneratorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateLicenseManagerReportGenerator{}, middleware.After)
}
func addOpUpdateLicenseSpecificationsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateLicenseSpecificationsForResource{}, middleware.After)
}
func addOpUpdateServiceSettingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateServiceSettings{}, middleware.After)
}
func validateBorrowConfiguration(v *types.BorrowConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BorrowConfiguration"}
if v.AllowEarlyCheckIn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AllowEarlyCheckIn"))
}
if v.MaxTimeToLiveInMinutes == nil {
invalidParams.Add(smithy.NewErrParamRequired("MaxTimeToLiveInMinutes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConsumptionConfiguration(v *types.ConsumptionConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConsumptionConfiguration"}
if v.ProvisionalConfiguration != nil {
if err := validateProvisionalConfiguration(v.ProvisionalConfiguration); err != nil {
invalidParams.AddNested("ProvisionalConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.BorrowConfiguration != nil {
if err := validateBorrowConfiguration(v.BorrowConfiguration); err != nil {
invalidParams.AddNested("BorrowConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDatetimeRange(v *types.DatetimeRange) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DatetimeRange"}
if v.Begin == nil {
invalidParams.Add(smithy.NewErrParamRequired("Begin"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEntitlement(v *types.Entitlement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Entitlement"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Unit) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Unit"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEntitlementData(v *types.EntitlementData) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EntitlementData"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Unit) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Unit"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEntitlementDataList(v []types.EntitlementData) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EntitlementDataList"}
for i := range v {
if err := validateEntitlementData(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEntitlementList(v []types.Entitlement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EntitlementList"}
for i := range v {
if err := validateEntitlement(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInventoryFilter(v *types.InventoryFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InventoryFilter"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Condition) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Condition"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInventoryFilterList(v []types.InventoryFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InventoryFilterList"}
for i := range v {
if err := validateInventoryFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIssuer(v *types.Issuer) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Issuer"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLicenseSpecification(v *types.LicenseSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LicenseSpecification"}
if v.LicenseConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConfigurationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLicenseSpecifications(v []types.LicenseSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LicenseSpecifications"}
for i := range v {
if err := validateLicenseSpecification(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOrganizationConfiguration(v *types.OrganizationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OrganizationConfiguration"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProductInformation(v *types.ProductInformation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProductInformation"}
if v.ResourceType == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
}
if v.ProductInformationFilterList == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProductInformationFilterList"))
} else if v.ProductInformationFilterList != nil {
if err := validateProductInformationFilterList(v.ProductInformationFilterList); err != nil {
invalidParams.AddNested("ProductInformationFilterList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProductInformationFilter(v *types.ProductInformationFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProductInformationFilter"}
if v.ProductInformationFilterName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProductInformationFilterName"))
}
if v.ProductInformationFilterComparator == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProductInformationFilterComparator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProductInformationFilterList(v []types.ProductInformationFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProductInformationFilterList"}
for i := range v {
if err := validateProductInformationFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProductInformationList(v []types.ProductInformation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProductInformationList"}
for i := range v {
if err := validateProductInformation(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProvisionalConfiguration(v *types.ProvisionalConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProvisionalConfiguration"}
if v.MaxTimeToLiveInMinutes == nil {
invalidParams.Add(smithy.NewErrParamRequired("MaxTimeToLiveInMinutes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReportContext(v *types.ReportContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReportContext"}
if v.LicenseConfigurationArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConfigurationArns"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAcceptGrantInput(v *AcceptGrantInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AcceptGrantInput"}
if v.GrantArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("GrantArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCheckInLicenseInput(v *CheckInLicenseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CheckInLicenseInput"}
if v.LicenseConsumptionToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConsumptionToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCheckoutBorrowLicenseInput(v *CheckoutBorrowLicenseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CheckoutBorrowLicenseInput"}
if v.LicenseArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseArn"))
}
if v.Entitlements == nil {
invalidParams.Add(smithy.NewErrParamRequired("Entitlements"))
} else if v.Entitlements != nil {
if err := validateEntitlementDataList(v.Entitlements); err != nil {
invalidParams.AddNested("Entitlements", err.(smithy.InvalidParamsError))
}
}
if len(v.DigitalSignatureMethod) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DigitalSignatureMethod"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCheckoutLicenseInput(v *CheckoutLicenseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CheckoutLicenseInput"}
if v.ProductSKU == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProductSKU"))
}
if len(v.CheckoutType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("CheckoutType"))
}
if v.KeyFingerprint == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyFingerprint"))
}
if v.Entitlements == nil {
invalidParams.Add(smithy.NewErrParamRequired("Entitlements"))
} else if v.Entitlements != nil {
if err := validateEntitlementDataList(v.Entitlements); err != nil {
invalidParams.AddNested("Entitlements", err.(smithy.InvalidParamsError))
}
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateGrantInput(v *CreateGrantInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateGrantInput"}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.GrantName == nil {
invalidParams.Add(smithy.NewErrParamRequired("GrantName"))
}
if v.LicenseArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseArn"))
}
if v.Principals == nil {
invalidParams.Add(smithy.NewErrParamRequired("Principals"))
}
if v.HomeRegion == nil {
invalidParams.Add(smithy.NewErrParamRequired("HomeRegion"))
}
if v.AllowedOperations == nil {
invalidParams.Add(smithy.NewErrParamRequired("AllowedOperations"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateGrantVersionInput(v *CreateGrantVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateGrantVersionInput"}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.GrantArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("GrantArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateLicenseConfigurationInput(v *CreateLicenseConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateLicenseConfigurationInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.LicenseCountingType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LicenseCountingType"))
}
if v.ProductInformationList != nil {
if err := validateProductInformationList(v.ProductInformationList); err != nil {
invalidParams.AddNested("ProductInformationList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateLicenseConversionTaskForResourceInput(v *CreateLicenseConversionTaskForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateLicenseConversionTaskForResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.SourceLicenseContext == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceLicenseContext"))
}
if v.DestinationLicenseContext == nil {
invalidParams.Add(smithy.NewErrParamRequired("DestinationLicenseContext"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateLicenseInput(v *CreateLicenseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateLicenseInput"}
if v.LicenseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseName"))
}
if v.ProductName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProductName"))
}
if v.ProductSKU == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProductSKU"))
}
if v.Issuer == nil {
invalidParams.Add(smithy.NewErrParamRequired("Issuer"))
} else if v.Issuer != nil {
if err := validateIssuer(v.Issuer); err != nil {
invalidParams.AddNested("Issuer", err.(smithy.InvalidParamsError))
}
}
if v.HomeRegion == nil {
invalidParams.Add(smithy.NewErrParamRequired("HomeRegion"))
}
if v.Validity == nil {
invalidParams.Add(smithy.NewErrParamRequired("Validity"))
} else if v.Validity != nil {
if err := validateDatetimeRange(v.Validity); err != nil {
invalidParams.AddNested("Validity", err.(smithy.InvalidParamsError))
}
}
if v.Entitlements == nil {
invalidParams.Add(smithy.NewErrParamRequired("Entitlements"))
} else if v.Entitlements != nil {
if err := validateEntitlementList(v.Entitlements); err != nil {
invalidParams.AddNested("Entitlements", err.(smithy.InvalidParamsError))
}
}
if v.Beneficiary == nil {
invalidParams.Add(smithy.NewErrParamRequired("Beneficiary"))
}
if v.ConsumptionConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConsumptionConfiguration"))
} else if v.ConsumptionConfiguration != nil {
if err := validateConsumptionConfiguration(v.ConsumptionConfiguration); err != nil {
invalidParams.AddNested("ConsumptionConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateLicenseManagerReportGeneratorInput(v *CreateLicenseManagerReportGeneratorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateLicenseManagerReportGeneratorInput"}
if v.ReportGeneratorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReportGeneratorName"))
}
if v.Type == nil {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.ReportContext == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReportContext"))
} else if v.ReportContext != nil {
if err := validateReportContext(v.ReportContext); err != nil {
invalidParams.AddNested("ReportContext", err.(smithy.InvalidParamsError))
}
}
if v.ReportFrequency == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReportFrequency"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateLicenseVersionInput(v *CreateLicenseVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateLicenseVersionInput"}
if v.LicenseArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseArn"))
}
if v.LicenseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseName"))
}
if v.ProductName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProductName"))
}
if v.Issuer == nil {
invalidParams.Add(smithy.NewErrParamRequired("Issuer"))
} else if v.Issuer != nil {
if err := validateIssuer(v.Issuer); err != nil {
invalidParams.AddNested("Issuer", err.(smithy.InvalidParamsError))
}
}
if v.HomeRegion == nil {
invalidParams.Add(smithy.NewErrParamRequired("HomeRegion"))
}
if v.Validity == nil {
invalidParams.Add(smithy.NewErrParamRequired("Validity"))
} else if v.Validity != nil {
if err := validateDatetimeRange(v.Validity); err != nil {
invalidParams.AddNested("Validity", err.(smithy.InvalidParamsError))
}
}
if v.Entitlements == nil {
invalidParams.Add(smithy.NewErrParamRequired("Entitlements"))
} else if v.Entitlements != nil {
if err := validateEntitlementList(v.Entitlements); err != nil {
invalidParams.AddNested("Entitlements", err.(smithy.InvalidParamsError))
}
}
if v.ConsumptionConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConsumptionConfiguration"))
} else if v.ConsumptionConfiguration != nil {
if err := validateConsumptionConfiguration(v.ConsumptionConfiguration); err != nil {
invalidParams.AddNested("ConsumptionConfiguration", err.(smithy.InvalidParamsError))
}
}
if len(v.Status) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Status"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateTokenInput(v *CreateTokenInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateTokenInput"}
if v.LicenseArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseArn"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteGrantInput(v *DeleteGrantInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteGrantInput"}
if v.GrantArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("GrantArn"))
}
if v.Version == nil {
invalidParams.Add(smithy.NewErrParamRequired("Version"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteLicenseConfigurationInput(v *DeleteLicenseConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteLicenseConfigurationInput"}
if v.LicenseConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConfigurationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteLicenseInput(v *DeleteLicenseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteLicenseInput"}
if v.LicenseArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseArn"))
}
if v.SourceVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteLicenseManagerReportGeneratorInput(v *DeleteLicenseManagerReportGeneratorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteLicenseManagerReportGeneratorInput"}
if v.LicenseManagerReportGeneratorArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseManagerReportGeneratorArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteTokenInput(v *DeleteTokenInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteTokenInput"}
if v.TokenId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TokenId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpExtendLicenseConsumptionInput(v *ExtendLicenseConsumptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExtendLicenseConsumptionInput"}
if v.LicenseConsumptionToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConsumptionToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAccessTokenInput(v *GetAccessTokenInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAccessTokenInput"}
if v.Token == nil {
invalidParams.Add(smithy.NewErrParamRequired("Token"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetGrantInput(v *GetGrantInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetGrantInput"}
if v.GrantArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("GrantArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLicenseConfigurationInput(v *GetLicenseConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLicenseConfigurationInput"}
if v.LicenseConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConfigurationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLicenseConversionTaskInput(v *GetLicenseConversionTaskInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLicenseConversionTaskInput"}
if v.LicenseConversionTaskId == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConversionTaskId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLicenseInput(v *GetLicenseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLicenseInput"}
if v.LicenseArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLicenseManagerReportGeneratorInput(v *GetLicenseManagerReportGeneratorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLicenseManagerReportGeneratorInput"}
if v.LicenseManagerReportGeneratorArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseManagerReportGeneratorArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLicenseUsageInput(v *GetLicenseUsageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLicenseUsageInput"}
if v.LicenseArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAssociationsForLicenseConfigurationInput(v *ListAssociationsForLicenseConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAssociationsForLicenseConfigurationInput"}
if v.LicenseConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConfigurationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListFailuresForLicenseConfigurationOperationsInput(v *ListFailuresForLicenseConfigurationOperationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListFailuresForLicenseConfigurationOperationsInput"}
if v.LicenseConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConfigurationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListLicenseSpecificationsForResourceInput(v *ListLicenseSpecificationsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListLicenseSpecificationsForResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListLicenseVersionsInput(v *ListLicenseVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListLicenseVersionsInput"}
if v.LicenseArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListReceivedGrantsForOrganizationInput(v *ListReceivedGrantsForOrganizationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListReceivedGrantsForOrganizationInput"}
if v.LicenseArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListResourceInventoryInput(v *ListResourceInventoryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListResourceInventoryInput"}
if v.Filters != nil {
if err := validateInventoryFilterList(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListUsageForLicenseConfigurationInput(v *ListUsageForLicenseConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListUsageForLicenseConfigurationInput"}
if v.LicenseConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConfigurationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRejectGrantInput(v *RejectGrantInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RejectGrantInput"}
if v.GrantArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("GrantArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateLicenseConfigurationInput(v *UpdateLicenseConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateLicenseConfigurationInput"}
if v.LicenseConfigurationArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseConfigurationArn"))
}
if v.ProductInformationList != nil {
if err := validateProductInformationList(v.ProductInformationList); err != nil {
invalidParams.AddNested("ProductInformationList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateLicenseManagerReportGeneratorInput(v *UpdateLicenseManagerReportGeneratorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateLicenseManagerReportGeneratorInput"}
if v.LicenseManagerReportGeneratorArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LicenseManagerReportGeneratorArn"))
}
if v.ReportGeneratorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReportGeneratorName"))
}
if v.Type == nil {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.ReportContext == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReportContext"))
} else if v.ReportContext != nil {
if err := validateReportContext(v.ReportContext); err != nil {
invalidParams.AddNested("ReportContext", err.(smithy.InvalidParamsError))
}
}
if v.ReportFrequency == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReportFrequency"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateLicenseSpecificationsForResourceInput(v *UpdateLicenseSpecificationsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateLicenseSpecificationsForResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.AddLicenseSpecifications != nil {
if err := validateLicenseSpecifications(v.AddLicenseSpecifications); err != nil {
invalidParams.AddNested("AddLicenseSpecifications", err.(smithy.InvalidParamsError))
}
}
if v.RemoveLicenseSpecifications != nil {
if err := validateLicenseSpecifications(v.RemoveLicenseSpecifications); err != nil {
invalidParams.AddNested("RemoveLicenseSpecifications", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateServiceSettingsInput(v *UpdateServiceSettingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateServiceSettingsInput"}
if v.OrganizationConfiguration != nil {
if err := validateOrganizationConfiguration(v.OrganizationConfiguration); err != nil {
invalidParams.AddNested("OrganizationConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 2,111 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver License Manager endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "license-manager.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "license-manager-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "license-manager.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "license-manager-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-2",
}: endpoints.Endpoint{
Hostname: "license-manager-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-1",
}: endpoints.Endpoint{
Hostname: "license-manager-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "license-manager-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "license-manager.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "license-manager-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "license-manager.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "license-manager.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-iso-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-iso-west-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "license-manager.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-isob-east-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "license-manager.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "license-manager.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "license-manager.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "license-manager-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "license-manager.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "license-manager-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "license-manager-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.us-gov-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "license-manager-fips.us-gov-west-1.amazonaws.com",
},
},
},
}
| 484 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type ActivationOverrideBehavior string
// Enum values for ActivationOverrideBehavior
const (
ActivationOverrideBehaviorDistributedGrantsOnly ActivationOverrideBehavior = "DISTRIBUTED_GRANTS_ONLY"
ActivationOverrideBehaviorAllGrantsPermittedByIssuer ActivationOverrideBehavior = "ALL_GRANTS_PERMITTED_BY_ISSUER"
)
// Values returns all known values for ActivationOverrideBehavior. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (ActivationOverrideBehavior) Values() []ActivationOverrideBehavior {
return []ActivationOverrideBehavior{
"DISTRIBUTED_GRANTS_ONLY",
"ALL_GRANTS_PERMITTED_BY_ISSUER",
}
}
type AllowedOperation string
// Enum values for AllowedOperation
const (
AllowedOperationCreateGrant AllowedOperation = "CreateGrant"
AllowedOperationCheckoutLicense AllowedOperation = "CheckoutLicense"
AllowedOperationCheckoutBorrowLicense AllowedOperation = "CheckoutBorrowLicense"
AllowedOperationCheckInLicense AllowedOperation = "CheckInLicense"
AllowedOperationExtendConsumptionLicense AllowedOperation = "ExtendConsumptionLicense"
AllowedOperationListPurchasedLicenses AllowedOperation = "ListPurchasedLicenses"
AllowedOperationCreateToken AllowedOperation = "CreateToken"
)
// Values returns all known values for AllowedOperation. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (AllowedOperation) Values() []AllowedOperation {
return []AllowedOperation{
"CreateGrant",
"CheckoutLicense",
"CheckoutBorrowLicense",
"CheckInLicense",
"ExtendConsumptionLicense",
"ListPurchasedLicenses",
"CreateToken",
}
}
type CheckoutType string
// Enum values for CheckoutType
const (
CheckoutTypeProvisional CheckoutType = "PROVISIONAL"
CheckoutTypePerpetual CheckoutType = "PERPETUAL"
)
// Values returns all known values for CheckoutType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (CheckoutType) Values() []CheckoutType {
return []CheckoutType{
"PROVISIONAL",
"PERPETUAL",
}
}
type DigitalSignatureMethod string
// Enum values for DigitalSignatureMethod
const (
DigitalSignatureMethodJwtPs384 DigitalSignatureMethod = "JWT_PS384"
)
// Values returns all known values for DigitalSignatureMethod. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (DigitalSignatureMethod) Values() []DigitalSignatureMethod {
return []DigitalSignatureMethod{
"JWT_PS384",
}
}
type EntitlementDataUnit string
// Enum values for EntitlementDataUnit
const (
EntitlementDataUnitCount EntitlementDataUnit = "Count"
EntitlementDataUnitNone EntitlementDataUnit = "None"
EntitlementDataUnitSeconds EntitlementDataUnit = "Seconds"
EntitlementDataUnitMicroseconds EntitlementDataUnit = "Microseconds"
EntitlementDataUnitMilliseconds EntitlementDataUnit = "Milliseconds"
EntitlementDataUnitBytes EntitlementDataUnit = "Bytes"
EntitlementDataUnitKilobytes EntitlementDataUnit = "Kilobytes"
EntitlementDataUnitMegabytes EntitlementDataUnit = "Megabytes"
EntitlementDataUnitGigabytes EntitlementDataUnit = "Gigabytes"
EntitlementDataUnitTerabytes EntitlementDataUnit = "Terabytes"
EntitlementDataUnitBits EntitlementDataUnit = "Bits"
EntitlementDataUnitKilobits EntitlementDataUnit = "Kilobits"
EntitlementDataUnitMegabits EntitlementDataUnit = "Megabits"
EntitlementDataUnitGigabits EntitlementDataUnit = "Gigabits"
EntitlementDataUnitTerabits EntitlementDataUnit = "Terabits"
EntitlementDataUnitPercent EntitlementDataUnit = "Percent"
EntitlementDataUnitBytesPerSecond EntitlementDataUnit = "Bytes/Second"
EntitlementDataUnitKilobytesPerSecond EntitlementDataUnit = "Kilobytes/Second"
EntitlementDataUnitMegabytesPerSecond EntitlementDataUnit = "Megabytes/Second"
EntitlementDataUnitGigabytesPerSecond EntitlementDataUnit = "Gigabytes/Second"
EntitlementDataUnitTerabytesPerSecond EntitlementDataUnit = "Terabytes/Second"
EntitlementDataUnitBitsPerSecond EntitlementDataUnit = "Bits/Second"
EntitlementDataUnitKilobitsPerSecond EntitlementDataUnit = "Kilobits/Second"
EntitlementDataUnitMegabitsPerSecond EntitlementDataUnit = "Megabits/Second"
EntitlementDataUnitGigabitsPerSecond EntitlementDataUnit = "Gigabits/Second"
EntitlementDataUnitTerabitsPerSecond EntitlementDataUnit = "Terabits/Second"
EntitlementDataUnitCountPerSecond EntitlementDataUnit = "Count/Second"
)
// Values returns all known values for EntitlementDataUnit. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (EntitlementDataUnit) Values() []EntitlementDataUnit {
return []EntitlementDataUnit{
"Count",
"None",
"Seconds",
"Microseconds",
"Milliseconds",
"Bytes",
"Kilobytes",
"Megabytes",
"Gigabytes",
"Terabytes",
"Bits",
"Kilobits",
"Megabits",
"Gigabits",
"Terabits",
"Percent",
"Bytes/Second",
"Kilobytes/Second",
"Megabytes/Second",
"Gigabytes/Second",
"Terabytes/Second",
"Bits/Second",
"Kilobits/Second",
"Megabits/Second",
"Gigabits/Second",
"Terabits/Second",
"Count/Second",
}
}
type EntitlementUnit string
// Enum values for EntitlementUnit
const (
EntitlementUnitCount EntitlementUnit = "Count"
EntitlementUnitNone EntitlementUnit = "None"
EntitlementUnitSeconds EntitlementUnit = "Seconds"
EntitlementUnitMicroseconds EntitlementUnit = "Microseconds"
EntitlementUnitMilliseconds EntitlementUnit = "Milliseconds"
EntitlementUnitBytes EntitlementUnit = "Bytes"
EntitlementUnitKilobytes EntitlementUnit = "Kilobytes"
EntitlementUnitMegabytes EntitlementUnit = "Megabytes"
EntitlementUnitGigabytes EntitlementUnit = "Gigabytes"
EntitlementUnitTerabytes EntitlementUnit = "Terabytes"
EntitlementUnitBits EntitlementUnit = "Bits"
EntitlementUnitKilobits EntitlementUnit = "Kilobits"
EntitlementUnitMegabits EntitlementUnit = "Megabits"
EntitlementUnitGigabits EntitlementUnit = "Gigabits"
EntitlementUnitTerabits EntitlementUnit = "Terabits"
EntitlementUnitPercent EntitlementUnit = "Percent"
EntitlementUnitBytesPerSecond EntitlementUnit = "Bytes/Second"
EntitlementUnitKilobytesPerSecond EntitlementUnit = "Kilobytes/Second"
EntitlementUnitMegabytesPerSecond EntitlementUnit = "Megabytes/Second"
EntitlementUnitGigabytesPerSecond EntitlementUnit = "Gigabytes/Second"
EntitlementUnitTerabytesPerSecond EntitlementUnit = "Terabytes/Second"
EntitlementUnitBitsPerSecond EntitlementUnit = "Bits/Second"
EntitlementUnitKilobitsPerSecond EntitlementUnit = "Kilobits/Second"
EntitlementUnitMegabitsPerSecond EntitlementUnit = "Megabits/Second"
EntitlementUnitGigabitsPerSecond EntitlementUnit = "Gigabits/Second"
EntitlementUnitTerabitsPerSecond EntitlementUnit = "Terabits/Second"
EntitlementUnitCountPerSecond EntitlementUnit = "Count/Second"
)
// Values returns all known values for EntitlementUnit. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (EntitlementUnit) Values() []EntitlementUnit {
return []EntitlementUnit{
"Count",
"None",
"Seconds",
"Microseconds",
"Milliseconds",
"Bytes",
"Kilobytes",
"Megabytes",
"Gigabytes",
"Terabytes",
"Bits",
"Kilobits",
"Megabits",
"Gigabits",
"Terabits",
"Percent",
"Bytes/Second",
"Kilobytes/Second",
"Megabytes/Second",
"Gigabytes/Second",
"Terabytes/Second",
"Bits/Second",
"Kilobits/Second",
"Megabits/Second",
"Gigabits/Second",
"Terabits/Second",
"Count/Second",
}
}
type GrantStatus string
// Enum values for GrantStatus
const (
GrantStatusPendingWorkflow GrantStatus = "PENDING_WORKFLOW"
GrantStatusPendingAccept GrantStatus = "PENDING_ACCEPT"
GrantStatusRejected GrantStatus = "REJECTED"
GrantStatusActive GrantStatus = "ACTIVE"
GrantStatusFailedWorkflow GrantStatus = "FAILED_WORKFLOW"
GrantStatusDeleted GrantStatus = "DELETED"
GrantStatusPendingDelete GrantStatus = "PENDING_DELETE"
GrantStatusDisabled GrantStatus = "DISABLED"
GrantStatusWorkflowCompleted GrantStatus = "WORKFLOW_COMPLETED"
)
// Values returns all known values for GrantStatus. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (GrantStatus) Values() []GrantStatus {
return []GrantStatus{
"PENDING_WORKFLOW",
"PENDING_ACCEPT",
"REJECTED",
"ACTIVE",
"FAILED_WORKFLOW",
"DELETED",
"PENDING_DELETE",
"DISABLED",
"WORKFLOW_COMPLETED",
}
}
type InventoryFilterCondition string
// Enum values for InventoryFilterCondition
const (
InventoryFilterConditionEquals InventoryFilterCondition = "EQUALS"
InventoryFilterConditionNotEquals InventoryFilterCondition = "NOT_EQUALS"
InventoryFilterConditionBeginsWith InventoryFilterCondition = "BEGINS_WITH"
InventoryFilterConditionContains InventoryFilterCondition = "CONTAINS"
)
// Values returns all known values for InventoryFilterCondition. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (InventoryFilterCondition) Values() []InventoryFilterCondition {
return []InventoryFilterCondition{
"EQUALS",
"NOT_EQUALS",
"BEGINS_WITH",
"CONTAINS",
}
}
type LicenseConfigurationStatus string
// Enum values for LicenseConfigurationStatus
const (
LicenseConfigurationStatusAvailable LicenseConfigurationStatus = "AVAILABLE"
LicenseConfigurationStatusDisabled LicenseConfigurationStatus = "DISABLED"
)
// Values returns all known values for LicenseConfigurationStatus. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (LicenseConfigurationStatus) Values() []LicenseConfigurationStatus {
return []LicenseConfigurationStatus{
"AVAILABLE",
"DISABLED",
}
}
type LicenseConversionTaskStatus string
// Enum values for LicenseConversionTaskStatus
const (
LicenseConversionTaskStatusInProgress LicenseConversionTaskStatus = "IN_PROGRESS"
LicenseConversionTaskStatusSucceeded LicenseConversionTaskStatus = "SUCCEEDED"
LicenseConversionTaskStatusFailed LicenseConversionTaskStatus = "FAILED"
)
// Values returns all known values for LicenseConversionTaskStatus. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (LicenseConversionTaskStatus) Values() []LicenseConversionTaskStatus {
return []LicenseConversionTaskStatus{
"IN_PROGRESS",
"SUCCEEDED",
"FAILED",
}
}
type LicenseCountingType string
// Enum values for LicenseCountingType
const (
LicenseCountingTypeVcpu LicenseCountingType = "vCPU"
LicenseCountingTypeInstance LicenseCountingType = "Instance"
LicenseCountingTypeCore LicenseCountingType = "Core"
LicenseCountingTypeSocket LicenseCountingType = "Socket"
)
// Values returns all known values for LicenseCountingType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (LicenseCountingType) Values() []LicenseCountingType {
return []LicenseCountingType{
"vCPU",
"Instance",
"Core",
"Socket",
}
}
type LicenseDeletionStatus string
// Enum values for LicenseDeletionStatus
const (
LicenseDeletionStatusPendingDelete LicenseDeletionStatus = "PENDING_DELETE"
LicenseDeletionStatusDeleted LicenseDeletionStatus = "DELETED"
)
// Values returns all known values for LicenseDeletionStatus. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (LicenseDeletionStatus) Values() []LicenseDeletionStatus {
return []LicenseDeletionStatus{
"PENDING_DELETE",
"DELETED",
}
}
type LicenseStatus string
// Enum values for LicenseStatus
const (
LicenseStatusAvailable LicenseStatus = "AVAILABLE"
LicenseStatusPendingAvailable LicenseStatus = "PENDING_AVAILABLE"
LicenseStatusDeactivated LicenseStatus = "DEACTIVATED"
LicenseStatusSuspended LicenseStatus = "SUSPENDED"
LicenseStatusExpired LicenseStatus = "EXPIRED"
LicenseStatusPendingDelete LicenseStatus = "PENDING_DELETE"
LicenseStatusDeleted LicenseStatus = "DELETED"
)
// Values returns all known values for LicenseStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (LicenseStatus) Values() []LicenseStatus {
return []LicenseStatus{
"AVAILABLE",
"PENDING_AVAILABLE",
"DEACTIVATED",
"SUSPENDED",
"EXPIRED",
"PENDING_DELETE",
"DELETED",
}
}
type ReceivedStatus string
// Enum values for ReceivedStatus
const (
ReceivedStatusPendingWorkflow ReceivedStatus = "PENDING_WORKFLOW"
ReceivedStatusPendingAccept ReceivedStatus = "PENDING_ACCEPT"
ReceivedStatusRejected ReceivedStatus = "REJECTED"
ReceivedStatusActive ReceivedStatus = "ACTIVE"
ReceivedStatusFailedWorkflow ReceivedStatus = "FAILED_WORKFLOW"
ReceivedStatusDeleted ReceivedStatus = "DELETED"
ReceivedStatusDisabled ReceivedStatus = "DISABLED"
ReceivedStatusWorkflowCompleted ReceivedStatus = "WORKFLOW_COMPLETED"
)
// Values returns all known values for ReceivedStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ReceivedStatus) Values() []ReceivedStatus {
return []ReceivedStatus{
"PENDING_WORKFLOW",
"PENDING_ACCEPT",
"REJECTED",
"ACTIVE",
"FAILED_WORKFLOW",
"DELETED",
"DISABLED",
"WORKFLOW_COMPLETED",
}
}
type RenewType string
// Enum values for RenewType
const (
RenewTypeNone RenewType = "None"
RenewTypeWeekly RenewType = "Weekly"
RenewTypeMonthly RenewType = "Monthly"
)
// Values returns all known values for RenewType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (RenewType) Values() []RenewType {
return []RenewType{
"None",
"Weekly",
"Monthly",
}
}
type ReportFrequencyType string
// Enum values for ReportFrequencyType
const (
ReportFrequencyTypeDay ReportFrequencyType = "DAY"
ReportFrequencyTypeWeek ReportFrequencyType = "WEEK"
ReportFrequencyTypeMonth ReportFrequencyType = "MONTH"
)
// Values returns all known values for ReportFrequencyType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ReportFrequencyType) Values() []ReportFrequencyType {
return []ReportFrequencyType{
"DAY",
"WEEK",
"MONTH",
}
}
type ReportType string
// Enum values for ReportType
const (
ReportTypeLicenseConfigurationSummaryReport ReportType = "LicenseConfigurationSummaryReport"
ReportTypeLicenseConfigurationUsageReport ReportType = "LicenseConfigurationUsageReport"
)
// Values returns all known values for ReportType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (ReportType) Values() []ReportType {
return []ReportType{
"LicenseConfigurationSummaryReport",
"LicenseConfigurationUsageReport",
}
}
type ResourceType string
// Enum values for ResourceType
const (
ResourceTypeEc2Instance ResourceType = "EC2_INSTANCE"
ResourceTypeEc2Host ResourceType = "EC2_HOST"
ResourceTypeEc2Ami ResourceType = "EC2_AMI"
ResourceTypeRds ResourceType = "RDS"
ResourceTypeSystemsManagerManagedInstance ResourceType = "SYSTEMS_MANAGER_MANAGED_INSTANCE"
)
// Values returns all known values for ResourceType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ResourceType) Values() []ResourceType {
return []ResourceType{
"EC2_INSTANCE",
"EC2_HOST",
"EC2_AMI",
"RDS",
"SYSTEMS_MANAGER_MANAGED_INSTANCE",
}
}
type TokenType string
// Enum values for TokenType
const (
TokenTypeRefreshToken TokenType = "REFRESH_TOKEN"
)
// Values returns all known values for TokenType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (TokenType) Values() []TokenType {
return []TokenType{
"REFRESH_TOKEN",
}
}
| 508 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// Access to resource denied.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The Amazon Web Services user account does not have permission to perform the
// action. Check the IAM policy associated with this account.
type AuthorizationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AuthorizationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AuthorizationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AuthorizationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AuthorizationException"
}
return *e.ErrorCodeOverride
}
func (e *AuthorizationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// There was a conflict processing the request. Try your request again.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The entitlement is not allowed.
type EntitlementNotAllowedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *EntitlementNotAllowedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *EntitlementNotAllowedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *EntitlementNotAllowedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "EntitlementNotAllowedException"
}
return *e.ErrorCodeOverride
}
func (e *EntitlementNotAllowedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// A dependency required to run the API is missing.
type FailedDependencyException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ *string
noSmithyDocumentSerde
}
func (e *FailedDependencyException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *FailedDependencyException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *FailedDependencyException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "FailedDependencyException"
}
return *e.ErrorCodeOverride
}
func (e *FailedDependencyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request uses too many filters or too many filter values.
type FilterLimitExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *FilterLimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *FilterLimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *FilterLimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "FilterLimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *FilterLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// One or more parameter values are not valid.
type InvalidParameterValueException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidParameterValueException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidParameterValueException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidParameterValueException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidParameterValueException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidParameterValueException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// License Manager cannot allocate a license to a resource because of its state.
// For example, you cannot allocate a license to an instance in the process of
// shutting down.
type InvalidResourceStateException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidResourceStateException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidResourceStateException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidResourceStateException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidResourceStateException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidResourceStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You do not have enough licenses available to support a new resource launch.
type LicenseUsageException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *LicenseUsageException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LicenseUsageException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LicenseUsageException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LicenseUsageException"
}
return *e.ErrorCodeOverride
}
func (e *LicenseUsageException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// There are no entitlements found for this license, or the entitlement maximum
// count is reached.
type NoEntitlementsAllowedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *NoEntitlementsAllowedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NoEntitlementsAllowedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NoEntitlementsAllowedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NoEntitlementsAllowedException"
}
return *e.ErrorCodeOverride
}
func (e *NoEntitlementsAllowedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Too many requests have been submitted. Try again after a brief wait.
type RateLimitExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *RateLimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *RateLimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *RateLimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "RateLimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *RateLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// This is not the correct Region for the resource. Try again.
type RedirectException struct {
Message *string
ErrorCodeOverride *string
Location *string
noSmithyDocumentSerde
}
func (e *RedirectException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *RedirectException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *RedirectException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "RedirectException"
}
return *e.ErrorCodeOverride
}
func (e *RedirectException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Your resource limits have been exceeded.
type ResourceLimitExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceLimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceLimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceLimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceLimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource cannot be found.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The server experienced an internal error. Try again.
type ServerInternalException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ServerInternalException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServerInternalException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServerInternalException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServerInternalException"
}
return *e.ErrorCodeOverride
}
func (e *ServerInternalException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The digital signature method is unsupported. Try your request again.
type UnsupportedDigitalSignatureMethodException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *UnsupportedDigitalSignatureMethodException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnsupportedDigitalSignatureMethodException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnsupportedDigitalSignatureMethodException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnsupportedDigitalSignatureMethodException"
}
return *e.ErrorCodeOverride
}
func (e *UnsupportedDigitalSignatureMethodException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// The provided input is not valid. Try your request again.
type ValidationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ValidationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ValidationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ValidationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ValidationException"
}
return *e.ErrorCodeOverride
}
func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 461 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// Describes automated discovery.
type AutomatedDiscoveryInformation struct {
// Time that automated discovery last ran.
LastRunTime *time.Time
noSmithyDocumentSerde
}
// Details about a borrow configuration.
type BorrowConfiguration struct {
// Indicates whether early check-ins are allowed.
//
// This member is required.
AllowEarlyCheckIn *bool
// Maximum time for the borrow configuration, in minutes.
//
// This member is required.
MaxTimeToLiveInMinutes *int32
noSmithyDocumentSerde
}
// Details about license consumption.
type ConsumedLicenseSummary struct {
// Number of licenses consumed by the resource.
ConsumedLicenses *int64
// Resource type of the resource consuming a license.
ResourceType ResourceType
noSmithyDocumentSerde
}
// Details about a consumption configuration.
type ConsumptionConfiguration struct {
// Details about a borrow configuration.
BorrowConfiguration *BorrowConfiguration
// Details about a provisional configuration.
ProvisionalConfiguration *ProvisionalConfiguration
// Renewal frequency.
RenewType RenewType
noSmithyDocumentSerde
}
// Describes a time range, in ISO8601-UTC format.
type DatetimeRange struct {
// Start of the time range.
//
// This member is required.
Begin *string
// End of the time range.
End *string
noSmithyDocumentSerde
}
// Describes a resource entitled for use with a license.
type Entitlement struct {
// Entitlement name.
//
// This member is required.
Name *string
// Entitlement unit.
//
// This member is required.
Unit EntitlementUnit
// Indicates whether check-ins are allowed.
AllowCheckIn *bool
// Maximum entitlement count. Use if the unit is not None.
MaxCount *int64
// Indicates whether overages are allowed.
Overage *bool
// Entitlement resource. Use only if the unit is None.
Value *string
noSmithyDocumentSerde
}
// Data associated with an entitlement resource.
type EntitlementData struct {
// Entitlement data name.
//
// This member is required.
Name *string
// Entitlement data unit.
//
// This member is required.
Unit EntitlementDataUnit
// Entitlement data value.
Value *string
noSmithyDocumentSerde
}
// Usage associated with an entitlement resource.
type EntitlementUsage struct {
// Resource usage consumed.
//
// This member is required.
ConsumedValue *string
// Entitlement usage name.
//
// This member is required.
Name *string
// Entitlement usage unit.
//
// This member is required.
Unit EntitlementDataUnit
// Maximum entitlement usage count.
MaxCount *string
noSmithyDocumentSerde
}
// A filter name and value pair that is used to return more specific results from
// a describe operation. Filters can be used to match a set of resources by
// specific criteria, such as tags, attributes, or IDs.
type Filter struct {
// Name of the filter. Filter names are case-sensitive.
Name *string
// The value of the filter, which is case-sensitive. You can only specify one
// value for the filter.
Values []string
noSmithyDocumentSerde
}
// Describes a grant.
type Grant struct {
// Amazon Resource Name (ARN) of the grant.
//
// This member is required.
GrantArn *string
// Grant name.
//
// This member is required.
GrantName *string
// Grant status.
//
// This member is required.
GrantStatus GrantStatus
// Granted operations.
//
// This member is required.
GrantedOperations []AllowedOperation
// The grantee principal ARN.
//
// This member is required.
GranteePrincipalArn *string
// Home Region of the grant.
//
// This member is required.
HomeRegion *string
// License ARN.
//
// This member is required.
LicenseArn *string
// Parent ARN.
//
// This member is required.
ParentArn *string
// Grant version.
//
// This member is required.
Version *string
// The options specified for the grant.
Options *Options
// Grant status reason.
StatusReason *string
noSmithyDocumentSerde
}
// Describes a license that is granted to a grantee.
type GrantedLicense struct {
// Granted license beneficiary.
Beneficiary *string
// Configuration for consumption of the license.
ConsumptionConfiguration *ConsumptionConfiguration
// Creation time of the granted license.
CreateTime *string
// License entitlements.
Entitlements []Entitlement
// Home Region of the granted license.
HomeRegion *string
// Granted license issuer.
Issuer *IssuerDetails
// Amazon Resource Name (ARN) of the license.
LicenseArn *string
// Granted license metadata.
LicenseMetadata []Metadata
// License name.
LicenseName *string
// Product name.
ProductName *string
// Product SKU.
ProductSKU *string
// Granted license received metadata.
ReceivedMetadata *ReceivedMetadata
// Granted license status.
Status LicenseStatus
// Date and time range during which the granted license is valid, in ISO8601-UTC
// format.
Validity *DatetimeRange
// Version of the granted license.
Version *string
noSmithyDocumentSerde
}
// An inventory filter.
type InventoryFilter struct {
// Condition of the filter.
//
// This member is required.
Condition InventoryFilterCondition
// Name of the filter.
//
// This member is required.
Name *string
// Value of the filter.
Value *string
noSmithyDocumentSerde
}
// Details about the issuer of a license.
type Issuer struct {
// Issuer name.
//
// This member is required.
Name *string
// Asymmetric KMS key from Key Management Service. The KMS key must have a key
// usage of sign and verify, and support the RSASSA-PSS SHA-256 signing algorithm.
SignKey *string
noSmithyDocumentSerde
}
// Details associated with the issuer of a license.
type IssuerDetails struct {
// Issuer key fingerprint.
KeyFingerprint *string
// Issuer name.
Name *string
// Asymmetric KMS key from Key Management Service. The KMS key must have a key
// usage of sign and verify, and support the RSASSA-PSS SHA-256 signing algorithm.
SignKey *string
noSmithyDocumentSerde
}
// Software license that is managed in License Manager.
type License struct {
// License beneficiary.
Beneficiary *string
// Configuration for consumption of the license.
ConsumptionConfiguration *ConsumptionConfiguration
// License creation time.
CreateTime *string
// License entitlements.
Entitlements []Entitlement
// Home Region of the license.
HomeRegion *string
// License issuer.
Issuer *IssuerDetails
// Amazon Resource Name (ARN) of the license.
LicenseArn *string
// License metadata.
LicenseMetadata []Metadata
// License name.
LicenseName *string
// Product name.
ProductName *string
// Product SKU.
ProductSKU *string
// License status.
Status LicenseStatus
// Date and time range during which the license is valid, in ISO8601-UTC format.
Validity *DatetimeRange
// License version.
Version *string
noSmithyDocumentSerde
}
// A license configuration is an abstraction of a customer license agreement that
// can be consumed and enforced by License Manager. Components include
// specifications for the license type (licensing by instance, socket, CPU, or
// vCPU), allowed tenancy (shared tenancy, Dedicated Instance, Dedicated Host, or
// all of these), host affinity (how long a VM must be associated with a host), and
// the number of licenses purchased and used.
type LicenseConfiguration struct {
// Automated discovery information.
AutomatedDiscoveryInformation *AutomatedDiscoveryInformation
// Summaries for licenses consumed by various resources.
ConsumedLicenseSummaryList []ConsumedLicenseSummary
// Number of licenses consumed.
ConsumedLicenses *int64
// Description of the license configuration.
Description *string
// When true, disassociates a resource when software is uninstalled.
DisassociateWhenNotFound *bool
// Amazon Resource Name (ARN) of the license configuration.
LicenseConfigurationArn *string
// Unique ID of the license configuration.
LicenseConfigurationId *string
// Number of licenses managed by the license configuration.
LicenseCount *int64
// Number of available licenses as a hard limit.
LicenseCountHardLimit *bool
// Dimension to use to track the license inventory.
LicenseCountingType LicenseCountingType
// License rules.
LicenseRules []string
// Summaries for managed resources.
ManagedResourceSummaryList []ManagedResourceSummary
// Name of the license configuration.
Name *string
// Account ID of the license configuration's owner.
OwnerAccountId *string
// Product information.
ProductInformationList []ProductInformation
// Status of the license configuration.
Status *string
noSmithyDocumentSerde
}
// Describes an association with a license configuration.
type LicenseConfigurationAssociation struct {
// Scope of AMI associations. The possible value is cross-account .
AmiAssociationScope *string
// Time when the license configuration was associated with the resource.
AssociationTime *time.Time
// Amazon Resource Name (ARN) of the resource.
ResourceArn *string
// ID of the Amazon Web Services account that owns the resource consuming licenses.
ResourceOwnerId *string
// Type of server resource.
ResourceType ResourceType
noSmithyDocumentSerde
}
// Details about the usage of a resource associated with a license configuration.
type LicenseConfigurationUsage struct {
// Time when the license configuration was initially associated with the resource.
AssociationTime *time.Time
// Number of licenses consumed by the resource.
ConsumedLicenses *int64
// Amazon Resource Name (ARN) of the resource.
ResourceArn *string
// ID of the account that owns the resource.
ResourceOwnerId *string
// Status of the resource.
ResourceStatus *string
// Type of resource.
ResourceType ResourceType
noSmithyDocumentSerde
}
// Information about a license type conversion task.
type LicenseConversionContext struct {
// The Usage operation value that corresponds to the license type you are
// converting your resource from. For more information about which platforms
// correspond to which usage operation values see Sample data: usage operation by
// platform (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-info-fields.html#billing-info)
UsageOperation *string
noSmithyDocumentSerde
}
// Information about a license type conversion task.
type LicenseConversionTask struct {
// Information about the license type this conversion task converted to.
DestinationLicenseContext *LicenseConversionContext
// The time the conversion task was completed.
EndTime *time.Time
// The ID of the license type conversion task.
LicenseConversionTaskId *string
// The time the usage operation value of the resource was changed.
LicenseConversionTime *time.Time
// The Amazon Resource Name (ARN) of the resource associated with the license type
// conversion task.
ResourceArn *string
// Information about the license type this conversion task converted from.
SourceLicenseContext *LicenseConversionContext
// The time the conversion task was started at.
StartTime *time.Time
// The status of the conversion task.
Status LicenseConversionTaskStatus
// The status message for the conversion task.
StatusMessage *string
noSmithyDocumentSerde
}
// Describes the failure of a license operation.
type LicenseOperationFailure struct {
// Error message.
ErrorMessage *string
// Failure time.
FailureTime *time.Time
// Reserved.
MetadataList []Metadata
// Name of the operation.
OperationName *string
// The requester is "License Manager Automated Discovery".
OperationRequestedBy *string
// Amazon Resource Name (ARN) of the resource.
ResourceArn *string
// ID of the Amazon Web Services account that owns the resource.
ResourceOwnerId *string
// Resource type.
ResourceType ResourceType
noSmithyDocumentSerde
}
// Details for associating a license configuration with a resource.
type LicenseSpecification struct {
// Amazon Resource Name (ARN) of the license configuration.
//
// This member is required.
LicenseConfigurationArn *string
// Scope of AMI associations. The possible value is cross-account .
AmiAssociationScope *string
noSmithyDocumentSerde
}
// Describes the entitlement usage associated with a license.
type LicenseUsage struct {
// License entitlement usages.
EntitlementUsages []EntitlementUsage
noSmithyDocumentSerde
}
// Summary information about a managed resource.
type ManagedResourceSummary struct {
// Number of resources associated with licenses.
AssociationCount *int64
// Type of resource associated with a license.
ResourceType ResourceType
noSmithyDocumentSerde
}
// Describes key/value pairs.
type Metadata struct {
// The key name.
Name *string
// The value.
Value *string
noSmithyDocumentSerde
}
// The options you can specify when you create a new version of a grant, such as
// activation override behavior. For more information, see Granted licenses in
// License Manager (https://docs.aws.amazon.com/license-manager/latest/userguide/granted-licenses.html)
// in the License Manager User Guide.
type Options struct {
// An activation option for your grant that determines the behavior of activating
// a grant. Activation options can only be used with granted licenses sourced from
// the Amazon Web Services Marketplace. Additionally, the operation must specify
// the value of ACTIVE for the Status parameter.
// - As a license administrator, you can optionally specify an
// ActivationOverrideBehavior when activating a grant.
// - As a grantor, you can optionally specify an ActivationOverrideBehavior when
// you activate a grant for a grantee account in your organization.
// - As a grantee, if the grantor creating the distributed grant doesn’t specify
// an ActivationOverrideBehavior , you can optionally specify one when you are
// activating the grant.
// DISTRIBUTED_GRANTS_ONLY Use this value to activate a grant without replacing
// any member account’s active grants for the same product.
// ALL_GRANTS_PERMITTED_BY_ISSUER Use this value to activate a grant and disable
// other active grants in any member accounts for the same product. This action
// will also replace their previously activated grants with this activated grant.
ActivationOverrideBehavior ActivationOverrideBehavior
noSmithyDocumentSerde
}
// Configuration information for Organizations.
type OrganizationConfiguration struct {
// Enables Organizations integration.
//
// This member is required.
EnableIntegration bool
noSmithyDocumentSerde
}
// Describes product information for a license configuration.
type ProductInformation struct {
// A Product information filter consists of a ProductInformationFilterComparator
// which is a logical operator, a ProductInformationFilterName which specifies the
// type of filter being declared, and a ProductInformationFilterValue that
// specifies the value to filter on. Accepted values for
// ProductInformationFilterName are listed here along with descriptions and valid
// options for ProductInformationFilterComparator . The following filters and are
// supported when the resource type is SSM_MANAGED :
// - Application Name - The name of the application. Logical operator is EQUALS .
// - Application Publisher - The publisher of the application. Logical operator
// is EQUALS .
// - Application Version - The version of the application. Logical operator is
// EQUALS .
// - Platform Name - The name of the platform. Logical operator is EQUALS .
// - Platform Type - The platform type. Logical operator is EQUALS .
// - Tag:key - The key of a tag attached to an Amazon Web Services resource you
// wish to exclude from automated discovery. Logical operator is NOT_EQUALS . The
// key for your tag must be appended to Tag: following the example:
// Tag:name-of-your-key . ProductInformationFilterValue is optional if you are
// not using values for the key.
// - AccountId - The 12-digit ID of an Amazon Web Services account you wish to
// exclude from automated discovery. Logical operator is NOT_EQUALS .
// - License Included - The type of license included. Logical operators are
// EQUALS and NOT_EQUALS . Possible values are: sql-server-enterprise |
// sql-server-standard | sql-server-web | windows-server-datacenter .
// The following filters and logical operators are supported when the resource
// type is RDS :
// - Engine Edition - The edition of the database engine. Logical operator is
// EQUALS . Possible values are: oracle-ee | oracle-se | oracle-se1 | oracle-se2
// .
// - License Pack - The license pack. Logical operator is EQUALS . Possible
// values are: data guard | diagnostic pack sqlt | tuning pack sqlt | ols | olap
// .
//
// This member is required.
ProductInformationFilterList []ProductInformationFilter
// Resource type. The possible values are SSM_MANAGED | RDS .
//
// This member is required.
ResourceType *string
noSmithyDocumentSerde
}
// Describes product information filters.
type ProductInformationFilter struct {
// Logical operator.
//
// This member is required.
ProductInformationFilterComparator *string
// Filter name.
//
// This member is required.
ProductInformationFilterName *string
// Filter value.
ProductInformationFilterValue []string
noSmithyDocumentSerde
}
// Details about a provisional configuration.
type ProvisionalConfiguration struct {
// Maximum time for the provisional configuration, in minutes.
//
// This member is required.
MaxTimeToLiveInMinutes *int32
noSmithyDocumentSerde
}
// Metadata associated with received licenses and grants.
type ReceivedMetadata struct {
// Allowed operations.
AllowedOperations []AllowedOperation
// Received status.
ReceivedStatus ReceivedStatus
// Received status reason.
ReceivedStatusReason *string
noSmithyDocumentSerde
}
// Details of the license configuration that this generator reports on.
type ReportContext struct {
// Amazon Resource Name (ARN) of the license configuration that this generator
// reports on.
//
// This member is required.
LicenseConfigurationArns []string
noSmithyDocumentSerde
}
// Details about how frequently reports are generated.
type ReportFrequency struct {
// Time period between each report. The period can be daily, weekly, or monthly.
Period ReportFrequencyType
// Number of times within the frequency period that a report is generated. The
// only supported value is 1 .
Value *int32
noSmithyDocumentSerde
}
// Describe the details of a report generator.
type ReportGenerator struct {
// Time the report was created.
CreateTime *string
// Description of the report generator.
Description *string
// Time the last report was generated at.
LastReportGenerationTime *string
// Failure message for the last report generation attempt.
LastRunFailureReason *string
// Status of the last report generation attempt.
LastRunStatus *string
// Amazon Resource Name (ARN) of the report generator.
LicenseManagerReportGeneratorArn *string
// License configuration type for this generator.
ReportContext *ReportContext
// The Amazon Web Services account ID used to create the report generator.
ReportCreatorAccount *string
// Details about how frequently reports are generated.
ReportFrequency *ReportFrequency
// Name of the report generator.
ReportGeneratorName *string
// Type of reports that are generated.
ReportType []ReportType
// Details of the S3 bucket that report generator reports are published to.
S3Location *S3Location
// Tags associated with the report generator.
Tags []Tag
noSmithyDocumentSerde
}
// Details about a resource.
type ResourceInventory struct {
// Platform of the resource.
Platform *string
// Platform version of the resource in the inventory.
PlatformVersion *string
// Amazon Resource Name (ARN) of the resource.
ResourceArn *string
// ID of the resource.
ResourceId *string
// ID of the account that owns the resource.
ResourceOwningAccountId *string
// Type of resource.
ResourceType ResourceType
noSmithyDocumentSerde
}
// Details of the S3 bucket that report generator reports are published to.
type S3Location struct {
// Name of the S3 bucket reports are published to.
Bucket *string
// Prefix of the S3 bucket reports are published to.
KeyPrefix *string
noSmithyDocumentSerde
}
// Details about a tag for a license configuration.
type Tag struct {
// Tag key.
Key *string
// Tag value.
Value *string
noSmithyDocumentSerde
}
// Describes a token.
type TokenData struct {
// Token expiration time, in ISO8601-UTC format.
ExpirationTime *string
// Amazon Resource Name (ARN) of the license.
LicenseArn *string
// Amazon Resource Names (ARN) of the roles included in the token.
RoleArns []string
// Token status. The possible values are AVAILABLE and DELETED .
Status *string
// Token ID.
TokenId *string
// Data specified by the caller.
TokenProperties []string
// Type of token generated. The supported value is REFRESH_TOKEN .
TokenType *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 872 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package licensemanagerlinuxsubscriptions
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "License Manager Linux Subscriptions"
const ServiceAPIVersion = "2018-05-10"
// Client provides the API client to make operations call for AWS License Manager
// Linux Subscriptions.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "licensemanagerlinuxsubscriptions", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 435 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.