Skip to content

Commit

Permalink
feat(client-managedblockchain): Add optional NetworkType property to …
Browse files Browse the repository at this point in the history
…Accessor APIs
  • Loading branch information
awstools committed Nov 27, 2023
1 parent 78a4dca commit ffc4c3f
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export interface CreateAccessorCommandOutput extends CreateAccessorOutput, __Met

/**
* @public
* <p>Creates a new accessor for use with Managed Blockchain Ethereum nodes. An accessor contains information
* required for token based access to your Ethereum nodes.</p>
* <p>Creates a new accessor for use with Amazon Managed Blockchain service that supports token based access.
* The accessor contains information required for token based access.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand All @@ -55,12 +55,14 @@ export interface CreateAccessorCommandOutput extends CreateAccessorOutput, __Met
* Tags: { // InputTagMap
* "<keys>": "STRING_VALUE",
* },
* NetworkType: "ETHEREUM_GOERLI" || "ETHEREUM_MAINNET" || "ETHEREUM_MAINNET_AND_GOERLI" || "POLYGON_MAINNET" || "POLYGON_MUMBAI",
* };
* const command = new CreateAccessorCommand(input);
* const response = await client.send(command);
* // { // CreateAccessorOutput
* // AccessorId: "STRING_VALUE",
* // BillingToken: "STRING_VALUE",
* // NetworkType: "ETHEREUM_GOERLI" || "ETHEREUM_MAINNET" || "ETHEREUM_MAINNET_AND_GOERLI" || "POLYGON_MAINNET" || "POLYGON_MUMBAI",
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface GetAccessorCommandOutput extends GetAccessorOutput, __MetadataB
* // Tags: { // OutputTagMap
* // "<keys>": "STRING_VALUE",
* // },
* // NetworkType: "ETHEREUM_GOERLI" || "ETHEREUM_MAINNET" || "ETHEREUM_MAINNET_AND_GOERLI" || "POLYGON_MAINNET" || "POLYGON_MUMBAI",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface ListAccessorsCommandOutput extends ListAccessorsOutput, __Metad
* const input = { // ListAccessorsInput
* MaxResults: Number("int"),
* NextToken: "STRING_VALUE",
* NetworkType: "ETHEREUM_GOERLI" || "ETHEREUM_MAINNET" || "ETHEREUM_MAINNET_AND_GOERLI" || "POLYGON_MAINNET" || "POLYGON_MUMBAI",
* };
* const command = new ListAccessorsCommand(input);
* const response = await client.send(command);
Expand All @@ -63,6 +64,7 @@ export interface ListAccessorsCommandOutput extends ListAccessorsOutput, __Metad
* // Status: "AVAILABLE" || "PENDING_DELETION" || "DELETED",
* // CreationDate: new Date("TIMESTAMP"),
* // Arn: "STRING_VALUE",
* // NetworkType: "ETHEREUM_GOERLI" || "ETHEREUM_MAINNET" || "ETHEREUM_MAINNET_AND_GOERLI" || "POLYGON_MAINNET" || "POLYGON_MUMBAI",
* // },
* // ],
* // NextToken: "STRING_VALUE",
Expand Down
84 changes: 77 additions & 7 deletions clients/client-managedblockchain/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ export class AccessDeniedException extends __BaseException {
}
}

/**
* @public
* @enum
*/
export const AccessorNetworkType = {
ETHEREUM_GOERLI: "ETHEREUM_GOERLI",
ETHEREUM_MAINNET: "ETHEREUM_MAINNET",
ETHEREUM_MAINNET_AND_GOERLI: "ETHEREUM_MAINNET_AND_GOERLI",
POLYGON_MAINNET: "POLYGON_MAINNET",
POLYGON_MUMBAI: "POLYGON_MUMBAI",
} as const;

/**
* @public
*/
export type AccessorNetworkType = (typeof AccessorNetworkType)[keyof typeof AccessorNetworkType];

/**
* @public
* @enum
Expand Down Expand Up @@ -75,9 +92,9 @@ export interface Accessor {

/**
* @public
* <p>The billing token is a property of the accessor. Use this token to make Ethereum API calls to your
* Ethereum node. The billing token is used to track your accessor object for billing Ethereum API
* requests made to your Ethereum nodes.</p>
* <p>The billing token is a property of the Accessor. Use this token to
* when making calls to the blockchain network. The billing token is used
* to track your accessor token for billing requests.</p>
*/
BillingToken?: string;

Expand Down Expand Up @@ -107,6 +124,12 @@ export interface Accessor {
* <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
*/
Tags?: Record<string, string>;

/**
* @public
* <p>The blockchain network that the Accessor token is created for.</p>
*/
NetworkType?: AccessorNetworkType;
}

/**
Expand Down Expand Up @@ -148,6 +171,12 @@ export interface AccessorSummary {
* Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
*/
Arn?: string;

/**
* @public
* <p>The blockchain network that the Accessor token is created for.</p>
*/
NetworkType?: AccessorNetworkType;
}

/**
Expand Down Expand Up @@ -184,7 +213,9 @@ export interface ApprovalThresholdPolicy {

/**
* @public
* <p>Determines whether the vote percentage must be greater than the <code>ThresholdPercentage</code> or must be greater than or equal to the <code>ThreholdPercentage</code> to be approved.</p>
* <p>Determines whether the vote percentage must be greater than the
* <code>ThresholdPercentage</code> or must be greater than or equal to the
* <code>ThresholdPercentage</code> to be approved.</p>
*/
ThresholdComparator?: ThresholdComparator;
}
Expand Down Expand Up @@ -221,6 +252,28 @@ export interface CreateAccessorInput {
* <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
*/
Tags?: Record<string, string>;

/**
* @public
* <p>The blockchain network that the <code>Accessor</code> token is created for.</p>
* <note>
* <p>We recommend using the appropriate <code>networkType</code>
* value for the blockchain network that you are creating the <code>Accessor</code>
* token for. You cannnot use the value <code>ETHEREUM_MAINNET_AND_GOERLI</code> to
* specify a <code>networkType</code> for your Accessor token.</p>
* <p>The default value of <code>ETHEREUM_MAINNET_AND_GOERLI</code> is only applied:</p>
* <ul>
* <li>
* <p>when the <code>CreateAccessor</code> action does not set a <code>networkType</code>.</p>
* </li>
* <li>
* <p>to all existing <code>Accessor</code> tokens that were created before the <code>networkType</code> property was introduced.
* </p>
* </li>
* </ul>
* </note>
*/
NetworkType?: AccessorNetworkType;
}

/**
Expand All @@ -235,11 +288,17 @@ export interface CreateAccessorOutput {

/**
* @public
* <p>The billing token is a property of the Accessor. Use this token to make Ethereum API calls to
* your Ethereum node. The billing token is used to track your accessor object for billing Ethereum
* API requests made to your Ethereum nodes.</p>
* <p>The billing token is a property of the Accessor. Use this token to
* when making calls to the blockchain network. The billing token is used
* to track your accessor token for billing requests.</p>
*/
BillingToken?: string;

/**
* @public
* <p>The blockchain network that the accessor token is created for.</p>
*/
NetworkType?: AccessorNetworkType;
}

/**
Expand Down Expand Up @@ -2059,6 +2118,17 @@ export interface ListAccessorsInput {
* <p> The pagination token that indicates the next set of results to retrieve. </p>
*/
NextToken?: string;

/**
* @public
* <p>The blockchain network that the <code>Accessor</code> token is created for.</p>
* <note>
* <p>Use the value <code>ETHEREUM_MAINNET_AND_GOERLI</code> for all
* existing <code>Accessors</code> tokens that were created before the <code>networkType</code>
* property was introduced.</p>
* </note>
*/
NetworkType?: AccessorNetworkType;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export const se_CreateAccessorCommand = async (
take(input, {
AccessorType: [],
ClientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
NetworkType: [],
Tags: (_) => _json(_),
})
);
Expand Down Expand Up @@ -481,6 +482,7 @@ export const se_ListAccessorsCommand = async (
const query: any = map({
maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults!.toString()],
nextToken: [, input.NextToken!],
networkType: [, input.NetworkType!],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -905,6 +907,7 @@ export const de_CreateAccessorCommand = async (
const doc = take(data, {
AccessorId: __expectString,
BillingToken: __expectString,
NetworkType: __expectString,
});
Object.assign(contents, doc);
return contents;
Expand Down Expand Up @@ -2735,6 +2738,7 @@ const de_Accessor = (output: any, context: __SerdeContext): Accessor => {
BillingToken: __expectString,
CreationDate: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
Id: __expectString,
NetworkType: __expectString,
Status: __expectString,
Tags: _json,
Type: __expectString,
Expand All @@ -2749,6 +2753,7 @@ const de_AccessorSummary = (output: any, context: __SerdeContext): AccessorSumma
Arn: __expectString,
CreationDate: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
Id: __expectString,
NetworkType: __expectString,
Status: __expectString,
Type: __expectString,
}) as any;
Expand Down
74 changes: 70 additions & 4 deletions codegen/sdk-codegen/aws-models/managedblockchain.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"BillingToken": {
"target": "com.amazonaws.managedblockchain#AccessorBillingTokenString",
"traits": {
"smithy.api#documentation": "<p>The billing token is a property of the accessor. Use this token to make Ethereum API calls to your \n Ethereum node. The billing token is used to track your accessor object for billing Ethereum API \n requests made to your Ethereum nodes.</p>"
"smithy.api#documentation": "<p>The billing token is a property of the Accessor. Use this token to \n when making calls to the blockchain network. The billing token is used \n to track your accessor token for billing requests.</p>"
}
},
"Status": {
Expand All @@ -86,6 +86,12 @@
"traits": {
"smithy.api#documentation": "<p>The tags assigned to the Accessor.</p>\n <p>For more information about tags, see <a href=\"https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html\">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href=\"https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html\">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>"
}
},
"NetworkType": {
"target": "com.amazonaws.managedblockchain#AccessorNetworkType",
"traits": {
"smithy.api#documentation": "<p>The blockchain network that the Accessor token is created for.</p>"
}
}
},
"traits": {
Expand All @@ -110,6 +116,41 @@
}
}
},
"com.amazonaws.managedblockchain#AccessorNetworkType": {
"type": "enum",
"members": {
"ETHEREUM_GOERLI": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "ETHEREUM_GOERLI"
}
},
"ETHEREUM_MAINNET": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "ETHEREUM_MAINNET"
}
},
"ETHEREUM_MAINNET_AND_GOERLI": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "ETHEREUM_MAINNET_AND_GOERLI"
}
},
"POLYGON_MAINNET": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "POLYGON_MAINNET"
}
},
"POLYGON_MUMBAI": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "POLYGON_MUMBAI"
}
}
}
},
"com.amazonaws.managedblockchain#AccessorStatus": {
"type": "enum",
"members": {
Expand Down Expand Up @@ -165,6 +206,12 @@
"traits": {
"smithy.api#documentation": "<p>The Amazon Resource Name (ARN) of the accessor. For more information about \n ARNs and their format, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource \n Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>"
}
},
"NetworkType": {
"target": "com.amazonaws.managedblockchain#AccessorNetworkType",
"traits": {
"smithy.api#documentation": "<p>The blockchain network that the Accessor token is created for.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -206,7 +253,7 @@
"ThresholdComparator": {
"target": "com.amazonaws.managedblockchain#ThresholdComparator",
"traits": {
"smithy.api#documentation": "<p>Determines whether the vote percentage must be greater than the <code>ThresholdPercentage</code> or must be greater than or equal to the <code>ThreholdPercentage</code> to be approved.</p>"
"smithy.api#documentation": "<p>Determines whether the vote percentage must be greater than the\n <code>ThresholdPercentage</code> or must be greater than or equal to the\n <code>ThresholdPercentage</code> to be approved.</p>"
}
}
},
Expand Down Expand Up @@ -268,7 +315,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Creates a new accessor for use with Managed Blockchain Ethereum nodes. An accessor contains information \n required for token based access to your Ethereum nodes.</p>",
"smithy.api#documentation": "<p>Creates a new accessor for use with Amazon Managed Blockchain service that supports token based access. \n The accessor contains information required for token based access.</p>",
"smithy.api#http": {
"method": "POST",
"uri": "/accessors",
Expand Down Expand Up @@ -299,6 +346,12 @@
"traits": {
"smithy.api#documentation": "<p>Tags to assign to the Accessor.</p>\n <p> Each tag consists of a key and an optional value. You can specify \n multiple key-value pairs in a single request with an overall maximum of 50 tags \n allowed per resource.</p>\n <p>For more information about tags, see <a href=\"https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html\">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href=\"https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html\">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>"
}
},
"NetworkType": {
"target": "com.amazonaws.managedblockchain#AccessorNetworkType",
"traits": {
"smithy.api#documentation": "<p>The blockchain network that the <code>Accessor</code> token is created for.</p>\n <note>\n <p>We recommend using the appropriate <code>networkType</code> \n value for the blockchain network that you are creating the <code>Accessor</code> \n token for. You cannnot use the value <code>ETHEREUM_MAINNET_AND_GOERLI</code> to \n specify a <code>networkType</code> for your Accessor token.</p>\n <p>The default value of <code>ETHEREUM_MAINNET_AND_GOERLI</code> is only applied:</p>\n <ul>\n <li>\n <p>when the <code>CreateAccessor</code> action does not set a <code>networkType</code>.</p>\n </li>\n <li>\n <p>to all existing <code>Accessor</code> tokens that were created before the <code>networkType</code> property was introduced.\n </p>\n </li>\n </ul>\n </note>"
}
}
},
"traits": {
Expand All @@ -317,7 +370,13 @@
"BillingToken": {
"target": "com.amazonaws.managedblockchain#AccessorBillingTokenString",
"traits": {
"smithy.api#documentation": "<p>The billing token is a property of the Accessor. Use this token to make Ethereum API calls to\n your Ethereum node. The billing token is used to track your accessor object for billing Ethereum \n API requests made to your Ethereum nodes.</p>"
"smithy.api#documentation": "<p>The billing token is a property of the Accessor. Use this token to \n when making calls to the blockchain network. The billing token is used \n to track your accessor token for billing requests.</p>"
}
},
"NetworkType": {
"target": "com.amazonaws.managedblockchain#AccessorNetworkType",
"traits": {
"smithy.api#documentation": "<p>The blockchain network that the accessor token is created for.</p>"
}
}
},
Expand Down Expand Up @@ -1580,6 +1639,13 @@
"smithy.api#documentation": "<p> The pagination token that indicates the next set of results to retrieve. </p>",
"smithy.api#httpQuery": "nextToken"
}
},
"NetworkType": {
"target": "com.amazonaws.managedblockchain#AccessorNetworkType",
"traits": {
"smithy.api#documentation": "<p>The blockchain network that the <code>Accessor</code> token is created for.</p>\n <note>\n <p>Use the value <code>ETHEREUM_MAINNET_AND_GOERLI</code> for all \n existing <code>Accessors</code> tokens that were created before the <code>networkType</code> \n property was introduced.</p>\n </note>",
"smithy.api#httpQuery": "networkType"
}
}
},
"traits": {
Expand Down

0 comments on commit ffc4c3f

Please sign in to comment.