Skip to content

Commit 198b9b2

Browse files
committed
fix(client-workspaces-thin-client): add customization script for workspaces thin client
1 parent a00f611 commit 198b9b2

File tree

7 files changed

+54
-6
lines changed

7 files changed

+54
-6
lines changed

clients/client-workspaces-thin-client/src/aliases.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

clients/client-workspaces-thin-client/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,17 @@ export * from "./models";
2828
import "@aws-sdk/util-endpoints";
2929

3030
export { WorkSpacesThinClientServiceException } from "./models/WorkSpacesThinClientServiceException";
31+
32+
import { WorkSpacesThinClient } from "./WorkSpacesThinClient";
33+
34+
/**
35+
* @deprecated use {WorkSpacesThinClient} (renamed) instead.
36+
* The aggregated client is called WorkSpacesThinClient,
37+
* and the barebones client is called WorkSpacesThinClientClient.
38+
*
39+
* Due to some code generation issues with the word "Client" in the service name,
40+
* we are maintaining a few backwards compatible aliases here.
41+
*/
42+
export const WorkSpacesThin = WorkSpacesThinClient;
43+
44+
export type { WorkSpacesThinClientPaginationConfiguration as WorkSpacesThinPaginationConfiguration } from "./pagination/Interfaces";

codegen/config/checkstyle/checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<!-- Files must contain a copyright header. -->
2323
<module name="RegexpHeader">
2424
<property name="header"
25-
value="/\*\n \* Copyright( 20(19|20|21|22)|) Amazon\.com, Inc\. or its affiliates\. All Rights Reserved\.\n"/>
25+
value="/\*\n \* Copyright( 20(19|20|21|22|23)|) Amazon\.com, Inc\. or its affiliates\. All Rights Reserved\.\n"/>
2626
<property name="fileExtensions" value="java"/>
2727
</module>
2828

scripts/generate-clients/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Update this commit when taking up new changes from smithy-typescript.
22
module.exports = {
33
// Use full commit hash as we explicitly fetch it.
4-
SMITHY_TS_COMMIT: "43d4bfbc329c3db4403b545e2bf518a2a185d7a0",
4+
SMITHY_TS_COMMIT: "cc922a47da45ed915bf914bdb790eaa885ad4063",
55
};
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const fs = require("fs");
2+
const path = require("path");
3+
4+
const root = path.join(__dirname, "..", "..", "..");
5+
6+
const indexTs = path.join(root, "clients", "client-workspaces-thin-client", "src", "index.ts");
7+
8+
/**
9+
* Exports aliases from the index of WorkSpacesThinClient.
10+
*/
11+
module.exports = function () {
12+
const indexContents = fs.readFileSync(indexTs, "utf-8");
13+
if (!indexContents.includes(`backwards compatible aliases`))
14+
fs.writeFileSync(
15+
indexTs,
16+
indexContents +
17+
`
18+
import { WorkSpacesThinClient } from "./WorkSpacesThinClient";
19+
20+
/**
21+
* @deprecated use {WorkSpacesThinClient} (renamed) instead.
22+
* The aggregated client is called WorkSpacesThinClient,
23+
* and the barebones client is called WorkSpacesThinClientClient.
24+
*
25+
* Due to some code generation issues with the word "Client" in the service name,
26+
* we are maintaining a few backwards compatible aliases here.
27+
*/
28+
export const WorkSpacesThin = WorkSpacesThinClient;
29+
30+
export type { WorkSpacesThinClientPaginationConfiguration as WorkSpacesThinPaginationConfiguration } from "./pagination/Interfaces";
31+
`
32+
);
33+
};

scripts/generate-clients/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ const {
9494

9595
const undoS3 = s3Hack();
9696
await generateClients(models || globs || DEFAULT_CODE_GEN_INPUT_DIR, batchSize);
97+
require("./customizations/workspaces-thin-client")();
9798
undoS3();
9899

99100
if (!noPrivateClients) {

scripts/generate-clients/single-service.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ const { solo } = yargs(process.argv.slice(2))
3030
);
3131
await codeOrdering(join(SDK_CLIENTS_DIR, `client-${solo}`));
3232

33+
if (solo === "workspaces-thin-client") {
34+
require("./customizations/workspaces-thin-client")();
35+
}
36+
3337
// post-generation transforms
3438
const clientFolder = join(SDK_CLIENTS_DIR, `client-${solo}`);
3539
const libFolder = join(SDK_CLIENTS_DIR, "..", "lib", `lib-${solo}`);

0 commit comments

Comments
 (0)