Skip to content

Commit b0756b9

Browse files
authored
fix(client-workspaces-thin-client): add compatibility alias (#5555)
1 parent 2121fd5 commit b0756b9

File tree

5 files changed

+54
-1
lines changed

5 files changed

+54
-1
lines changed

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

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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ const {
132132
emptyDirSync(TEMP_CODE_GEN_INPUT_DIR);
133133
rmdirSync(TEMP_CODE_GEN_INPUT_DIR);
134134
}
135+
136+
require("./customizations/workspaces-thin-client")();
135137
} catch (e) {
136138
console.log(e);
137139
process.exit(1);

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)