@jugarhoy/api 1.1.16 → 1.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,350 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Jugar Hoy - API
5
+ * API documentation for Jugar Hoy application
6
+ *
7
+ * The version of the OpenAPI document: 1.5.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ ActivateCoachProfileRequest,
19
+ AddCoachLocation200Response,
20
+ AddCoachLocationRequest,
21
+ Customer,
22
+ DefineCoachScheduleRequest,
23
+ Location,
24
+ PlaySpotShift,
25
+ SaveCoachBasicInfoRequest,
26
+ UserCoachProfile,
27
+ } from '../models/index';
28
+ import {
29
+ ActivateCoachProfileRequestFromJSON,
30
+ ActivateCoachProfileRequestToJSON,
31
+ AddCoachLocation200ResponseFromJSON,
32
+ AddCoachLocation200ResponseToJSON,
33
+ AddCoachLocationRequestFromJSON,
34
+ AddCoachLocationRequestToJSON,
35
+ CustomerFromJSON,
36
+ CustomerToJSON,
37
+ DefineCoachScheduleRequestFromJSON,
38
+ DefineCoachScheduleRequestToJSON,
39
+ LocationFromJSON,
40
+ LocationToJSON,
41
+ PlaySpotShiftFromJSON,
42
+ PlaySpotShiftToJSON,
43
+ SaveCoachBasicInfoRequestFromJSON,
44
+ SaveCoachBasicInfoRequestToJSON,
45
+ UserCoachProfileFromJSON,
46
+ UserCoachProfileToJSON,
47
+ } from '../models/index';
48
+
49
+ export interface ActivateCoachProfileOperationRequest {
50
+ activateCoachProfileRequest: ActivateCoachProfileRequest;
51
+ }
52
+
53
+ export interface AddCoachLocationOperationRequest {
54
+ addCoachLocationRequest: AddCoachLocationRequest;
55
+ }
56
+
57
+ export interface DefineCoachScheduleOperationRequest {
58
+ defineCoachScheduleRequest: DefineCoachScheduleRequest;
59
+ }
60
+
61
+ export interface SaveCoachBasicInfoOperationRequest {
62
+ saveCoachBasicInfoRequest: SaveCoachBasicInfoRequest;
63
+ }
64
+
65
+ /**
66
+ *
67
+ */
68
+ export class CoachApi extends runtime.BaseAPI {
69
+
70
+ /**
71
+ * Activate coach profile (Step 4 of wizard)
72
+ */
73
+ async activateCoachProfileRaw(requestParameters: ActivateCoachProfileOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserCoachProfile>> {
74
+ if (requestParameters['activateCoachProfileRequest'] == null) {
75
+ throw new runtime.RequiredError(
76
+ 'activateCoachProfileRequest',
77
+ 'Required parameter "activateCoachProfileRequest" was null or undefined when calling activateCoachProfile().'
78
+ );
79
+ }
80
+
81
+ const queryParameters: any = {};
82
+
83
+ const headerParameters: runtime.HTTPHeaders = {};
84
+
85
+ headerParameters['Content-Type'] = 'application/json';
86
+
87
+ if (this.configuration && this.configuration.accessToken) {
88
+ const token = this.configuration.accessToken;
89
+ const tokenString = await token("bearerAuth", []);
90
+
91
+ if (tokenString) {
92
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
93
+ }
94
+ }
95
+ const response = await this.request({
96
+ path: `/api/app/coach/profile/activate`,
97
+ method: 'POST',
98
+ headers: headerParameters,
99
+ query: queryParameters,
100
+ body: ActivateCoachProfileRequestToJSON(requestParameters['activateCoachProfileRequest']),
101
+ }, initOverrides);
102
+
103
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserCoachProfileFromJSON(jsonValue));
104
+ }
105
+
106
+ /**
107
+ * Activate coach profile (Step 4 of wizard)
108
+ */
109
+ async activateCoachProfile(requestParameters: ActivateCoachProfileOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserCoachProfile> {
110
+ const response = await this.activateCoachProfileRaw(requestParameters, initOverrides);
111
+ return await response.value();
112
+ }
113
+
114
+ /**
115
+ * Auto-creates Customer (type=COACH), Location, and PlaySpot (DEFAULT) if they don\'t exist
116
+ * Add a location for the coach (Step 2 of wizard)
117
+ */
118
+ async addCoachLocationRaw(requestParameters: AddCoachLocationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AddCoachLocation200Response>> {
119
+ if (requestParameters['addCoachLocationRequest'] == null) {
120
+ throw new runtime.RequiredError(
121
+ 'addCoachLocationRequest',
122
+ 'Required parameter "addCoachLocationRequest" was null or undefined when calling addCoachLocation().'
123
+ );
124
+ }
125
+
126
+ const queryParameters: any = {};
127
+
128
+ const headerParameters: runtime.HTTPHeaders = {};
129
+
130
+ headerParameters['Content-Type'] = 'application/json';
131
+
132
+ if (this.configuration && this.configuration.accessToken) {
133
+ const token = this.configuration.accessToken;
134
+ const tokenString = await token("bearerAuth", []);
135
+
136
+ if (tokenString) {
137
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
138
+ }
139
+ }
140
+ const response = await this.request({
141
+ path: `/api/app/coach/location`,
142
+ method: 'POST',
143
+ headers: headerParameters,
144
+ query: queryParameters,
145
+ body: AddCoachLocationRequestToJSON(requestParameters['addCoachLocationRequest']),
146
+ }, initOverrides);
147
+
148
+ return new runtime.JSONApiResponse(response, (jsonValue) => AddCoachLocation200ResponseFromJSON(jsonValue));
149
+ }
150
+
151
+ /**
152
+ * Auto-creates Customer (type=COACH), Location, and PlaySpot (DEFAULT) if they don\'t exist
153
+ * Add a location for the coach (Step 2 of wizard)
154
+ */
155
+ async addCoachLocation(requestParameters: AddCoachLocationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AddCoachLocation200Response> {
156
+ const response = await this.addCoachLocationRaw(requestParameters, initOverrides);
157
+ return await response.value();
158
+ }
159
+
160
+ /**
161
+ * Define coach availability schedule (Step 3 of wizard)
162
+ */
163
+ async defineCoachScheduleRaw(requestParameters: DefineCoachScheduleOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PlaySpotShift>>> {
164
+ if (requestParameters['defineCoachScheduleRequest'] == null) {
165
+ throw new runtime.RequiredError(
166
+ 'defineCoachScheduleRequest',
167
+ 'Required parameter "defineCoachScheduleRequest" was null or undefined when calling defineCoachSchedule().'
168
+ );
169
+ }
170
+
171
+ const queryParameters: any = {};
172
+
173
+ const headerParameters: runtime.HTTPHeaders = {};
174
+
175
+ headerParameters['Content-Type'] = 'application/json';
176
+
177
+ if (this.configuration && this.configuration.accessToken) {
178
+ const token = this.configuration.accessToken;
179
+ const tokenString = await token("bearerAuth", []);
180
+
181
+ if (tokenString) {
182
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
183
+ }
184
+ }
185
+ const response = await this.request({
186
+ path: `/api/app/coach/schedule`,
187
+ method: 'POST',
188
+ headers: headerParameters,
189
+ query: queryParameters,
190
+ body: DefineCoachScheduleRequestToJSON(requestParameters['defineCoachScheduleRequest']),
191
+ }, initOverrides);
192
+
193
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PlaySpotShiftFromJSON));
194
+ }
195
+
196
+ /**
197
+ * Define coach availability schedule (Step 3 of wizard)
198
+ */
199
+ async defineCoachSchedule(requestParameters: DefineCoachScheduleOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PlaySpotShift>> {
200
+ const response = await this.defineCoachScheduleRaw(requestParameters, initOverrides);
201
+ return await response.value();
202
+ }
203
+
204
+ /**
205
+ * Get coach\'s customer entity
206
+ */
207
+ async getCoachCustomerRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Customer>> {
208
+ const queryParameters: any = {};
209
+
210
+ const headerParameters: runtime.HTTPHeaders = {};
211
+
212
+ if (this.configuration && this.configuration.accessToken) {
213
+ const token = this.configuration.accessToken;
214
+ const tokenString = await token("bearerAuth", []);
215
+
216
+ if (tokenString) {
217
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
218
+ }
219
+ }
220
+ const response = await this.request({
221
+ path: `/api/app/coach/customer`,
222
+ method: 'GET',
223
+ headers: headerParameters,
224
+ query: queryParameters,
225
+ }, initOverrides);
226
+
227
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomerFromJSON(jsonValue));
228
+ }
229
+
230
+ /**
231
+ * Get coach\'s customer entity
232
+ */
233
+ async getCoachCustomer(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Customer> {
234
+ const response = await this.getCoachCustomerRaw(initOverrides);
235
+ return await response.value();
236
+ }
237
+
238
+ /**
239
+ * Get coach\'s locations
240
+ */
241
+ async getCoachLocationsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Location>>> {
242
+ const queryParameters: any = {};
243
+
244
+ const headerParameters: runtime.HTTPHeaders = {};
245
+
246
+ if (this.configuration && this.configuration.accessToken) {
247
+ const token = this.configuration.accessToken;
248
+ const tokenString = await token("bearerAuth", []);
249
+
250
+ if (tokenString) {
251
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
252
+ }
253
+ }
254
+ const response = await this.request({
255
+ path: `/api/app/coach/locations`,
256
+ method: 'GET',
257
+ headers: headerParameters,
258
+ query: queryParameters,
259
+ }, initOverrides);
260
+
261
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(LocationFromJSON));
262
+ }
263
+
264
+ /**
265
+ * Get coach\'s locations
266
+ */
267
+ async getCoachLocations(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Location>> {
268
+ const response = await this.getCoachLocationsRaw(initOverrides);
269
+ return await response.value();
270
+ }
271
+
272
+ /**
273
+ * Get own coach profile
274
+ */
275
+ async getCoachProfileRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserCoachProfile>> {
276
+ const queryParameters: any = {};
277
+
278
+ const headerParameters: runtime.HTTPHeaders = {};
279
+
280
+ if (this.configuration && this.configuration.accessToken) {
281
+ const token = this.configuration.accessToken;
282
+ const tokenString = await token("bearerAuth", []);
283
+
284
+ if (tokenString) {
285
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
286
+ }
287
+ }
288
+ const response = await this.request({
289
+ path: `/api/app/coach/profile`,
290
+ method: 'GET',
291
+ headers: headerParameters,
292
+ query: queryParameters,
293
+ }, initOverrides);
294
+
295
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserCoachProfileFromJSON(jsonValue));
296
+ }
297
+
298
+ /**
299
+ * Get own coach profile
300
+ */
301
+ async getCoachProfile(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserCoachProfile> {
302
+ const response = await this.getCoachProfileRaw(initOverrides);
303
+ return await response.value();
304
+ }
305
+
306
+ /**
307
+ * Save basic coach information (Step 1 of wizard)
308
+ */
309
+ async saveCoachBasicInfoRaw(requestParameters: SaveCoachBasicInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserCoachProfile>> {
310
+ if (requestParameters['saveCoachBasicInfoRequest'] == null) {
311
+ throw new runtime.RequiredError(
312
+ 'saveCoachBasicInfoRequest',
313
+ 'Required parameter "saveCoachBasicInfoRequest" was null or undefined when calling saveCoachBasicInfo().'
314
+ );
315
+ }
316
+
317
+ const queryParameters: any = {};
318
+
319
+ const headerParameters: runtime.HTTPHeaders = {};
320
+
321
+ headerParameters['Content-Type'] = 'application/json';
322
+
323
+ if (this.configuration && this.configuration.accessToken) {
324
+ const token = this.configuration.accessToken;
325
+ const tokenString = await token("bearerAuth", []);
326
+
327
+ if (tokenString) {
328
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
329
+ }
330
+ }
331
+ const response = await this.request({
332
+ path: `/api/app/coach/profile/setup/step1`,
333
+ method: 'POST',
334
+ headers: headerParameters,
335
+ query: queryParameters,
336
+ body: SaveCoachBasicInfoRequestToJSON(requestParameters['saveCoachBasicInfoRequest']),
337
+ }, initOverrides);
338
+
339
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserCoachProfileFromJSON(jsonValue));
340
+ }
341
+
342
+ /**
343
+ * Save basic coach information (Step 1 of wizard)
344
+ */
345
+ async saveCoachBasicInfo(requestParameters: SaveCoachBasicInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserCoachProfile> {
346
+ const response = await this.saveCoachBasicInfoRaw(requestParameters, initOverrides);
347
+ return await response.value();
348
+ }
349
+
350
+ }
@@ -0,0 +1,263 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Jugar Hoy - API
5
+ * API documentation for Jugar Hoy application
6
+ *
7
+ * The version of the OpenAPI document: 1.5.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ CreateCoachPriceDto,
19
+ PlayPrice,
20
+ UpdateCoachPriceDto,
21
+ } from '../models/index';
22
+ import {
23
+ CreateCoachPriceDtoFromJSON,
24
+ CreateCoachPriceDtoToJSON,
25
+ PlayPriceFromJSON,
26
+ PlayPriceToJSON,
27
+ UpdateCoachPriceDtoFromJSON,
28
+ UpdateCoachPriceDtoToJSON,
29
+ } from '../models/index';
30
+
31
+ export interface ApiAppCoachPricingPostRequest {
32
+ createCoachPriceDto: CreateCoachPriceDto;
33
+ }
34
+
35
+ export interface ApiAppCoachPricingPriceIdDeleteRequest {
36
+ priceId: string;
37
+ }
38
+
39
+ export interface ApiAppCoachPricingPriceIdGetRequest {
40
+ priceId: string;
41
+ }
42
+
43
+ export interface ApiAppCoachPricingPriceIdPutRequest {
44
+ priceId: string;
45
+ updateCoachPriceDto: UpdateCoachPriceDto;
46
+ }
47
+
48
+ /**
49
+ *
50
+ */
51
+ export class CoachPricingApi extends runtime.BaseAPI {
52
+
53
+ /**
54
+ * List all prices for the coach
55
+ */
56
+ async apiAppCoachPricingGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PlayPrice>>> {
57
+ const queryParameters: any = {};
58
+
59
+ const headerParameters: runtime.HTTPHeaders = {};
60
+
61
+ if (this.configuration && this.configuration.accessToken) {
62
+ const token = this.configuration.accessToken;
63
+ const tokenString = await token("bearerAuth", []);
64
+
65
+ if (tokenString) {
66
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
67
+ }
68
+ }
69
+ const response = await this.request({
70
+ path: `/api/app/coach/pricing`,
71
+ method: 'GET',
72
+ headers: headerParameters,
73
+ query: queryParameters,
74
+ }, initOverrides);
75
+
76
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PlayPriceFromJSON));
77
+ }
78
+
79
+ /**
80
+ * List all prices for the coach
81
+ */
82
+ async apiAppCoachPricingGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PlayPrice>> {
83
+ const response = await this.apiAppCoachPricingGetRaw(initOverrides);
84
+ return await response.value();
85
+ }
86
+
87
+ /**
88
+ * Create a new price for coach\'s shifts
89
+ */
90
+ async apiAppCoachPricingPostRaw(requestParameters: ApiAppCoachPricingPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PlayPrice>> {
91
+ if (requestParameters['createCoachPriceDto'] == null) {
92
+ throw new runtime.RequiredError(
93
+ 'createCoachPriceDto',
94
+ 'Required parameter "createCoachPriceDto" was null or undefined when calling apiAppCoachPricingPost().'
95
+ );
96
+ }
97
+
98
+ const queryParameters: any = {};
99
+
100
+ const headerParameters: runtime.HTTPHeaders = {};
101
+
102
+ headerParameters['Content-Type'] = 'application/json';
103
+
104
+ if (this.configuration && this.configuration.accessToken) {
105
+ const token = this.configuration.accessToken;
106
+ const tokenString = await token("bearerAuth", []);
107
+
108
+ if (tokenString) {
109
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
110
+ }
111
+ }
112
+ const response = await this.request({
113
+ path: `/api/app/coach/pricing`,
114
+ method: 'POST',
115
+ headers: headerParameters,
116
+ query: queryParameters,
117
+ body: CreateCoachPriceDtoToJSON(requestParameters['createCoachPriceDto']),
118
+ }, initOverrides);
119
+
120
+ return new runtime.JSONApiResponse(response, (jsonValue) => PlayPriceFromJSON(jsonValue));
121
+ }
122
+
123
+ /**
124
+ * Create a new price for coach\'s shifts
125
+ */
126
+ async apiAppCoachPricingPost(requestParameters: ApiAppCoachPricingPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PlayPrice> {
127
+ const response = await this.apiAppCoachPricingPostRaw(requestParameters, initOverrides);
128
+ return await response.value();
129
+ }
130
+
131
+ /**
132
+ * Delete a price
133
+ */
134
+ async apiAppCoachPricingPriceIdDeleteRaw(requestParameters: ApiAppCoachPricingPriceIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
135
+ if (requestParameters['priceId'] == null) {
136
+ throw new runtime.RequiredError(
137
+ 'priceId',
138
+ 'Required parameter "priceId" was null or undefined when calling apiAppCoachPricingPriceIdDelete().'
139
+ );
140
+ }
141
+
142
+ const queryParameters: any = {};
143
+
144
+ const headerParameters: runtime.HTTPHeaders = {};
145
+
146
+ if (this.configuration && this.configuration.accessToken) {
147
+ const token = this.configuration.accessToken;
148
+ const tokenString = await token("bearerAuth", []);
149
+
150
+ if (tokenString) {
151
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
152
+ }
153
+ }
154
+ const response = await this.request({
155
+ path: `/api/app/coach/pricing/{priceId}`.replace(`{${"priceId"}}`, encodeURIComponent(String(requestParameters['priceId']))),
156
+ method: 'DELETE',
157
+ headers: headerParameters,
158
+ query: queryParameters,
159
+ }, initOverrides);
160
+
161
+ return new runtime.VoidApiResponse(response);
162
+ }
163
+
164
+ /**
165
+ * Delete a price
166
+ */
167
+ async apiAppCoachPricingPriceIdDelete(requestParameters: ApiAppCoachPricingPriceIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
168
+ await this.apiAppCoachPricingPriceIdDeleteRaw(requestParameters, initOverrides);
169
+ }
170
+
171
+ /**
172
+ * Get a specific price by ID
173
+ */
174
+ async apiAppCoachPricingPriceIdGetRaw(requestParameters: ApiAppCoachPricingPriceIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PlayPrice>> {
175
+ if (requestParameters['priceId'] == null) {
176
+ throw new runtime.RequiredError(
177
+ 'priceId',
178
+ 'Required parameter "priceId" was null or undefined when calling apiAppCoachPricingPriceIdGet().'
179
+ );
180
+ }
181
+
182
+ const queryParameters: any = {};
183
+
184
+ const headerParameters: runtime.HTTPHeaders = {};
185
+
186
+ if (this.configuration && this.configuration.accessToken) {
187
+ const token = this.configuration.accessToken;
188
+ const tokenString = await token("bearerAuth", []);
189
+
190
+ if (tokenString) {
191
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
192
+ }
193
+ }
194
+ const response = await this.request({
195
+ path: `/api/app/coach/pricing/{priceId}`.replace(`{${"priceId"}}`, encodeURIComponent(String(requestParameters['priceId']))),
196
+ method: 'GET',
197
+ headers: headerParameters,
198
+ query: queryParameters,
199
+ }, initOverrides);
200
+
201
+ return new runtime.JSONApiResponse(response, (jsonValue) => PlayPriceFromJSON(jsonValue));
202
+ }
203
+
204
+ /**
205
+ * Get a specific price by ID
206
+ */
207
+ async apiAppCoachPricingPriceIdGet(requestParameters: ApiAppCoachPricingPriceIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PlayPrice> {
208
+ const response = await this.apiAppCoachPricingPriceIdGetRaw(requestParameters, initOverrides);
209
+ return await response.value();
210
+ }
211
+
212
+ /**
213
+ * Update a price
214
+ */
215
+ async apiAppCoachPricingPriceIdPutRaw(requestParameters: ApiAppCoachPricingPriceIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PlayPrice>> {
216
+ if (requestParameters['priceId'] == null) {
217
+ throw new runtime.RequiredError(
218
+ 'priceId',
219
+ 'Required parameter "priceId" was null or undefined when calling apiAppCoachPricingPriceIdPut().'
220
+ );
221
+ }
222
+
223
+ if (requestParameters['updateCoachPriceDto'] == null) {
224
+ throw new runtime.RequiredError(
225
+ 'updateCoachPriceDto',
226
+ 'Required parameter "updateCoachPriceDto" was null or undefined when calling apiAppCoachPricingPriceIdPut().'
227
+ );
228
+ }
229
+
230
+ const queryParameters: any = {};
231
+
232
+ const headerParameters: runtime.HTTPHeaders = {};
233
+
234
+ headerParameters['Content-Type'] = 'application/json';
235
+
236
+ if (this.configuration && this.configuration.accessToken) {
237
+ const token = this.configuration.accessToken;
238
+ const tokenString = await token("bearerAuth", []);
239
+
240
+ if (tokenString) {
241
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
242
+ }
243
+ }
244
+ const response = await this.request({
245
+ path: `/api/app/coach/pricing/{priceId}`.replace(`{${"priceId"}}`, encodeURIComponent(String(requestParameters['priceId']))),
246
+ method: 'PUT',
247
+ headers: headerParameters,
248
+ query: queryParameters,
249
+ body: UpdateCoachPriceDtoToJSON(requestParameters['updateCoachPriceDto']),
250
+ }, initOverrides);
251
+
252
+ return new runtime.JSONApiResponse(response, (jsonValue) => PlayPriceFromJSON(jsonValue));
253
+ }
254
+
255
+ /**
256
+ * Update a price
257
+ */
258
+ async apiAppCoachPricingPriceIdPut(requestParameters: ApiAppCoachPricingPriceIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PlayPrice> {
259
+ const response = await this.apiAppCoachPricingPriceIdPutRaw(requestParameters, initOverrides);
260
+ return await response.value();
261
+ }
262
+
263
+ }