Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(codegen): preprocess AwsQuery error to shapeId in waiter errorType #6501

Merged
merged 4 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const checkState = async (client: DocDBClient, input: DescribeDBInstancesCommand
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "DBInstanceNotFound") {
if (exception.name && exception.name == "DBInstanceNotFoundFault") {
return { state: WaiterState.SUCCESS, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const checkState = async (
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "LoadBalancerNotFound") {
if (exception.name && exception.name == "LoadBalancerNotFoundException") {
return { state: WaiterState.RETRY, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const checkState = async (
return { state: WaiterState.SUCCESS, reason };
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "LoadBalancerNotFound") {
if (exception.name && exception.name == "LoadBalancerNotFoundException") {
return { state: WaiterState.RETRY, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const checkState = async (
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "LoadBalancerNotFound") {
if (exception.name && exception.name == "LoadBalancerNotFoundException") {
return { state: WaiterState.SUCCESS, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const checkState = async (
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "InvalidTarget") {
if (exception.name && exception.name == "InvalidTargetException") {
return { state: WaiterState.SUCCESS, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const checkState = async (
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "InvalidInstance") {
if (exception.name && exception.name == "InvalidEndPointException") {
return { state: WaiterState.SUCCESS, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const checkState = async (
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "InvalidInstance") {
if (exception.name && exception.name == "InvalidEndPointException") {
return { state: WaiterState.RETRY, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const checkState = async (
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "CacheClusterNotFound") {
if (exception.name && exception.name == "CacheClusterNotFoundFault") {
return { state: WaiterState.SUCCESS, reason };
}
}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-iam/src/waiters/waitForPolicyExists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const checkState = async (client: IAMClient, input: GetPolicyCommandInput): Prom
return { state: WaiterState.SUCCESS, reason };
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "NoSuchEntity") {
if (exception.name && exception.name == "NoSuchEntityException") {
return { state: WaiterState.RETRY, reason };
}
}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-iam/src/waiters/waitForRoleExists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const checkState = async (client: IAMClient, input: GetRoleCommandInput): Promis
return { state: WaiterState.SUCCESS, reason };
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "NoSuchEntity") {
if (exception.name && exception.name == "NoSuchEntityException") {
return { state: WaiterState.RETRY, reason };
}
}
Expand Down
2 changes: 1 addition & 1 deletion clients/client-iam/src/waiters/waitForUserExists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const checkState = async (client: IAMClient, input: GetUserCommandInput): Promis
return { state: WaiterState.SUCCESS, reason };
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "NoSuchEntity") {
if (exception.name && exception.name == "NoSuchEntityException") {
return { state: WaiterState.RETRY, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const checkState = async (client: NeptuneClient, input: DescribeDBInstancesComma
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "DBInstanceNotFound") {
if (exception.name && exception.name == "DBInstanceNotFoundFault") {
return { state: WaiterState.SUCCESS, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const checkState = async (client: RDSClient, input: DescribeDBInstancesCommandIn
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "DBInstanceNotFound") {
if (exception.name && exception.name == "DBInstanceNotFoundFault") {
return { state: WaiterState.SUCCESS, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const checkState = async (client: RDSClient, input: DescribeDBSnapshotsCommandIn
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "DBSnapshotNotFound") {
if (exception.name && exception.name == "DBSnapshotNotFoundFault") {
return { state: WaiterState.SUCCESS, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const checkState = async (client: RedshiftClient, input: DescribeClustersCommand
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "ClusterNotFound") {
if (exception.name && exception.name == "ClusterNotFoundFault") {
return { state: WaiterState.RETRY, reason };
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const checkState = async (client: RedshiftClient, input: DescribeClustersCommand
} catch (e) {}
} catch (exception) {
reason = exception;
if (exception.name && exception.name == "ClusterNotFound") {
if (exception.name && exception.name == "ClusterNotFoundFault") {
return { state: WaiterState.SUCCESS, reason };
}
}
Expand Down
22 changes: 11 additions & 11 deletions clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,39 +82,39 @@ export interface DeleteObjectTaggingCommandOutput extends DeleteObjectTaggingOut
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @public
* @example To remove tag set from an object version
* @example To remove tag set from an object
* ```javascript
* // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version.
* // The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the operation removes tag set from the latest object version.
* const input = {
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg",
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* "Key": "HappyFace.jpg"
* };
* const command = new DeleteObjectTaggingCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* "VersionId": "null"
* }
* *\/
* // example id: to-remove-tag-set-from-an-object-version-1483145285913
* // example id: to-remove-tag-set-from-an-object-1483145342862
* ```
*
* @example To remove tag set from an object
* @example To remove tag set from an object version
* ```javascript
* // The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the operation removes tag set from the latest object version.
* // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version.
* const input = {
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg"
* "Key": "HappyFace.jpg",
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* };
* const command = new DeleteObjectTaggingCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "VersionId": "null"
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* }
* *\/
* // example id: to-remove-tag-set-from-an-object-1483145342862
* // example id: to-remove-tag-set-from-an-object-version-1483145285913
* ```
*
*/
Expand Down
44 changes: 22 additions & 22 deletions clients/client-s3/src/commands/DeleteObjectsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,20 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @public
* @example To delete multiple objects from a versioned bucket
* @example To delete multiple object versions from a versioned bucket
* ```javascript
* // The following example deletes objects from a bucket. The bucket is versioned, and the request does not specify the object version to delete. In this case, all versions remain in the bucket and S3 adds a delete marker.
* // The following example deletes objects from a bucket. The request specifies object versions. S3 deletes specific object versions and returns the key and versions of deleted objects in the response.
* const input = {
* "Bucket": "examplebucket",
* "Delete": {
* "Objects": [
* {
* "Key": "objectkey1"
* "Key": "HappyFace.jpg",
* "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b"
* },
* {
* "Key": "objectkey2"
* "Key": "HappyFace.jpg",
* "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd"
* }
* ],
* "Quiet": false
Expand All @@ -236,35 +238,31 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad
* {
* "Deleted": [
* {
* "DeleteMarker": "true",
* "DeleteMarkerVersionId": "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F",
* "Key": "objectkey1"
* "Key": "HappyFace.jpg",
* "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd"
* },
* {
* "DeleteMarker": "true",
* "DeleteMarkerVersionId": "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt",
* "Key": "objectkey2"
* "Key": "HappyFace.jpg",
* "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b"
* }
* ]
* }
* *\/
* // example id: to-delete-multiple-objects-from-a-versioned-bucket-1483146248805
* // example id: to-delete-multiple-object-versions-from-a-versioned-bucket-1483147087737
* ```
*
* @example To delete multiple object versions from a versioned bucket
* @example To delete multiple objects from a versioned bucket
* ```javascript
* // The following example deletes objects from a bucket. The request specifies object versions. S3 deletes specific object versions and returns the key and versions of deleted objects in the response.
* // The following example deletes objects from a bucket. The bucket is versioned, and the request does not specify the object version to delete. In this case, all versions remain in the bucket and S3 adds a delete marker.
* const input = {
* "Bucket": "examplebucket",
* "Delete": {
* "Objects": [
* {
* "Key": "HappyFace.jpg",
* "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b"
* "Key": "objectkey1"
* },
* {
* "Key": "HappyFace.jpg",
* "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd"
* "Key": "objectkey2"
* }
* ],
* "Quiet": false
Expand All @@ -276,17 +274,19 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad
* {
* "Deleted": [
* {
* "Key": "HappyFace.jpg",
* "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd"
* "DeleteMarker": "true",
* "DeleteMarkerVersionId": "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F",
* "Key": "objectkey1"
* },
* {
* "Key": "HappyFace.jpg",
* "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b"
* "DeleteMarker": "true",
* "DeleteMarkerVersionId": "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt",
* "Key": "objectkey2"
* }
* ]
* }
* *\/
* // example id: to-delete-multiple-object-versions-from-a-versioned-bucket-1483147087737
* // example id: to-delete-multiple-objects-from-a-versioned-bucket-1483146248805
* ```
*
*/
Expand Down
38 changes: 19 additions & 19 deletions clients/client-s3/src/commands/GetObjectTaggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,55 +98,55 @@ export interface GetObjectTaggingCommandOutput extends GetObjectTaggingOutput, _
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @public
* @example To retrieve tag set of an object
* @example To retrieve tag set of a specific object version
* ```javascript
* // The following example retrieves tag set of an object.
* // The following example retrieves tag set of an object. The request specifies object version.
* const input = {
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg"
* "Key": "exampleobject",
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* };
* const command = new GetObjectTaggingCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "TagSet": [
* {
* "Key": "Key4",
* "Value": "Value4"
* },
* {
* "Key": "Key3",
* "Value": "Value3"
* "Key": "Key1",
* "Value": "Value1"
* }
* ],
* "VersionId": "null"
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* }
* *\/
* // example id: to-retrieve-tag-set-of-an-object-1481833847896
* // example id: to-retrieve-tag-set-of-a-specific-object-version-1483400283663
* ```
*
* @example To retrieve tag set of a specific object version
* @example To retrieve tag set of an object
* ```javascript
* // The following example retrieves tag set of an object. The request specifies object version.
* // The following example retrieves tag set of an object.
* const input = {
* "Bucket": "examplebucket",
* "Key": "exampleobject",
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* "Key": "HappyFace.jpg"
* };
* const command = new GetObjectTaggingCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "TagSet": [
* {
* "Key": "Key1",
* "Value": "Value1"
* "Key": "Key4",
* "Value": "Value4"
* },
* {
* "Key": "Key3",
* "Value": "Value3"
* }
* ],
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* "VersionId": "null"
* }
* *\/
* // example id: to-retrieve-tag-set-of-a-specific-object-version-1483400283663
* // example id: to-retrieve-tag-set-of-an-object-1481833847896
* ```
*
*/
Expand Down
Loading
Loading