Skip to content

Commit

Permalink
feat(client-inspector2): Extend inspector2 service model to include S…
Browse files Browse the repository at this point in the history
…erviceQuotaExceededException.
  • Loading branch information
awstools committed Nov 22, 2024
1 parent 48054dc commit dc13e07
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 33 deletions.
12 changes: 11 additions & 1 deletion clients/client-inspector2/src/commands/AssociateMemberCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ export interface AssociateMemberCommandInput extends AssociateMemberRequest {}
export interface AssociateMemberCommandOutput extends AssociateMemberResponse, __MetadataBearer {}

/**
* <p>Associates an Amazon Web Services account with an Amazon Inspector delegated administrator. An HTTP 200 response indicates the association was successfully started, but doesn’t indicate whether it was completed. You can check if the association completed by using <a href="https://docs.aws.amazon.com/inspector/v2/APIReference/API_ListMembers.html">ListMembers</a> for multiple accounts or <a href="https://docs.aws.amazon.com/inspector/v2/APIReference/API_GetMember.html">GetMembers</a> for a single account.</p>
* <p>
* Associates an Amazon Web Services account with an Amazon Inspector delegated administrator.
* An HTTP 200 response indicates the association was started but doesn’t indicate whether it completed.
* You can check if the association completed using <a href="https://docs.aws.amazon.com/inspector/v2/APIReference/API_ListMembers.html">ListMembers</a> for multiple accounts or <a href="https://docs.aws.amazon.com/inspector/v2/APIReference/API_GetMember.html">GetMembers</a> for a single account.
* An HTTP 402 response indicates the association failed because the organization size exceeded its limit.
* For information on limits, see <a href="https://docs.aws.amazon.com/inspector/latest/user/quotas.html">Amazon Inspector quotas</a>.
* </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -58,6 +64,10 @@ export interface AssociateMemberCommandOutput extends AssociateMemberResponse, _
* @throws {@link InternalServerException} (server fault)
* <p>The request has failed due to an internal failure of the Amazon Inspector service.</p>
*
* @throws {@link ServiceQuotaExceededException} (client fault)
* <p>You have exceeded your service quota. To perform the requested action, remove some of
* the relevant resources, or use Service Quotas to request a service quota increase.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The limit on the number of requests per second was exceeded.</p>
*
Expand Down
56 changes: 28 additions & 28 deletions clients/client-inspector2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,34 @@ export class InternalServerException extends __BaseException {
}
}

/**
* <p>You have exceeded your service quota. To perform the requested action, remove some of
* the relevant resources, or use Service Quotas to request a service quota increase.</p>
* @public
*/
export class ServiceQuotaExceededException extends __BaseException {
readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException";
readonly $fault: "client" = "client";
/**
* <p>The ID of the resource that exceeds a service quota.</p>
* @public
*/
resourceId: string | undefined;

/**
* @internal
*/
constructor(opts: __ExceptionOptionType<ServiceQuotaExceededException, __BaseException>) {
super({
name: "ServiceQuotaExceededException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);
this.resourceId = opts.resourceId;
}
}

/**
* <p>The limit on the number of requests per second was exceeded.</p>
* @public
Expand Down Expand Up @@ -5584,34 +5612,6 @@ export interface CreateFilterResponse {
arn: string | undefined;
}

/**
* <p>You have exceeded your service quota. To perform the requested action, remove some of
* the relevant resources, or use Service Quotas to request a service quota increase.</p>
* @public
*/
export class ServiceQuotaExceededException extends __BaseException {
readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException";
readonly $fault: "client" = "client";
/**
* <p>The ID of the resource that exceeds a service quota.</p>
* @public
*/
resourceId: string | undefined;

/**
* @internal
*/
constructor(opts: __ExceptionOptionType<ServiceQuotaExceededException, __BaseException>) {
super({
name: "ServiceQuotaExceededException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);
this.resourceId = opts.resourceId;
}
}

/**
* @public
* @enum
Expand Down
6 changes: 3 additions & 3 deletions clients/client-inspector2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2910,6 +2910,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
case "InternalServerException":
case "com.amazonaws.inspector2#InternalServerException":
throw await de_InternalServerExceptionRes(parsedOutput, context);
case "ServiceQuotaExceededException":
case "com.amazonaws.inspector2#ServiceQuotaExceededException":
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
case "ThrottlingException":
case "com.amazonaws.inspector2#ThrottlingException":
throw await de_ThrottlingExceptionRes(parsedOutput, context);
Expand All @@ -2922,9 +2925,6 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
case "BadRequestException":
case "com.amazonaws.inspector2#BadRequestException":
throw await de_BadRequestExceptionRes(parsedOutput, context);
case "ServiceQuotaExceededException":
case "com.amazonaws.inspector2#ServiceQuotaExceededException":
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
case "ConflictException":
case "com.amazonaws.inspector2#ConflictException":
throw await de_ConflictExceptionRes(parsedOutput, context);
Expand Down
5 changes: 4 additions & 1 deletion codegen/sdk-codegen/aws-models/inspector2.json
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,9 @@
{
"target": "com.amazonaws.inspector2#InternalServerException"
},
{
"target": "com.amazonaws.inspector2#ServiceQuotaExceededException"
},
{
"target": "com.amazonaws.inspector2#ThrottlingException"
},
Expand All @@ -607,7 +610,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Associates an Amazon Web Services account with an Amazon Inspector delegated administrator. An HTTP 200 response indicates the association was successfully started, but doesn’t indicate whether it was completed. You can check if the association completed by using <a href=\"https://docs.aws.amazon.com/inspector/v2/APIReference/API_ListMembers.html\">ListMembers</a> for multiple accounts or <a href=\"https://docs.aws.amazon.com/inspector/v2/APIReference/API_GetMember.html\">GetMembers</a> for a single account.</p>",
"smithy.api#documentation": "<p>\n Associates an Amazon Web Services account with an Amazon Inspector delegated administrator. \n An HTTP 200 response indicates the association was started but doesn’t indicate whether it completed. \n You can check if the association completed using <a href=\"https://docs.aws.amazon.com/inspector/v2/APIReference/API_ListMembers.html\">ListMembers</a> for multiple accounts or <a href=\"https://docs.aws.amazon.com/inspector/v2/APIReference/API_GetMember.html\">GetMembers</a> for a single account. \n An HTTP 402 response indicates the association failed because the organization size exceeded its limit. \n For information on limits, see <a href=\"https://docs.aws.amazon.com/inspector/latest/user/quotas.html\">Amazon Inspector quotas</a>.\n </p>",
"smithy.api#http": {
"code": 200,
"method": "POST",
Expand Down

0 comments on commit dc13e07

Please sign in to comment.