Skip to content

Commit

Permalink
feat: update orders and tokens api model (#195)
Browse files Browse the repository at this point in the history
- add buyer information and shipping address in order
- support target application parameter when create Restricted Data Token (RDT)

Co-authored-by: nguyentoanit <[email protected]>
  • Loading branch information
github-actions[bot] and nguyentoanit authored Aug 3, 2021
1 parent 9d232ac commit bac11e7
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 23 deletions.
2 changes: 2 additions & 0 deletions src/api-models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ export {
TaxCollectionResponsiblePartyEnum as OrdersApiModelTaxCollectionResponsiblePartyEnum,
Address as OrdersApiModelAddress,
BuyerCustomizedInfoDetail as OrdersApiModelBuyerCustomizedInfoDetail,
BuyerInfo as OrdersApiModelBuyerInfo,
BuyerTaxInfo as OrdersApiModelBuyerTaxInfo,
FulfillmentInstruction as OrdersApiModelFulfillmentInstruction,
GetOrderAddressResponse as OrdersApiModelGetOrderAddressResponse,
Expand All @@ -637,6 +638,7 @@ export {
GetOrderItemsResponse as OrdersApiModelGetOrderItemsResponse,
GetOrderResponse as OrdersApiModelGetOrderResponse,
GetOrdersResponse as OrdersApiModelGetOrdersResponse,
ItemBuyerInfo as OrdersApiModelItemBuyerInfo,
MarketplaceTaxInfo as OrdersApiModelMarketplaceTaxInfo,
ModelError as OrdersApiModelModelError,
Money as OrdersApiModelMoney,
Expand Down
116 changes: 104 additions & 12 deletions src/api-models/orders-api-model/api.ts

Large diffs are not rendered by default.

26 changes: 19 additions & 7 deletions src/api-models/tokens-api-model/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Selling Partner API for Tokens
* The Selling Partner API for Tokens provides a secure way to access a customers\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes you to make subsequent requests to access these restricted resources.
* The Selling Partner API for Tokens provides a secure way to access a customer\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes you to make subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/references/tokens-api/tokens_2021-03-01.md).
*
* The version of the OpenAPI document: 2021-03-01
*
Expand All @@ -27,6 +27,12 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr
* @interface CreateRestrictedDataTokenRequest
*/
export interface CreateRestrictedDataTokenRequest {
/**
* The application ID for the target application to which access is being delegated.
* @type {string}
* @memberof CreateRestrictedDataTokenRequest
*/
targetApplication?: string;
/**
* A list of restricted resources. Maximum: 50
* @type {Array<RestrictedResource>}
Expand Down Expand Up @@ -98,17 +104,23 @@ export interface ModelError {
*/
export interface RestrictedResource {
/**
* The HTTP method used with the restricted resource.
* The HTTP method in the restricted resource.
* @type {string}
* @memberof RestrictedResource
*/
method: RestrictedResourceMethodEnum | 'GET' | 'PUT' | 'POST' | 'DELETE';
/**
* The path from a restricted operation. This could be: - A specific path containing a seller\'s order ID, for example ```/orders/v0/orders/902-3159896-1390916/address```. - A generic path that does not contain a seller\'s order ID, for example```/orders/v0/orders/{orderId}/address```).
* The path in the restricted resource. Here are some path examples: - ```/orders/v0/orders```. For getting an RDT for the getOrders operation of the Orders API. For bulk orders. - ```/orders/v0/orders/123-1234567-1234567```. For getting an RDT for the getOrder operation of the Orders API. For a specific order. - ```/orders/v0/orders/123-1234567-1234567/orderItems```. For getting an RDT for the getOrderItems operation of the Orders API. For the order items in a specific order. - ```/mfn/v0/shipments/FBA1234ABC5D```. For getting an RDT for the getShipment operation of the Shipping API. For a specific shipment. - ```/mfn/v0/shipments/{shipmentId}```. For getting an RDT for the getShipment operation of the Shipping API. For any of a selling partner\'s shipments that you specify when you call the getShipment operation.
* @type {string}
* @memberof RestrictedResource
*/
path: string;
/**
* Indicates the type of Personally Identifiable Information requested. This parameter is required only when getting an RDT for use with the getOrder, getOrders, or getOrderItems operation of the Orders API. For more information, see the [Tokens API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/references/tokens-api/tokens_2021-03-01.md). Possible values include: - **buyerInfo**. On the order level this includes general identifying information about the buyer and tax-related information. On the order item level this includes gift wrap information and custom order information, if available. - **shippingAddress**. This includes information for fulfilling orders.
* @type {Array<string>}
* @memberof RestrictedResource
*/
dataElements?: Array<string>;
}

/**
Expand All @@ -130,7 +142,7 @@ export enum RestrictedResourceMethodEnum {
export const TokensApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII). See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. The path of a restricted resource can be: - A specific path containing a seller\'s order ID, for example ```/orders/v0/orders/902-3159896-1390916/address```. The returned RDT authorizes a subsequent call to the getOrderAddress operation of the Orders API for that specific order only. For example, ```GET /orders/v0/orders/902-3159896-1390916/address```. - A generic path that does not contain a seller\'s order ID, for example```/orders/v0/orders/{orderId}/address```). The returned RDT authorizes subsequent calls to the getOrderAddress operation for *any* of a seller\'s order IDs. For example, ```GET /orders/v0/orders/902-3159896-1390916/address``` and ```GET /orders/v0/orders/483-3488972-0896720/address``` **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 1 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 1 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down Expand Up @@ -175,7 +187,7 @@ export const TokensApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = TokensApiAxiosParamCreator(configuration)
return {
/**
* Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII). See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. The path of a restricted resource can be: - A specific path containing a seller\'s order ID, for example ```/orders/v0/orders/902-3159896-1390916/address```. The returned RDT authorizes a subsequent call to the getOrderAddress operation of the Orders API for that specific order only. For example, ```GET /orders/v0/orders/902-3159896-1390916/address```. - A generic path that does not contain a seller\'s order ID, for example```/orders/v0/orders/{orderId}/address```). The returned RDT authorizes subsequent calls to the getOrderAddress operation for *any* of a seller\'s order IDs. For example, ```GET /orders/v0/orders/902-3159896-1390916/address``` and ```GET /orders/v0/orders/483-3488972-0896720/address``` **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 1 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 1 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand All @@ -195,7 +207,7 @@ export const TokensApiFactory = function (configuration?: Configuration, basePat
const localVarFp = TokensApiFp(configuration)
return {
/**
* Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII). See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. The path of a restricted resource can be: - A specific path containing a seller\'s order ID, for example ```/orders/v0/orders/902-3159896-1390916/address```. The returned RDT authorizes a subsequent call to the getOrderAddress operation of the Orders API for that specific order only. For example, ```GET /orders/v0/orders/902-3159896-1390916/address```. - A generic path that does not contain a seller\'s order ID, for example```/orders/v0/orders/{orderId}/address```). The returned RDT authorizes subsequent calls to the getOrderAddress operation for *any* of a seller\'s order IDs. For example, ```GET /orders/v0/orders/902-3159896-1390916/address``` and ```GET /orders/v0/orders/483-3488972-0896720/address``` **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 1 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 1 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {CreateRestrictedDataTokenRequest} body The restricted data token request details.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down Expand Up @@ -228,7 +240,7 @@ export interface TokensApiCreateRestrictedDataTokenRequest {
*/
export class TokensApi extends BaseAPI {
/**
* Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII). See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. The path of a restricted resource can be: - A specific path containing a seller\'s order ID, for example ```/orders/v0/orders/902-3159896-1390916/address```. The returned RDT authorizes a subsequent call to the getOrderAddress operation of the Orders API for that specific order only. For example, ```GET /orders/v0/orders/902-3159896-1390916/address```. - A generic path that does not contain a seller\'s order ID, for example```/orders/v0/orders/{orderId}/address```). The returned RDT authorizes subsequent calls to the getOrderAddress operation for *any* of a seller\'s order IDs. For example, ```GET /orders/v0/orders/902-3159896-1390916/address``` and ```GET /orders/v0/orders/483-3488972-0896720/address``` **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 1 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 1 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
* @param {TokensApiCreateRestrictedDataTokenRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand Down
2 changes: 1 addition & 1 deletion src/api-models/tokens-api-model/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Selling Partner API for Tokens
* The Selling Partner API for Tokens provides a secure way to access a customers\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes you to make subsequent requests to access these restricted resources.
* The Selling Partner API for Tokens provides a secure way to access a customer\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes you to make subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/references/tokens-api/tokens_2021-03-01.md).
*
* The version of the OpenAPI document: 2021-03-01
*
Expand Down
2 changes: 1 addition & 1 deletion src/api-models/tokens-api-model/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Selling Partner API for Tokens
* The Selling Partner API for Tokens provides a secure way to access a customers\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes you to make subsequent requests to access these restricted resources.
* The Selling Partner API for Tokens provides a secure way to access a customer\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes you to make subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/references/tokens-api/tokens_2021-03-01.md).
*
* The version of the OpenAPI document: 2021-03-01
*
Expand Down
2 changes: 1 addition & 1 deletion src/api-models/tokens-api-model/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Selling Partner API for Tokens
* The Selling Partner API for Tokens provides a secure way to access a customers\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes you to make subsequent requests to access these restricted resources.
* The Selling Partner API for Tokens provides a secure way to access a customer\'s PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes you to make subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/references/tokens-api/tokens_2021-03-01.md).
*
* The version of the OpenAPI document: 2021-03-01
*
Expand Down
Loading

0 comments on commit bac11e7

Please sign in to comment.