Skip to content

Commit

Permalink
feat: implement all api clients
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentoanit committed Mar 9, 2021
1 parent 9b6244c commit 9a2dbf8
Show file tree
Hide file tree
Showing 23 changed files with 443 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/clients/aplus-content-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { AplusContentApi } from '../api-models/aplus-content-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class AplusContentApiClient extends AplusContentApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/authorization-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { AuthorizationApi } from '../api-models/authorization-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class AuthorizationApiClient extends AuthorizationApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/catalog-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { CatalogApi } from '../api-models/catalog-items-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class CatalogApiClient extends CatalogApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/default-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { DefaultApi } from '../api-models/finances-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class DefaultApiClient extends DefaultApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/fba-inbound-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { FbaInboundApi } from '../api-models/fba-inbound-eligibility-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class FbaInboundApiClient extends FbaInboundApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/fba-inventory-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { FbaInventoryApi } from '../api-models/fba-inventory-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class FbaInventoryApiClient extends FbaInventoryApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/feeds-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { FeedsApi } from '../api-models/feeds-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class FeedsApiClient extends FeedsApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/fees-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { FeesApi } from '../api-models/product-fees-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class FeesApiClient extends FeesApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
20 changes: 20 additions & 0 deletions src/clients/fulfillment-fba-inbound-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { FbaInboundApi } from '../api-models/fulfillment-inbound-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

// TODO: duplicated API model with fba inbound
export class FulfillmentFbaInboundApiClient extends FbaInboundApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
20 changes: 20 additions & 0 deletions src/clients/fulfillment-fba-outbound-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { FbaOutboundApi } from '../api-models/fulfillment-outbound-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

// TODO: duplicated API model with fba outbound
export class FulfillmentFbaOutboundApiClient extends FbaOutboundApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
22 changes: 22 additions & 0 deletions src/clients/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
export * from './aplus-content-api-client'
export * from './authorization-api-client'
export * from './catalog-api-client'
export * from './fba-inbound-api-client'
export * from './fba-inventory-api-client'
export * from './small-and-light-api-client'
export * from './feeds-api-client'
export * from './default-api-client'
export * from './fulfillment-fba-inbound-api-client'
export * from './fulfillment-fba-outbound-api-client'
export * from './merchant-fulfillment-api-client'
export * from './messaging-api-client'
export * from './notifications-api-client'
export * from './orders-api-client'
export * from './fees-api-client'
export * from './product-pricing-api-client'
export * from './reports-api-client'
export * from './sales-api-client'
export * from './sellers-api-client'
export * from './service-api-client'
export * from './shipping-api-client'
export * from './solicitations-api-client'
export * from './uploads-api-client'
19 changes: 19 additions & 0 deletions src/clients/merchant-fulfillment-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MerchantFulfillmentApi } from '../api-models/merchant-fulfillment-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class MerchantFulfillmentApiClient extends MerchantFulfillmentApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/messaging-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MessagingApi } from '../api-models/messaging-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class MessagingApiClient extends MessagingApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/notifications-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { NotificationsApi } from '../api-models/notifications-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class NotificationsApiClient extends NotificationsApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
20 changes: 20 additions & 0 deletions src/clients/orders-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { OrdersV0Api } from '../api-models/orders-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

// TODO: remove V0 in client name when generate automatically
export class OrdersApiClient extends OrdersV0Api {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/product-pricing-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ProductPricingApi } from '../api-models/product-pricing-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class ProductPricingApiClient extends ProductPricingApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/reports-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ReportsApi } from '../api-models/reports-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class ReportsApiClient extends ReportsApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/sales-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { SalesApi } from '../api-models/sales-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class SalesApiClient extends SalesApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
19 changes: 19 additions & 0 deletions src/clients/sellers-api-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { SellersApi } from '../api-models/sellers-api-model'
import { ApiClientHelpers } from '../helpers'
import { APIConfigurationParameters } from '../types/api-configuration-parameters'

export class SellersApiClient extends SellersApi {
constructor(parameters?: APIConfigurationParameters) {
const axios = ApiClientHelpers.assertAxiosInstance(parameters)
const basePath = ApiClientHelpers.getDefaultBasePath()

super(
{
isJsonMime: ApiClientHelpers.isJsonMime,
...parameters,
},
basePath,
axios,
)
}
}
Loading

0 comments on commit 9a2dbf8

Please sign in to comment.