@outseta/react 0.3.5 → 0.3.7
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.
- package/dist/index.js +593 -0
- package/package.json +2 -2
- package/src/generated/activity/activity.ts +2 -2
- package/src/generated/attribute/attribute.ts +4 -4
- package/src/generated/billing/billing.ts +2160 -621
- package/src/generated/crm/crm.ts +15 -12
- package/src/generated/email/email.ts +7 -6
- package/src/generated/outsetaAPI.schemas.ts +99 -0
- package/src/generated/public/public.ts +5 -3
- package/src/generated/support/support.ts +10 -9
|
@@ -16,15 +16,28 @@ import type {
|
|
|
16
16
|
import type {
|
|
17
17
|
DiscountCoupon,
|
|
18
18
|
DiscountCouponAddDiscountCouponBody,
|
|
19
|
+
DiscountCouponGetAllDiscountCouponsParams,
|
|
20
|
+
DiscountCouponGetDiscountCouponByCodeParams,
|
|
21
|
+
DiscountCouponGetDiscountCouponRedemptionsParams,
|
|
22
|
+
DiscountCouponSubscription,
|
|
23
|
+
DiscountCouponUpdateDiscountCouponBody,
|
|
19
24
|
Invoice,
|
|
20
25
|
InvoiceAddInvoiceBody,
|
|
21
26
|
InvoiceUpdateInvoiceBody,
|
|
22
27
|
PaymentInformation,
|
|
23
28
|
PaymentInformationSavePaymentInformationBody,
|
|
24
29
|
Plan,
|
|
30
|
+
PlanAddPlanBody,
|
|
25
31
|
PlanFamily,
|
|
32
|
+
PlanFamilyAddPlanFamilyBody,
|
|
33
|
+
PlanFamilyUpdatePlanFamilyBody,
|
|
34
|
+
PlanUpdatePlanBody,
|
|
26
35
|
Subscription,
|
|
36
|
+
SubscriptionAddOn,
|
|
27
37
|
SubscriptionAddOnAddSubscriptionAddOnBody,
|
|
38
|
+
SubscriptionAddOnAddSubscriptionAddOnPreviewBody,
|
|
39
|
+
SubscriptionAddOnGetAllSubscriptionsAddOnsParams,
|
|
40
|
+
SubscriptionAddOnSetAddOnUpgradeRequiredBody,
|
|
28
41
|
SubscriptionChangeSubscriptionBody,
|
|
29
42
|
SubscriptionChangeSubscriptionParams,
|
|
30
43
|
SubscriptionChangeSubscriptionPreviewBody,
|
|
@@ -32,6 +45,7 @@ import type {
|
|
|
32
45
|
SubscriptionFirstTimeSubscriptionBody,
|
|
33
46
|
SubscriptionFirstTimeSubscriptionPreviewBody,
|
|
34
47
|
SubscriptionFirstTimeSubscriptionPreviewParams,
|
|
48
|
+
SubscriptionGetAllSubscriptionsParams,
|
|
35
49
|
SubscriptionSetSubscriptionUpgradeRequiredBody,
|
|
36
50
|
Transaction,
|
|
37
51
|
TransactionsAddPaymentTransactionBody,
|
|
@@ -74,95 +88,176 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
|
74
88
|
|
|
75
89
|
|
|
76
90
|
/**
|
|
77
|
-
*
|
|
78
|
-
|
|
79
|
-
|
|
91
|
+
* Used during registration to confirm that a coupon code can still be applied to a plan.
|
|
92
|
+
Returns the coupon when valid, 404 when no coupon matches the code, or a validation
|
|
93
|
+
error when the coupon cannot be applied.
|
|
94
|
+
* @summary Retrieve a discount coupon by code.
|
|
80
95
|
*/
|
|
81
|
-
export const
|
|
82
|
-
|
|
96
|
+
export const discountCouponGetDiscountCouponByCode = (
|
|
97
|
+
code: string | null,
|
|
98
|
+
params: DiscountCouponGetDiscountCouponByCodeParams,
|
|
83
99
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
84
100
|
) => {
|
|
85
101
|
|
|
86
102
|
|
|
87
103
|
return customFetch<DiscountCoupon>(
|
|
88
|
-
{url: `/api/v1/billing/discountcoupons`, method: '
|
|
89
|
-
|
|
90
|
-
data: discountCouponAddDiscountCouponBody, signal
|
|
104
|
+
{url: `/api/v1/public/billing/discountcoupons/${code}`, method: 'GET',
|
|
105
|
+
params, signal
|
|
91
106
|
},
|
|
92
107
|
options);
|
|
93
108
|
}
|
|
94
109
|
|
|
95
110
|
|
|
96
111
|
|
|
97
|
-
export const getDiscountCouponAddDiscountCouponMutationOptions = <TError = void,
|
|
98
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, TError,{data: NonReadonly<DiscountCouponAddDiscountCouponBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
99
|
-
): UseMutationOptions<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, TError,{data: NonReadonly<DiscountCouponAddDiscountCouponBody>}, TContext> => {
|
|
100
112
|
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
export const getDiscountCouponGetDiscountCouponByCodeQueryKey = (code?: string | null,
|
|
114
|
+
params?: DiscountCouponGetDiscountCouponByCodeParams,) => {
|
|
115
|
+
return [
|
|
116
|
+
`/api/v1/public/billing/discountcoupons/${code}`, ...(params ? [params]: [])
|
|
117
|
+
] as const;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
export const getDiscountCouponGetDiscountCouponByCodeQueryOptions = <TData = Awaited<ReturnType<typeof discountCouponGetDiscountCouponByCode>>, TError = void>(code: string | null,
|
|
122
|
+
params: DiscountCouponGetDiscountCouponByCodeParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetDiscountCouponByCode>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
123
|
+
) => {
|
|
124
|
+
|
|
125
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
126
|
+
|
|
127
|
+
const queryKey = queryOptions?.queryKey ?? getDiscountCouponGetDiscountCouponByCodeQueryKey(code,params);
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof discountCouponGetDiscountCouponByCode>>> = ({ signal }) => discountCouponGetDiscountCouponByCode(code,params, requestOptions, signal);
|
|
107
132
|
|
|
108
133
|
|
|
109
134
|
|
|
135
|
+
|
|
110
136
|
|
|
111
|
-
|
|
112
|
-
|
|
137
|
+
return { queryKey, queryFn, enabled: !!(code), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetDiscountCouponByCode>>, TError, TData> & { queryKey: QueryKey }
|
|
138
|
+
}
|
|
113
139
|
|
|
114
|
-
|
|
115
|
-
|
|
140
|
+
export type DiscountCouponGetDiscountCouponByCodeQueryResult = NonNullable<Awaited<ReturnType<typeof discountCouponGetDiscountCouponByCode>>>
|
|
141
|
+
export type DiscountCouponGetDiscountCouponByCodeQueryError = void
|
|
116
142
|
|
|
117
|
-
|
|
118
143
|
|
|
144
|
+
/**
|
|
145
|
+
* @summary Retrieve a discount coupon by code.
|
|
146
|
+
*/
|
|
119
147
|
|
|
120
|
-
|
|
148
|
+
export function useDiscountCouponGetDiscountCouponByCode<TData = Awaited<ReturnType<typeof discountCouponGetDiscountCouponByCode>>, TError = void>(
|
|
149
|
+
code: string | null,
|
|
150
|
+
params: DiscountCouponGetDiscountCouponByCodeParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetDiscountCouponByCode>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
151
|
+
|
|
152
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
121
153
|
|
|
122
|
-
|
|
123
|
-
export type DiscountCouponAddDiscountCouponMutationBody = NonReadonly<DiscountCouponAddDiscountCouponBody>
|
|
124
|
-
export type DiscountCouponAddDiscountCouponMutationError = void
|
|
154
|
+
const queryOptions = getDiscountCouponGetDiscountCouponByCodeQueryOptions(code,params,options)
|
|
125
155
|
|
|
126
|
-
|
|
127
|
-
|
|
156
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
157
|
+
|
|
158
|
+
query.queryKey = queryOptions.queryKey ;
|
|
159
|
+
|
|
160
|
+
return query;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @summary Retrieve all discount coupons.
|
|
128
168
|
*/
|
|
129
|
-
export const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
169
|
+
export const discountCouponGetAllDiscountCoupons = (
|
|
170
|
+
params?: DiscountCouponGetAllDiscountCouponsParams,
|
|
171
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
172
|
+
) => {
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
return customFetch<DiscountCoupon[]>(
|
|
176
|
+
{url: `/api/v1/billing/discountcoupons`, method: 'GET',
|
|
177
|
+
params, signal
|
|
178
|
+
},
|
|
179
|
+
options);
|
|
180
|
+
}
|
|
181
|
+
|
|
137
182
|
|
|
138
|
-
const mutationOptions = getDiscountCouponAddDiscountCouponMutationOptions(options);
|
|
139
183
|
|
|
140
|
-
|
|
184
|
+
|
|
185
|
+
export const getDiscountCouponGetAllDiscountCouponsQueryKey = (params?: DiscountCouponGetAllDiscountCouponsParams,) => {
|
|
186
|
+
return [
|
|
187
|
+
`/api/v1/billing/discountcoupons`, ...(params ? [params]: [])
|
|
188
|
+
] as const;
|
|
141
189
|
}
|
|
142
|
-
|
|
143
|
-
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
export const getDiscountCouponGetAllDiscountCouponsQueryOptions = <TData = Awaited<ReturnType<typeof discountCouponGetAllDiscountCoupons>>, TError = void>(params?: DiscountCouponGetAllDiscountCouponsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetAllDiscountCoupons>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
193
|
+
) => {
|
|
194
|
+
|
|
195
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
196
|
+
|
|
197
|
+
const queryKey = queryOptions?.queryKey ?? getDiscountCouponGetAllDiscountCouponsQueryKey(params);
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof discountCouponGetAllDiscountCoupons>>> = ({ signal }) => discountCouponGetAllDiscountCoupons(params, requestOptions, signal);
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetAllDiscountCoupons>>, TError, TData> & { queryKey: QueryKey }
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export type DiscountCouponGetAllDiscountCouponsQueryResult = NonNullable<Awaited<ReturnType<typeof discountCouponGetAllDiscountCoupons>>>
|
|
211
|
+
export type DiscountCouponGetAllDiscountCouponsQueryError = void
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @summary Retrieve all discount coupons.
|
|
144
216
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
217
|
+
|
|
218
|
+
export function useDiscountCouponGetAllDiscountCoupons<TData = Awaited<ReturnType<typeof discountCouponGetAllDiscountCoupons>>, TError = void>(
|
|
219
|
+
params?: DiscountCouponGetAllDiscountCouponsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetAllDiscountCoupons>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
220
|
+
|
|
221
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
222
|
+
|
|
223
|
+
const queryOptions = getDiscountCouponGetAllDiscountCouponsQueryOptions(params,options)
|
|
224
|
+
|
|
225
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
226
|
+
|
|
227
|
+
query.queryKey = queryOptions.queryKey ;
|
|
228
|
+
|
|
229
|
+
return query;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Only one of AmountOff or PercentOff should be set.
|
|
237
|
+
Duration values: 1 = Forever, 2 = Once, 3 = Repeating (DurationInMonths must be set).
|
|
238
|
+
* @summary Add a new discount coupon.
|
|
239
|
+
*/
|
|
240
|
+
export const discountCouponAddDiscountCoupon = (
|
|
241
|
+
discountCouponAddDiscountCouponBody: NonReadonly<DiscountCouponAddDiscountCouponBody>,
|
|
147
242
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
148
243
|
) => {
|
|
149
244
|
|
|
150
245
|
|
|
151
|
-
return customFetch<
|
|
152
|
-
{url: `/api/v1/billing/
|
|
246
|
+
return customFetch<DiscountCoupon>(
|
|
247
|
+
{url: `/api/v1/billing/discountcoupons`, method: 'POST',
|
|
153
248
|
headers: {'Content-Type': 'application/json', },
|
|
154
|
-
data:
|
|
249
|
+
data: discountCouponAddDiscountCouponBody, signal
|
|
155
250
|
},
|
|
156
251
|
options);
|
|
157
252
|
}
|
|
158
253
|
|
|
159
254
|
|
|
160
255
|
|
|
161
|
-
export const
|
|
162
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
163
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
256
|
+
export const getDiscountCouponAddDiscountCouponMutationOptions = <TError = void,
|
|
257
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, TError,{data: NonReadonly<DiscountCouponAddDiscountCouponBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
258
|
+
): UseMutationOptions<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, TError,{data: NonReadonly<DiscountCouponAddDiscountCouponBody>}, TContext> => {
|
|
164
259
|
|
|
165
|
-
const mutationKey = ['
|
|
260
|
+
const mutationKey = ['discountCouponAddDiscountCoupon'];
|
|
166
261
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
167
262
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
168
263
|
options
|
|
@@ -172,10 +267,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
172
267
|
|
|
173
268
|
|
|
174
269
|
|
|
175
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
270
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, {data: NonReadonly<DiscountCouponAddDiscountCouponBody>}> = (props) => {
|
|
176
271
|
const {data} = props ?? {};
|
|
177
272
|
|
|
178
|
-
return
|
|
273
|
+
return discountCouponAddDiscountCoupon(data,requestOptions)
|
|
179
274
|
}
|
|
180
275
|
|
|
181
276
|
|
|
@@ -183,39 +278,37 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
183
278
|
|
|
184
279
|
return { mutationFn, ...mutationOptions }}
|
|
185
280
|
|
|
186
|
-
export type
|
|
187
|
-
export type
|
|
188
|
-
export type
|
|
281
|
+
export type DiscountCouponAddDiscountCouponMutationResult = NonNullable<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>>
|
|
282
|
+
export type DiscountCouponAddDiscountCouponMutationBody = NonReadonly<DiscountCouponAddDiscountCouponBody>
|
|
283
|
+
export type DiscountCouponAddDiscountCouponMutationError = void
|
|
189
284
|
|
|
190
285
|
/**
|
|
191
|
-
* @summary Add a
|
|
286
|
+
* @summary Add a new discount coupon.
|
|
192
287
|
*/
|
|
193
|
-
export const
|
|
194
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
288
|
+
export const useDiscountCouponAddDiscountCoupon = <TError = void,
|
|
289
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>, TError,{data: NonReadonly<DiscountCouponAddDiscountCouponBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
195
290
|
): UseMutationResult<
|
|
196
|
-
Awaited<ReturnType<typeof
|
|
291
|
+
Awaited<ReturnType<typeof discountCouponAddDiscountCoupon>>,
|
|
197
292
|
TError,
|
|
198
|
-
{data: NonReadonly<
|
|
293
|
+
{data: NonReadonly<DiscountCouponAddDiscountCouponBody>},
|
|
199
294
|
TContext
|
|
200
295
|
> => {
|
|
201
296
|
|
|
202
|
-
const mutationOptions =
|
|
297
|
+
const mutationOptions = getDiscountCouponAddDiscountCouponMutationOptions(options);
|
|
203
298
|
|
|
204
299
|
return useMutation(mutationOptions);
|
|
205
300
|
}
|
|
206
301
|
/**
|
|
207
|
-
*
|
|
208
|
-
BillingTransactionType: Invoice = 1, Payment = 2, Credit = 3, Refund = 4, Chargeback = 5.
|
|
209
|
-
* @summary Retrieve all transactions for a given account.
|
|
302
|
+
* @summary Retrieve a discount coupon.
|
|
210
303
|
*/
|
|
211
|
-
export const
|
|
212
|
-
|
|
304
|
+
export const discountCouponGetDiscountCoupon = (
|
|
305
|
+
discountCouponUid: string | null,
|
|
213
306
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
214
307
|
) => {
|
|
215
308
|
|
|
216
309
|
|
|
217
|
-
return customFetch<
|
|
218
|
-
{url: `/api/v1/billing/
|
|
310
|
+
return customFetch<DiscountCoupon>(
|
|
311
|
+
{url: `/api/v1/billing/discountcoupons/${discountCouponUid}`, method: 'GET', signal
|
|
219
312
|
},
|
|
220
313
|
options);
|
|
221
314
|
}
|
|
@@ -223,45 +316,45 @@ export const transactionsGetAllTransactionsByAccountId = (
|
|
|
223
316
|
|
|
224
317
|
|
|
225
318
|
|
|
226
|
-
export const
|
|
319
|
+
export const getDiscountCouponGetDiscountCouponQueryKey = (discountCouponUid?: string | null,) => {
|
|
227
320
|
return [
|
|
228
|
-
`/api/v1/billing/
|
|
321
|
+
`/api/v1/billing/discountcoupons/${discountCouponUid}`
|
|
229
322
|
] as const;
|
|
230
323
|
}
|
|
231
324
|
|
|
232
325
|
|
|
233
|
-
export const
|
|
326
|
+
export const getDiscountCouponGetDiscountCouponQueryOptions = <TData = Awaited<ReturnType<typeof discountCouponGetDiscountCoupon>>, TError = void>(discountCouponUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetDiscountCoupon>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
234
327
|
) => {
|
|
235
328
|
|
|
236
329
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
237
330
|
|
|
238
|
-
const queryKey = queryOptions?.queryKey ??
|
|
331
|
+
const queryKey = queryOptions?.queryKey ?? getDiscountCouponGetDiscountCouponQueryKey(discountCouponUid);
|
|
239
332
|
|
|
240
333
|
|
|
241
334
|
|
|
242
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof
|
|
335
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof discountCouponGetDiscountCoupon>>> = ({ signal }) => discountCouponGetDiscountCoupon(discountCouponUid, requestOptions, signal);
|
|
243
336
|
|
|
244
337
|
|
|
245
338
|
|
|
246
339
|
|
|
247
340
|
|
|
248
|
-
return { queryKey, queryFn, enabled: !!(
|
|
341
|
+
return { queryKey, queryFn, enabled: !!(discountCouponUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetDiscountCoupon>>, TError, TData> & { queryKey: QueryKey }
|
|
249
342
|
}
|
|
250
343
|
|
|
251
|
-
export type
|
|
252
|
-
export type
|
|
344
|
+
export type DiscountCouponGetDiscountCouponQueryResult = NonNullable<Awaited<ReturnType<typeof discountCouponGetDiscountCoupon>>>
|
|
345
|
+
export type DiscountCouponGetDiscountCouponQueryError = void
|
|
253
346
|
|
|
254
347
|
|
|
255
348
|
/**
|
|
256
|
-
* @summary Retrieve
|
|
349
|
+
* @summary Retrieve a discount coupon.
|
|
257
350
|
*/
|
|
258
351
|
|
|
259
|
-
export function
|
|
260
|
-
|
|
352
|
+
export function useDiscountCouponGetDiscountCoupon<TData = Awaited<ReturnType<typeof discountCouponGetDiscountCoupon>>, TError = void>(
|
|
353
|
+
discountCouponUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetDiscountCoupon>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
261
354
|
|
|
262
355
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
263
356
|
|
|
264
|
-
const queryOptions =
|
|
357
|
+
const queryOptions = getDiscountCouponGetDiscountCouponQueryOptions(discountCouponUid,options)
|
|
265
358
|
|
|
266
359
|
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
267
360
|
|
|
@@ -274,31 +367,29 @@ export function useTransactionsGetAllTransactionsByAccountId<TData = Awaited<Ret
|
|
|
274
367
|
|
|
275
368
|
|
|
276
369
|
/**
|
|
277
|
-
*
|
|
278
|
-
as Paid.
|
|
279
|
-
* @summary Add a payment to an invoice.
|
|
370
|
+
* @summary Update a discount coupon.
|
|
280
371
|
*/
|
|
281
|
-
export const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
) => {
|
|
372
|
+
export const discountCouponUpdateDiscountCoupon = (
|
|
373
|
+
discountCouponUid: string | null,
|
|
374
|
+
discountCouponUpdateDiscountCouponBody: NonReadonly<DiscountCouponUpdateDiscountCouponBody>,
|
|
375
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
285
376
|
|
|
286
377
|
|
|
287
|
-
return customFetch<
|
|
288
|
-
{url: `/api/v1/billing/
|
|
378
|
+
return customFetch<DiscountCoupon>(
|
|
379
|
+
{url: `/api/v1/billing/discountcoupons/${discountCouponUid}`, method: 'PUT',
|
|
289
380
|
headers: {'Content-Type': 'application/json', },
|
|
290
|
-
data:
|
|
381
|
+
data: discountCouponUpdateDiscountCouponBody
|
|
291
382
|
},
|
|
292
383
|
options);
|
|
293
384
|
}
|
|
294
385
|
|
|
295
386
|
|
|
296
387
|
|
|
297
|
-
export const
|
|
298
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
299
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
388
|
+
export const getDiscountCouponUpdateDiscountCouponMutationOptions = <TError = void,
|
|
389
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof discountCouponUpdateDiscountCoupon>>, TError,{discountCouponUid: string | null;data: NonReadonly<DiscountCouponUpdateDiscountCouponBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
390
|
+
): UseMutationOptions<Awaited<ReturnType<typeof discountCouponUpdateDiscountCoupon>>, TError,{discountCouponUid: string | null;data: NonReadonly<DiscountCouponUpdateDiscountCouponBody>}, TContext> => {
|
|
300
391
|
|
|
301
|
-
const mutationKey = ['
|
|
392
|
+
const mutationKey = ['discountCouponUpdateDiscountCoupon'];
|
|
302
393
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
303
394
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
304
395
|
options
|
|
@@ -308,10 +399,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
308
399
|
|
|
309
400
|
|
|
310
401
|
|
|
311
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
312
|
-
const {data} = props ?? {};
|
|
402
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof discountCouponUpdateDiscountCoupon>>, {discountCouponUid: string | null;data: NonReadonly<DiscountCouponUpdateDiscountCouponBody>}> = (props) => {
|
|
403
|
+
const {discountCouponUid,data} = props ?? {};
|
|
313
404
|
|
|
314
|
-
return
|
|
405
|
+
return discountCouponUpdateDiscountCoupon(discountCouponUid,data,requestOptions)
|
|
315
406
|
}
|
|
316
407
|
|
|
317
408
|
|
|
@@ -319,50 +410,48 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
319
410
|
|
|
320
411
|
return { mutationFn, ...mutationOptions }}
|
|
321
412
|
|
|
322
|
-
export type
|
|
323
|
-
export type
|
|
324
|
-
export type
|
|
413
|
+
export type DiscountCouponUpdateDiscountCouponMutationResult = NonNullable<Awaited<ReturnType<typeof discountCouponUpdateDiscountCoupon>>>
|
|
414
|
+
export type DiscountCouponUpdateDiscountCouponMutationBody = NonReadonly<DiscountCouponUpdateDiscountCouponBody>
|
|
415
|
+
export type DiscountCouponUpdateDiscountCouponMutationError = void
|
|
325
416
|
|
|
326
417
|
/**
|
|
327
|
-
* @summary
|
|
418
|
+
* @summary Update a discount coupon.
|
|
328
419
|
*/
|
|
329
|
-
export const
|
|
330
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
420
|
+
export const useDiscountCouponUpdateDiscountCoupon = <TError = void,
|
|
421
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof discountCouponUpdateDiscountCoupon>>, TError,{discountCouponUid: string | null;data: NonReadonly<DiscountCouponUpdateDiscountCouponBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
331
422
|
): UseMutationResult<
|
|
332
|
-
Awaited<ReturnType<typeof
|
|
423
|
+
Awaited<ReturnType<typeof discountCouponUpdateDiscountCoupon>>,
|
|
333
424
|
TError,
|
|
334
|
-
{data: NonReadonly<
|
|
425
|
+
{discountCouponUid: string | null;data: NonReadonly<DiscountCouponUpdateDiscountCouponBody>},
|
|
335
426
|
TContext
|
|
336
427
|
> => {
|
|
337
428
|
|
|
338
|
-
const mutationOptions =
|
|
429
|
+
const mutationOptions = getDiscountCouponUpdateDiscountCouponMutationOptions(options);
|
|
339
430
|
|
|
340
431
|
return useMutation(mutationOptions);
|
|
341
432
|
}
|
|
342
433
|
/**
|
|
343
|
-
* @summary
|
|
434
|
+
* @summary Delete a discount coupon.
|
|
344
435
|
*/
|
|
345
|
-
export const
|
|
346
|
-
|
|
347
|
-
options?: SecondParameter<typeof customFetch>,
|
|
348
|
-
) => {
|
|
436
|
+
export const discountCouponDeleteDiscountCoupon = (
|
|
437
|
+
discountCouponUid: string | null,
|
|
438
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
349
439
|
|
|
350
440
|
|
|
351
|
-
return customFetch<
|
|
352
|
-
{url: `/api/v1/billing/
|
|
353
|
-
|
|
354
|
-
data: paymentInformationSavePaymentInformationBody, signal
|
|
441
|
+
return customFetch<Blob>(
|
|
442
|
+
{url: `/api/v1/billing/discountcoupons/${discountCouponUid}`, method: 'DELETE',
|
|
443
|
+
responseType: 'blob'
|
|
355
444
|
},
|
|
356
445
|
options);
|
|
357
446
|
}
|
|
358
447
|
|
|
359
448
|
|
|
360
449
|
|
|
361
|
-
export const
|
|
362
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
363
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
450
|
+
export const getDiscountCouponDeleteDiscountCouponMutationOptions = <TError = void,
|
|
451
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof discountCouponDeleteDiscountCoupon>>, TError,{discountCouponUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
452
|
+
): UseMutationOptions<Awaited<ReturnType<typeof discountCouponDeleteDiscountCoupon>>, TError,{discountCouponUid: string | null}, TContext> => {
|
|
364
453
|
|
|
365
|
-
const mutationKey = ['
|
|
454
|
+
const mutationKey = ['discountCouponDeleteDiscountCoupon'];
|
|
366
455
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
367
456
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
368
457
|
options
|
|
@@ -372,10 +461,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
372
461
|
|
|
373
462
|
|
|
374
463
|
|
|
375
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
376
|
-
const {
|
|
464
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof discountCouponDeleteDiscountCoupon>>, {discountCouponUid: string | null}> = (props) => {
|
|
465
|
+
const {discountCouponUid} = props ?? {};
|
|
377
466
|
|
|
378
|
-
return
|
|
467
|
+
return discountCouponDeleteDiscountCoupon(discountCouponUid,requestOptions)
|
|
379
468
|
}
|
|
380
469
|
|
|
381
470
|
|
|
@@ -383,151 +472,88 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
383
472
|
|
|
384
473
|
return { mutationFn, ...mutationOptions }}
|
|
385
474
|
|
|
386
|
-
export type
|
|
387
|
-
|
|
388
|
-
export type
|
|
475
|
+
export type DiscountCouponDeleteDiscountCouponMutationResult = NonNullable<Awaited<ReturnType<typeof discountCouponDeleteDiscountCoupon>>>
|
|
476
|
+
|
|
477
|
+
export type DiscountCouponDeleteDiscountCouponMutationError = void
|
|
389
478
|
|
|
390
479
|
/**
|
|
391
|
-
* @summary
|
|
480
|
+
* @summary Delete a discount coupon.
|
|
392
481
|
*/
|
|
393
|
-
export const
|
|
394
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
482
|
+
export const useDiscountCouponDeleteDiscountCoupon = <TError = void,
|
|
483
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof discountCouponDeleteDiscountCoupon>>, TError,{discountCouponUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
395
484
|
): UseMutationResult<
|
|
396
|
-
Awaited<ReturnType<typeof
|
|
485
|
+
Awaited<ReturnType<typeof discountCouponDeleteDiscountCoupon>>,
|
|
397
486
|
TError,
|
|
398
|
-
{
|
|
487
|
+
{discountCouponUid: string | null},
|
|
399
488
|
TContext
|
|
400
489
|
> => {
|
|
401
490
|
|
|
402
|
-
const mutationOptions =
|
|
491
|
+
const mutationOptions = getDiscountCouponDeleteDiscountCouponMutationOptions(options);
|
|
403
492
|
|
|
404
493
|
return useMutation(mutationOptions);
|
|
405
494
|
}
|
|
406
495
|
/**
|
|
407
|
-
* @summary
|
|
496
|
+
* @summary Retrieve the redemptions of a discount coupon.
|
|
408
497
|
*/
|
|
409
|
-
export const
|
|
410
|
-
|
|
498
|
+
export const discountCouponGetDiscountCouponRedemptions = (
|
|
499
|
+
discountCouponUid: string | null,
|
|
500
|
+
params?: DiscountCouponGetDiscountCouponRedemptionsParams,
|
|
411
501
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
412
502
|
) => {
|
|
413
503
|
|
|
414
504
|
|
|
415
|
-
return customFetch<
|
|
416
|
-
{url: `/api/v1/billing/
|
|
417
|
-
|
|
418
|
-
data: subscriptionAddOnAddSubscriptionAddOnBody,
|
|
419
|
-
responseType: 'blob', signal
|
|
505
|
+
return customFetch<DiscountCouponSubscription[]>(
|
|
506
|
+
{url: `/api/v1/billing/discountcoupons/${discountCouponUid}/redemptions`, method: 'GET',
|
|
507
|
+
params, signal
|
|
420
508
|
},
|
|
421
509
|
options);
|
|
422
510
|
}
|
|
423
511
|
|
|
424
512
|
|
|
425
513
|
|
|
426
|
-
export const getSubscriptionAddOnAddSubscriptionAddOnMutationOptions = <TError = void,
|
|
427
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, TError,{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
428
|
-
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, TError,{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>}, TContext> => {
|
|
429
514
|
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, {data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>}> = (props) => {
|
|
441
|
-
const {data} = props ?? {};
|
|
442
|
-
|
|
443
|
-
return subscriptionAddOnAddSubscriptionAddOn(data,requestOptions)
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
return { mutationFn, ...mutationOptions }}
|
|
450
|
-
|
|
451
|
-
export type SubscriptionAddOnAddSubscriptionAddOnMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>>
|
|
452
|
-
export type SubscriptionAddOnAddSubscriptionAddOnMutationBody = NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>
|
|
453
|
-
export type SubscriptionAddOnAddSubscriptionAddOnMutationError = void
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* @summary Add an add-on to a subscription.
|
|
457
|
-
*/
|
|
458
|
-
export const useSubscriptionAddOnAddSubscriptionAddOn = <TError = void,
|
|
459
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, TError,{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
460
|
-
): UseMutationResult<
|
|
461
|
-
Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>,
|
|
462
|
-
TError,
|
|
463
|
-
{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>},
|
|
464
|
-
TContext
|
|
465
|
-
> => {
|
|
466
|
-
|
|
467
|
-
const mutationOptions = getSubscriptionAddOnAddSubscriptionAddOnMutationOptions(options);
|
|
468
|
-
|
|
469
|
-
return useMutation(mutationOptions);
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Admins and API key callers see every invoice. Non-admin users see only invoices
|
|
473
|
-
belonging to the account they are the primary contact of.
|
|
474
|
-
Pass excludeInvoiceUid as a query parameter to omit a specific invoice from the result set.
|
|
475
|
-
* @summary Returns all invoices, optionally restricted to the requester's account.
|
|
476
|
-
*/
|
|
477
|
-
export const invoiceGetAllInvoices = (
|
|
478
|
-
|
|
479
|
-
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
480
|
-
) => {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
return customFetch<Invoice[]>(
|
|
484
|
-
{url: `/api/v1/billing/invoices`, method: 'GET', signal
|
|
485
|
-
},
|
|
486
|
-
options);
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
export const getInvoiceGetAllInvoicesQueryKey = () => {
|
|
493
|
-
return [
|
|
494
|
-
`/api/v1/billing/invoices`
|
|
495
|
-
] as const;
|
|
496
|
-
}
|
|
515
|
+
export const getDiscountCouponGetDiscountCouponRedemptionsQueryKey = (discountCouponUid?: string | null,
|
|
516
|
+
params?: DiscountCouponGetDiscountCouponRedemptionsParams,) => {
|
|
517
|
+
return [
|
|
518
|
+
`/api/v1/billing/discountcoupons/${discountCouponUid}/redemptions`, ...(params ? [params]: [])
|
|
519
|
+
] as const;
|
|
520
|
+
}
|
|
497
521
|
|
|
498
522
|
|
|
499
|
-
export const
|
|
523
|
+
export const getDiscountCouponGetDiscountCouponRedemptionsQueryOptions = <TData = Awaited<ReturnType<typeof discountCouponGetDiscountCouponRedemptions>>, TError = void>(discountCouponUid: string | null,
|
|
524
|
+
params?: DiscountCouponGetDiscountCouponRedemptionsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetDiscountCouponRedemptions>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
500
525
|
) => {
|
|
501
526
|
|
|
502
527
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
503
528
|
|
|
504
|
-
const queryKey = queryOptions?.queryKey ??
|
|
529
|
+
const queryKey = queryOptions?.queryKey ?? getDiscountCouponGetDiscountCouponRedemptionsQueryKey(discountCouponUid,params);
|
|
505
530
|
|
|
506
531
|
|
|
507
532
|
|
|
508
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof
|
|
533
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof discountCouponGetDiscountCouponRedemptions>>> = ({ signal }) => discountCouponGetDiscountCouponRedemptions(discountCouponUid,params, requestOptions, signal);
|
|
509
534
|
|
|
510
535
|
|
|
511
536
|
|
|
512
537
|
|
|
513
538
|
|
|
514
|
-
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof
|
|
539
|
+
return { queryKey, queryFn, enabled: !!(discountCouponUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetDiscountCouponRedemptions>>, TError, TData> & { queryKey: QueryKey }
|
|
515
540
|
}
|
|
516
541
|
|
|
517
|
-
export type
|
|
518
|
-
export type
|
|
542
|
+
export type DiscountCouponGetDiscountCouponRedemptionsQueryResult = NonNullable<Awaited<ReturnType<typeof discountCouponGetDiscountCouponRedemptions>>>
|
|
543
|
+
export type DiscountCouponGetDiscountCouponRedemptionsQueryError = void
|
|
519
544
|
|
|
520
545
|
|
|
521
546
|
/**
|
|
522
|
-
* @summary
|
|
547
|
+
* @summary Retrieve the redemptions of a discount coupon.
|
|
523
548
|
*/
|
|
524
549
|
|
|
525
|
-
export function
|
|
526
|
-
|
|
550
|
+
export function useDiscountCouponGetDiscountCouponRedemptions<TData = Awaited<ReturnType<typeof discountCouponGetDiscountCouponRedemptions>>, TError = void>(
|
|
551
|
+
discountCouponUid: string | null,
|
|
552
|
+
params?: DiscountCouponGetDiscountCouponRedemptionsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof discountCouponGetDiscountCouponRedemptions>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
527
553
|
|
|
528
554
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
529
555
|
|
|
530
|
-
const queryOptions =
|
|
556
|
+
const queryOptions = getDiscountCouponGetDiscountCouponRedemptionsQueryOptions(discountCouponUid,params,options)
|
|
531
557
|
|
|
532
558
|
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
533
559
|
|
|
@@ -540,29 +566,29 @@ export function useInvoiceGetAllInvoices<TData = Awaited<ReturnType<typeof invoi
|
|
|
540
566
|
|
|
541
567
|
|
|
542
568
|
/**
|
|
543
|
-
* @summary
|
|
569
|
+
* @summary Add a usage entry for an add-on that bills for usage at the end of the month.
|
|
544
570
|
*/
|
|
545
|
-
export const
|
|
546
|
-
|
|
571
|
+
export const usageAddUsage = (
|
|
572
|
+
usageAddUsageBody: NonReadonly<UsageAddUsageBody>,
|
|
547
573
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
548
574
|
) => {
|
|
549
575
|
|
|
550
576
|
|
|
551
|
-
return customFetch<
|
|
552
|
-
{url: `/api/v1/billing/
|
|
577
|
+
return customFetch<Usage>(
|
|
578
|
+
{url: `/api/v1/billing/usage`, method: 'POST',
|
|
553
579
|
headers: {'Content-Type': 'application/json', },
|
|
554
|
-
data:
|
|
580
|
+
data: usageAddUsageBody, signal
|
|
555
581
|
},
|
|
556
582
|
options);
|
|
557
583
|
}
|
|
558
584
|
|
|
559
585
|
|
|
560
586
|
|
|
561
|
-
export const
|
|
562
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
563
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
587
|
+
export const getUsageAddUsageMutationOptions = <TError = void,
|
|
588
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof usageAddUsage>>, TError,{data: NonReadonly<UsageAddUsageBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
589
|
+
): UseMutationOptions<Awaited<ReturnType<typeof usageAddUsage>>, TError,{data: NonReadonly<UsageAddUsageBody>}, TContext> => {
|
|
564
590
|
|
|
565
|
-
const mutationKey = ['
|
|
591
|
+
const mutationKey = ['usageAddUsage'];
|
|
566
592
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
567
593
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
568
594
|
options
|
|
@@ -572,10 +598,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
572
598
|
|
|
573
599
|
|
|
574
600
|
|
|
575
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
601
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof usageAddUsage>>, {data: NonReadonly<UsageAddUsageBody>}> = (props) => {
|
|
576
602
|
const {data} = props ?? {};
|
|
577
603
|
|
|
578
|
-
return
|
|
604
|
+
return usageAddUsage(data,requestOptions)
|
|
579
605
|
}
|
|
580
606
|
|
|
581
607
|
|
|
@@ -583,37 +609,39 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
583
609
|
|
|
584
610
|
return { mutationFn, ...mutationOptions }}
|
|
585
611
|
|
|
586
|
-
export type
|
|
587
|
-
export type
|
|
588
|
-
export type
|
|
612
|
+
export type UsageAddUsageMutationResult = NonNullable<Awaited<ReturnType<typeof usageAddUsage>>>
|
|
613
|
+
export type UsageAddUsageMutationBody = NonReadonly<UsageAddUsageBody>
|
|
614
|
+
export type UsageAddUsageMutationError = void
|
|
589
615
|
|
|
590
616
|
/**
|
|
591
|
-
* @summary
|
|
617
|
+
* @summary Add a usage entry for an add-on that bills for usage at the end of the month.
|
|
592
618
|
*/
|
|
593
|
-
export const
|
|
594
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
619
|
+
export const useUsageAddUsage = <TError = void,
|
|
620
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof usageAddUsage>>, TError,{data: NonReadonly<UsageAddUsageBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
595
621
|
): UseMutationResult<
|
|
596
|
-
Awaited<ReturnType<typeof
|
|
622
|
+
Awaited<ReturnType<typeof usageAddUsage>>,
|
|
597
623
|
TError,
|
|
598
|
-
{data: NonReadonly<
|
|
624
|
+
{data: NonReadonly<UsageAddUsageBody>},
|
|
599
625
|
TContext
|
|
600
626
|
> => {
|
|
601
627
|
|
|
602
|
-
const mutationOptions =
|
|
628
|
+
const mutationOptions = getUsageAddUsageMutationOptions(options);
|
|
603
629
|
|
|
604
630
|
return useMutation(mutationOptions);
|
|
605
631
|
}
|
|
606
632
|
/**
|
|
607
|
-
*
|
|
633
|
+
* Transactions for a given account, tied to accounts and invoices.
|
|
634
|
+
BillingTransactionType: Invoice = 1, Payment = 2, Credit = 3, Refund = 4, Chargeback = 5.
|
|
635
|
+
* @summary Retrieve all transactions.
|
|
608
636
|
*/
|
|
609
|
-
export const
|
|
610
|
-
|
|
637
|
+
export const transactionsGetAllTransactionsByAccountId = (
|
|
638
|
+
accountUid: string | null,
|
|
611
639
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
612
640
|
) => {
|
|
613
641
|
|
|
614
642
|
|
|
615
|
-
return customFetch<
|
|
616
|
-
{url: `/api/v1/billing/
|
|
643
|
+
return customFetch<Transaction[]>(
|
|
644
|
+
{url: `/api/v1/billing/transactions/${accountUid}`, method: 'GET', signal
|
|
617
645
|
},
|
|
618
646
|
options);
|
|
619
647
|
}
|
|
@@ -621,45 +649,45 @@ export const invoiceGetInvoice = (
|
|
|
621
649
|
|
|
622
650
|
|
|
623
651
|
|
|
624
|
-
export const
|
|
652
|
+
export const getTransactionsGetAllTransactionsByAccountIdQueryKey = (accountUid?: string | null,) => {
|
|
625
653
|
return [
|
|
626
|
-
`/api/v1/billing/
|
|
654
|
+
`/api/v1/billing/transactions/${accountUid}`
|
|
627
655
|
] as const;
|
|
628
656
|
}
|
|
629
657
|
|
|
630
658
|
|
|
631
|
-
export const
|
|
659
|
+
export const getTransactionsGetAllTransactionsByAccountIdQueryOptions = <TData = Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError = void>(accountUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
632
660
|
) => {
|
|
633
661
|
|
|
634
662
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
635
663
|
|
|
636
|
-
const queryKey = queryOptions?.queryKey ??
|
|
664
|
+
const queryKey = queryOptions?.queryKey ?? getTransactionsGetAllTransactionsByAccountIdQueryKey(accountUid);
|
|
637
665
|
|
|
638
666
|
|
|
639
667
|
|
|
640
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof
|
|
668
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>> = ({ signal }) => transactionsGetAllTransactionsByAccountId(accountUid, requestOptions, signal);
|
|
641
669
|
|
|
642
670
|
|
|
643
671
|
|
|
644
672
|
|
|
645
673
|
|
|
646
|
-
return { queryKey, queryFn, enabled: !!(
|
|
674
|
+
return { queryKey, queryFn, enabled: !!(accountUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError, TData> & { queryKey: QueryKey }
|
|
647
675
|
}
|
|
648
676
|
|
|
649
|
-
export type
|
|
650
|
-
export type
|
|
677
|
+
export type TransactionsGetAllTransactionsByAccountIdQueryResult = NonNullable<Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>>
|
|
678
|
+
export type TransactionsGetAllTransactionsByAccountIdQueryError = void
|
|
651
679
|
|
|
652
680
|
|
|
653
681
|
/**
|
|
654
|
-
* @summary
|
|
682
|
+
* @summary Retrieve all transactions.
|
|
655
683
|
*/
|
|
656
684
|
|
|
657
|
-
export function
|
|
658
|
-
|
|
685
|
+
export function useTransactionsGetAllTransactionsByAccountId<TData = Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError = void>(
|
|
686
|
+
accountUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof transactionsGetAllTransactionsByAccountId>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
659
687
|
|
|
660
688
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
661
689
|
|
|
662
|
-
const queryOptions =
|
|
690
|
+
const queryOptions = getTransactionsGetAllTransactionsByAccountIdQueryOptions(accountUid,options)
|
|
663
691
|
|
|
664
692
|
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
665
693
|
|
|
@@ -672,32 +700,31 @@ export function useInvoiceGetInvoice<TData = Awaited<ReturnType<typeof invoiceGe
|
|
|
672
700
|
|
|
673
701
|
|
|
674
702
|
/**
|
|
675
|
-
*
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
* @summary Update an ad-hoc (manually created) invoice.
|
|
703
|
+
* If the amount matches the outstanding amount of the invoice, the invoice will be marked
|
|
704
|
+
as Paid.
|
|
705
|
+
* @summary Add a payment to an invoice.
|
|
679
706
|
*/
|
|
680
|
-
export const
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
707
|
+
export const transactionsAddPaymentTransaction = (
|
|
708
|
+
transactionsAddPaymentTransactionBody: NonReadonly<TransactionsAddPaymentTransactionBody>,
|
|
709
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
710
|
+
) => {
|
|
684
711
|
|
|
685
712
|
|
|
686
|
-
return customFetch<
|
|
687
|
-
{url: `/api/v1/billing/
|
|
713
|
+
return customFetch<Transaction>(
|
|
714
|
+
{url: `/api/v1/billing/transactions/payment`, method: 'POST',
|
|
688
715
|
headers: {'Content-Type': 'application/json', },
|
|
689
|
-
data:
|
|
716
|
+
data: transactionsAddPaymentTransactionBody, signal
|
|
690
717
|
},
|
|
691
718
|
options);
|
|
692
719
|
}
|
|
693
720
|
|
|
694
721
|
|
|
695
722
|
|
|
696
|
-
export const
|
|
697
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
698
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
723
|
+
export const getTransactionsAddPaymentTransactionMutationOptions = <TError = void,
|
|
724
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>, TError,{data: NonReadonly<TransactionsAddPaymentTransactionBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
725
|
+
): UseMutationOptions<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>, TError,{data: NonReadonly<TransactionsAddPaymentTransactionBody>}, TContext> => {
|
|
699
726
|
|
|
700
|
-
const mutationKey = ['
|
|
727
|
+
const mutationKey = ['transactionsAddPaymentTransaction'];
|
|
701
728
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
702
729
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
703
730
|
options
|
|
@@ -707,10 +734,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
707
734
|
|
|
708
735
|
|
|
709
736
|
|
|
710
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
711
|
-
const {
|
|
737
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>, {data: NonReadonly<TransactionsAddPaymentTransactionBody>}> = (props) => {
|
|
738
|
+
const {data} = props ?? {};
|
|
712
739
|
|
|
713
|
-
return
|
|
740
|
+
return transactionsAddPaymentTransaction(data,requestOptions)
|
|
714
741
|
}
|
|
715
742
|
|
|
716
743
|
|
|
@@ -718,48 +745,50 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
718
745
|
|
|
719
746
|
return { mutationFn, ...mutationOptions }}
|
|
720
747
|
|
|
721
|
-
export type
|
|
722
|
-
export type
|
|
723
|
-
export type
|
|
748
|
+
export type TransactionsAddPaymentTransactionMutationResult = NonNullable<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>>
|
|
749
|
+
export type TransactionsAddPaymentTransactionMutationBody = NonReadonly<TransactionsAddPaymentTransactionBody>
|
|
750
|
+
export type TransactionsAddPaymentTransactionMutationError = void
|
|
724
751
|
|
|
725
752
|
/**
|
|
726
|
-
* @summary
|
|
753
|
+
* @summary Add a payment to an invoice.
|
|
727
754
|
*/
|
|
728
|
-
export const
|
|
729
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
755
|
+
export const useTransactionsAddPaymentTransaction = <TError = void,
|
|
756
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>, TError,{data: NonReadonly<TransactionsAddPaymentTransactionBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
730
757
|
): UseMutationResult<
|
|
731
|
-
Awaited<ReturnType<typeof
|
|
758
|
+
Awaited<ReturnType<typeof transactionsAddPaymentTransaction>>,
|
|
732
759
|
TError,
|
|
733
|
-
{
|
|
760
|
+
{data: NonReadonly<TransactionsAddPaymentTransactionBody>},
|
|
734
761
|
TContext
|
|
735
762
|
> => {
|
|
736
763
|
|
|
737
|
-
const mutationOptions =
|
|
764
|
+
const mutationOptions = getTransactionsAddPaymentTransactionMutationOptions(options);
|
|
738
765
|
|
|
739
766
|
return useMutation(mutationOptions);
|
|
740
767
|
}
|
|
741
768
|
/**
|
|
742
|
-
* @summary
|
|
769
|
+
* @summary Update payment information for an account.
|
|
743
770
|
*/
|
|
744
|
-
export const
|
|
745
|
-
|
|
746
|
-
options?: SecondParameter<typeof customFetch>,
|
|
771
|
+
export const paymentInformationSavePaymentInformation = (
|
|
772
|
+
paymentInformationSavePaymentInformationBody: NonReadonly<PaymentInformationSavePaymentInformationBody>,
|
|
773
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
774
|
+
) => {
|
|
747
775
|
|
|
748
776
|
|
|
749
|
-
return customFetch<
|
|
750
|
-
{url: `/api/v1/billing/
|
|
751
|
-
|
|
777
|
+
return customFetch<PaymentInformation>(
|
|
778
|
+
{url: `/api/v1/billing/paymentinformation`, method: 'POST',
|
|
779
|
+
headers: {'Content-Type': 'application/json', },
|
|
780
|
+
data: paymentInformationSavePaymentInformationBody, signal
|
|
752
781
|
},
|
|
753
782
|
options);
|
|
754
783
|
}
|
|
755
784
|
|
|
756
785
|
|
|
757
786
|
|
|
758
|
-
export const
|
|
759
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
760
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
787
|
+
export const getPaymentInformationSavePaymentInformationMutationOptions = <TError = void,
|
|
788
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>, TError,{data: NonReadonly<PaymentInformationSavePaymentInformationBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
789
|
+
): UseMutationOptions<Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>, TError,{data: NonReadonly<PaymentInformationSavePaymentInformationBody>}, TContext> => {
|
|
761
790
|
|
|
762
|
-
const mutationKey = ['
|
|
791
|
+
const mutationKey = ['paymentInformationSavePaymentInformation'];
|
|
763
792
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
764
793
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
765
794
|
options
|
|
@@ -769,10 +798,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
769
798
|
|
|
770
799
|
|
|
771
800
|
|
|
772
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
773
|
-
const {
|
|
801
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>, {data: NonReadonly<PaymentInformationSavePaymentInformationBody>}> = (props) => {
|
|
802
|
+
const {data} = props ?? {};
|
|
774
803
|
|
|
775
|
-
return
|
|
804
|
+
return paymentInformationSavePaymentInformation(data,requestOptions)
|
|
776
805
|
}
|
|
777
806
|
|
|
778
807
|
|
|
@@ -780,40 +809,38 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
780
809
|
|
|
781
810
|
return { mutationFn, ...mutationOptions }}
|
|
782
811
|
|
|
783
|
-
export type
|
|
784
|
-
|
|
785
|
-
export type
|
|
812
|
+
export type PaymentInformationSavePaymentInformationMutationResult = NonNullable<Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>>
|
|
813
|
+
export type PaymentInformationSavePaymentInformationMutationBody = NonReadonly<PaymentInformationSavePaymentInformationBody>
|
|
814
|
+
export type PaymentInformationSavePaymentInformationMutationError = void
|
|
786
815
|
|
|
787
816
|
/**
|
|
788
|
-
* @summary
|
|
817
|
+
* @summary Update payment information for an account.
|
|
789
818
|
*/
|
|
790
|
-
export const
|
|
791
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
819
|
+
export const usePaymentInformationSavePaymentInformation = <TError = void,
|
|
820
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>, TError,{data: NonReadonly<PaymentInformationSavePaymentInformationBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
792
821
|
): UseMutationResult<
|
|
793
|
-
Awaited<ReturnType<typeof
|
|
822
|
+
Awaited<ReturnType<typeof paymentInformationSavePaymentInformation>>,
|
|
794
823
|
TError,
|
|
795
|
-
{
|
|
824
|
+
{data: NonReadonly<PaymentInformationSavePaymentInformationBody>},
|
|
796
825
|
TContext
|
|
797
826
|
> => {
|
|
798
827
|
|
|
799
|
-
const mutationOptions =
|
|
828
|
+
const mutationOptions = getPaymentInformationSavePaymentInformationMutationOptions(options);
|
|
800
829
|
|
|
801
830
|
return useMutation(mutationOptions);
|
|
802
831
|
}
|
|
803
832
|
/**
|
|
804
|
-
*
|
|
805
|
-
attachment named invoice-{Number}-{InvoiceDate}-{AccountName}.pdf.
|
|
806
|
-
* @summary Returns a rendered PDF copy of an invoice.
|
|
833
|
+
* @summary Retrieve all subscription add-ons.
|
|
807
834
|
*/
|
|
808
|
-
export const
|
|
809
|
-
|
|
835
|
+
export const subscriptionAddOnGetAllSubscriptionsAddOns = (
|
|
836
|
+
params?: SubscriptionAddOnGetAllSubscriptionsAddOnsParams,
|
|
810
837
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
811
838
|
) => {
|
|
812
839
|
|
|
813
840
|
|
|
814
|
-
return customFetch<
|
|
815
|
-
{url: `/api/v1/billing/
|
|
816
|
-
|
|
841
|
+
return customFetch<SubscriptionAddOn[]>(
|
|
842
|
+
{url: `/api/v1/billing/subscriptionaddons`, method: 'GET',
|
|
843
|
+
params, signal
|
|
817
844
|
},
|
|
818
845
|
options);
|
|
819
846
|
}
|
|
@@ -821,45 +848,45 @@ export const invoiceGetInvoiceAsPdf = (
|
|
|
821
848
|
|
|
822
849
|
|
|
823
850
|
|
|
824
|
-
export const
|
|
851
|
+
export const getSubscriptionAddOnGetAllSubscriptionsAddOnsQueryKey = (params?: SubscriptionAddOnGetAllSubscriptionsAddOnsParams,) => {
|
|
825
852
|
return [
|
|
826
|
-
`/api/v1/billing/
|
|
853
|
+
`/api/v1/billing/subscriptionaddons`, ...(params ? [params]: [])
|
|
827
854
|
] as const;
|
|
828
855
|
}
|
|
829
856
|
|
|
830
857
|
|
|
831
|
-
export const
|
|
858
|
+
export const getSubscriptionAddOnGetAllSubscriptionsAddOnsQueryOptions = <TData = Awaited<ReturnType<typeof subscriptionAddOnGetAllSubscriptionsAddOns>>, TError = void>(params?: SubscriptionAddOnGetAllSubscriptionsAddOnsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof subscriptionAddOnGetAllSubscriptionsAddOns>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
832
859
|
) => {
|
|
833
860
|
|
|
834
861
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
835
862
|
|
|
836
|
-
const queryKey = queryOptions?.queryKey ??
|
|
863
|
+
const queryKey = queryOptions?.queryKey ?? getSubscriptionAddOnGetAllSubscriptionsAddOnsQueryKey(params);
|
|
837
864
|
|
|
838
865
|
|
|
839
866
|
|
|
840
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof
|
|
867
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof subscriptionAddOnGetAllSubscriptionsAddOns>>> = ({ signal }) => subscriptionAddOnGetAllSubscriptionsAddOns(params, requestOptions, signal);
|
|
841
868
|
|
|
842
869
|
|
|
843
870
|
|
|
844
871
|
|
|
845
872
|
|
|
846
|
-
return { queryKey, queryFn,
|
|
873
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof subscriptionAddOnGetAllSubscriptionsAddOns>>, TError, TData> & { queryKey: QueryKey }
|
|
847
874
|
}
|
|
848
875
|
|
|
849
|
-
export type
|
|
850
|
-
export type
|
|
876
|
+
export type SubscriptionAddOnGetAllSubscriptionsAddOnsQueryResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddOnGetAllSubscriptionsAddOns>>>
|
|
877
|
+
export type SubscriptionAddOnGetAllSubscriptionsAddOnsQueryError = void
|
|
851
878
|
|
|
852
879
|
|
|
853
880
|
/**
|
|
854
|
-
* @summary
|
|
881
|
+
* @summary Retrieve all subscription add-ons.
|
|
855
882
|
*/
|
|
856
883
|
|
|
857
|
-
export function
|
|
858
|
-
|
|
884
|
+
export function useSubscriptionAddOnGetAllSubscriptionsAddOns<TData = Awaited<ReturnType<typeof subscriptionAddOnGetAllSubscriptionsAddOns>>, TError = void>(
|
|
885
|
+
params?: SubscriptionAddOnGetAllSubscriptionsAddOnsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof subscriptionAddOnGetAllSubscriptionsAddOns>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
859
886
|
|
|
860
887
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
861
888
|
|
|
862
|
-
const queryOptions =
|
|
889
|
+
const queryOptions = getSubscriptionAddOnGetAllSubscriptionsAddOnsQueryOptions(params,options)
|
|
863
890
|
|
|
864
891
|
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
865
892
|
|
|
@@ -872,83 +899,18 @@ export function useInvoiceGetInvoiceAsPdf<TData = Awaited<ReturnType<typeof invo
|
|
|
872
899
|
|
|
873
900
|
|
|
874
901
|
/**
|
|
875
|
-
*
|
|
876
|
-
note - free-text note to include in the email body.
|
|
877
|
-
bcc - comma-separated list of email addresses to BCC.
|
|
878
|
-
* @summary Email an invoice to the account's billing contact.
|
|
879
|
-
*/
|
|
880
|
-
export const invoiceSendInvoiceEmail = (
|
|
881
|
-
invoiceUid: string | null,
|
|
882
|
-
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
883
|
-
) => {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
return customFetch<Blob>(
|
|
887
|
-
{url: `/api/v1/billing/invoices/${invoiceUid}/sendinvoiceemail`, method: 'POST',
|
|
888
|
-
responseType: 'blob', signal
|
|
889
|
-
},
|
|
890
|
-
options);
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
export const getInvoiceSendInvoiceEmailMutationOptions = <TError = void,
|
|
896
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
897
|
-
): UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, TError,{invoiceUid: string | null}, TContext> => {
|
|
898
|
-
|
|
899
|
-
const mutationKey = ['invoiceSendInvoiceEmail'];
|
|
900
|
-
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
901
|
-
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
902
|
-
options
|
|
903
|
-
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
904
|
-
: {mutation: { mutationKey, }, request: undefined};
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, {invoiceUid: string | null}> = (props) => {
|
|
910
|
-
const {invoiceUid} = props ?? {};
|
|
911
|
-
|
|
912
|
-
return invoiceSendInvoiceEmail(invoiceUid,requestOptions)
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
return { mutationFn, ...mutationOptions }}
|
|
919
|
-
|
|
920
|
-
export type InvoiceSendInvoiceEmailMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>>
|
|
921
|
-
|
|
922
|
-
export type InvoiceSendInvoiceEmailMutationError = void
|
|
923
|
-
|
|
924
|
-
/**
|
|
925
|
-
* @summary Email an invoice to the account's billing contact.
|
|
926
|
-
*/
|
|
927
|
-
export const useInvoiceSendInvoiceEmail = <TError = void,
|
|
928
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
929
|
-
): UseMutationResult<
|
|
930
|
-
Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>,
|
|
931
|
-
TError,
|
|
932
|
-
{invoiceUid: string | null},
|
|
933
|
-
TContext
|
|
934
|
-
> => {
|
|
935
|
-
|
|
936
|
-
const mutationOptions = getInvoiceSendInvoiceEmailMutationOptions(options);
|
|
937
|
-
|
|
938
|
-
return useMutation(mutationOptions);
|
|
939
|
-
}
|
|
940
|
-
/**
|
|
941
|
-
* Returns 400 Bad Request if the invoice is not in the Paid status.
|
|
942
|
-
* @summary Send the "invoice paid" receipt email to the account's billing contact.
|
|
902
|
+
* @summary Add an add-on to a subscription.
|
|
943
903
|
*/
|
|
944
|
-
export const
|
|
945
|
-
|
|
904
|
+
export const subscriptionAddOnAddSubscriptionAddOn = (
|
|
905
|
+
subscriptionAddOnAddSubscriptionAddOnBody: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>,
|
|
946
906
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
947
907
|
) => {
|
|
948
908
|
|
|
949
909
|
|
|
950
910
|
return customFetch<Blob>(
|
|
951
|
-
{url: `/api/v1/billing/
|
|
911
|
+
{url: `/api/v1/billing/subscriptionaddons`, method: 'POST',
|
|
912
|
+
headers: {'Content-Type': 'application/json', },
|
|
913
|
+
data: subscriptionAddOnAddSubscriptionAddOnBody,
|
|
952
914
|
responseType: 'blob', signal
|
|
953
915
|
},
|
|
954
916
|
options);
|
|
@@ -956,11 +918,11 @@ export const invoiceSendInvoicePaidEmail = (
|
|
|
956
918
|
|
|
957
919
|
|
|
958
920
|
|
|
959
|
-
export const
|
|
960
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
961
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
921
|
+
export const getSubscriptionAddOnAddSubscriptionAddOnMutationOptions = <TError = void,
|
|
922
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, TError,{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
923
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, TError,{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>}, TContext> => {
|
|
962
924
|
|
|
963
|
-
const mutationKey = ['
|
|
925
|
+
const mutationKey = ['subscriptionAddOnAddSubscriptionAddOn'];
|
|
964
926
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
965
927
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
966
928
|
options
|
|
@@ -970,10 +932,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
970
932
|
|
|
971
933
|
|
|
972
934
|
|
|
973
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
974
|
-
const {
|
|
935
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, {data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>}> = (props) => {
|
|
936
|
+
const {data} = props ?? {};
|
|
975
937
|
|
|
976
|
-
return
|
|
938
|
+
return subscriptionAddOnAddSubscriptionAddOn(data,requestOptions)
|
|
977
939
|
}
|
|
978
940
|
|
|
979
941
|
|
|
@@ -981,37 +943,37 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
981
943
|
|
|
982
944
|
return { mutationFn, ...mutationOptions }}
|
|
983
945
|
|
|
984
|
-
export type
|
|
985
|
-
|
|
986
|
-
export type
|
|
946
|
+
export type SubscriptionAddOnAddSubscriptionAddOnMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>>
|
|
947
|
+
export type SubscriptionAddOnAddSubscriptionAddOnMutationBody = NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>
|
|
948
|
+
export type SubscriptionAddOnAddSubscriptionAddOnMutationError = void
|
|
987
949
|
|
|
988
950
|
/**
|
|
989
|
-
* @summary
|
|
951
|
+
* @summary Add an add-on to a subscription.
|
|
990
952
|
*/
|
|
991
|
-
export const
|
|
992
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
953
|
+
export const useSubscriptionAddOnAddSubscriptionAddOn = <TError = void,
|
|
954
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>, TError,{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
993
955
|
): UseMutationResult<
|
|
994
|
-
Awaited<ReturnType<typeof
|
|
956
|
+
Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOn>>,
|
|
995
957
|
TError,
|
|
996
|
-
{
|
|
958
|
+
{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnBody>},
|
|
997
959
|
TContext
|
|
998
960
|
> => {
|
|
999
961
|
|
|
1000
|
-
const mutationOptions =
|
|
962
|
+
const mutationOptions = getSubscriptionAddOnAddSubscriptionAddOnMutationOptions(options);
|
|
1001
963
|
|
|
1002
964
|
return useMutation(mutationOptions);
|
|
1003
965
|
}
|
|
1004
966
|
/**
|
|
1005
|
-
* @summary
|
|
967
|
+
* @summary Retrieve a subscription add-on.
|
|
1006
968
|
*/
|
|
1007
|
-
export const
|
|
1008
|
-
|
|
969
|
+
export const subscriptionAddOnGetSubscriptionAddOn = (
|
|
970
|
+
subscriptionAddOnUid: string | null,
|
|
1009
971
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1010
972
|
) => {
|
|
1011
973
|
|
|
1012
974
|
|
|
1013
|
-
return customFetch<
|
|
1014
|
-
{url: `/api/v1/billing/
|
|
975
|
+
return customFetch<SubscriptionAddOn>(
|
|
976
|
+
{url: `/api/v1/billing/subscriptionaddons/${subscriptionAddOnUid}`, method: 'GET', signal
|
|
1015
977
|
},
|
|
1016
978
|
options);
|
|
1017
979
|
}
|
|
@@ -1019,45 +981,45 @@ export const subscriptionGetSubscription = (
|
|
|
1019
981
|
|
|
1020
982
|
|
|
1021
983
|
|
|
1022
|
-
export const
|
|
984
|
+
export const getSubscriptionAddOnGetSubscriptionAddOnQueryKey = (subscriptionAddOnUid?: string | null,) => {
|
|
1023
985
|
return [
|
|
1024
|
-
`/api/v1/billing/
|
|
986
|
+
`/api/v1/billing/subscriptionaddons/${subscriptionAddOnUid}`
|
|
1025
987
|
] as const;
|
|
1026
988
|
}
|
|
1027
989
|
|
|
1028
990
|
|
|
1029
|
-
export const
|
|
991
|
+
export const getSubscriptionAddOnGetSubscriptionAddOnQueryOptions = <TData = Awaited<ReturnType<typeof subscriptionAddOnGetSubscriptionAddOn>>, TError = void>(subscriptionAddOnUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof subscriptionAddOnGetSubscriptionAddOn>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1030
992
|
) => {
|
|
1031
993
|
|
|
1032
994
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1033
995
|
|
|
1034
|
-
const queryKey = queryOptions?.queryKey ??
|
|
996
|
+
const queryKey = queryOptions?.queryKey ?? getSubscriptionAddOnGetSubscriptionAddOnQueryKey(subscriptionAddOnUid);
|
|
1035
997
|
|
|
1036
998
|
|
|
1037
999
|
|
|
1038
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof
|
|
1000
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof subscriptionAddOnGetSubscriptionAddOn>>> = ({ signal }) => subscriptionAddOnGetSubscriptionAddOn(subscriptionAddOnUid, requestOptions, signal);
|
|
1039
1001
|
|
|
1040
1002
|
|
|
1041
1003
|
|
|
1042
1004
|
|
|
1043
1005
|
|
|
1044
|
-
return { queryKey, queryFn, enabled: !!(
|
|
1006
|
+
return { queryKey, queryFn, enabled: !!(subscriptionAddOnUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof subscriptionAddOnGetSubscriptionAddOn>>, TError, TData> & { queryKey: QueryKey }
|
|
1045
1007
|
}
|
|
1046
1008
|
|
|
1047
|
-
export type
|
|
1048
|
-
export type
|
|
1009
|
+
export type SubscriptionAddOnGetSubscriptionAddOnQueryResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddOnGetSubscriptionAddOn>>>
|
|
1010
|
+
export type SubscriptionAddOnGetSubscriptionAddOnQueryError = void
|
|
1049
1011
|
|
|
1050
1012
|
|
|
1051
1013
|
/**
|
|
1052
|
-
* @summary
|
|
1014
|
+
* @summary Retrieve a subscription add-on.
|
|
1053
1015
|
*/
|
|
1054
1016
|
|
|
1055
|
-
export function
|
|
1056
|
-
|
|
1017
|
+
export function useSubscriptionAddOnGetSubscriptionAddOn<TData = Awaited<ReturnType<typeof subscriptionAddOnGetSubscriptionAddOn>>, TError = void>(
|
|
1018
|
+
subscriptionAddOnUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof subscriptionAddOnGetSubscriptionAddOn>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1057
1019
|
|
|
1058
1020
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1059
1021
|
|
|
1060
|
-
const queryOptions =
|
|
1022
|
+
const queryOptions = getSubscriptionAddOnGetSubscriptionAddOnQueryOptions(subscriptionAddOnUid,options)
|
|
1061
1023
|
|
|
1062
1024
|
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1063
1025
|
|
|
@@ -1070,29 +1032,31 @@ export function useSubscriptionGetSubscription<TData = Awaited<ReturnType<typeof
|
|
|
1070
1032
|
|
|
1071
1033
|
|
|
1072
1034
|
/**
|
|
1073
|
-
*
|
|
1035
|
+
* Returns an invoice object with information about the amount outstanding. This method
|
|
1036
|
+
does not commit the change.
|
|
1037
|
+
* @summary Preview the invoice for adding an add-on to a subscription.
|
|
1074
1038
|
*/
|
|
1075
|
-
export const
|
|
1076
|
-
|
|
1077
|
-
discountUid: string | null,
|
|
1039
|
+
export const subscriptionAddOnAddSubscriptionAddOnPreview = (
|
|
1040
|
+
subscriptionAddOnAddSubscriptionAddOnPreviewBody: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnPreviewBody>,
|
|
1078
1041
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1079
1042
|
) => {
|
|
1080
1043
|
|
|
1081
1044
|
|
|
1082
|
-
return customFetch<
|
|
1083
|
-
{url: `/api/v1/billing/
|
|
1084
|
-
|
|
1045
|
+
return customFetch<Invoice>(
|
|
1046
|
+
{url: `/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview`, method: 'POST',
|
|
1047
|
+
headers: {'Content-Type': 'application/json', },
|
|
1048
|
+
data: subscriptionAddOnAddSubscriptionAddOnPreviewBody, signal
|
|
1085
1049
|
},
|
|
1086
1050
|
options);
|
|
1087
1051
|
}
|
|
1088
1052
|
|
|
1089
1053
|
|
|
1090
1054
|
|
|
1091
|
-
export const
|
|
1092
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
1093
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
1055
|
+
export const getSubscriptionAddOnAddSubscriptionAddOnPreviewMutationOptions = <TError = void,
|
|
1056
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOnPreview>>, TError,{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnPreviewBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1057
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOnPreview>>, TError,{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnPreviewBody>}, TContext> => {
|
|
1094
1058
|
|
|
1095
|
-
const mutationKey = ['
|
|
1059
|
+
const mutationKey = ['subscriptionAddOnAddSubscriptionAddOnPreview'];
|
|
1096
1060
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1097
1061
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1098
1062
|
options
|
|
@@ -1102,10 +1066,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1102
1066
|
|
|
1103
1067
|
|
|
1104
1068
|
|
|
1105
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
1106
|
-
const {
|
|
1069
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOnPreview>>, {data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnPreviewBody>}> = (props) => {
|
|
1070
|
+
const {data} = props ?? {};
|
|
1107
1071
|
|
|
1108
|
-
return
|
|
1072
|
+
return subscriptionAddOnAddSubscriptionAddOnPreview(data,requestOptions)
|
|
1109
1073
|
}
|
|
1110
1074
|
|
|
1111
1075
|
|
|
@@ -1113,52 +1077,52 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1113
1077
|
|
|
1114
1078
|
return { mutationFn, ...mutationOptions }}
|
|
1115
1079
|
|
|
1116
|
-
export type
|
|
1117
|
-
|
|
1118
|
-
export type
|
|
1080
|
+
export type SubscriptionAddOnAddSubscriptionAddOnPreviewMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOnPreview>>>
|
|
1081
|
+
export type SubscriptionAddOnAddSubscriptionAddOnPreviewMutationBody = NonReadonly<SubscriptionAddOnAddSubscriptionAddOnPreviewBody>
|
|
1082
|
+
export type SubscriptionAddOnAddSubscriptionAddOnPreviewMutationError = void
|
|
1119
1083
|
|
|
1120
1084
|
/**
|
|
1121
|
-
* @summary
|
|
1085
|
+
* @summary Preview the invoice for adding an add-on to a subscription.
|
|
1122
1086
|
*/
|
|
1123
|
-
export const
|
|
1124
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
1087
|
+
export const useSubscriptionAddOnAddSubscriptionAddOnPreview = <TError = void,
|
|
1088
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOnPreview>>, TError,{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnPreviewBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1125
1089
|
): UseMutationResult<
|
|
1126
|
-
Awaited<ReturnType<typeof
|
|
1090
|
+
Awaited<ReturnType<typeof subscriptionAddOnAddSubscriptionAddOnPreview>>,
|
|
1127
1091
|
TError,
|
|
1128
|
-
{
|
|
1092
|
+
{data: NonReadonly<SubscriptionAddOnAddSubscriptionAddOnPreviewBody>},
|
|
1129
1093
|
TContext
|
|
1130
1094
|
> => {
|
|
1131
1095
|
|
|
1132
|
-
const mutationOptions =
|
|
1096
|
+
const mutationOptions = getSubscriptionAddOnAddSubscriptionAddOnPreviewMutationOptions(options);
|
|
1133
1097
|
|
|
1134
1098
|
return useMutation(mutationOptions);
|
|
1135
1099
|
}
|
|
1136
1100
|
/**
|
|
1137
|
-
* When a subscription is flagged, next time the user authenticates the
|
|
1138
|
-
widget will prompt the user to change
|
|
1139
|
-
* @summary Indicate that an upgrade of
|
|
1101
|
+
* When a subscription add-on is flagged, the next time the user authenticates the
|
|
1102
|
+
authentication widget will prompt the user to change their add-on.
|
|
1103
|
+
* @summary Indicate that an upgrade of an add-on is required.
|
|
1140
1104
|
*/
|
|
1141
|
-
export const
|
|
1142
|
-
|
|
1143
|
-
|
|
1105
|
+
export const subscriptionAddOnSetAddOnUpgradeRequired = (
|
|
1106
|
+
subscriptionAddOnUid: string | null,
|
|
1107
|
+
subscriptionAddOnSetAddOnUpgradeRequiredBody: NonReadonly<SubscriptionAddOnSetAddOnUpgradeRequiredBody>,
|
|
1144
1108
|
options?: SecondParameter<typeof customFetch>,) => {
|
|
1145
1109
|
|
|
1146
1110
|
|
|
1147
|
-
return customFetch<
|
|
1148
|
-
{url: `/api/v1/billing/
|
|
1111
|
+
return customFetch<SubscriptionAddOn>(
|
|
1112
|
+
{url: `/api/v1/billing/subscriptionaddons/${subscriptionAddOnUid}/setaddonupgraderequired`, method: 'PUT',
|
|
1149
1113
|
headers: {'Content-Type': 'application/json', },
|
|
1150
|
-
data:
|
|
1114
|
+
data: subscriptionAddOnSetAddOnUpgradeRequiredBody
|
|
1151
1115
|
},
|
|
1152
1116
|
options);
|
|
1153
1117
|
}
|
|
1154
1118
|
|
|
1155
1119
|
|
|
1156
1120
|
|
|
1157
|
-
export const
|
|
1158
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
1159
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
1121
|
+
export const getSubscriptionAddOnSetAddOnUpgradeRequiredMutationOptions = <TError = void,
|
|
1122
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnSetAddOnUpgradeRequired>>, TError,{subscriptionAddOnUid: string | null;data: NonReadonly<SubscriptionAddOnSetAddOnUpgradeRequiredBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1123
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnSetAddOnUpgradeRequired>>, TError,{subscriptionAddOnUid: string | null;data: NonReadonly<SubscriptionAddOnSetAddOnUpgradeRequiredBody>}, TContext> => {
|
|
1160
1124
|
|
|
1161
|
-
const mutationKey = ['
|
|
1125
|
+
const mutationKey = ['subscriptionAddOnSetAddOnUpgradeRequired'];
|
|
1162
1126
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1163
1127
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1164
1128
|
options
|
|
@@ -1168,10 +1132,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1168
1132
|
|
|
1169
1133
|
|
|
1170
1134
|
|
|
1171
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
1172
|
-
const {
|
|
1135
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionAddOnSetAddOnUpgradeRequired>>, {subscriptionAddOnUid: string | null;data: NonReadonly<SubscriptionAddOnSetAddOnUpgradeRequiredBody>}> = (props) => {
|
|
1136
|
+
const {subscriptionAddOnUid,data} = props ?? {};
|
|
1173
1137
|
|
|
1174
|
-
return
|
|
1138
|
+
return subscriptionAddOnSetAddOnUpgradeRequired(subscriptionAddOnUid,data,requestOptions)
|
|
1175
1139
|
}
|
|
1176
1140
|
|
|
1177
1141
|
|
|
@@ -1179,56 +1143,49 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1179
1143
|
|
|
1180
1144
|
return { mutationFn, ...mutationOptions }}
|
|
1181
1145
|
|
|
1182
|
-
export type
|
|
1183
|
-
export type
|
|
1184
|
-
export type
|
|
1146
|
+
export type SubscriptionAddOnSetAddOnUpgradeRequiredMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddOnSetAddOnUpgradeRequired>>>
|
|
1147
|
+
export type SubscriptionAddOnSetAddOnUpgradeRequiredMutationBody = NonReadonly<SubscriptionAddOnSetAddOnUpgradeRequiredBody>
|
|
1148
|
+
export type SubscriptionAddOnSetAddOnUpgradeRequiredMutationError = void
|
|
1185
1149
|
|
|
1186
1150
|
/**
|
|
1187
|
-
* @summary Indicate that an upgrade of
|
|
1151
|
+
* @summary Indicate that an upgrade of an add-on is required.
|
|
1188
1152
|
*/
|
|
1189
|
-
export const
|
|
1190
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
1153
|
+
export const useSubscriptionAddOnSetAddOnUpgradeRequired = <TError = void,
|
|
1154
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnSetAddOnUpgradeRequired>>, TError,{subscriptionAddOnUid: string | null;data: NonReadonly<SubscriptionAddOnSetAddOnUpgradeRequiredBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1191
1155
|
): UseMutationResult<
|
|
1192
|
-
Awaited<ReturnType<typeof
|
|
1156
|
+
Awaited<ReturnType<typeof subscriptionAddOnSetAddOnUpgradeRequired>>,
|
|
1193
1157
|
TError,
|
|
1194
|
-
{
|
|
1158
|
+
{subscriptionAddOnUid: string | null;data: NonReadonly<SubscriptionAddOnSetAddOnUpgradeRequiredBody>},
|
|
1195
1159
|
TContext
|
|
1196
1160
|
> => {
|
|
1197
1161
|
|
|
1198
|
-
const mutationOptions =
|
|
1162
|
+
const mutationOptions = getSubscriptionAddOnSetAddOnUpgradeRequiredMutationOptions(options);
|
|
1199
1163
|
|
|
1200
1164
|
return useMutation(mutationOptions);
|
|
1201
1165
|
}
|
|
1202
1166
|
/**
|
|
1203
|
-
*
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
instead of the initial invoice.
|
|
1207
|
-
* @summary Preview the initial or renewal invoice for a hypothetical subscription.
|
|
1167
|
+
* Removes the add-on from the subscription going forward and returns the updated
|
|
1168
|
+
subscription.
|
|
1169
|
+
* @summary End an add-on on a subscription.
|
|
1208
1170
|
*/
|
|
1209
|
-
export const
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1213
|
-
) => {
|
|
1171
|
+
export const subscriptionAddOnEndSubscriptionAddOn = (
|
|
1172
|
+
subscriptionAddOnUid: string | null,
|
|
1173
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
1214
1174
|
|
|
1215
1175
|
|
|
1216
|
-
return customFetch<
|
|
1217
|
-
{url: `/api/v1/billing/
|
|
1218
|
-
headers: {'Content-Type': 'application/json', },
|
|
1219
|
-
data: subscriptionFirstTimeSubscriptionPreviewBody,
|
|
1220
|
-
params, signal
|
|
1176
|
+
return customFetch<Subscription>(
|
|
1177
|
+
{url: `/api/v1/billing/subscriptionaddons/${subscriptionAddOnUid}/end`, method: 'PUT'
|
|
1221
1178
|
},
|
|
1222
1179
|
options);
|
|
1223
1180
|
}
|
|
1224
1181
|
|
|
1225
1182
|
|
|
1226
1183
|
|
|
1227
|
-
export const
|
|
1228
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
1229
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
1184
|
+
export const getSubscriptionAddOnEndSubscriptionAddOnMutationOptions = <TError = void,
|
|
1185
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnEndSubscriptionAddOn>>, TError,{subscriptionAddOnUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1186
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnEndSubscriptionAddOn>>, TError,{subscriptionAddOnUid: string | null}, TContext> => {
|
|
1230
1187
|
|
|
1231
|
-
const mutationKey = ['
|
|
1188
|
+
const mutationKey = ['subscriptionAddOnEndSubscriptionAddOn'];
|
|
1232
1189
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1233
1190
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1234
1191
|
options
|
|
@@ -1238,10 +1195,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1238
1195
|
|
|
1239
1196
|
|
|
1240
1197
|
|
|
1241
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
1242
|
-
const {
|
|
1198
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionAddOnEndSubscriptionAddOn>>, {subscriptionAddOnUid: string | null}> = (props) => {
|
|
1199
|
+
const {subscriptionAddOnUid} = props ?? {};
|
|
1243
1200
|
|
|
1244
|
-
return
|
|
1201
|
+
return subscriptionAddOnEndSubscriptionAddOn(subscriptionAddOnUid,requestOptions)
|
|
1245
1202
|
}
|
|
1246
1203
|
|
|
1247
1204
|
|
|
@@ -1249,50 +1206,48 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1249
1206
|
|
|
1250
1207
|
return { mutationFn, ...mutationOptions }}
|
|
1251
1208
|
|
|
1252
|
-
export type
|
|
1253
|
-
|
|
1254
|
-
export type
|
|
1209
|
+
export type SubscriptionAddOnEndSubscriptionAddOnMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddOnEndSubscriptionAddOn>>>
|
|
1210
|
+
|
|
1211
|
+
export type SubscriptionAddOnEndSubscriptionAddOnMutationError = void
|
|
1255
1212
|
|
|
1256
1213
|
/**
|
|
1257
|
-
* @summary
|
|
1214
|
+
* @summary End an add-on on a subscription.
|
|
1258
1215
|
*/
|
|
1259
|
-
export const
|
|
1260
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
1216
|
+
export const useSubscriptionAddOnEndSubscriptionAddOn = <TError = void,
|
|
1217
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnEndSubscriptionAddOn>>, TError,{subscriptionAddOnUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1261
1218
|
): UseMutationResult<
|
|
1262
|
-
Awaited<ReturnType<typeof
|
|
1219
|
+
Awaited<ReturnType<typeof subscriptionAddOnEndSubscriptionAddOn>>,
|
|
1263
1220
|
TError,
|
|
1264
|
-
{
|
|
1221
|
+
{subscriptionAddOnUid: string | null},
|
|
1265
1222
|
TContext
|
|
1266
1223
|
> => {
|
|
1267
1224
|
|
|
1268
|
-
const mutationOptions =
|
|
1225
|
+
const mutationOptions = getSubscriptionAddOnEndSubscriptionAddOnMutationOptions(options);
|
|
1269
1226
|
|
|
1270
1227
|
return useMutation(mutationOptions);
|
|
1271
1228
|
}
|
|
1272
1229
|
/**
|
|
1273
|
-
*
|
|
1274
|
-
* @summary Add a subscription to an account for the first time.
|
|
1230
|
+
* @summary Immediately ends an add-on.
|
|
1275
1231
|
*/
|
|
1276
|
-
export const
|
|
1277
|
-
|
|
1232
|
+
export const subscriptionAddOnExpireSubscriptionAddOn = (
|
|
1233
|
+
subscriptionAddOnUid: string | null,
|
|
1278
1234
|
options?: SecondParameter<typeof customFetch>,) => {
|
|
1279
1235
|
|
|
1280
1236
|
|
|
1281
|
-
return customFetch<
|
|
1282
|
-
{url: `/api/v1/billing/
|
|
1283
|
-
|
|
1284
|
-
data: subscriptionFirstTimeSubscriptionBody
|
|
1237
|
+
return customFetch<Blob>(
|
|
1238
|
+
{url: `/api/v1/billing/subscriptionaddons/${subscriptionAddOnUid}/expire`, method: 'PUT',
|
|
1239
|
+
responseType: 'blob'
|
|
1285
1240
|
},
|
|
1286
1241
|
options);
|
|
1287
1242
|
}
|
|
1288
1243
|
|
|
1289
1244
|
|
|
1290
1245
|
|
|
1291
|
-
export const
|
|
1292
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
1293
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
1246
|
+
export const getSubscriptionAddOnExpireSubscriptionAddOnMutationOptions = <TError = void,
|
|
1247
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnExpireSubscriptionAddOn>>, TError,{subscriptionAddOnUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1248
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnExpireSubscriptionAddOn>>, TError,{subscriptionAddOnUid: string | null}, TContext> => {
|
|
1294
1249
|
|
|
1295
|
-
const mutationKey = ['
|
|
1250
|
+
const mutationKey = ['subscriptionAddOnExpireSubscriptionAddOn'];
|
|
1296
1251
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1297
1252
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1298
1253
|
options
|
|
@@ -1302,10 +1257,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1302
1257
|
|
|
1303
1258
|
|
|
1304
1259
|
|
|
1305
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
1306
|
-
const {
|
|
1260
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionAddOnExpireSubscriptionAddOn>>, {subscriptionAddOnUid: string | null}> = (props) => {
|
|
1261
|
+
const {subscriptionAddOnUid} = props ?? {};
|
|
1307
1262
|
|
|
1308
|
-
return
|
|
1263
|
+
return subscriptionAddOnExpireSubscriptionAddOn(subscriptionAddOnUid,requestOptions)
|
|
1309
1264
|
}
|
|
1310
1265
|
|
|
1311
1266
|
|
|
@@ -1313,54 +1268,1452 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1313
1268
|
|
|
1314
1269
|
return { mutationFn, ...mutationOptions }}
|
|
1315
1270
|
|
|
1316
|
-
export type
|
|
1317
|
-
|
|
1318
|
-
export type
|
|
1271
|
+
export type SubscriptionAddOnExpireSubscriptionAddOnMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddOnExpireSubscriptionAddOn>>>
|
|
1272
|
+
|
|
1273
|
+
export type SubscriptionAddOnExpireSubscriptionAddOnMutationError = void
|
|
1319
1274
|
|
|
1320
1275
|
/**
|
|
1321
|
-
* @summary
|
|
1276
|
+
* @summary Immediately ends an add-on.
|
|
1322
1277
|
*/
|
|
1323
|
-
export const
|
|
1324
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
1278
|
+
export const useSubscriptionAddOnExpireSubscriptionAddOn = <TError = void,
|
|
1279
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddOnExpireSubscriptionAddOn>>, TError,{subscriptionAddOnUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1325
1280
|
): UseMutationResult<
|
|
1326
|
-
Awaited<ReturnType<typeof
|
|
1281
|
+
Awaited<ReturnType<typeof subscriptionAddOnExpireSubscriptionAddOn>>,
|
|
1327
1282
|
TError,
|
|
1328
|
-
{
|
|
1283
|
+
{subscriptionAddOnUid: string | null},
|
|
1329
1284
|
TContext
|
|
1330
1285
|
> => {
|
|
1331
1286
|
|
|
1332
|
-
const mutationOptions =
|
|
1287
|
+
const mutationOptions = getSubscriptionAddOnExpireSubscriptionAddOnMutationOptions(options);
|
|
1333
1288
|
|
|
1334
1289
|
return useMutation(mutationOptions);
|
|
1335
1290
|
}
|
|
1336
1291
|
/**
|
|
1337
|
-
*
|
|
1338
|
-
|
|
1339
|
-
|
|
1292
|
+
* Admins and API key callers see every invoice. Non-admin users see only invoices
|
|
1293
|
+
belonging to the account they are the primary contact of.
|
|
1294
|
+
Pass excludeInvoiceUid as a query parameter to omit a specific invoice from the result set.
|
|
1295
|
+
* @summary Retrieve all invoices.
|
|
1340
1296
|
*/
|
|
1341
|
-
export const
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1297
|
+
export const invoiceGetAllInvoices = (
|
|
1298
|
+
|
|
1299
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1300
|
+
) => {
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
return customFetch<Invoice[]>(
|
|
1304
|
+
{url: `/api/v1/billing/invoices`, method: 'GET', signal
|
|
1305
|
+
},
|
|
1306
|
+
options);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
export const getInvoiceGetAllInvoicesQueryKey = () => {
|
|
1313
|
+
return [
|
|
1314
|
+
`/api/v1/billing/invoices`
|
|
1315
|
+
] as const;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
|
|
1319
|
+
export const getInvoiceGetAllInvoicesQueryOptions = <TData = Awaited<ReturnType<typeof invoiceGetAllInvoices>>, TError = void>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetAllInvoices>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1320
|
+
) => {
|
|
1321
|
+
|
|
1322
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1323
|
+
|
|
1324
|
+
const queryKey = queryOptions?.queryKey ?? getInvoiceGetAllInvoicesQueryKey();
|
|
1325
|
+
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof invoiceGetAllInvoices>>> = ({ signal }) => invoiceGetAllInvoices(requestOptions, signal);
|
|
1329
|
+
|
|
1330
|
+
|
|
1331
|
+
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof invoiceGetAllInvoices>>, TError, TData> & { queryKey: QueryKey }
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
export type InvoiceGetAllInvoicesQueryResult = NonNullable<Awaited<ReturnType<typeof invoiceGetAllInvoices>>>
|
|
1338
|
+
export type InvoiceGetAllInvoicesQueryError = void
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* @summary Retrieve all invoices.
|
|
1343
|
+
*/
|
|
1344
|
+
|
|
1345
|
+
export function useInvoiceGetAllInvoices<TData = Awaited<ReturnType<typeof invoiceGetAllInvoices>>, TError = void>(
|
|
1346
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetAllInvoices>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1347
|
+
|
|
1348
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1349
|
+
|
|
1350
|
+
const queryOptions = getInvoiceGetAllInvoicesQueryOptions(options)
|
|
1351
|
+
|
|
1352
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1353
|
+
|
|
1354
|
+
query.queryKey = queryOptions.queryKey ;
|
|
1355
|
+
|
|
1356
|
+
return query;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* @summary Create an ad-hoc invoice for a given account.
|
|
1364
|
+
*/
|
|
1365
|
+
export const invoiceAddInvoice = (
|
|
1366
|
+
invoiceAddInvoiceBody: NonReadonly<InvoiceAddInvoiceBody>,
|
|
1367
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1368
|
+
) => {
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
return customFetch<Invoice>(
|
|
1372
|
+
{url: `/api/v1/billing/invoices`, method: 'POST',
|
|
1373
|
+
headers: {'Content-Type': 'application/json', },
|
|
1374
|
+
data: invoiceAddInvoiceBody, signal
|
|
1375
|
+
},
|
|
1376
|
+
options);
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
|
|
1381
|
+
export const getInvoiceAddInvoiceMutationOptions = <TError = void,
|
|
1382
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceAddInvoice>>, TError,{data: NonReadonly<InvoiceAddInvoiceBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1383
|
+
): UseMutationOptions<Awaited<ReturnType<typeof invoiceAddInvoice>>, TError,{data: NonReadonly<InvoiceAddInvoiceBody>}, TContext> => {
|
|
1384
|
+
|
|
1385
|
+
const mutationKey = ['invoiceAddInvoice'];
|
|
1386
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1387
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1388
|
+
options
|
|
1389
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1390
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1391
|
+
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof invoiceAddInvoice>>, {data: NonReadonly<InvoiceAddInvoiceBody>}> = (props) => {
|
|
1396
|
+
const {data} = props ?? {};
|
|
1397
|
+
|
|
1398
|
+
return invoiceAddInvoice(data,requestOptions)
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
|
|
1403
|
+
|
|
1404
|
+
return { mutationFn, ...mutationOptions }}
|
|
1405
|
+
|
|
1406
|
+
export type InvoiceAddInvoiceMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceAddInvoice>>>
|
|
1407
|
+
export type InvoiceAddInvoiceMutationBody = NonReadonly<InvoiceAddInvoiceBody>
|
|
1408
|
+
export type InvoiceAddInvoiceMutationError = void
|
|
1409
|
+
|
|
1410
|
+
/**
|
|
1411
|
+
* @summary Create an ad-hoc invoice for a given account.
|
|
1412
|
+
*/
|
|
1413
|
+
export const useInvoiceAddInvoice = <TError = void,
|
|
1414
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceAddInvoice>>, TError,{data: NonReadonly<InvoiceAddInvoiceBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1415
|
+
): UseMutationResult<
|
|
1416
|
+
Awaited<ReturnType<typeof invoiceAddInvoice>>,
|
|
1417
|
+
TError,
|
|
1418
|
+
{data: NonReadonly<InvoiceAddInvoiceBody>},
|
|
1419
|
+
TContext
|
|
1420
|
+
> => {
|
|
1421
|
+
|
|
1422
|
+
const mutationOptions = getInvoiceAddInvoiceMutationOptions(options);
|
|
1423
|
+
|
|
1424
|
+
return useMutation(mutationOptions);
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* @summary Retrieve an invoice.
|
|
1428
|
+
*/
|
|
1429
|
+
export const invoiceGetInvoice = (
|
|
1430
|
+
invoiceUid: string | null,
|
|
1431
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1432
|
+
) => {
|
|
1433
|
+
|
|
1434
|
+
|
|
1435
|
+
return customFetch<Invoice>(
|
|
1436
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}`, method: 'GET', signal
|
|
1437
|
+
},
|
|
1438
|
+
options);
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
|
|
1442
|
+
|
|
1443
|
+
|
|
1444
|
+
export const getInvoiceGetInvoiceQueryKey = (invoiceUid?: string | null,) => {
|
|
1445
|
+
return [
|
|
1446
|
+
`/api/v1/billing/invoices/${invoiceUid}`
|
|
1447
|
+
] as const;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
export const getInvoiceGetInvoiceQueryOptions = <TData = Awaited<ReturnType<typeof invoiceGetInvoice>>, TError = void>(invoiceUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoice>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1452
|
+
) => {
|
|
1453
|
+
|
|
1454
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1455
|
+
|
|
1456
|
+
const queryKey = queryOptions?.queryKey ?? getInvoiceGetInvoiceQueryKey(invoiceUid);
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof invoiceGetInvoice>>> = ({ signal }) => invoiceGetInvoice(invoiceUid, requestOptions, signal);
|
|
1461
|
+
|
|
1462
|
+
|
|
1463
|
+
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
return { queryKey, queryFn, enabled: !!(invoiceUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoice>>, TError, TData> & { queryKey: QueryKey }
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
export type InvoiceGetInvoiceQueryResult = NonNullable<Awaited<ReturnType<typeof invoiceGetInvoice>>>
|
|
1470
|
+
export type InvoiceGetInvoiceQueryError = void
|
|
1471
|
+
|
|
1472
|
+
|
|
1473
|
+
/**
|
|
1474
|
+
* @summary Retrieve an invoice.
|
|
1475
|
+
*/
|
|
1476
|
+
|
|
1477
|
+
export function useInvoiceGetInvoice<TData = Awaited<ReturnType<typeof invoiceGetInvoice>>, TError = void>(
|
|
1478
|
+
invoiceUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoice>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1479
|
+
|
|
1480
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1481
|
+
|
|
1482
|
+
const queryOptions = getInvoiceGetInvoiceQueryOptions(invoiceUid,options)
|
|
1483
|
+
|
|
1484
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1485
|
+
|
|
1486
|
+
query.queryKey = queryOptions.queryKey ;
|
|
1487
|
+
|
|
1488
|
+
return query;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* Only invoices created manually via the API or admin UI can be updated; invoices
|
|
1496
|
+
generated by a subscription's billing cycle are immutable and will return a
|
|
1497
|
+
validation error.
|
|
1498
|
+
* @summary Update an ad-hoc (manually created) invoice.
|
|
1499
|
+
*/
|
|
1500
|
+
export const invoiceUpdateInvoice = (
|
|
1501
|
+
invoiceUid: string | null,
|
|
1502
|
+
invoiceUpdateInvoiceBody: NonReadonly<InvoiceUpdateInvoiceBody>,
|
|
1503
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
1504
|
+
|
|
1505
|
+
|
|
1506
|
+
return customFetch<Invoice>(
|
|
1507
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}`, method: 'PUT',
|
|
1508
|
+
headers: {'Content-Type': 'application/json', },
|
|
1509
|
+
data: invoiceUpdateInvoiceBody
|
|
1510
|
+
},
|
|
1511
|
+
options);
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
|
|
1516
|
+
export const getInvoiceUpdateInvoiceMutationOptions = <TError = void,
|
|
1517
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceUpdateInvoice>>, TError,{invoiceUid: string | null;data: NonReadonly<InvoiceUpdateInvoiceBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1518
|
+
): UseMutationOptions<Awaited<ReturnType<typeof invoiceUpdateInvoice>>, TError,{invoiceUid: string | null;data: NonReadonly<InvoiceUpdateInvoiceBody>}, TContext> => {
|
|
1519
|
+
|
|
1520
|
+
const mutationKey = ['invoiceUpdateInvoice'];
|
|
1521
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1522
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1523
|
+
options
|
|
1524
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1525
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1526
|
+
|
|
1527
|
+
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof invoiceUpdateInvoice>>, {invoiceUid: string | null;data: NonReadonly<InvoiceUpdateInvoiceBody>}> = (props) => {
|
|
1531
|
+
const {invoiceUid,data} = props ?? {};
|
|
1532
|
+
|
|
1533
|
+
return invoiceUpdateInvoice(invoiceUid,data,requestOptions)
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
|
|
1537
|
+
|
|
1538
|
+
|
|
1539
|
+
return { mutationFn, ...mutationOptions }}
|
|
1540
|
+
|
|
1541
|
+
export type InvoiceUpdateInvoiceMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceUpdateInvoice>>>
|
|
1542
|
+
export type InvoiceUpdateInvoiceMutationBody = NonReadonly<InvoiceUpdateInvoiceBody>
|
|
1543
|
+
export type InvoiceUpdateInvoiceMutationError = void
|
|
1544
|
+
|
|
1545
|
+
/**
|
|
1546
|
+
* @summary Update an ad-hoc (manually created) invoice.
|
|
1547
|
+
*/
|
|
1548
|
+
export const useInvoiceUpdateInvoice = <TError = void,
|
|
1549
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceUpdateInvoice>>, TError,{invoiceUid: string | null;data: NonReadonly<InvoiceUpdateInvoiceBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1550
|
+
): UseMutationResult<
|
|
1551
|
+
Awaited<ReturnType<typeof invoiceUpdateInvoice>>,
|
|
1552
|
+
TError,
|
|
1553
|
+
{invoiceUid: string | null;data: NonReadonly<InvoiceUpdateInvoiceBody>},
|
|
1554
|
+
TContext
|
|
1555
|
+
> => {
|
|
1556
|
+
|
|
1557
|
+
const mutationOptions = getInvoiceUpdateInvoiceMutationOptions(options);
|
|
1558
|
+
|
|
1559
|
+
return useMutation(mutationOptions);
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* @summary Delete an invoice.
|
|
1563
|
+
*/
|
|
1564
|
+
export const invoiceDeleteInvoice = (
|
|
1565
|
+
invoiceUid: string | null,
|
|
1566
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
1567
|
+
|
|
1568
|
+
|
|
1569
|
+
return customFetch<Blob>(
|
|
1570
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}`, method: 'DELETE',
|
|
1571
|
+
responseType: 'blob'
|
|
1572
|
+
},
|
|
1573
|
+
options);
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
export const getInvoiceDeleteInvoiceMutationOptions = <TError = void,
|
|
1579
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceDeleteInvoice>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1580
|
+
): UseMutationOptions<Awaited<ReturnType<typeof invoiceDeleteInvoice>>, TError,{invoiceUid: string | null}, TContext> => {
|
|
1581
|
+
|
|
1582
|
+
const mutationKey = ['invoiceDeleteInvoice'];
|
|
1583
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1584
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1585
|
+
options
|
|
1586
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1587
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof invoiceDeleteInvoice>>, {invoiceUid: string | null}> = (props) => {
|
|
1593
|
+
const {invoiceUid} = props ?? {};
|
|
1594
|
+
|
|
1595
|
+
return invoiceDeleteInvoice(invoiceUid,requestOptions)
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
|
|
1599
|
+
|
|
1600
|
+
|
|
1601
|
+
return { mutationFn, ...mutationOptions }}
|
|
1602
|
+
|
|
1603
|
+
export type InvoiceDeleteInvoiceMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceDeleteInvoice>>>
|
|
1604
|
+
|
|
1605
|
+
export type InvoiceDeleteInvoiceMutationError = void
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* @summary Delete an invoice.
|
|
1609
|
+
*/
|
|
1610
|
+
export const useInvoiceDeleteInvoice = <TError = void,
|
|
1611
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceDeleteInvoice>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1612
|
+
): UseMutationResult<
|
|
1613
|
+
Awaited<ReturnType<typeof invoiceDeleteInvoice>>,
|
|
1614
|
+
TError,
|
|
1615
|
+
{invoiceUid: string | null},
|
|
1616
|
+
TContext
|
|
1617
|
+
> => {
|
|
1618
|
+
|
|
1619
|
+
const mutationOptions = getInvoiceDeleteInvoiceMutationOptions(options);
|
|
1620
|
+
|
|
1621
|
+
return useMutation(mutationOptions);
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* Response body is a binary PDF (Content-Type: application/pdf) served as an
|
|
1625
|
+
attachment named invoice-{Number}-{InvoiceDate}-{AccountName}.pdf.
|
|
1626
|
+
* @summary Retrieve a rendered PDF copy of an invoice.
|
|
1627
|
+
*/
|
|
1628
|
+
export const invoiceGetInvoiceAsPdf = (
|
|
1629
|
+
invoiceUid: string | null,
|
|
1630
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1631
|
+
) => {
|
|
1632
|
+
|
|
1633
|
+
|
|
1634
|
+
return customFetch<Blob>(
|
|
1635
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}/pdf`, method: 'GET',
|
|
1636
|
+
responseType: 'blob', signal
|
|
1637
|
+
},
|
|
1638
|
+
options);
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
|
|
1642
|
+
|
|
1643
|
+
|
|
1644
|
+
export const getInvoiceGetInvoiceAsPdfQueryKey = (invoiceUid?: string | null,) => {
|
|
1645
|
+
return [
|
|
1646
|
+
`/api/v1/billing/invoices/${invoiceUid}/pdf`
|
|
1647
|
+
] as const;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
|
|
1651
|
+
export const getInvoiceGetInvoiceAsPdfQueryOptions = <TData = Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>, TError = void>(invoiceUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1652
|
+
) => {
|
|
1653
|
+
|
|
1654
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1655
|
+
|
|
1656
|
+
const queryKey = queryOptions?.queryKey ?? getInvoiceGetInvoiceAsPdfQueryKey(invoiceUid);
|
|
1657
|
+
|
|
1658
|
+
|
|
1659
|
+
|
|
1660
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>> = ({ signal }) => invoiceGetInvoiceAsPdf(invoiceUid, requestOptions, signal);
|
|
1661
|
+
|
|
1662
|
+
|
|
1663
|
+
|
|
1664
|
+
|
|
1665
|
+
|
|
1666
|
+
return { queryKey, queryFn, enabled: !!(invoiceUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>, TError, TData> & { queryKey: QueryKey }
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
export type InvoiceGetInvoiceAsPdfQueryResult = NonNullable<Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>>
|
|
1670
|
+
export type InvoiceGetInvoiceAsPdfQueryError = void
|
|
1671
|
+
|
|
1672
|
+
|
|
1673
|
+
/**
|
|
1674
|
+
* @summary Retrieve a rendered PDF copy of an invoice.
|
|
1675
|
+
*/
|
|
1676
|
+
|
|
1677
|
+
export function useInvoiceGetInvoiceAsPdf<TData = Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>, TError = void>(
|
|
1678
|
+
invoiceUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof invoiceGetInvoiceAsPdf>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1679
|
+
|
|
1680
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1681
|
+
|
|
1682
|
+
const queryOptions = getInvoiceGetInvoiceAsPdfQueryOptions(invoiceUid,options)
|
|
1683
|
+
|
|
1684
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1685
|
+
|
|
1686
|
+
query.queryKey = queryOptions.queryKey ;
|
|
1687
|
+
|
|
1688
|
+
return query;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* Optional query parameters:
|
|
1696
|
+
note - free-text note to include in the email body.
|
|
1697
|
+
bcc - comma-separated list of email addresses to BCC.
|
|
1698
|
+
* @summary Email an invoice to the account's billing contact.
|
|
1699
|
+
*/
|
|
1700
|
+
export const invoiceSendInvoiceEmail = (
|
|
1701
|
+
invoiceUid: string | null,
|
|
1702
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1703
|
+
) => {
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
return customFetch<Blob>(
|
|
1707
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}/sendinvoiceemail`, method: 'POST',
|
|
1708
|
+
responseType: 'blob', signal
|
|
1709
|
+
},
|
|
1710
|
+
options);
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
export const getInvoiceSendInvoiceEmailMutationOptions = <TError = void,
|
|
1716
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1717
|
+
): UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, TError,{invoiceUid: string | null}, TContext> => {
|
|
1718
|
+
|
|
1719
|
+
const mutationKey = ['invoiceSendInvoiceEmail'];
|
|
1720
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1721
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1722
|
+
options
|
|
1723
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1724
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1725
|
+
|
|
1726
|
+
|
|
1727
|
+
|
|
1728
|
+
|
|
1729
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, {invoiceUid: string | null}> = (props) => {
|
|
1730
|
+
const {invoiceUid} = props ?? {};
|
|
1731
|
+
|
|
1732
|
+
return invoiceSendInvoiceEmail(invoiceUid,requestOptions)
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
return { mutationFn, ...mutationOptions }}
|
|
1739
|
+
|
|
1740
|
+
export type InvoiceSendInvoiceEmailMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>>
|
|
1741
|
+
|
|
1742
|
+
export type InvoiceSendInvoiceEmailMutationError = void
|
|
1743
|
+
|
|
1744
|
+
/**
|
|
1745
|
+
* @summary Email an invoice to the account's billing contact.
|
|
1746
|
+
*/
|
|
1747
|
+
export const useInvoiceSendInvoiceEmail = <TError = void,
|
|
1748
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1749
|
+
): UseMutationResult<
|
|
1750
|
+
Awaited<ReturnType<typeof invoiceSendInvoiceEmail>>,
|
|
1751
|
+
TError,
|
|
1752
|
+
{invoiceUid: string | null},
|
|
1753
|
+
TContext
|
|
1754
|
+
> => {
|
|
1755
|
+
|
|
1756
|
+
const mutationOptions = getInvoiceSendInvoiceEmailMutationOptions(options);
|
|
1757
|
+
|
|
1758
|
+
return useMutation(mutationOptions);
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* Returns 400 Bad Request if the invoice is not in the Paid status.
|
|
1762
|
+
* @summary Send the "invoice paid" receipt email to the account's billing contact.
|
|
1763
|
+
*/
|
|
1764
|
+
export const invoiceSendInvoicePaidEmail = (
|
|
1765
|
+
invoiceUid: string | null,
|
|
1766
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1767
|
+
) => {
|
|
1768
|
+
|
|
1769
|
+
|
|
1770
|
+
return customFetch<Blob>(
|
|
1771
|
+
{url: `/api/v1/billing/invoices/${invoiceUid}/sendinvoicepaidemail`, method: 'POST',
|
|
1772
|
+
responseType: 'blob', signal
|
|
1773
|
+
},
|
|
1774
|
+
options);
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
|
|
1778
|
+
|
|
1779
|
+
export const getInvoiceSendInvoicePaidEmailMutationOptions = <TError = void,
|
|
1780
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1781
|
+
): UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>, TError,{invoiceUid: string | null}, TContext> => {
|
|
1782
|
+
|
|
1783
|
+
const mutationKey = ['invoiceSendInvoicePaidEmail'];
|
|
1784
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1785
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1786
|
+
options
|
|
1787
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1788
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1789
|
+
|
|
1790
|
+
|
|
1791
|
+
|
|
1792
|
+
|
|
1793
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>, {invoiceUid: string | null}> = (props) => {
|
|
1794
|
+
const {invoiceUid} = props ?? {};
|
|
1795
|
+
|
|
1796
|
+
return invoiceSendInvoicePaidEmail(invoiceUid,requestOptions)
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
|
|
1800
|
+
|
|
1801
|
+
|
|
1802
|
+
return { mutationFn, ...mutationOptions }}
|
|
1803
|
+
|
|
1804
|
+
export type InvoiceSendInvoicePaidEmailMutationResult = NonNullable<Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>>
|
|
1805
|
+
|
|
1806
|
+
export type InvoiceSendInvoicePaidEmailMutationError = void
|
|
1807
|
+
|
|
1808
|
+
/**
|
|
1809
|
+
* @summary Send the "invoice paid" receipt email to the account's billing contact.
|
|
1810
|
+
*/
|
|
1811
|
+
export const useInvoiceSendInvoicePaidEmail = <TError = void,
|
|
1812
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>, TError,{invoiceUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1813
|
+
): UseMutationResult<
|
|
1814
|
+
Awaited<ReturnType<typeof invoiceSendInvoicePaidEmail>>,
|
|
1815
|
+
TError,
|
|
1816
|
+
{invoiceUid: string | null},
|
|
1817
|
+
TContext
|
|
1818
|
+
> => {
|
|
1819
|
+
|
|
1820
|
+
const mutationOptions = getInvoiceSendInvoicePaidEmailMutationOptions(options);
|
|
1821
|
+
|
|
1822
|
+
return useMutation(mutationOptions);
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* Admins and API key callers see every subscription; non-admin users see only
|
|
1826
|
+
subscriptions on accounts they are related to. That scope is determined by the auth
|
|
1827
|
+
token and cannot be widened by the caller. Optionally pass
|
|
1828
|
+
Account.PersonAccount.Person.Uid as a query parameter to narrow the results to a
|
|
1829
|
+
specific person.
|
|
1830
|
+
* @summary Retrieve all subscriptions.
|
|
1831
|
+
*/
|
|
1832
|
+
export const subscriptionGetAllSubscriptions = (
|
|
1833
|
+
params?: SubscriptionGetAllSubscriptionsParams,
|
|
1834
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1835
|
+
) => {
|
|
1836
|
+
|
|
1837
|
+
|
|
1838
|
+
return customFetch<Subscription[]>(
|
|
1839
|
+
{url: `/api/v1/billing/subscriptions`, method: 'GET',
|
|
1840
|
+
params, signal
|
|
1841
|
+
},
|
|
1842
|
+
options);
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
|
|
1846
|
+
|
|
1847
|
+
|
|
1848
|
+
export const getSubscriptionGetAllSubscriptionsQueryKey = (params?: SubscriptionGetAllSubscriptionsParams,) => {
|
|
1849
|
+
return [
|
|
1850
|
+
`/api/v1/billing/subscriptions`, ...(params ? [params]: [])
|
|
1851
|
+
] as const;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
|
|
1855
|
+
export const getSubscriptionGetAllSubscriptionsQueryOptions = <TData = Awaited<ReturnType<typeof subscriptionGetAllSubscriptions>>, TError = void>(params?: SubscriptionGetAllSubscriptionsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof subscriptionGetAllSubscriptions>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1856
|
+
) => {
|
|
1857
|
+
|
|
1858
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1859
|
+
|
|
1860
|
+
const queryKey = queryOptions?.queryKey ?? getSubscriptionGetAllSubscriptionsQueryKey(params);
|
|
1861
|
+
|
|
1862
|
+
|
|
1863
|
+
|
|
1864
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof subscriptionGetAllSubscriptions>>> = ({ signal }) => subscriptionGetAllSubscriptions(params, requestOptions, signal);
|
|
1865
|
+
|
|
1866
|
+
|
|
1867
|
+
|
|
1868
|
+
|
|
1869
|
+
|
|
1870
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof subscriptionGetAllSubscriptions>>, TError, TData> & { queryKey: QueryKey }
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
export type SubscriptionGetAllSubscriptionsQueryResult = NonNullable<Awaited<ReturnType<typeof subscriptionGetAllSubscriptions>>>
|
|
1874
|
+
export type SubscriptionGetAllSubscriptionsQueryError = void
|
|
1875
|
+
|
|
1876
|
+
|
|
1877
|
+
/**
|
|
1878
|
+
* @summary Retrieve all subscriptions.
|
|
1879
|
+
*/
|
|
1880
|
+
|
|
1881
|
+
export function useSubscriptionGetAllSubscriptions<TData = Awaited<ReturnType<typeof subscriptionGetAllSubscriptions>>, TError = void>(
|
|
1882
|
+
params?: SubscriptionGetAllSubscriptionsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof subscriptionGetAllSubscriptions>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1883
|
+
|
|
1884
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1885
|
+
|
|
1886
|
+
const queryOptions = getSubscriptionGetAllSubscriptionsQueryOptions(params,options)
|
|
1887
|
+
|
|
1888
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1889
|
+
|
|
1890
|
+
query.queryKey = queryOptions.queryKey ;
|
|
1891
|
+
|
|
1892
|
+
return query;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
|
|
1898
|
+
/**
|
|
1899
|
+
* @summary Retrieve a subscription.
|
|
1900
|
+
*/
|
|
1901
|
+
export const subscriptionGetSubscription = (
|
|
1902
|
+
subscriptionUid: string | null,
|
|
1903
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1904
|
+
) => {
|
|
1905
|
+
|
|
1906
|
+
|
|
1907
|
+
return customFetch<Subscription>(
|
|
1908
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}`, method: 'GET', signal
|
|
1909
|
+
},
|
|
1910
|
+
options);
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
|
|
1914
|
+
|
|
1915
|
+
|
|
1916
|
+
export const getSubscriptionGetSubscriptionQueryKey = (subscriptionUid?: string | null,) => {
|
|
1917
|
+
return [
|
|
1918
|
+
`/api/v1/billing/subscriptions/${subscriptionUid}`
|
|
1919
|
+
] as const;
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
|
|
1923
|
+
export const getSubscriptionGetSubscriptionQueryOptions = <TData = Awaited<ReturnType<typeof subscriptionGetSubscription>>, TError = void>(subscriptionUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof subscriptionGetSubscription>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1924
|
+
) => {
|
|
1925
|
+
|
|
1926
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1927
|
+
|
|
1928
|
+
const queryKey = queryOptions?.queryKey ?? getSubscriptionGetSubscriptionQueryKey(subscriptionUid);
|
|
1929
|
+
|
|
1930
|
+
|
|
1931
|
+
|
|
1932
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof subscriptionGetSubscription>>> = ({ signal }) => subscriptionGetSubscription(subscriptionUid, requestOptions, signal);
|
|
1933
|
+
|
|
1934
|
+
|
|
1935
|
+
|
|
1936
|
+
|
|
1937
|
+
|
|
1938
|
+
return { queryKey, queryFn, enabled: !!(subscriptionUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof subscriptionGetSubscription>>, TError, TData> & { queryKey: QueryKey }
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
export type SubscriptionGetSubscriptionQueryResult = NonNullable<Awaited<ReturnType<typeof subscriptionGetSubscription>>>
|
|
1942
|
+
export type SubscriptionGetSubscriptionQueryError = void
|
|
1943
|
+
|
|
1944
|
+
|
|
1945
|
+
/**
|
|
1946
|
+
* @summary Retrieve a subscription.
|
|
1947
|
+
*/
|
|
1948
|
+
|
|
1949
|
+
export function useSubscriptionGetSubscription<TData = Awaited<ReturnType<typeof subscriptionGetSubscription>>, TError = void>(
|
|
1950
|
+
subscriptionUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof subscriptionGetSubscription>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1951
|
+
|
|
1952
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1953
|
+
|
|
1954
|
+
const queryOptions = getSubscriptionGetSubscriptionQueryOptions(subscriptionUid,options)
|
|
1955
|
+
|
|
1956
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1957
|
+
|
|
1958
|
+
query.queryKey = queryOptions.queryKey ;
|
|
1959
|
+
|
|
1960
|
+
return query;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
|
|
1966
|
+
/**
|
|
1967
|
+
* Only a future-dated subscription can be deleted; the current subscription on an
|
|
1968
|
+
account cannot be removed this way.
|
|
1969
|
+
* @summary Delete a subscription.
|
|
1970
|
+
*/
|
|
1971
|
+
export const subscriptionDeleteSubscription = (
|
|
1972
|
+
subscriptionUid: string | null,
|
|
1973
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
1974
|
+
|
|
1975
|
+
|
|
1976
|
+
return customFetch<Blob>(
|
|
1977
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}`, method: 'DELETE',
|
|
1978
|
+
responseType: 'blob'
|
|
1979
|
+
},
|
|
1980
|
+
options);
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
|
|
1984
|
+
|
|
1985
|
+
export const getSubscriptionDeleteSubscriptionMutationOptions = <TError = void,
|
|
1986
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionDeleteSubscription>>, TError,{subscriptionUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1987
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionDeleteSubscription>>, TError,{subscriptionUid: string | null}, TContext> => {
|
|
1988
|
+
|
|
1989
|
+
const mutationKey = ['subscriptionDeleteSubscription'];
|
|
1990
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1991
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1992
|
+
options
|
|
1993
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1994
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
1995
|
+
|
|
1996
|
+
|
|
1997
|
+
|
|
1998
|
+
|
|
1999
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionDeleteSubscription>>, {subscriptionUid: string | null}> = (props) => {
|
|
2000
|
+
const {subscriptionUid} = props ?? {};
|
|
2001
|
+
|
|
2002
|
+
return subscriptionDeleteSubscription(subscriptionUid,requestOptions)
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
|
|
2006
|
+
|
|
2007
|
+
|
|
2008
|
+
return { mutationFn, ...mutationOptions }}
|
|
2009
|
+
|
|
2010
|
+
export type SubscriptionDeleteSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionDeleteSubscription>>>
|
|
2011
|
+
|
|
2012
|
+
export type SubscriptionDeleteSubscriptionMutationError = void
|
|
2013
|
+
|
|
2014
|
+
/**
|
|
2015
|
+
* @summary Delete a subscription.
|
|
2016
|
+
*/
|
|
2017
|
+
export const useSubscriptionDeleteSubscription = <TError = void,
|
|
2018
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionDeleteSubscription>>, TError,{subscriptionUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2019
|
+
): UseMutationResult<
|
|
2020
|
+
Awaited<ReturnType<typeof subscriptionDeleteSubscription>>,
|
|
2021
|
+
TError,
|
|
2022
|
+
{subscriptionUid: string | null},
|
|
2023
|
+
TContext
|
|
2024
|
+
> => {
|
|
2025
|
+
|
|
2026
|
+
const mutationOptions = getSubscriptionDeleteSubscriptionMutationOptions(options);
|
|
2027
|
+
|
|
2028
|
+
return useMutation(mutationOptions);
|
|
2029
|
+
}
|
|
2030
|
+
/**
|
|
2031
|
+
* @summary Add a discount to a subscription.
|
|
2032
|
+
*/
|
|
2033
|
+
export const subscriptionAddDiscountToSubscription = (
|
|
2034
|
+
subscriptionUid: string | null,
|
|
2035
|
+
discountUid: string | null,
|
|
2036
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
2037
|
+
) => {
|
|
2038
|
+
|
|
2039
|
+
|
|
2040
|
+
return customFetch<Blob>(
|
|
2041
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}/discounts/${discountUid}`, method: 'POST',
|
|
2042
|
+
responseType: 'blob', signal
|
|
2043
|
+
},
|
|
2044
|
+
options);
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
|
|
2048
|
+
|
|
2049
|
+
export const getSubscriptionAddDiscountToSubscriptionMutationOptions = <TError = void,
|
|
2050
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>, TError,{subscriptionUid: string | null;discountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2051
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>, TError,{subscriptionUid: string | null;discountUid: string | null}, TContext> => {
|
|
2052
|
+
|
|
2053
|
+
const mutationKey = ['subscriptionAddDiscountToSubscription'];
|
|
2054
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
2055
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2056
|
+
options
|
|
2057
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
2058
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
2059
|
+
|
|
2060
|
+
|
|
2061
|
+
|
|
2062
|
+
|
|
2063
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>, {subscriptionUid: string | null;discountUid: string | null}> = (props) => {
|
|
2064
|
+
const {subscriptionUid,discountUid} = props ?? {};
|
|
2065
|
+
|
|
2066
|
+
return subscriptionAddDiscountToSubscription(subscriptionUid,discountUid,requestOptions)
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
|
|
2070
|
+
|
|
2071
|
+
|
|
2072
|
+
return { mutationFn, ...mutationOptions }}
|
|
2073
|
+
|
|
2074
|
+
export type SubscriptionAddDiscountToSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>>
|
|
2075
|
+
|
|
2076
|
+
export type SubscriptionAddDiscountToSubscriptionMutationError = void
|
|
2077
|
+
|
|
2078
|
+
/**
|
|
2079
|
+
* @summary Add a discount to a subscription.
|
|
2080
|
+
*/
|
|
2081
|
+
export const useSubscriptionAddDiscountToSubscription = <TError = void,
|
|
2082
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>, TError,{subscriptionUid: string | null;discountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2083
|
+
): UseMutationResult<
|
|
2084
|
+
Awaited<ReturnType<typeof subscriptionAddDiscountToSubscription>>,
|
|
2085
|
+
TError,
|
|
2086
|
+
{subscriptionUid: string | null;discountUid: string | null},
|
|
2087
|
+
TContext
|
|
2088
|
+
> => {
|
|
2089
|
+
|
|
2090
|
+
const mutationOptions = getSubscriptionAddDiscountToSubscriptionMutationOptions(options);
|
|
2091
|
+
|
|
2092
|
+
return useMutation(mutationOptions);
|
|
2093
|
+
}
|
|
2094
|
+
/**
|
|
2095
|
+
* Expires the active discount coupon on the subscription as of now.
|
|
2096
|
+
* @summary Remove a discount from a subscription.
|
|
2097
|
+
*/
|
|
2098
|
+
export const subscriptionExpireDiscountCouponSubscription = (
|
|
2099
|
+
subscriptionUid: string | null,
|
|
2100
|
+
discountUid: string | null,
|
|
2101
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
2102
|
+
|
|
2103
|
+
|
|
2104
|
+
return customFetch<Blob>(
|
|
2105
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}/discounts/${discountUid}`, method: 'DELETE',
|
|
2106
|
+
responseType: 'blob'
|
|
2107
|
+
},
|
|
2108
|
+
options);
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
export const getSubscriptionExpireDiscountCouponSubscriptionMutationOptions = <TError = void,
|
|
2114
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionExpireDiscountCouponSubscription>>, TError,{subscriptionUid: string | null;discountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2115
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionExpireDiscountCouponSubscription>>, TError,{subscriptionUid: string | null;discountUid: string | null}, TContext> => {
|
|
2116
|
+
|
|
2117
|
+
const mutationKey = ['subscriptionExpireDiscountCouponSubscription'];
|
|
2118
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
2119
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2120
|
+
options
|
|
2121
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
2122
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
2123
|
+
|
|
2124
|
+
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionExpireDiscountCouponSubscription>>, {subscriptionUid: string | null;discountUid: string | null}> = (props) => {
|
|
2128
|
+
const {subscriptionUid,discountUid} = props ?? {};
|
|
2129
|
+
|
|
2130
|
+
return subscriptionExpireDiscountCouponSubscription(subscriptionUid,discountUid,requestOptions)
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
|
|
2134
|
+
|
|
2135
|
+
|
|
2136
|
+
return { mutationFn, ...mutationOptions }}
|
|
2137
|
+
|
|
2138
|
+
export type SubscriptionExpireDiscountCouponSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionExpireDiscountCouponSubscription>>>
|
|
2139
|
+
|
|
2140
|
+
export type SubscriptionExpireDiscountCouponSubscriptionMutationError = void
|
|
2141
|
+
|
|
2142
|
+
/**
|
|
2143
|
+
* @summary Remove a discount from a subscription.
|
|
2144
|
+
*/
|
|
2145
|
+
export const useSubscriptionExpireDiscountCouponSubscription = <TError = void,
|
|
2146
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionExpireDiscountCouponSubscription>>, TError,{subscriptionUid: string | null;discountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2147
|
+
): UseMutationResult<
|
|
2148
|
+
Awaited<ReturnType<typeof subscriptionExpireDiscountCouponSubscription>>,
|
|
2149
|
+
TError,
|
|
2150
|
+
{subscriptionUid: string | null;discountUid: string | null},
|
|
2151
|
+
TContext
|
|
2152
|
+
> => {
|
|
2153
|
+
|
|
2154
|
+
const mutationOptions = getSubscriptionExpireDiscountCouponSubscriptionMutationOptions(options);
|
|
2155
|
+
|
|
2156
|
+
return useMutation(mutationOptions);
|
|
2157
|
+
}
|
|
2158
|
+
/**
|
|
2159
|
+
* When a subscription is flagged, next time the user authenticates the authentication
|
|
2160
|
+
widget will prompt the user to change plan.
|
|
2161
|
+
* @summary Indicate that an upgrade of plan is required.
|
|
2162
|
+
*/
|
|
2163
|
+
export const subscriptionSetSubscriptionUpgradeRequired = (
|
|
2164
|
+
subscriptionUid: string | null,
|
|
2165
|
+
subscriptionSetSubscriptionUpgradeRequiredBody: NonReadonly<SubscriptionSetSubscriptionUpgradeRequiredBody>,
|
|
2166
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
2167
|
+
|
|
2168
|
+
|
|
2169
|
+
return customFetch<Subscription>(
|
|
2170
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}/setsubscriptionupgraderequired`, method: 'PUT',
|
|
2171
|
+
headers: {'Content-Type': 'application/json', },
|
|
2172
|
+
data: subscriptionSetSubscriptionUpgradeRequiredBody
|
|
2173
|
+
},
|
|
2174
|
+
options);
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
|
|
2178
|
+
|
|
2179
|
+
export const getSubscriptionSetSubscriptionUpgradeRequiredMutationOptions = <TError = void,
|
|
2180
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>, TError,{subscriptionUid: string | null;data: NonReadonly<SubscriptionSetSubscriptionUpgradeRequiredBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2181
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>, TError,{subscriptionUid: string | null;data: NonReadonly<SubscriptionSetSubscriptionUpgradeRequiredBody>}, TContext> => {
|
|
2182
|
+
|
|
2183
|
+
const mutationKey = ['subscriptionSetSubscriptionUpgradeRequired'];
|
|
2184
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
2185
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2186
|
+
options
|
|
2187
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
2188
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
2189
|
+
|
|
2190
|
+
|
|
2191
|
+
|
|
2192
|
+
|
|
2193
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>, {subscriptionUid: string | null;data: NonReadonly<SubscriptionSetSubscriptionUpgradeRequiredBody>}> = (props) => {
|
|
2194
|
+
const {subscriptionUid,data} = props ?? {};
|
|
2195
|
+
|
|
2196
|
+
return subscriptionSetSubscriptionUpgradeRequired(subscriptionUid,data,requestOptions)
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
|
|
2200
|
+
|
|
2201
|
+
|
|
2202
|
+
return { mutationFn, ...mutationOptions }}
|
|
2203
|
+
|
|
2204
|
+
export type SubscriptionSetSubscriptionUpgradeRequiredMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>>
|
|
2205
|
+
export type SubscriptionSetSubscriptionUpgradeRequiredMutationBody = NonReadonly<SubscriptionSetSubscriptionUpgradeRequiredBody>
|
|
2206
|
+
export type SubscriptionSetSubscriptionUpgradeRequiredMutationError = void
|
|
2207
|
+
|
|
2208
|
+
/**
|
|
2209
|
+
* @summary Indicate that an upgrade of plan is required.
|
|
2210
|
+
*/
|
|
2211
|
+
export const useSubscriptionSetSubscriptionUpgradeRequired = <TError = void,
|
|
2212
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>, TError,{subscriptionUid: string | null;data: NonReadonly<SubscriptionSetSubscriptionUpgradeRequiredBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2213
|
+
): UseMutationResult<
|
|
2214
|
+
Awaited<ReturnType<typeof subscriptionSetSubscriptionUpgradeRequired>>,
|
|
2215
|
+
TError,
|
|
2216
|
+
{subscriptionUid: string | null;data: NonReadonly<SubscriptionSetSubscriptionUpgradeRequiredBody>},
|
|
2217
|
+
TContext
|
|
2218
|
+
> => {
|
|
2219
|
+
|
|
2220
|
+
const mutationOptions = getSubscriptionSetSubscriptionUpgradeRequiredMutationOptions(options);
|
|
2221
|
+
|
|
2222
|
+
return useMutation(mutationOptions);
|
|
2223
|
+
}
|
|
2224
|
+
/**
|
|
2225
|
+
* Returns an invoice object with information about the amount outstanding if an account
|
|
2226
|
+
were to register with this subscription. BillingRenewalTerm values: 1 = Monthly,
|
|
2227
|
+
2 = Yearly, 3 = Quarterly, 4 = OneTime. Pass asOf=renewal to see the renewal invoice
|
|
2228
|
+
instead of the initial invoice.
|
|
2229
|
+
* @summary Preview the initial or renewal invoice for a hypothetical subscription.
|
|
2230
|
+
*/
|
|
2231
|
+
export const subscriptionFirstTimeSubscriptionPreview = (
|
|
2232
|
+
subscriptionFirstTimeSubscriptionPreviewBody: NonReadonly<SubscriptionFirstTimeSubscriptionPreviewBody>,
|
|
2233
|
+
params?: SubscriptionFirstTimeSubscriptionPreviewParams,
|
|
2234
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
2235
|
+
) => {
|
|
2236
|
+
|
|
2237
|
+
|
|
2238
|
+
return customFetch<Invoice>(
|
|
2239
|
+
{url: `/api/v1/billing/subscriptions/compute-charge-summary`, method: 'POST',
|
|
2240
|
+
headers: {'Content-Type': 'application/json', },
|
|
2241
|
+
data: subscriptionFirstTimeSubscriptionPreviewBody,
|
|
2242
|
+
params, signal
|
|
2243
|
+
},
|
|
2244
|
+
options);
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
export const getSubscriptionFirstTimeSubscriptionPreviewMutationOptions = <TError = unknown,
|
|
2250
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>, TError,{data: NonReadonly<SubscriptionFirstTimeSubscriptionPreviewBody>;params?: SubscriptionFirstTimeSubscriptionPreviewParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2251
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>, TError,{data: NonReadonly<SubscriptionFirstTimeSubscriptionPreviewBody>;params?: SubscriptionFirstTimeSubscriptionPreviewParams}, TContext> => {
|
|
2252
|
+
|
|
2253
|
+
const mutationKey = ['subscriptionFirstTimeSubscriptionPreview'];
|
|
2254
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
2255
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2256
|
+
options
|
|
2257
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
2258
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
2259
|
+
|
|
2260
|
+
|
|
2261
|
+
|
|
2262
|
+
|
|
2263
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>, {data: NonReadonly<SubscriptionFirstTimeSubscriptionPreviewBody>;params?: SubscriptionFirstTimeSubscriptionPreviewParams}> = (props) => {
|
|
2264
|
+
const {data,params} = props ?? {};
|
|
2265
|
+
|
|
2266
|
+
return subscriptionFirstTimeSubscriptionPreview(data,params,requestOptions)
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
|
|
2270
|
+
|
|
2271
|
+
|
|
2272
|
+
return { mutationFn, ...mutationOptions }}
|
|
2273
|
+
|
|
2274
|
+
export type SubscriptionFirstTimeSubscriptionPreviewMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>>
|
|
2275
|
+
export type SubscriptionFirstTimeSubscriptionPreviewMutationBody = NonReadonly<SubscriptionFirstTimeSubscriptionPreviewBody>
|
|
2276
|
+
export type SubscriptionFirstTimeSubscriptionPreviewMutationError = unknown
|
|
2277
|
+
|
|
2278
|
+
/**
|
|
2279
|
+
* @summary Preview the initial or renewal invoice for a hypothetical subscription.
|
|
2280
|
+
*/
|
|
2281
|
+
export const useSubscriptionFirstTimeSubscriptionPreview = <TError = unknown,
|
|
2282
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>, TError,{data: NonReadonly<SubscriptionFirstTimeSubscriptionPreviewBody>;params?: SubscriptionFirstTimeSubscriptionPreviewParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2283
|
+
): UseMutationResult<
|
|
2284
|
+
Awaited<ReturnType<typeof subscriptionFirstTimeSubscriptionPreview>>,
|
|
2285
|
+
TError,
|
|
2286
|
+
{data: NonReadonly<SubscriptionFirstTimeSubscriptionPreviewBody>;params?: SubscriptionFirstTimeSubscriptionPreviewParams},
|
|
2287
|
+
TContext
|
|
2288
|
+
> => {
|
|
2289
|
+
|
|
2290
|
+
const mutationOptions = getSubscriptionFirstTimeSubscriptionPreviewMutationOptions(options);
|
|
2291
|
+
|
|
2292
|
+
return useMutation(mutationOptions);
|
|
2293
|
+
}
|
|
2294
|
+
/**
|
|
2295
|
+
* Returns an invoice object with information about the amount outstanding.
|
|
2296
|
+
* @summary Add a subscription to an account for the first time.
|
|
2297
|
+
*/
|
|
2298
|
+
export const subscriptionFirstTimeSubscription = (
|
|
2299
|
+
subscriptionFirstTimeSubscriptionBody: NonReadonly<SubscriptionFirstTimeSubscriptionBody>,
|
|
2300
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
2301
|
+
|
|
2302
|
+
|
|
2303
|
+
return customFetch<Invoice>(
|
|
2304
|
+
{url: `/api/v1/billing/subscriptions/firsttimesubscription`, method: 'PUT',
|
|
2305
|
+
headers: {'Content-Type': 'application/json', },
|
|
2306
|
+
data: subscriptionFirstTimeSubscriptionBody
|
|
2307
|
+
},
|
|
2308
|
+
options);
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
|
|
2312
|
+
|
|
2313
|
+
export const getSubscriptionFirstTimeSubscriptionMutationOptions = <TError = void,
|
|
2314
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>, TError,{data: NonReadonly<SubscriptionFirstTimeSubscriptionBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2315
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>, TError,{data: NonReadonly<SubscriptionFirstTimeSubscriptionBody>}, TContext> => {
|
|
2316
|
+
|
|
2317
|
+
const mutationKey = ['subscriptionFirstTimeSubscription'];
|
|
2318
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
2319
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2320
|
+
options
|
|
2321
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
2322
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
2323
|
+
|
|
2324
|
+
|
|
2325
|
+
|
|
2326
|
+
|
|
2327
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>, {data: NonReadonly<SubscriptionFirstTimeSubscriptionBody>}> = (props) => {
|
|
2328
|
+
const {data} = props ?? {};
|
|
2329
|
+
|
|
2330
|
+
return subscriptionFirstTimeSubscription(data,requestOptions)
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
|
|
2336
|
+
return { mutationFn, ...mutationOptions }}
|
|
2337
|
+
|
|
2338
|
+
export type SubscriptionFirstTimeSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>>
|
|
2339
|
+
export type SubscriptionFirstTimeSubscriptionMutationBody = NonReadonly<SubscriptionFirstTimeSubscriptionBody>
|
|
2340
|
+
export type SubscriptionFirstTimeSubscriptionMutationError = void
|
|
2341
|
+
|
|
2342
|
+
/**
|
|
2343
|
+
* @summary Add a subscription to an account for the first time.
|
|
2344
|
+
*/
|
|
2345
|
+
export const useSubscriptionFirstTimeSubscription = <TError = void,
|
|
2346
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>, TError,{data: NonReadonly<SubscriptionFirstTimeSubscriptionBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2347
|
+
): UseMutationResult<
|
|
2348
|
+
Awaited<ReturnType<typeof subscriptionFirstTimeSubscription>>,
|
|
2349
|
+
TError,
|
|
2350
|
+
{data: NonReadonly<SubscriptionFirstTimeSubscriptionBody>},
|
|
2351
|
+
TContext
|
|
2352
|
+
> => {
|
|
2353
|
+
|
|
2354
|
+
const mutationOptions = getSubscriptionFirstTimeSubscriptionMutationOptions(options);
|
|
2355
|
+
|
|
2356
|
+
return useMutation(mutationOptions);
|
|
2357
|
+
}
|
|
2358
|
+
/**
|
|
2359
|
+
* Returns an invoice object with information about the amount outstanding. This method
|
|
2360
|
+
does not commit the subscription change.
|
|
2361
|
+
* @summary Preview the invoice for a subscription change.
|
|
2362
|
+
*/
|
|
2363
|
+
export const subscriptionChangeSubscriptionPreview = (
|
|
2364
|
+
subscriptionUid: string | null,
|
|
2365
|
+
subscriptionChangeSubscriptionPreviewBody: NonReadonly<SubscriptionChangeSubscriptionPreviewBody>,
|
|
2366
|
+
params?: SubscriptionChangeSubscriptionPreviewParams,
|
|
2367
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
2368
|
+
|
|
2369
|
+
|
|
1348
2370
|
return customFetch<Invoice>(
|
|
1349
2371
|
{url: `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscriptionpreview`, method: 'PUT',
|
|
1350
2372
|
headers: {'Content-Type': 'application/json', },
|
|
1351
|
-
data: subscriptionChangeSubscriptionPreviewBody,
|
|
1352
|
-
params
|
|
2373
|
+
data: subscriptionChangeSubscriptionPreviewBody,
|
|
2374
|
+
params
|
|
2375
|
+
},
|
|
2376
|
+
options);
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
|
|
2380
|
+
|
|
2381
|
+
export const getSubscriptionChangeSubscriptionPreviewMutationOptions = <TError = void,
|
|
2382
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>, TError,{subscriptionUid: string | null;data: NonReadonly<SubscriptionChangeSubscriptionPreviewBody>;params?: SubscriptionChangeSubscriptionPreviewParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2383
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>, TError,{subscriptionUid: string | null;data: NonReadonly<SubscriptionChangeSubscriptionPreviewBody>;params?: SubscriptionChangeSubscriptionPreviewParams}, TContext> => {
|
|
2384
|
+
|
|
2385
|
+
const mutationKey = ['subscriptionChangeSubscriptionPreview'];
|
|
2386
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
2387
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2388
|
+
options
|
|
2389
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
2390
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
2391
|
+
|
|
2392
|
+
|
|
2393
|
+
|
|
2394
|
+
|
|
2395
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>, {subscriptionUid: string | null;data: NonReadonly<SubscriptionChangeSubscriptionPreviewBody>;params?: SubscriptionChangeSubscriptionPreviewParams}> = (props) => {
|
|
2396
|
+
const {subscriptionUid,data,params} = props ?? {};
|
|
2397
|
+
|
|
2398
|
+
return subscriptionChangeSubscriptionPreview(subscriptionUid,data,params,requestOptions)
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
|
|
2402
|
+
|
|
2403
|
+
|
|
2404
|
+
return { mutationFn, ...mutationOptions }}
|
|
2405
|
+
|
|
2406
|
+
export type SubscriptionChangeSubscriptionPreviewMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>>
|
|
2407
|
+
export type SubscriptionChangeSubscriptionPreviewMutationBody = NonReadonly<SubscriptionChangeSubscriptionPreviewBody>
|
|
2408
|
+
export type SubscriptionChangeSubscriptionPreviewMutationError = void
|
|
2409
|
+
|
|
2410
|
+
/**
|
|
2411
|
+
* @summary Preview the invoice for a subscription change.
|
|
2412
|
+
*/
|
|
2413
|
+
export const useSubscriptionChangeSubscriptionPreview = <TError = void,
|
|
2414
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>, TError,{subscriptionUid: string | null;data: NonReadonly<SubscriptionChangeSubscriptionPreviewBody>;params?: SubscriptionChangeSubscriptionPreviewParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2415
|
+
): UseMutationResult<
|
|
2416
|
+
Awaited<ReturnType<typeof subscriptionChangeSubscriptionPreview>>,
|
|
2417
|
+
TError,
|
|
2418
|
+
{subscriptionUid: string | null;data: NonReadonly<SubscriptionChangeSubscriptionPreviewBody>;params?: SubscriptionChangeSubscriptionPreviewParams},
|
|
2419
|
+
TContext
|
|
2420
|
+
> => {
|
|
2421
|
+
|
|
2422
|
+
const mutationOptions = getSubscriptionChangeSubscriptionPreviewMutationOptions(options);
|
|
2423
|
+
|
|
2424
|
+
return useMutation(mutationOptions);
|
|
2425
|
+
}
|
|
2426
|
+
/**
|
|
2427
|
+
* Returns an invoice object with information about the amount outstanding.
|
|
2428
|
+
* @summary Change a subscription on an account.
|
|
2429
|
+
*/
|
|
2430
|
+
export const subscriptionChangeSubscription = (
|
|
2431
|
+
subscriptionUid: string | null,
|
|
2432
|
+
subscriptionChangeSubscriptionBody: NonReadonly<SubscriptionChangeSubscriptionBody>,
|
|
2433
|
+
params?: SubscriptionChangeSubscriptionParams,
|
|
2434
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
2435
|
+
|
|
2436
|
+
|
|
2437
|
+
return customFetch<Subscription>(
|
|
2438
|
+
{url: `/api/v1/billing/subscriptions/${subscriptionUid}/changesubscription`, method: 'PUT',
|
|
2439
|
+
headers: {'Content-Type': 'application/json', },
|
|
2440
|
+
data: subscriptionChangeSubscriptionBody,
|
|
2441
|
+
params
|
|
2442
|
+
},
|
|
2443
|
+
options);
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
|
|
2447
|
+
|
|
2448
|
+
export const getSubscriptionChangeSubscriptionMutationOptions = <TError = void,
|
|
2449
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscription>>, TError,{subscriptionUid: string | null;data: NonReadonly<SubscriptionChangeSubscriptionBody>;params?: SubscriptionChangeSubscriptionParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2450
|
+
): UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscription>>, TError,{subscriptionUid: string | null;data: NonReadonly<SubscriptionChangeSubscriptionBody>;params?: SubscriptionChangeSubscriptionParams}, TContext> => {
|
|
2451
|
+
|
|
2452
|
+
const mutationKey = ['subscriptionChangeSubscription'];
|
|
2453
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
2454
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2455
|
+
options
|
|
2456
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
2457
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
2458
|
+
|
|
2459
|
+
|
|
2460
|
+
|
|
2461
|
+
|
|
2462
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof subscriptionChangeSubscription>>, {subscriptionUid: string | null;data: NonReadonly<SubscriptionChangeSubscriptionBody>;params?: SubscriptionChangeSubscriptionParams}> = (props) => {
|
|
2463
|
+
const {subscriptionUid,data,params} = props ?? {};
|
|
2464
|
+
|
|
2465
|
+
return subscriptionChangeSubscription(subscriptionUid,data,params,requestOptions)
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
|
|
2469
|
+
|
|
2470
|
+
|
|
2471
|
+
return { mutationFn, ...mutationOptions }}
|
|
2472
|
+
|
|
2473
|
+
export type SubscriptionChangeSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof subscriptionChangeSubscription>>>
|
|
2474
|
+
export type SubscriptionChangeSubscriptionMutationBody = NonReadonly<SubscriptionChangeSubscriptionBody>
|
|
2475
|
+
export type SubscriptionChangeSubscriptionMutationError = void
|
|
2476
|
+
|
|
2477
|
+
/**
|
|
2478
|
+
* @summary Change a subscription on an account.
|
|
2479
|
+
*/
|
|
2480
|
+
export const useSubscriptionChangeSubscription = <TError = void,
|
|
2481
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof subscriptionChangeSubscription>>, TError,{subscriptionUid: string | null;data: NonReadonly<SubscriptionChangeSubscriptionBody>;params?: SubscriptionChangeSubscriptionParams}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2482
|
+
): UseMutationResult<
|
|
2483
|
+
Awaited<ReturnType<typeof subscriptionChangeSubscription>>,
|
|
2484
|
+
TError,
|
|
2485
|
+
{subscriptionUid: string | null;data: NonReadonly<SubscriptionChangeSubscriptionBody>;params?: SubscriptionChangeSubscriptionParams},
|
|
2486
|
+
TContext
|
|
2487
|
+
> => {
|
|
2488
|
+
|
|
2489
|
+
const mutationOptions = getSubscriptionChangeSubscriptionMutationOptions(options);
|
|
2490
|
+
|
|
2491
|
+
return useMutation(mutationOptions);
|
|
2492
|
+
}
|
|
2493
|
+
/**
|
|
2494
|
+
* @summary Retrieve all plans.
|
|
2495
|
+
*/
|
|
2496
|
+
export const planGetAllPlans = (
|
|
2497
|
+
|
|
2498
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
2499
|
+
) => {
|
|
2500
|
+
|
|
2501
|
+
|
|
2502
|
+
return customFetch<Plan[]>(
|
|
2503
|
+
{url: `/api/v1/billing/plans`, method: 'GET', signal
|
|
2504
|
+
},
|
|
2505
|
+
options);
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
|
|
2509
|
+
|
|
2510
|
+
|
|
2511
|
+
export const getPlanGetAllPlansQueryKey = () => {
|
|
2512
|
+
return [
|
|
2513
|
+
`/api/v1/billing/plans`
|
|
2514
|
+
] as const;
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
|
|
2518
|
+
export const getPlanGetAllPlansQueryOptions = <TData = Awaited<ReturnType<typeof planGetAllPlans>>, TError = unknown>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planGetAllPlans>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
2519
|
+
) => {
|
|
2520
|
+
|
|
2521
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
2522
|
+
|
|
2523
|
+
const queryKey = queryOptions?.queryKey ?? getPlanGetAllPlansQueryKey();
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
|
|
2527
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof planGetAllPlans>>> = ({ signal }) => planGetAllPlans(requestOptions, signal);
|
|
2528
|
+
|
|
2529
|
+
|
|
2530
|
+
|
|
2531
|
+
|
|
2532
|
+
|
|
2533
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof planGetAllPlans>>, TError, TData> & { queryKey: QueryKey }
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
export type PlanGetAllPlansQueryResult = NonNullable<Awaited<ReturnType<typeof planGetAllPlans>>>
|
|
2537
|
+
export type PlanGetAllPlansQueryError = unknown
|
|
2538
|
+
|
|
2539
|
+
|
|
2540
|
+
/**
|
|
2541
|
+
* @summary Retrieve all plans.
|
|
2542
|
+
*/
|
|
2543
|
+
|
|
2544
|
+
export function usePlanGetAllPlans<TData = Awaited<ReturnType<typeof planGetAllPlans>>, TError = unknown>(
|
|
2545
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planGetAllPlans>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
2546
|
+
|
|
2547
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
2548
|
+
|
|
2549
|
+
const queryOptions = getPlanGetAllPlansQueryOptions(options)
|
|
2550
|
+
|
|
2551
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
2552
|
+
|
|
2553
|
+
query.queryKey = queryOptions.queryKey ;
|
|
2554
|
+
|
|
2555
|
+
return query;
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
|
|
2559
|
+
|
|
2560
|
+
|
|
2561
|
+
/**
|
|
2562
|
+
* @summary Add a new plan.
|
|
2563
|
+
*/
|
|
2564
|
+
export const planAddPlan = (
|
|
2565
|
+
planAddPlanBody: NonReadonly<PlanAddPlanBody>,
|
|
2566
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
2567
|
+
) => {
|
|
2568
|
+
|
|
2569
|
+
|
|
2570
|
+
return customFetch<Plan>(
|
|
2571
|
+
{url: `/api/v1/billing/plans`, method: 'POST',
|
|
2572
|
+
headers: {'Content-Type': 'application/json', },
|
|
2573
|
+
data: planAddPlanBody, signal
|
|
2574
|
+
},
|
|
2575
|
+
options);
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
|
|
2579
|
+
|
|
2580
|
+
export const getPlanAddPlanMutationOptions = <TError = void,
|
|
2581
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planAddPlan>>, TError,{data: NonReadonly<PlanAddPlanBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2582
|
+
): UseMutationOptions<Awaited<ReturnType<typeof planAddPlan>>, TError,{data: NonReadonly<PlanAddPlanBody>}, TContext> => {
|
|
2583
|
+
|
|
2584
|
+
const mutationKey = ['planAddPlan'];
|
|
2585
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
2586
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2587
|
+
options
|
|
2588
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
2589
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
2590
|
+
|
|
2591
|
+
|
|
2592
|
+
|
|
2593
|
+
|
|
2594
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof planAddPlan>>, {data: NonReadonly<PlanAddPlanBody>}> = (props) => {
|
|
2595
|
+
const {data} = props ?? {};
|
|
2596
|
+
|
|
2597
|
+
return planAddPlan(data,requestOptions)
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
|
|
2601
|
+
|
|
2602
|
+
|
|
2603
|
+
return { mutationFn, ...mutationOptions }}
|
|
2604
|
+
|
|
2605
|
+
export type PlanAddPlanMutationResult = NonNullable<Awaited<ReturnType<typeof planAddPlan>>>
|
|
2606
|
+
export type PlanAddPlanMutationBody = NonReadonly<PlanAddPlanBody>
|
|
2607
|
+
export type PlanAddPlanMutationError = void
|
|
2608
|
+
|
|
2609
|
+
/**
|
|
2610
|
+
* @summary Add a new plan.
|
|
2611
|
+
*/
|
|
2612
|
+
export const usePlanAddPlan = <TError = void,
|
|
2613
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planAddPlan>>, TError,{data: NonReadonly<PlanAddPlanBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2614
|
+
): UseMutationResult<
|
|
2615
|
+
Awaited<ReturnType<typeof planAddPlan>>,
|
|
2616
|
+
TError,
|
|
2617
|
+
{data: NonReadonly<PlanAddPlanBody>},
|
|
2618
|
+
TContext
|
|
2619
|
+
> => {
|
|
2620
|
+
|
|
2621
|
+
const mutationOptions = getPlanAddPlanMutationOptions(options);
|
|
2622
|
+
|
|
2623
|
+
return useMutation(mutationOptions);
|
|
2624
|
+
}
|
|
2625
|
+
/**
|
|
2626
|
+
* @summary Retrieve a plan.
|
|
2627
|
+
*/
|
|
2628
|
+
export const planGetPlan = (
|
|
2629
|
+
planUid: string | null,
|
|
2630
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
2631
|
+
) => {
|
|
2632
|
+
|
|
2633
|
+
|
|
2634
|
+
return customFetch<Plan>(
|
|
2635
|
+
{url: `/api/v1/billing/plans/${planUid}`, method: 'GET', signal
|
|
2636
|
+
},
|
|
2637
|
+
options);
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
|
|
2641
|
+
|
|
2642
|
+
|
|
2643
|
+
export const getPlanGetPlanQueryKey = (planUid?: string | null,) => {
|
|
2644
|
+
return [
|
|
2645
|
+
`/api/v1/billing/plans/${planUid}`
|
|
2646
|
+
] as const;
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
|
|
2650
|
+
export const getPlanGetPlanQueryOptions = <TData = Awaited<ReturnType<typeof planGetPlan>>, TError = void>(planUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planGetPlan>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
2651
|
+
) => {
|
|
2652
|
+
|
|
2653
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
2654
|
+
|
|
2655
|
+
const queryKey = queryOptions?.queryKey ?? getPlanGetPlanQueryKey(planUid);
|
|
2656
|
+
|
|
2657
|
+
|
|
2658
|
+
|
|
2659
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof planGetPlan>>> = ({ signal }) => planGetPlan(planUid, requestOptions, signal);
|
|
2660
|
+
|
|
2661
|
+
|
|
2662
|
+
|
|
2663
|
+
|
|
2664
|
+
|
|
2665
|
+
return { queryKey, queryFn, enabled: !!(planUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof planGetPlan>>, TError, TData> & { queryKey: QueryKey }
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
export type PlanGetPlanQueryResult = NonNullable<Awaited<ReturnType<typeof planGetPlan>>>
|
|
2669
|
+
export type PlanGetPlanQueryError = void
|
|
2670
|
+
|
|
2671
|
+
|
|
2672
|
+
/**
|
|
2673
|
+
* @summary Retrieve a plan.
|
|
2674
|
+
*/
|
|
2675
|
+
|
|
2676
|
+
export function usePlanGetPlan<TData = Awaited<ReturnType<typeof planGetPlan>>, TError = void>(
|
|
2677
|
+
planUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planGetPlan>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
2678
|
+
|
|
2679
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
2680
|
+
|
|
2681
|
+
const queryOptions = getPlanGetPlanQueryOptions(planUid,options)
|
|
2682
|
+
|
|
2683
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
2684
|
+
|
|
2685
|
+
query.queryKey = queryOptions.queryKey ;
|
|
2686
|
+
|
|
2687
|
+
return query;
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
|
|
2691
|
+
|
|
2692
|
+
|
|
2693
|
+
/**
|
|
2694
|
+
* @summary Update a plan.
|
|
2695
|
+
*/
|
|
2696
|
+
export const planUpdatePlan = (
|
|
2697
|
+
planUid: string | null,
|
|
2698
|
+
planUpdatePlanBody: NonReadonly<PlanUpdatePlanBody>,
|
|
2699
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
2700
|
+
|
|
2701
|
+
|
|
2702
|
+
return customFetch<Plan>(
|
|
2703
|
+
{url: `/api/v1/billing/plans/${planUid}`, method: 'PUT',
|
|
2704
|
+
headers: {'Content-Type': 'application/json', },
|
|
2705
|
+
data: planUpdatePlanBody
|
|
1353
2706
|
},
|
|
1354
2707
|
options);
|
|
1355
2708
|
}
|
|
1356
2709
|
|
|
1357
2710
|
|
|
1358
2711
|
|
|
1359
|
-
export const
|
|
1360
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
1361
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
2712
|
+
export const getPlanUpdatePlanMutationOptions = <TError = void,
|
|
2713
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planUpdatePlan>>, TError,{planUid: string | null;data: NonReadonly<PlanUpdatePlanBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2714
|
+
): UseMutationOptions<Awaited<ReturnType<typeof planUpdatePlan>>, TError,{planUid: string | null;data: NonReadonly<PlanUpdatePlanBody>}, TContext> => {
|
|
1362
2715
|
|
|
1363
|
-
const mutationKey = ['
|
|
2716
|
+
const mutationKey = ['planUpdatePlan'];
|
|
1364
2717
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1365
2718
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1366
2719
|
options
|
|
@@ -1370,10 +2723,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1370
2723
|
|
|
1371
2724
|
|
|
1372
2725
|
|
|
1373
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
1374
|
-
const {
|
|
2726
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof planUpdatePlan>>, {planUid: string | null;data: NonReadonly<PlanUpdatePlanBody>}> = (props) => {
|
|
2727
|
+
const {planUid,data} = props ?? {};
|
|
1375
2728
|
|
|
1376
|
-
return
|
|
2729
|
+
return planUpdatePlan(planUid,data,requestOptions)
|
|
1377
2730
|
}
|
|
1378
2731
|
|
|
1379
2732
|
|
|
@@ -1381,53 +2734,48 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1381
2734
|
|
|
1382
2735
|
return { mutationFn, ...mutationOptions }}
|
|
1383
2736
|
|
|
1384
|
-
export type
|
|
1385
|
-
export type
|
|
1386
|
-
export type
|
|
2737
|
+
export type PlanUpdatePlanMutationResult = NonNullable<Awaited<ReturnType<typeof planUpdatePlan>>>
|
|
2738
|
+
export type PlanUpdatePlanMutationBody = NonReadonly<PlanUpdatePlanBody>
|
|
2739
|
+
export type PlanUpdatePlanMutationError = void
|
|
1387
2740
|
|
|
1388
2741
|
/**
|
|
1389
|
-
* @summary
|
|
2742
|
+
* @summary Update a plan.
|
|
1390
2743
|
*/
|
|
1391
|
-
export const
|
|
1392
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
2744
|
+
export const usePlanUpdatePlan = <TError = void,
|
|
2745
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planUpdatePlan>>, TError,{planUid: string | null;data: NonReadonly<PlanUpdatePlanBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1393
2746
|
): UseMutationResult<
|
|
1394
|
-
Awaited<ReturnType<typeof
|
|
2747
|
+
Awaited<ReturnType<typeof planUpdatePlan>>,
|
|
1395
2748
|
TError,
|
|
1396
|
-
{
|
|
2749
|
+
{planUid: string | null;data: NonReadonly<PlanUpdatePlanBody>},
|
|
1397
2750
|
TContext
|
|
1398
2751
|
> => {
|
|
1399
2752
|
|
|
1400
|
-
const mutationOptions =
|
|
2753
|
+
const mutationOptions = getPlanUpdatePlanMutationOptions(options);
|
|
1401
2754
|
|
|
1402
2755
|
return useMutation(mutationOptions);
|
|
1403
2756
|
}
|
|
1404
2757
|
/**
|
|
1405
|
-
*
|
|
1406
|
-
* @summary Change a subscription on an account.
|
|
2758
|
+
* @summary Delete a plan.
|
|
1407
2759
|
*/
|
|
1408
|
-
export const
|
|
1409
|
-
|
|
1410
|
-
subscriptionChangeSubscriptionBody: NonReadonly<SubscriptionChangeSubscriptionBody>,
|
|
1411
|
-
params?: SubscriptionChangeSubscriptionParams,
|
|
2760
|
+
export const planDeletePlan = (
|
|
2761
|
+
planUid: string | null,
|
|
1412
2762
|
options?: SecondParameter<typeof customFetch>,) => {
|
|
1413
2763
|
|
|
1414
2764
|
|
|
1415
|
-
return customFetch<
|
|
1416
|
-
{url: `/api/v1/billing/
|
|
1417
|
-
|
|
1418
|
-
data: subscriptionChangeSubscriptionBody,
|
|
1419
|
-
params
|
|
2765
|
+
return customFetch<Blob>(
|
|
2766
|
+
{url: `/api/v1/billing/plans/${planUid}`, method: 'DELETE',
|
|
2767
|
+
responseType: 'blob'
|
|
1420
2768
|
},
|
|
1421
2769
|
options);
|
|
1422
2770
|
}
|
|
1423
2771
|
|
|
1424
2772
|
|
|
1425
2773
|
|
|
1426
|
-
export const
|
|
1427
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
1428
|
-
): UseMutationOptions<Awaited<ReturnType<typeof
|
|
2774
|
+
export const getPlanDeletePlanMutationOptions = <TError = void,
|
|
2775
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planDeletePlan>>, TError,{planUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2776
|
+
): UseMutationOptions<Awaited<ReturnType<typeof planDeletePlan>>, TError,{planUid: string | null}, TContext> => {
|
|
1429
2777
|
|
|
1430
|
-
const mutationKey = ['
|
|
2778
|
+
const mutationKey = ['planDeletePlan'];
|
|
1431
2779
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1432
2780
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1433
2781
|
options
|
|
@@ -1437,10 +2785,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1437
2785
|
|
|
1438
2786
|
|
|
1439
2787
|
|
|
1440
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof
|
|
1441
|
-
const {
|
|
2788
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof planDeletePlan>>, {planUid: string | null}> = (props) => {
|
|
2789
|
+
const {planUid} = props ?? {};
|
|
1442
2790
|
|
|
1443
|
-
return
|
|
2791
|
+
return planDeletePlan(planUid,requestOptions)
|
|
1444
2792
|
}
|
|
1445
2793
|
|
|
1446
2794
|
|
|
@@ -1448,37 +2796,37 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
|
1448
2796
|
|
|
1449
2797
|
return { mutationFn, ...mutationOptions }}
|
|
1450
2798
|
|
|
1451
|
-
export type
|
|
1452
|
-
|
|
1453
|
-
export type
|
|
2799
|
+
export type PlanDeletePlanMutationResult = NonNullable<Awaited<ReturnType<typeof planDeletePlan>>>
|
|
2800
|
+
|
|
2801
|
+
export type PlanDeletePlanMutationError = void
|
|
1454
2802
|
|
|
1455
2803
|
/**
|
|
1456
|
-
* @summary
|
|
2804
|
+
* @summary Delete a plan.
|
|
1457
2805
|
*/
|
|
1458
|
-
export const
|
|
1459
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof
|
|
2806
|
+
export const usePlanDeletePlan = <TError = void,
|
|
2807
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planDeletePlan>>, TError,{planUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
1460
2808
|
): UseMutationResult<
|
|
1461
|
-
Awaited<ReturnType<typeof
|
|
2809
|
+
Awaited<ReturnType<typeof planDeletePlan>>,
|
|
1462
2810
|
TError,
|
|
1463
|
-
{
|
|
2811
|
+
{planUid: string | null},
|
|
1464
2812
|
TContext
|
|
1465
2813
|
> => {
|
|
1466
2814
|
|
|
1467
|
-
const mutationOptions =
|
|
2815
|
+
const mutationOptions = getPlanDeletePlanMutationOptions(options);
|
|
1468
2816
|
|
|
1469
2817
|
return useMutation(mutationOptions);
|
|
1470
2818
|
}
|
|
1471
2819
|
/**
|
|
1472
|
-
* @summary
|
|
2820
|
+
* @summary Retrieve all plan families.
|
|
1473
2821
|
*/
|
|
1474
|
-
export const
|
|
2822
|
+
export const planFamilyGetAllPlanFamilies = (
|
|
1475
2823
|
|
|
1476
2824
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1477
2825
|
) => {
|
|
1478
2826
|
|
|
1479
2827
|
|
|
1480
|
-
return customFetch<
|
|
1481
|
-
{url: `/api/v1/billing/
|
|
2828
|
+
return customFetch<PlanFamily[]>(
|
|
2829
|
+
{url: `/api/v1/billing/planfamilies`, method: 'GET', signal
|
|
1482
2830
|
},
|
|
1483
2831
|
options);
|
|
1484
2832
|
}
|
|
@@ -1486,45 +2834,45 @@ export const planGetAllPlans = (
|
|
|
1486
2834
|
|
|
1487
2835
|
|
|
1488
2836
|
|
|
1489
|
-
export const
|
|
2837
|
+
export const getPlanFamilyGetAllPlanFamiliesQueryKey = () => {
|
|
1490
2838
|
return [
|
|
1491
|
-
`/api/v1/billing/
|
|
2839
|
+
`/api/v1/billing/planfamilies`
|
|
1492
2840
|
] as const;
|
|
1493
2841
|
}
|
|
1494
2842
|
|
|
1495
2843
|
|
|
1496
|
-
export const
|
|
2844
|
+
export const getPlanFamilyGetAllPlanFamiliesQueryOptions = <TData = Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>, TError = unknown>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1497
2845
|
) => {
|
|
1498
2846
|
|
|
1499
2847
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1500
2848
|
|
|
1501
|
-
const queryKey = queryOptions?.queryKey ??
|
|
2849
|
+
const queryKey = queryOptions?.queryKey ?? getPlanFamilyGetAllPlanFamiliesQueryKey();
|
|
1502
2850
|
|
|
1503
2851
|
|
|
1504
2852
|
|
|
1505
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof
|
|
2853
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>> = ({ signal }) => planFamilyGetAllPlanFamilies(requestOptions, signal);
|
|
1506
2854
|
|
|
1507
2855
|
|
|
1508
2856
|
|
|
1509
2857
|
|
|
1510
2858
|
|
|
1511
|
-
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof
|
|
2859
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>, TError, TData> & { queryKey: QueryKey }
|
|
1512
2860
|
}
|
|
1513
2861
|
|
|
1514
|
-
export type
|
|
1515
|
-
export type
|
|
2862
|
+
export type PlanFamilyGetAllPlanFamiliesQueryResult = NonNullable<Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>>
|
|
2863
|
+
export type PlanFamilyGetAllPlanFamiliesQueryError = unknown
|
|
1516
2864
|
|
|
1517
2865
|
|
|
1518
2866
|
/**
|
|
1519
|
-
* @summary
|
|
2867
|
+
* @summary Retrieve all plan families.
|
|
1520
2868
|
*/
|
|
1521
2869
|
|
|
1522
|
-
export function
|
|
1523
|
-
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof
|
|
2870
|
+
export function usePlanFamilyGetAllPlanFamilies<TData = Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>, TError = unknown>(
|
|
2871
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planFamilyGetAllPlanFamilies>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1524
2872
|
|
|
1525
2873
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1526
2874
|
|
|
1527
|
-
const queryOptions =
|
|
2875
|
+
const queryOptions = getPlanFamilyGetAllPlanFamiliesQueryOptions(options)
|
|
1528
2876
|
|
|
1529
2877
|
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1530
2878
|
|
|
@@ -1537,62 +2885,126 @@ export function usePlanGetAllPlans<TData = Awaited<ReturnType<typeof planGetAllP
|
|
|
1537
2885
|
|
|
1538
2886
|
|
|
1539
2887
|
/**
|
|
1540
|
-
* @summary
|
|
2888
|
+
* @summary Add a new plan family.
|
|
1541
2889
|
*/
|
|
1542
|
-
export const
|
|
1543
|
-
|
|
2890
|
+
export const planFamilyAddPlanFamily = (
|
|
2891
|
+
planFamilyAddPlanFamilyBody: NonReadonly<PlanFamilyAddPlanFamilyBody>,
|
|
1544
2892
|
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
1545
2893
|
) => {
|
|
1546
2894
|
|
|
1547
2895
|
|
|
1548
|
-
return customFetch<PlanFamily
|
|
1549
|
-
{url: `/api/v1/billing/planfamilies`, method: '
|
|
2896
|
+
return customFetch<PlanFamily>(
|
|
2897
|
+
{url: `/api/v1/billing/planfamilies`, method: 'POST',
|
|
2898
|
+
headers: {'Content-Type': 'application/json', },
|
|
2899
|
+
data: planFamilyAddPlanFamilyBody, signal
|
|
1550
2900
|
},
|
|
1551
2901
|
options);
|
|
1552
2902
|
}
|
|
1553
2903
|
|
|
1554
2904
|
|
|
1555
2905
|
|
|
2906
|
+
export const getPlanFamilyAddPlanFamilyMutationOptions = <TError = void,
|
|
2907
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planFamilyAddPlanFamily>>, TError,{data: NonReadonly<PlanFamilyAddPlanFamilyBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2908
|
+
): UseMutationOptions<Awaited<ReturnType<typeof planFamilyAddPlanFamily>>, TError,{data: NonReadonly<PlanFamilyAddPlanFamilyBody>}, TContext> => {
|
|
1556
2909
|
|
|
1557
|
-
|
|
2910
|
+
const mutationKey = ['planFamilyAddPlanFamily'];
|
|
2911
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
2912
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2913
|
+
options
|
|
2914
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
2915
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
2916
|
+
|
|
2917
|
+
|
|
2918
|
+
|
|
2919
|
+
|
|
2920
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof planFamilyAddPlanFamily>>, {data: NonReadonly<PlanFamilyAddPlanFamilyBody>}> = (props) => {
|
|
2921
|
+
const {data} = props ?? {};
|
|
2922
|
+
|
|
2923
|
+
return planFamilyAddPlanFamily(data,requestOptions)
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
|
|
2927
|
+
|
|
2928
|
+
|
|
2929
|
+
return { mutationFn, ...mutationOptions }}
|
|
2930
|
+
|
|
2931
|
+
export type PlanFamilyAddPlanFamilyMutationResult = NonNullable<Awaited<ReturnType<typeof planFamilyAddPlanFamily>>>
|
|
2932
|
+
export type PlanFamilyAddPlanFamilyMutationBody = NonReadonly<PlanFamilyAddPlanFamilyBody>
|
|
2933
|
+
export type PlanFamilyAddPlanFamilyMutationError = void
|
|
2934
|
+
|
|
2935
|
+
/**
|
|
2936
|
+
* @summary Add a new plan family.
|
|
2937
|
+
*/
|
|
2938
|
+
export const usePlanFamilyAddPlanFamily = <TError = void,
|
|
2939
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planFamilyAddPlanFamily>>, TError,{data: NonReadonly<PlanFamilyAddPlanFamilyBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
2940
|
+
): UseMutationResult<
|
|
2941
|
+
Awaited<ReturnType<typeof planFamilyAddPlanFamily>>,
|
|
2942
|
+
TError,
|
|
2943
|
+
{data: NonReadonly<PlanFamilyAddPlanFamilyBody>},
|
|
2944
|
+
TContext
|
|
2945
|
+
> => {
|
|
2946
|
+
|
|
2947
|
+
const mutationOptions = getPlanFamilyAddPlanFamilyMutationOptions(options);
|
|
2948
|
+
|
|
2949
|
+
return useMutation(mutationOptions);
|
|
2950
|
+
}
|
|
2951
|
+
/**
|
|
2952
|
+
* @summary Retrieve a plan family.
|
|
2953
|
+
*/
|
|
2954
|
+
export const planFamilyGetPlanFamily = (
|
|
2955
|
+
planFamilyUid: string | null,
|
|
2956
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
2957
|
+
) => {
|
|
2958
|
+
|
|
2959
|
+
|
|
2960
|
+
return customFetch<PlanFamily>(
|
|
2961
|
+
{url: `/api/v1/billing/planfamilies/${planFamilyUid}`, method: 'GET', signal
|
|
2962
|
+
},
|
|
2963
|
+
options);
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
|
|
2967
|
+
|
|
2968
|
+
|
|
2969
|
+
export const getPlanFamilyGetPlanFamilyQueryKey = (planFamilyUid?: string | null,) => {
|
|
1558
2970
|
return [
|
|
1559
|
-
`/api/v1/billing/planfamilies`
|
|
2971
|
+
`/api/v1/billing/planfamilies/${planFamilyUid}`
|
|
1560
2972
|
] as const;
|
|
1561
2973
|
}
|
|
1562
2974
|
|
|
1563
2975
|
|
|
1564
|
-
export const
|
|
2976
|
+
export const getPlanFamilyGetPlanFamilyQueryOptions = <TData = Awaited<ReturnType<typeof planFamilyGetPlanFamily>>, TError = void>(planFamilyUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planFamilyGetPlanFamily>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1565
2977
|
) => {
|
|
1566
2978
|
|
|
1567
2979
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1568
2980
|
|
|
1569
|
-
const queryKey = queryOptions?.queryKey ??
|
|
2981
|
+
const queryKey = queryOptions?.queryKey ?? getPlanFamilyGetPlanFamilyQueryKey(planFamilyUid);
|
|
1570
2982
|
|
|
1571
2983
|
|
|
1572
2984
|
|
|
1573
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof
|
|
2985
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof planFamilyGetPlanFamily>>> = ({ signal }) => planFamilyGetPlanFamily(planFamilyUid, requestOptions, signal);
|
|
1574
2986
|
|
|
1575
2987
|
|
|
1576
2988
|
|
|
1577
2989
|
|
|
1578
2990
|
|
|
1579
|
-
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof
|
|
2991
|
+
return { queryKey, queryFn, enabled: !!(planFamilyUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof planFamilyGetPlanFamily>>, TError, TData> & { queryKey: QueryKey }
|
|
1580
2992
|
}
|
|
1581
2993
|
|
|
1582
|
-
export type
|
|
1583
|
-
export type
|
|
2994
|
+
export type PlanFamilyGetPlanFamilyQueryResult = NonNullable<Awaited<ReturnType<typeof planFamilyGetPlanFamily>>>
|
|
2995
|
+
export type PlanFamilyGetPlanFamilyQueryError = void
|
|
1584
2996
|
|
|
1585
2997
|
|
|
1586
2998
|
/**
|
|
1587
|
-
* @summary
|
|
2999
|
+
* @summary Retrieve a plan family.
|
|
1588
3000
|
*/
|
|
1589
3001
|
|
|
1590
|
-
export function
|
|
1591
|
-
|
|
3002
|
+
export function usePlanFamilyGetPlanFamily<TData = Awaited<ReturnType<typeof planFamilyGetPlanFamily>>, TError = void>(
|
|
3003
|
+
planFamilyUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planFamilyGetPlanFamily>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
1592
3004
|
|
|
1593
3005
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
1594
3006
|
|
|
1595
|
-
const queryOptions =
|
|
3007
|
+
const queryOptions = getPlanFamilyGetPlanFamilyQueryOptions(planFamilyUid,options)
|
|
1596
3008
|
|
|
1597
3009
|
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
1598
3010
|
|
|
@@ -1604,3 +3016,130 @@ export function usePlanFamilyGetAllPlanFamilies<TData = Awaited<ReturnType<typeo
|
|
|
1604
3016
|
|
|
1605
3017
|
|
|
1606
3018
|
|
|
3019
|
+
/**
|
|
3020
|
+
* @summary Update a plan family.
|
|
3021
|
+
*/
|
|
3022
|
+
export const planFamilyUpdatePlanFamily = (
|
|
3023
|
+
planFamilyUid: string | null,
|
|
3024
|
+
planFamilyUpdatePlanFamilyBody: NonReadonly<PlanFamilyUpdatePlanFamilyBody>,
|
|
3025
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
3026
|
+
|
|
3027
|
+
|
|
3028
|
+
return customFetch<PlanFamily>(
|
|
3029
|
+
{url: `/api/v1/billing/planfamilies/${planFamilyUid}`, method: 'PUT',
|
|
3030
|
+
headers: {'Content-Type': 'application/json', },
|
|
3031
|
+
data: planFamilyUpdatePlanFamilyBody
|
|
3032
|
+
},
|
|
3033
|
+
options);
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
|
|
3037
|
+
|
|
3038
|
+
export const getPlanFamilyUpdatePlanFamilyMutationOptions = <TError = void,
|
|
3039
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planFamilyUpdatePlanFamily>>, TError,{planFamilyUid: string | null;data: NonReadonly<PlanFamilyUpdatePlanFamilyBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
3040
|
+
): UseMutationOptions<Awaited<ReturnType<typeof planFamilyUpdatePlanFamily>>, TError,{planFamilyUid: string | null;data: NonReadonly<PlanFamilyUpdatePlanFamilyBody>}, TContext> => {
|
|
3041
|
+
|
|
3042
|
+
const mutationKey = ['planFamilyUpdatePlanFamily'];
|
|
3043
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
3044
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
3045
|
+
options
|
|
3046
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
3047
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
3048
|
+
|
|
3049
|
+
|
|
3050
|
+
|
|
3051
|
+
|
|
3052
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof planFamilyUpdatePlanFamily>>, {planFamilyUid: string | null;data: NonReadonly<PlanFamilyUpdatePlanFamilyBody>}> = (props) => {
|
|
3053
|
+
const {planFamilyUid,data} = props ?? {};
|
|
3054
|
+
|
|
3055
|
+
return planFamilyUpdatePlanFamily(planFamilyUid,data,requestOptions)
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
|
|
3059
|
+
|
|
3060
|
+
|
|
3061
|
+
return { mutationFn, ...mutationOptions }}
|
|
3062
|
+
|
|
3063
|
+
export type PlanFamilyUpdatePlanFamilyMutationResult = NonNullable<Awaited<ReturnType<typeof planFamilyUpdatePlanFamily>>>
|
|
3064
|
+
export type PlanFamilyUpdatePlanFamilyMutationBody = NonReadonly<PlanFamilyUpdatePlanFamilyBody>
|
|
3065
|
+
export type PlanFamilyUpdatePlanFamilyMutationError = void
|
|
3066
|
+
|
|
3067
|
+
/**
|
|
3068
|
+
* @summary Update a plan family.
|
|
3069
|
+
*/
|
|
3070
|
+
export const usePlanFamilyUpdatePlanFamily = <TError = void,
|
|
3071
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planFamilyUpdatePlanFamily>>, TError,{planFamilyUid: string | null;data: NonReadonly<PlanFamilyUpdatePlanFamilyBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
3072
|
+
): UseMutationResult<
|
|
3073
|
+
Awaited<ReturnType<typeof planFamilyUpdatePlanFamily>>,
|
|
3074
|
+
TError,
|
|
3075
|
+
{planFamilyUid: string | null;data: NonReadonly<PlanFamilyUpdatePlanFamilyBody>},
|
|
3076
|
+
TContext
|
|
3077
|
+
> => {
|
|
3078
|
+
|
|
3079
|
+
const mutationOptions = getPlanFamilyUpdatePlanFamilyMutationOptions(options);
|
|
3080
|
+
|
|
3081
|
+
return useMutation(mutationOptions);
|
|
3082
|
+
}
|
|
3083
|
+
/**
|
|
3084
|
+
* @summary Delete a plan family.
|
|
3085
|
+
*/
|
|
3086
|
+
export const planFamilyDeletePlanFamily = (
|
|
3087
|
+
planFamilyUid: string | null,
|
|
3088
|
+
options?: SecondParameter<typeof customFetch>,) => {
|
|
3089
|
+
|
|
3090
|
+
|
|
3091
|
+
return customFetch<Blob>(
|
|
3092
|
+
{url: `/api/v1/billing/planfamilies/${planFamilyUid}`, method: 'DELETE',
|
|
3093
|
+
responseType: 'blob'
|
|
3094
|
+
},
|
|
3095
|
+
options);
|
|
3096
|
+
}
|
|
3097
|
+
|
|
3098
|
+
|
|
3099
|
+
|
|
3100
|
+
export const getPlanFamilyDeletePlanFamilyMutationOptions = <TError = void,
|
|
3101
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planFamilyDeletePlanFamily>>, TError,{planFamilyUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
3102
|
+
): UseMutationOptions<Awaited<ReturnType<typeof planFamilyDeletePlanFamily>>, TError,{planFamilyUid: string | null}, TContext> => {
|
|
3103
|
+
|
|
3104
|
+
const mutationKey = ['planFamilyDeletePlanFamily'];
|
|
3105
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
3106
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
3107
|
+
options
|
|
3108
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
3109
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
3110
|
+
|
|
3111
|
+
|
|
3112
|
+
|
|
3113
|
+
|
|
3114
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof planFamilyDeletePlanFamily>>, {planFamilyUid: string | null}> = (props) => {
|
|
3115
|
+
const {planFamilyUid} = props ?? {};
|
|
3116
|
+
|
|
3117
|
+
return planFamilyDeletePlanFamily(planFamilyUid,requestOptions)
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
|
|
3121
|
+
|
|
3122
|
+
|
|
3123
|
+
return { mutationFn, ...mutationOptions }}
|
|
3124
|
+
|
|
3125
|
+
export type PlanFamilyDeletePlanFamilyMutationResult = NonNullable<Awaited<ReturnType<typeof planFamilyDeletePlanFamily>>>
|
|
3126
|
+
|
|
3127
|
+
export type PlanFamilyDeletePlanFamilyMutationError = void
|
|
3128
|
+
|
|
3129
|
+
/**
|
|
3130
|
+
* @summary Delete a plan family.
|
|
3131
|
+
*/
|
|
3132
|
+
export const usePlanFamilyDeletePlanFamily = <TError = void,
|
|
3133
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof planFamilyDeletePlanFamily>>, TError,{planFamilyUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
|
|
3134
|
+
): UseMutationResult<
|
|
3135
|
+
Awaited<ReturnType<typeof planFamilyDeletePlanFamily>>,
|
|
3136
|
+
TError,
|
|
3137
|
+
{planFamilyUid: string | null},
|
|
3138
|
+
TContext
|
|
3139
|
+
> => {
|
|
3140
|
+
|
|
3141
|
+
const mutationOptions = getPlanFamilyDeletePlanFamilyMutationOptions(options);
|
|
3142
|
+
|
|
3143
|
+
return useMutation(mutationOptions);
|
|
3144
|
+
}
|
|
3145
|
+
|