Skip to content

Commit

Permalink
feat(client-ec2-instance-connect): This release includes a new except…
Browse files Browse the repository at this point in the history
…ion type "EC2InstanceUnavailableException" for SendSSHPublicKey and SendSerialConsoleSSHPublicKey APIs.
  • Loading branch information
awstools committed Jul 21, 2022
1 parent e94c855 commit a2aef86
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
21 changes: 21 additions & 0 deletions clients/client-ec2-instance-connect/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@ export class EC2InstanceTypeInvalidException extends __BaseException {
}
}

/**
* <p>The instance is currently unavailable. Wait a few minutes and try again.</p>
*/
export class EC2InstanceUnavailableException extends __BaseException {
readonly name: "EC2InstanceUnavailableException" = "EC2InstanceUnavailableException";
readonly $fault: "server" = "server";
Message?: string;
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<EC2InstanceUnavailableException, __BaseException>) {
super({
name: "EC2InstanceUnavailableException",
$fault: "server",
...opts,
});
Object.setPrototypeOf(this, EC2InstanceUnavailableException.prototype);
this.Message = opts.Message;
}
}

/**
* <p>One of the parameters is not valid.</p>
*/
Expand Down
29 changes: 29 additions & 0 deletions clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
EC2InstanceNotFoundException,
EC2InstanceStateInvalidException,
EC2InstanceTypeInvalidException,
EC2InstanceUnavailableException,
InvalidArgsException,
SendSerialConsoleSSHPublicKeyRequest,
SendSerialConsoleSSHPublicKeyResponse,
Expand Down Expand Up @@ -101,6 +102,9 @@ const deserializeAws_json1_1SendSerialConsoleSSHPublicKeyCommandError = async (
case "EC2InstanceTypeInvalidException":
case "com.amazonaws.ec2instanceconnect#EC2InstanceTypeInvalidException":
throw await deserializeAws_json1_1EC2InstanceTypeInvalidExceptionResponse(parsedOutput, context);
case "EC2InstanceUnavailableException":
case "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException":
throw await deserializeAws_json1_1EC2InstanceUnavailableExceptionResponse(parsedOutput, context);
case "InvalidArgsException":
case "com.amazonaws.ec2instanceconnect#InvalidArgsException":
throw await deserializeAws_json1_1InvalidArgsExceptionResponse(parsedOutput, context);
Expand Down Expand Up @@ -169,6 +173,9 @@ const deserializeAws_json1_1SendSSHPublicKeyCommandError = async (
case "EC2InstanceStateInvalidException":
case "com.amazonaws.ec2instanceconnect#EC2InstanceStateInvalidException":
throw await deserializeAws_json1_1EC2InstanceStateInvalidExceptionResponse(parsedOutput, context);
case "EC2InstanceUnavailableException":
case "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException":
throw await deserializeAws_json1_1EC2InstanceUnavailableExceptionResponse(parsedOutput, context);
case "InvalidArgsException":
case "com.amazonaws.ec2instanceconnect#InvalidArgsException":
throw await deserializeAws_json1_1InvalidArgsExceptionResponse(parsedOutput, context);
Expand Down Expand Up @@ -243,6 +250,19 @@ const deserializeAws_json1_1EC2InstanceTypeInvalidExceptionResponse = async (
return __decorateServiceException(exception, body);
};

const deserializeAws_json1_1EC2InstanceUnavailableExceptionResponse = async (
parsedOutput: any,
context: __SerdeContext
): Promise<EC2InstanceUnavailableException> => {
const body = parsedOutput.body;
const deserialized: any = deserializeAws_json1_1EC2InstanceUnavailableException(body, context);
const exception = new EC2InstanceUnavailableException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return __decorateServiceException(exception, body);
};

const deserializeAws_json1_1InvalidArgsExceptionResponse = async (
parsedOutput: any,
context: __SerdeContext
Expand Down Expand Up @@ -374,6 +394,15 @@ const deserializeAws_json1_1EC2InstanceTypeInvalidException = (
} as any;
};

const deserializeAws_json1_1EC2InstanceUnavailableException = (
output: any,
context: __SerdeContext
): EC2InstanceUnavailableException => {
return {
Message: __expectString(output.Message),
} as any;
};

const deserializeAws_json1_1InvalidArgsException = (output: any, context: __SerdeContext): InvalidArgsException => {
return {
Message: __expectString(output.Message),
Expand Down
23 changes: 23 additions & 0 deletions codegen/sdk-codegen/aws-models/ec2-instance-connect.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,23 @@
"smithy.api#httpError": 400
}
},
"com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException": {
"type": "structure",
"members": {
"Message": {
"target": "com.amazonaws.ec2instanceconnect#String"
}
},
"traits": {
"aws.protocols#awsQueryError": {
"code": "EC2InstanceUnavailable",
"httpResponseCode": 503
},
"smithy.api#documentation": "<p>The instance is currently unavailable. Wait a few minutes and try again.</p>",
"smithy.api#error": "server",
"smithy.api#httpError": 503
}
},
"com.amazonaws.ec2instanceconnect#InstanceId": {
"type": "string",
"traits": {
Expand Down Expand Up @@ -201,6 +218,9 @@
{
"target": "com.amazonaws.ec2instanceconnect#EC2InstanceStateInvalidException"
},
{
"target": "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException"
},
{
"target": "com.amazonaws.ec2instanceconnect#InvalidArgsException"
},
Expand Down Expand Up @@ -285,6 +305,9 @@
{
"target": "com.amazonaws.ec2instanceconnect#EC2InstanceTypeInvalidException"
},
{
"target": "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException"
},
{
"target": "com.amazonaws.ec2instanceconnect#InvalidArgsException"
},
Expand Down

0 comments on commit a2aef86

Please sign in to comment.