Skip to content

Commit

Permalink
test: api-promise/client-class-member.js
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Apr 11, 2024
1 parent 5ca81f1 commit 5a3fde7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,19 @@ class ClientClassMember {
async listTagsOfResource() {
return await this.clientInClass.listTagsOfResource({ ResourceArn: "STRING_VALUE" }).promise();
}
}

// Client as class member with creation inside constructor
class ClientClassMemberConstructor {
constructor() {
this.clientInClassCtr = new AWS.DynamoDB();
}

async listTables() {
return this.clientInClassCtr.listTables().promise();
}

async listTagsOfResource() {
return this.clientInClassCtr.listTagsOfResource({ ResourceArn: "STRING_VALUE" }).promise();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,19 @@ class ClientClassMember {
async listTagsOfResource() {
return await this.clientInClass.listTagsOfResource({ ResourceArn: "STRING_VALUE" });
}
}

// Client as class member with creation inside constructor
class ClientClassMemberConstructor {
constructor() {
this.clientInClassCtr = new DynamoDB();
}

async listTables() {
return this.clientInClassCtr.listTables();
}

async listTagsOfResource() {
return this.clientInClassCtr.listTagsOfResource({ ResourceArn: "STRING_VALUE" });
}
}

0 comments on commit 5a3fde7

Please sign in to comment.