Skip to content

Commit 38ef992

Browse files
stackops-nginstackops-ngin
andauthored
feat: generate service-specific errors union type (#74)
Co-authored-by: stackops-ngin <[email protected]>
1 parent 95981c4 commit 38ef992

File tree

445 files changed

+23965
-494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

445 files changed

+23965
-494
lines changed

aws-models

Submodule aws-models updated 419 files

scripts/generate-clients.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,13 @@ const generateServiceTypes = (serviceName: string, manifest: Manifest) =>
15801580
}
15811581
}
15821582

1583+
// Generate service-specific errors union type
1584+
const allServiceErrors = Object.entries(manifest.shapes)
1585+
.filter(([_, shape]) => shape.traits?.["smithy.api#error"])
1586+
.map(([shapeId, _]) => extractShapeName(shapeId));
1587+
allServiceErrors.push("CommonAwsError");
1588+
code += `export type ${consistentInterfaceName}Errors = ${allServiceErrors.join(" | ")};\n\n`;
1589+
15831590
// Store metadata for the service
15841591
// FIXME: shouldn't this be typed to ServiceMetdata?
15851592
const metadata = {

src/services/accessanalyzer/types.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,3 +2059,15 @@ export declare namespace UpdateArchiveRule {
20592059
| ValidationException
20602060
| CommonAwsError;
20612061
}
2062+
2063+
export type AccessAnalyzerErrors =
2064+
| AccessDeniedException
2065+
| ConflictException
2066+
| InternalServerException
2067+
| InvalidParameterException
2068+
| ResourceNotFoundException
2069+
| ServiceQuotaExceededException
2070+
| ThrottlingException
2071+
| UnprocessableEntityException
2072+
| ValidationException
2073+
| CommonAwsError;

src/services/account/types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,3 +559,12 @@ export declare namespace StartPrimaryEmailUpdate {
559559
| ValidationException
560560
| CommonAwsError;
561561
}
562+
563+
export type AccountErrors =
564+
| AccessDeniedException
565+
| ConflictException
566+
| InternalServerException
567+
| ResourceNotFoundException
568+
| TooManyRequestsException
569+
| ValidationException
570+
| CommonAwsError;

src/services/acm-pca/types.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,3 +1090,25 @@ export declare namespace UpdateCertificateAuthority {
10901090
| ResourceNotFoundException
10911091
| CommonAwsError;
10921092
}
1093+
1094+
export type ACMPCAErrors =
1095+
| CertificateMismatchException
1096+
| ConcurrentModificationException
1097+
| InvalidArgsException
1098+
| InvalidArnException
1099+
| InvalidNextTokenException
1100+
| InvalidPolicyException
1101+
| InvalidRequestException
1102+
| InvalidStateException
1103+
| InvalidTagException
1104+
| LimitExceededException
1105+
| LockoutPreventedException
1106+
| MalformedCSRException
1107+
| MalformedCertificateException
1108+
| PermissionAlreadyExistsException
1109+
| RequestAlreadyProcessedException
1110+
| RequestFailedException
1111+
| RequestInProgressException
1112+
| ResourceNotFoundException
1113+
| TooManyTagsException
1114+
| CommonAwsError;

src/services/acm/types.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,3 +804,22 @@ export declare namespace UpdateCertificateOptions {
804804
| ResourceNotFoundException
805805
| CommonAwsError;
806806
}
807+
808+
export type ACMErrors =
809+
| AccessDeniedException
810+
| ConflictException
811+
| InvalidArgsException
812+
| InvalidArnException
813+
| InvalidDomainValidationOptionsException
814+
| InvalidParameterException
815+
| InvalidStateException
816+
| InvalidTagException
817+
| LimitExceededException
818+
| RequestInProgressException
819+
| ResourceInUseException
820+
| ResourceNotFoundException
821+
| TagPolicyException
822+
| ThrottlingException
823+
| TooManyTagsException
824+
| ValidationException
825+
| CommonAwsError;

src/services/aiops/types.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,3 +476,14 @@ export declare namespace UpdateInvestigationGroup {
476476
| ValidationException
477477
| CommonAwsError;
478478
}
479+
480+
export type AIOpsErrors =
481+
| AccessDeniedException
482+
| ConflictException
483+
| ForbiddenException
484+
| InternalServerException
485+
| ResourceNotFoundException
486+
| ServiceQuotaExceededException
487+
| ThrottlingException
488+
| ValidationException
489+
| CommonAwsError;

src/services/amp/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const metadata = {
3636
UntagResource: "DELETE /tags/{resourceArn}",
3737
CreateAlertManagerDefinition:
3838
"POST /workspaces/{workspaceId}/alertmanager/definition",
39+
CreateAnomalyDetector: "POST /workspaces/{workspaceId}/anomalydetectors",
3940
CreateLoggingConfiguration: "POST /workspaces/{workspaceId}/logging",
4041
CreateQueryLoggingConfiguration:
4142
"POST /workspaces/{workspaceId}/logging/query",
@@ -45,36 +46,52 @@ const metadata = {
4546
CreateWorkspace: "POST /workspaces",
4647
DeleteAlertManagerDefinition:
4748
"DELETE /workspaces/{workspaceId}/alertmanager/definition",
49+
DeleteAnomalyDetector:
50+
"DELETE /workspaces/{workspaceId}/anomalydetectors/{anomalyDetectorId}",
4851
DeleteLoggingConfiguration: "DELETE /workspaces/{workspaceId}/logging",
4952
DeleteQueryLoggingConfiguration:
5053
"DELETE /workspaces/{workspaceId}/logging/query",
54+
DeleteResourcePolicy: "DELETE /workspaces/{workspaceId}/policy",
5155
DeleteRuleGroupsNamespace:
5256
"DELETE /workspaces/{workspaceId}/rulegroupsnamespaces/{name}",
5357
DeleteScraper: "DELETE /scrapers/{scraperId}",
58+
DeleteScraperLoggingConfiguration:
59+
"DELETE /scrapers/{scraperId}/logging-configuration",
5460
DeleteWorkspace: "DELETE /workspaces/{workspaceId}",
5561
DescribeAlertManagerDefinition:
5662
"GET /workspaces/{workspaceId}/alertmanager/definition",
63+
DescribeAnomalyDetector:
64+
"GET /workspaces/{workspaceId}/anomalydetectors/{anomalyDetectorId}",
5765
DescribeLoggingConfiguration: "GET /workspaces/{workspaceId}/logging",
5866
DescribeQueryLoggingConfiguration:
5967
"GET /workspaces/{workspaceId}/logging/query",
68+
DescribeResourcePolicy: "GET /workspaces/{workspaceId}/policy",
6069
DescribeRuleGroupsNamespace:
6170
"GET /workspaces/{workspaceId}/rulegroupsnamespaces/{name}",
6271
DescribeScraper: "GET /scrapers/{scraperId}",
72+
DescribeScraperLoggingConfiguration:
73+
"GET /scrapers/{scraperId}/logging-configuration",
6374
DescribeWorkspace: "GET /workspaces/{workspaceId}",
6475
DescribeWorkspaceConfiguration:
6576
"GET /workspaces/{workspaceId}/configuration",
77+
ListAnomalyDetectors: "GET /workspaces/{workspaceId}/anomalydetectors",
6678
ListRuleGroupsNamespaces:
6779
"GET /workspaces/{workspaceId}/rulegroupsnamespaces",
6880
ListScrapers: "GET /scrapers",
6981
ListWorkspaces: "GET /workspaces",
7082
PutAlertManagerDefinition:
7183
"PUT /workspaces/{workspaceId}/alertmanager/definition",
84+
PutAnomalyDetector:
85+
"PUT /workspaces/{workspaceId}/anomalydetectors/{anomalyDetectorId}",
86+
PutResourcePolicy: "PUT /workspaces/{workspaceId}/policy",
7287
PutRuleGroupsNamespace:
7388
"PUT /workspaces/{workspaceId}/rulegroupsnamespaces/{name}",
7489
UpdateLoggingConfiguration: "PUT /workspaces/{workspaceId}/logging",
7590
UpdateQueryLoggingConfiguration:
7691
"PUT /workspaces/{workspaceId}/logging/query",
7792
UpdateScraper: "PUT /scrapers/{scraperId}",
93+
UpdateScraperLoggingConfiguration:
94+
"PUT /scrapers/{scraperId}/logging-configuration",
7895
UpdateWorkspaceAlias: "POST /workspaces/{workspaceId}/alias",
7996
UpdateWorkspaceConfiguration:
8097
"PATCH /workspaces/{workspaceId}/configuration",

0 commit comments

Comments
 (0)