Skip to content

Commit

Permalink
feat(client-s3outposts): S3 On Outposts added support for endpoint st…
Browse files Browse the repository at this point in the history
…atus, and a failed endpoint reason, if any
  • Loading branch information
awstools committed Mar 20, 2023
1 parent 1824352 commit 56a152d
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 56 deletions.
20 changes: 4 additions & 16 deletions clients/client-s3outposts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,15 @@
"typedoc": "0.23.23",
"typescript": "~4.9.5"
},
"engines": {
"node": ">=14.0.0"
},
"typesVersions": {
"<4.0": {
"dist-types/*": [
"dist-types/ts3.4/*"
]
}
},
"files": [
"dist-*"
],
"engines": { "node": ">=14.0.0" },
"typesVersions": { "<4.0": { "dist-types/*": ["dist-types/ts3.4/*"] } },
"files": ["dist-*"],
"author": {
"name": "AWS SDK for JavaScript Team",
"url": "https://aws.amazon.com/javascript/"
},
"license": "Apache-2.0",
"browser": {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
},
"browser": { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" },
"react-native": {
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export interface CreateEndpointCommandOutput extends CreateEndpointResult, __Met
* @throws {@link InternalServerException} (server fault)
* <p>There was an exception with the internal server.</p>
*
* @throws {@link OutpostOfflineException} (client fault)
* <p>The service link connection to your Outposts home Region is down. Check your connection and try again.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The requested resource was not found.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ export interface DeleteEndpointCommandOutput extends __MetadataBearer {}
* @throws {@link InternalServerException} (server fault)
* <p>There was an exception with the internal server.</p>
*
* @throws {@link OutpostOfflineException} (client fault)
* <p>The service link connection to your Outposts home Region is down. Check your connection and try again.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The requested resource was not found.</p>
*
Expand Down
50 changes: 50 additions & 0 deletions clients/client-s3outposts/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,27 @@ export class InternalServerException extends __BaseException {
}
}

/**
* <p>The service link connection to your Outposts home Region is down. Check your connection and try again.</p>
*/
export class OutpostOfflineException extends __BaseException {
readonly name: "OutpostOfflineException" = "OutpostOfflineException";
readonly $fault: "client" = "client";
Message?: string;
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<OutpostOfflineException, __BaseException>) {
super({
name: "OutpostOfflineException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, OutpostOfflineException.prototype);
this.Message = opts.Message;
}
}

/**
* <p>The requested resource was not found.</p>
*/
Expand Down Expand Up @@ -190,6 +211,21 @@ export interface DeleteEndpointRequest {
OutpostId: string | undefined;
}

/**
* <p>The failure reason, if any, for a create or delete endpoint operation.</p>
*/
export interface FailedReason {
/**
* <p>The failure code, if any, for a create or delete endpoint operation.</p>
*/
ErrorCode?: string;

/**
* <p>Additional error details describing the endpoint failure and recommended action.</p>
*/
Message?: string;
}

/**
* <p>The container for the network interface.</p>
*/
Expand All @@ -202,6 +238,8 @@ export interface NetworkInterface {

export enum EndpointStatus {
AVAILABLE = "Available",
CREATE_FAILED = "Create_Failed",
DELETE_FAILED = "Delete_Failed",
DELETING = "Deleting",
PENDING = "Pending",
}
Expand Down Expand Up @@ -267,6 +305,11 @@ export interface Endpoint {
* <p>The ID of the customer-owned IPv4 address pool used for the endpoint.</p>
*/
CustomerOwnedIpv4Pool?: string;

/**
* <p>The failure reason, if any, for a create or delete endpoint operation.</p>
*/
FailedReason?: FailedReason;
}

export interface ListEndpointsRequest {
Expand Down Expand Up @@ -410,6 +453,13 @@ export const DeleteEndpointRequestFilterSensitiveLog = (obj: DeleteEndpointReque
...obj,
});

/**
* @internal
*/
export const FailedReasonFilterSensitiveLog = (obj: FailedReason): any => ({
...obj,
});

/**
* @internal
*/
Expand Down
33 changes: 33 additions & 0 deletions clients/client-s3outposts/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ import {
AccessDeniedException,
ConflictException,
Endpoint,
FailedReason,
InternalServerException,
NetworkInterface,
Outpost,
OutpostOfflineException,
ResourceNotFoundException,
ThrottlingException,
ValidationException,
Expand Down Expand Up @@ -205,6 +207,9 @@ const deserializeAws_restJson1CreateEndpointCommandError = async (
case "InternalServerException":
case "com.amazonaws.s3outposts#InternalServerException":
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
case "OutpostOfflineException":
case "com.amazonaws.s3outposts#OutpostOfflineException":
throw await deserializeAws_restJson1OutpostOfflineExceptionResponse(parsedOutput, context);
case "ResourceNotFoundException":
case "com.amazonaws.s3outposts#ResourceNotFoundException":
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
Expand Down Expand Up @@ -255,6 +260,9 @@ const deserializeAws_restJson1DeleteEndpointCommandError = async (
case "InternalServerException":
case "com.amazonaws.s3outposts#InternalServerException":
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
case "OutpostOfflineException":
case "com.amazonaws.s3outposts#OutpostOfflineException":
throw await deserializeAws_restJson1OutpostOfflineExceptionResponse(parsedOutput, context);
case "ResourceNotFoundException":
case "com.amazonaws.s3outposts#ResourceNotFoundException":
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
Expand Down Expand Up @@ -489,6 +497,22 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (
return __decorateServiceException(exception, parsedOutput.body);
};

const deserializeAws_restJson1OutpostOfflineExceptionResponse = async (
parsedOutput: any,
context: __SerdeContext
): Promise<OutpostOfflineException> => {
const contents: any = map({});
const data: any = parsedOutput.body;
if (data.Message != null) {
contents.Message = __expectString(data.Message);
}
const exception = new OutpostOfflineException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return __decorateServiceException(exception, parsedOutput.body);
};

const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
parsedOutput: any,
context: __SerdeContext
Expand Down Expand Up @@ -547,6 +571,8 @@ const deserializeAws_restJson1Endpoint = (output: any, context: __SerdeContext):
: undefined,
CustomerOwnedIpv4Pool: __expectString(output.CustomerOwnedIpv4Pool),
EndpointArn: __expectString(output.EndpointArn),
FailedReason:
output.FailedReason != null ? deserializeAws_restJson1FailedReason(output.FailedReason, context) : undefined,
NetworkInterfaces:
output.NetworkInterfaces != null
? deserializeAws_restJson1NetworkInterfaces(output.NetworkInterfaces, context)
Expand All @@ -571,6 +597,13 @@ const deserializeAws_restJson1Endpoints = (output: any, context: __SerdeContext)
return retVal;
};

const deserializeAws_restJson1FailedReason = (output: any, context: __SerdeContext): FailedReason => {
return {
ErrorCode: __expectString(output.ErrorCode),
Message: __expectString(output.Message),
} as any;
};

const deserializeAws_restJson1NetworkInterface = (output: any, context: __SerdeContext): NetworkInterface => {
return {
NetworkInterfaceId: __expectString(output.NetworkInterfaceId),
Expand Down
Loading

0 comments on commit 56a152d

Please sign in to comment.