celitech-sdk 1.1.71 → 1.1.72

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/.manifest.json +12 -12
  2. package/README.md +2 -2
  3. package/documentation/services/PurchasesService.md +6 -6
  4. package/examples/package.json +1 -1
  5. package/package.json +1 -1
  6. package/src/http/handlers/hook-handler.ts +6 -4
  7. package/src/http/handlers/response-validation-handler.ts +1 -1
  8. package/src/http/handlers/retry-handler.ts +8 -5
  9. package/src/http/hooks/hook.ts +3 -2
  10. package/src/http/serializer.ts +7 -4
  11. package/src/http/transport/request-builder.ts +145 -0
  12. package/src/http/transport/request.ts +45 -36
  13. package/src/services/destinations/destinations.ts +14 -11
  14. package/src/services/destinations/models/destinations.ts +3 -3
  15. package/src/services/destinations/models/list-destinations-ok-response.ts +3 -3
  16. package/src/services/e-sim/e-sim.ts +57 -45
  17. package/src/services/e-sim/models/device.ts +3 -3
  18. package/src/services/e-sim/models/get-esim-device-ok-response.ts +3 -3
  19. package/src/services/e-sim/models/get-esim-history-ok-response-esim.ts +3 -3
  20. package/src/services/e-sim/models/get-esim-history-ok-response.ts +3 -3
  21. package/src/services/e-sim/models/get-esim-mac-ok-response-esim.ts +3 -3
  22. package/src/services/e-sim/models/get-esim-mac-ok-response.ts +3 -3
  23. package/src/services/e-sim/models/get-esim-ok-response-esim.ts +3 -3
  24. package/src/services/e-sim/models/get-esim-ok-response.ts +3 -3
  25. package/src/services/e-sim/models/history.ts +3 -3
  26. package/src/services/packages/models/list-packages-ok-response.ts +3 -3
  27. package/src/services/packages/models/packages.ts +3 -3
  28. package/src/services/packages/packages.ts +22 -19
  29. package/src/services/purchases/models/create-purchase-ok-response-profile.ts +3 -3
  30. package/src/services/purchases/models/create-purchase-ok-response-purchase.ts +3 -3
  31. package/src/services/purchases/models/create-purchase-ok-response.ts +3 -3
  32. package/src/services/purchases/models/create-purchase-request.ts +3 -3
  33. package/src/services/purchases/models/edit-purchase-ok-response.ts +3 -3
  34. package/src/services/purchases/models/edit-purchase-request.ts +3 -3
  35. package/src/services/purchases/models/get-purchase-consumption-ok-response.ts +3 -3
  36. package/src/services/purchases/models/list-purchases-ok-response.ts +3 -3
  37. package/src/services/purchases/models/package_.ts +3 -3
  38. package/src/services/purchases/models/purchases-esim.ts +3 -3
  39. package/src/services/purchases/models/purchases.ts +3 -3
  40. package/src/services/purchases/models/top-up-esim-ok-response-profile.ts +3 -3
  41. package/src/services/purchases/models/top-up-esim-ok-response-purchase.ts +3 -3
  42. package/src/services/purchases/models/top-up-esim-ok-response.ts +3 -3
  43. package/src/services/purchases/models/top-up-esim-request.ts +3 -3
  44. package/src/services/purchases/purchases.ts +81 -66
  45. package/.github/PROTECTED_BRANCHES.txt +0 -1
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const editPurchaseRequest: any = z.lazy(() => {
6
+ export const editPurchaseRequest = z.lazy(() => {
7
7
  return z.object({
8
8
  purchaseId: z.string(),
9
9
  startDate: z.string(),
@@ -28,7 +28,7 @@ export type EditPurchaseRequest = z.infer<typeof editPurchaseRequest>;
28
28
  * The shape of the model mapping from the api schema into the application shape.
29
29
  * Is equal to application shape if all property names match the api schema
30
30
  */
31
- export const editPurchaseRequestResponse: any = z.lazy(() => {
31
+ export const editPurchaseRequestResponse = z.lazy(() => {
32
32
  return z
33
33
  .object({
34
34
  purchaseId: z.string(),
@@ -50,7 +50,7 @@ export const editPurchaseRequestResponse: any = z.lazy(() => {
50
50
  * The shape of the model mapping from the application shape into the api schema.
51
51
  * Is equal to application shape if all property names match the api schema
52
52
  */
53
- export const editPurchaseRequestRequest: any = z.lazy(() => {
53
+ export const editPurchaseRequestRequest = z.lazy(() => {
54
54
  return z
55
55
  .object({
56
56
  purchaseId: z.string().nullish(),
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const getPurchaseConsumptionOkResponse: any = z.lazy(() => {
6
+ export const getPurchaseConsumptionOkResponse = z.lazy(() => {
7
7
  return z.object({
8
8
  dataUsageRemainingInBytes: z.number().optional(),
9
9
  status: z.string().optional(),
@@ -22,7 +22,7 @@ export type GetPurchaseConsumptionOkResponse = z.infer<typeof getPurchaseConsump
22
22
  * The shape of the model mapping from the api schema into the application shape.
23
23
  * Is equal to application shape if all property names match the api schema
24
24
  */
25
- export const getPurchaseConsumptionOkResponseResponse: any = z.lazy(() => {
25
+ export const getPurchaseConsumptionOkResponseResponse = z.lazy(() => {
26
26
  return z
27
27
  .object({
28
28
  dataUsageRemainingInBytes: z.number().optional(),
@@ -38,7 +38,7 @@ export const getPurchaseConsumptionOkResponseResponse: any = z.lazy(() => {
38
38
  * The shape of the model mapping from the application shape into the api schema.
39
39
  * Is equal to application shape if all property names match the api schema
40
40
  */
41
- export const getPurchaseConsumptionOkResponseRequest: any = z.lazy(() => {
41
+ export const getPurchaseConsumptionOkResponseRequest = z.lazy(() => {
42
42
  return z
43
43
  .object({ dataUsageRemainingInBytes: z.number().nullish(), status: z.string().nullish() })
44
44
  .transform((data) => ({
@@ -4,7 +4,7 @@ import { purchases, purchasesRequest, purchasesResponse } from './purchases';
4
4
  /**
5
5
  * The shape of the model inside the application code - what the users use
6
6
  */
7
- export const listPurchasesOkResponse: any = z.lazy(() => {
7
+ export const listPurchasesOkResponse = z.lazy(() => {
8
8
  return z.object({
9
9
  purchases: z.array(purchases).optional(),
10
10
  afterCursor: z.string().optional().nullable(),
@@ -23,7 +23,7 @@ export type ListPurchasesOkResponse = z.infer<typeof listPurchasesOkResponse>;
23
23
  * The shape of the model mapping from the api schema into the application shape.
24
24
  * Is equal to application shape if all property names match the api schema
25
25
  */
26
- export const listPurchasesOkResponseResponse: any = z.lazy(() => {
26
+ export const listPurchasesOkResponseResponse = z.lazy(() => {
27
27
  return z
28
28
  .object({
29
29
  purchases: z.array(purchasesResponse).optional(),
@@ -39,7 +39,7 @@ export const listPurchasesOkResponseResponse: any = z.lazy(() => {
39
39
  * The shape of the model mapping from the application shape into the api schema.
40
40
  * Is equal to application shape if all property names match the api schema
41
41
  */
42
- export const listPurchasesOkResponseRequest: any = z.lazy(() => {
42
+ export const listPurchasesOkResponseRequest = z.lazy(() => {
43
43
  return z
44
44
  .object({ purchases: z.array(purchasesRequest).nullish(), afterCursor: z.string().nullish() })
45
45
  .transform((data) => ({
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const package_: any = z.lazy(() => {
6
+ export const package_ = z.lazy(() => {
7
7
  return z.object({
8
8
  id: z.string().optional(),
9
9
  dataLimitInBytes: z.number().optional(),
@@ -28,7 +28,7 @@ export type Package_ = z.infer<typeof package_>;
28
28
  * The shape of the model mapping from the api schema into the application shape.
29
29
  * Is equal to application shape if all property names match the api schema
30
30
  */
31
- export const packageResponse: any = z.lazy(() => {
31
+ export const packageResponse = z.lazy(() => {
32
32
  return z
33
33
  .object({
34
34
  id: z.string().optional(),
@@ -50,7 +50,7 @@ export const packageResponse: any = z.lazy(() => {
50
50
  * The shape of the model mapping from the application shape into the api schema.
51
51
  * Is equal to application shape if all property names match the api schema
52
52
  */
53
- export const packageRequest: any = z.lazy(() => {
53
+ export const packageRequest = z.lazy(() => {
54
54
  return z
55
55
  .object({
56
56
  id: z.string().nullish(),
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const purchasesEsim: any = z.lazy(() => {
6
+ export const purchasesEsim = z.lazy(() => {
7
7
  return z.object({
8
8
  iccid: z.string().min(18).max(22).optional(),
9
9
  });
@@ -20,7 +20,7 @@ export type PurchasesEsim = z.infer<typeof purchasesEsim>;
20
20
  * The shape of the model mapping from the api schema into the application shape.
21
21
  * Is equal to application shape if all property names match the api schema
22
22
  */
23
- export const purchasesEsimResponse: any = z.lazy(() => {
23
+ export const purchasesEsimResponse = z.lazy(() => {
24
24
  return z
25
25
  .object({
26
26
  iccid: z.string().min(18).max(22).optional(),
@@ -34,7 +34,7 @@ export const purchasesEsimResponse: any = z.lazy(() => {
34
34
  * The shape of the model mapping from the application shape into the api schema.
35
35
  * Is equal to application shape if all property names match the api schema
36
36
  */
37
- export const purchasesEsimRequest: any = z.lazy(() => {
37
+ export const purchasesEsimRequest = z.lazy(() => {
38
38
  return z.object({ iccid: z.string().nullish() }).transform((data) => ({
39
39
  iccid: data['iccid'],
40
40
  }));
@@ -5,7 +5,7 @@ import { purchasesEsim, purchasesEsimRequest, purchasesEsimResponse } from './pu
5
5
  /**
6
6
  * The shape of the model inside the application code - what the users use
7
7
  */
8
- export const purchases: any = z.lazy(() => {
8
+ export const purchases = z.lazy(() => {
9
9
  return z.object({
10
10
  id: z.string().optional(),
11
11
  startDate: z.string().optional(),
@@ -42,7 +42,7 @@ export type Purchases = z.infer<typeof purchases>;
42
42
  * The shape of the model mapping from the api schema into the application shape.
43
43
  * Is equal to application shape if all property names match the api schema
44
44
  */
45
- export const purchasesResponse: any = z.lazy(() => {
45
+ export const purchasesResponse = z.lazy(() => {
46
46
  return z
47
47
  .object({
48
48
  id: z.string().optional(),
@@ -76,7 +76,7 @@ export const purchasesResponse: any = z.lazy(() => {
76
76
  * The shape of the model mapping from the application shape into the api schema.
77
77
  * Is equal to application shape if all property names match the api schema
78
78
  */
79
- export const purchasesRequest: any = z.lazy(() => {
79
+ export const purchasesRequest = z.lazy(() => {
80
80
  return z
81
81
  .object({
82
82
  id: z.string().nullish(),
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const topUpEsimOkResponseProfile: any = z.lazy(() => {
6
+ export const topUpEsimOkResponseProfile = z.lazy(() => {
7
7
  return z.object({
8
8
  iccid: z.string().min(18).max(22).optional(),
9
9
  });
@@ -20,7 +20,7 @@ export type TopUpEsimOkResponseProfile = z.infer<typeof topUpEsimOkResponseProfi
20
20
  * The shape of the model mapping from the api schema into the application shape.
21
21
  * Is equal to application shape if all property names match the api schema
22
22
  */
23
- export const topUpEsimOkResponseProfileResponse: any = z.lazy(() => {
23
+ export const topUpEsimOkResponseProfileResponse = z.lazy(() => {
24
24
  return z
25
25
  .object({
26
26
  iccid: z.string().min(18).max(22).optional(),
@@ -34,7 +34,7 @@ export const topUpEsimOkResponseProfileResponse: any = z.lazy(() => {
34
34
  * The shape of the model mapping from the application shape into the api schema.
35
35
  * Is equal to application shape if all property names match the api schema
36
36
  */
37
- export const topUpEsimOkResponseProfileRequest: any = z.lazy(() => {
37
+ export const topUpEsimOkResponseProfileRequest = z.lazy(() => {
38
38
  return z.object({ iccid: z.string().nullish() }).transform((data) => ({
39
39
  iccid: data['iccid'],
40
40
  }));
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const topUpEsimOkResponsePurchase: any = z.lazy(() => {
6
+ export const topUpEsimOkResponsePurchase = z.lazy(() => {
7
7
  return z.object({
8
8
  id: z.string().optional(),
9
9
  packageId: z.string().optional(),
@@ -32,7 +32,7 @@ export type TopUpEsimOkResponsePurchase = z.infer<typeof topUpEsimOkResponsePurc
32
32
  * The shape of the model mapping from the api schema into the application shape.
33
33
  * Is equal to application shape if all property names match the api schema
34
34
  */
35
- export const topUpEsimOkResponsePurchaseResponse: any = z.lazy(() => {
35
+ export const topUpEsimOkResponsePurchaseResponse = z.lazy(() => {
36
36
  return z
37
37
  .object({
38
38
  id: z.string().optional(),
@@ -58,7 +58,7 @@ export const topUpEsimOkResponsePurchaseResponse: any = z.lazy(() => {
58
58
  * The shape of the model mapping from the application shape into the api schema.
59
59
  * Is equal to application shape if all property names match the api schema
60
60
  */
61
- export const topUpEsimOkResponsePurchaseRequest: any = z.lazy(() => {
61
+ export const topUpEsimOkResponsePurchaseRequest = z.lazy(() => {
62
62
  return z
63
63
  .object({
64
64
  id: z.string().nullish(),
@@ -13,7 +13,7 @@ import {
13
13
  /**
14
14
  * The shape of the model inside the application code - what the users use
15
15
  */
16
- export const topUpEsimOkResponse: any = z.lazy(() => {
16
+ export const topUpEsimOkResponse = z.lazy(() => {
17
17
  return z.object({
18
18
  purchase: topUpEsimOkResponsePurchase.optional(),
19
19
  profile: topUpEsimOkResponseProfile.optional(),
@@ -32,7 +32,7 @@ export type TopUpEsimOkResponse = z.infer<typeof topUpEsimOkResponse>;
32
32
  * The shape of the model mapping from the api schema into the application shape.
33
33
  * Is equal to application shape if all property names match the api schema
34
34
  */
35
- export const topUpEsimOkResponseResponse: any = z.lazy(() => {
35
+ export const topUpEsimOkResponseResponse = z.lazy(() => {
36
36
  return z
37
37
  .object({
38
38
  purchase: topUpEsimOkResponsePurchaseResponse.optional(),
@@ -48,7 +48,7 @@ export const topUpEsimOkResponseResponse: any = z.lazy(() => {
48
48
  * The shape of the model mapping from the application shape into the api schema.
49
49
  * Is equal to application shape if all property names match the api schema
50
50
  */
51
- export const topUpEsimOkResponseRequest: any = z.lazy(() => {
51
+ export const topUpEsimOkResponseRequest = z.lazy(() => {
52
52
  return z
53
53
  .object({
54
54
  purchase: topUpEsimOkResponsePurchaseRequest.nullish(),
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const topUpEsimRequest: any = z.lazy(() => {
6
+ export const topUpEsimRequest = z.lazy(() => {
7
7
  return z.object({
8
8
  iccid: z.string().min(18).max(22),
9
9
  dataLimitInGb: z.number(),
@@ -34,7 +34,7 @@ export type TopUpEsimRequest = z.infer<typeof topUpEsimRequest>;
34
34
  * The shape of the model mapping from the api schema into the application shape.
35
35
  * Is equal to application shape if all property names match the api schema
36
36
  */
37
- export const topUpEsimRequestResponse: any = z.lazy(() => {
37
+ export const topUpEsimRequestResponse = z.lazy(() => {
38
38
  return z
39
39
  .object({
40
40
  iccid: z.string().min(18).max(22),
@@ -62,7 +62,7 @@ export const topUpEsimRequestResponse: any = z.lazy(() => {
62
62
  * The shape of the model mapping from the application shape into the api schema.
63
63
  * Is equal to application shape if all property names match the api schema
64
64
  */
65
- export const topUpEsimRequestRequest: any = z.lazy(() => {
65
+ export const topUpEsimRequestRequest = z.lazy(() => {
66
66
  return z
67
67
  .object({
68
68
  iccid: z.string().nullish(),
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { BaseService } from '../base-service';
3
3
  import { ContentType, HttpResponse } from '../../http';
4
4
  import { RequestConfig } from '../../http/types';
5
- import { Request } from '../../http/transport/request';
5
+ import { RequestBuilder } from '../../http/transport/request-builder';
6
6
  import { ListPurchasesOkResponse, listPurchasesOkResponseResponse } from './models/list-purchases-ok-response';
7
7
  import { ListPurchasesParams } from './request-params';
8
8
  import { CreatePurchaseRequest, createPurchaseRequestRequest } from './models/create-purchase-request';
@@ -33,24 +33,27 @@ export class PurchasesService extends BaseService {
33
33
  params?: ListPurchasesParams,
34
34
  requestConfig?: RequestConfig,
35
35
  ): Promise<HttpResponse<ListPurchasesOkResponse>> {
36
- const request = new Request({
37
- method: 'GET',
38
- path: '/purchases',
39
- config: this.config,
40
- responseSchema: listPurchasesOkResponseResponse,
41
- requestSchema: z.any(),
42
- requestContentType: ContentType.Json,
43
- responseContentType: ContentType.Json,
44
- requestConfig,
45
- });
46
- request.addQueryParam('iccid', params?.iccid);
47
- request.addQueryParam('afterDate', params?.afterDate);
48
- request.addQueryParam('beforeDate', params?.beforeDate);
49
- request.addQueryParam('referenceId', params?.referenceId);
50
- request.addQueryParam('afterCursor', params?.afterCursor);
51
- request.addQueryParam('limit', params?.limit);
52
- request.addQueryParam('after', params?.after);
53
- request.addQueryParam('before', params?.before);
36
+ const request = new RequestBuilder<ListPurchasesOkResponse>()
37
+ .setConfig(this.config)
38
+ .setBaseUrl(this.config)
39
+ .setMethod('GET')
40
+ .setPath('/purchases')
41
+ .setRequestSchema(z.any())
42
+ .setResponseSchema(listPurchasesOkResponseResponse)
43
+ .setRequestContentType(ContentType.Json)
44
+ .setResponseContentType(ContentType.Json)
45
+ .setRetryAttempts(this.config, requestConfig)
46
+ .setRetryDelayMs(this.config, requestConfig)
47
+ .setResponseValidation(this.config, requestConfig)
48
+ .addQueryParam('iccid', params?.iccid)
49
+ .addQueryParam('afterDate', params?.afterDate)
50
+ .addQueryParam('beforeDate', params?.beforeDate)
51
+ .addQueryParam('referenceId', params?.referenceId)
52
+ .addQueryParam('afterCursor', params?.afterCursor)
53
+ .addQueryParam('limit', params?.limit)
54
+ .addQueryParam('after', params?.after)
55
+ .addQueryParam('before', params?.before)
56
+ .build();
54
57
  return this.client.call<ListPurchasesOkResponse>(request);
55
58
  }
56
59
 
@@ -62,18 +65,21 @@ export class PurchasesService extends BaseService {
62
65
  body: CreatePurchaseRequest,
63
66
  requestConfig?: RequestConfig,
64
67
  ): Promise<HttpResponse<CreatePurchaseOkResponse>> {
65
- const request = new Request({
66
- method: 'POST',
67
- body,
68
- path: '/purchases',
69
- config: this.config,
70
- responseSchema: createPurchaseOkResponseResponse,
71
- requestSchema: createPurchaseRequestRequest,
72
- requestContentType: ContentType.Json,
73
- responseContentType: ContentType.Json,
74
- requestConfig,
75
- });
76
- request.addHeaderParam('Content-Type', 'application/json');
68
+ const request = new RequestBuilder<CreatePurchaseOkResponse>()
69
+ .setConfig(this.config)
70
+ .setBaseUrl(this.config)
71
+ .setMethod('POST')
72
+ .setPath('/purchases')
73
+ .setRequestSchema(createPurchaseRequestRequest)
74
+ .setResponseSchema(createPurchaseOkResponseResponse)
75
+ .setRequestContentType(ContentType.Json)
76
+ .setResponseContentType(ContentType.Json)
77
+ .setRetryAttempts(this.config, requestConfig)
78
+ .setRetryDelayMs(this.config, requestConfig)
79
+ .setResponseValidation(this.config, requestConfig)
80
+ .addHeaderParam('Content-Type', 'application/json')
81
+ .addBody(body)
82
+ .build();
77
83
  return this.client.call<CreatePurchaseOkResponse>(request);
78
84
  }
79
85
 
@@ -82,18 +88,21 @@ export class PurchasesService extends BaseService {
82
88
  * @returns {Promise<HttpResponse<TopUpEsimOkResponse>>} Successful Response
83
89
  */
84
90
  async topUpEsim(body: TopUpEsimRequest, requestConfig?: RequestConfig): Promise<HttpResponse<TopUpEsimOkResponse>> {
85
- const request = new Request({
86
- method: 'POST',
87
- body,
88
- path: '/purchases/topup',
89
- config: this.config,
90
- responseSchema: topUpEsimOkResponseResponse,
91
- requestSchema: topUpEsimRequestRequest,
92
- requestContentType: ContentType.Json,
93
- responseContentType: ContentType.Json,
94
- requestConfig,
95
- });
96
- request.addHeaderParam('Content-Type', 'application/json');
91
+ const request = new RequestBuilder<TopUpEsimOkResponse>()
92
+ .setConfig(this.config)
93
+ .setBaseUrl(this.config)
94
+ .setMethod('POST')
95
+ .setPath('/purchases/topup')
96
+ .setRequestSchema(topUpEsimRequestRequest)
97
+ .setResponseSchema(topUpEsimOkResponseResponse)
98
+ .setRequestContentType(ContentType.Json)
99
+ .setResponseContentType(ContentType.Json)
100
+ .setRetryAttempts(this.config, requestConfig)
101
+ .setRetryDelayMs(this.config, requestConfig)
102
+ .setResponseValidation(this.config, requestConfig)
103
+ .addHeaderParam('Content-Type', 'application/json')
104
+ .addBody(body)
105
+ .build();
97
106
  return this.client.call<TopUpEsimOkResponse>(request);
98
107
  }
99
108
 
@@ -105,18 +114,21 @@ export class PurchasesService extends BaseService {
105
114
  body: EditPurchaseRequest,
106
115
  requestConfig?: RequestConfig,
107
116
  ): Promise<HttpResponse<EditPurchaseOkResponse>> {
108
- const request = new Request({
109
- method: 'POST',
110
- body,
111
- path: '/purchases/edit',
112
- config: this.config,
113
- responseSchema: editPurchaseOkResponseResponse,
114
- requestSchema: editPurchaseRequestRequest,
115
- requestContentType: ContentType.Json,
116
- responseContentType: ContentType.Json,
117
- requestConfig,
118
- });
119
- request.addHeaderParam('Content-Type', 'application/json');
117
+ const request = new RequestBuilder<EditPurchaseOkResponse>()
118
+ .setConfig(this.config)
119
+ .setBaseUrl(this.config)
120
+ .setMethod('POST')
121
+ .setPath('/purchases/edit')
122
+ .setRequestSchema(editPurchaseRequestRequest)
123
+ .setResponseSchema(editPurchaseOkResponseResponse)
124
+ .setRequestContentType(ContentType.Json)
125
+ .setResponseContentType(ContentType.Json)
126
+ .setRetryAttempts(this.config, requestConfig)
127
+ .setRetryDelayMs(this.config, requestConfig)
128
+ .setResponseValidation(this.config, requestConfig)
129
+ .addHeaderParam('Content-Type', 'application/json')
130
+ .addBody(body)
131
+ .build();
120
132
  return this.client.call<EditPurchaseOkResponse>(request);
121
133
  }
122
134
 
@@ -129,17 +141,20 @@ export class PurchasesService extends BaseService {
129
141
  purchaseId: string,
130
142
  requestConfig?: RequestConfig,
131
143
  ): Promise<HttpResponse<GetPurchaseConsumptionOkResponse>> {
132
- const request = new Request({
133
- method: 'GET',
134
- path: '/purchases/{purchaseId}/consumption',
135
- config: this.config,
136
- responseSchema: getPurchaseConsumptionOkResponseResponse,
137
- requestSchema: z.any(),
138
- requestContentType: ContentType.Json,
139
- responseContentType: ContentType.Json,
140
- requestConfig,
141
- });
142
- request.addPathParam('purchaseId', purchaseId);
144
+ const request = new RequestBuilder<GetPurchaseConsumptionOkResponse>()
145
+ .setConfig(this.config)
146
+ .setBaseUrl(this.config)
147
+ .setMethod('GET')
148
+ .setPath('/purchases/{purchaseId}/consumption')
149
+ .setRequestSchema(z.any())
150
+ .setResponseSchema(getPurchaseConsumptionOkResponseResponse)
151
+ .setRequestContentType(ContentType.Json)
152
+ .setResponseContentType(ContentType.Json)
153
+ .setRetryAttempts(this.config, requestConfig)
154
+ .setRetryDelayMs(this.config, requestConfig)
155
+ .setResponseValidation(this.config, requestConfig)
156
+ .addPathParam('purchaseId', purchaseId)
157
+ .build();
143
158
  return this.client.call<GetPurchaseConsumptionOkResponse>(request);
144
159
  }
145
160
  }
@@ -1 +0,0 @@
1
- main