-
Notifications
You must be signed in to change notification settings - Fork 1
/
customerplan.go
500 lines (436 loc) · 21.4 KB
/
customerplan.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package metronome
import (
"context"
"errors"
"fmt"
"net/http"
"net/url"
"time"
"github.com/Metronome-Industries/metronome-go/internal/apijson"
"github.com/Metronome-Industries/metronome-go/internal/apiquery"
"github.com/Metronome-Industries/metronome-go/internal/pagination"
"github.com/Metronome-Industries/metronome-go/internal/param"
"github.com/Metronome-Industries/metronome-go/internal/requestconfig"
"github.com/Metronome-Industries/metronome-go/option"
"github.com/Metronome-Industries/metronome-go/shared"
)
// CustomerPlanService contains methods and other services that help with
// interacting with the metronome API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewCustomerPlanService] method instead.
type CustomerPlanService struct {
Options []option.RequestOption
}
// NewCustomerPlanService generates a new service that applies the given options to
// each request. These options are applied after the parent client's options (if
// there is one), and before any request-specific options.
func NewCustomerPlanService(opts ...option.RequestOption) (r *CustomerPlanService) {
r = &CustomerPlanService{}
r.Options = opts
return
}
// List the given customer's plans in reverse-chronological order.
func (r *CustomerPlanService) List(ctx context.Context, customerID string, query CustomerPlanListParams, opts ...option.RequestOption) (res *pagination.CursorPage[CustomerPlanListResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
if customerID == "" {
err = errors.New("missing required customer_id parameter")
return
}
path := fmt.Sprintf("customers/%s/plans", customerID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// List the given customer's plans in reverse-chronological order.
func (r *CustomerPlanService) ListAutoPaging(ctx context.Context, customerID string, query CustomerPlanListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[CustomerPlanListResponse] {
return pagination.NewCursorPageAutoPager(r.List(ctx, customerID, query, opts...))
}
// Associate an existing customer with a plan for a specified date range. See the
// [price adjustments documentation](https://docs.metronome.com/pricing/managing-plans/#price-adjustments)
// for details on the price adjustments.
func (r *CustomerPlanService) Add(ctx context.Context, customerID string, body CustomerPlanAddParams, opts ...option.RequestOption) (res *CustomerPlanAddResponse, err error) {
opts = append(r.Options[:], opts...)
if customerID == "" {
err = errors.New("missing required customer_id parameter")
return
}
path := fmt.Sprintf("customers/%s/plans/add", customerID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
// Change the end date of a customer's plan.
func (r *CustomerPlanService) End(ctx context.Context, customerID string, customerPlanID string, body CustomerPlanEndParams, opts ...option.RequestOption) (res *CustomerPlanEndResponse, err error) {
opts = append(r.Options[:], opts...)
if customerID == "" {
err = errors.New("missing required customer_id parameter")
return
}
if customerPlanID == "" {
err = errors.New("missing required customer_plan_id parameter")
return
}
path := fmt.Sprintf("customers/%s/plans/%s/end", customerID, customerPlanID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
// Lists a customer plans adjustments. See the
// [price adjustments documentation](https://docs.metronome.com/pricing/managing-plans/#price-adjustments)
// for details.
func (r *CustomerPlanService) ListPriceAdjustments(ctx context.Context, customerID string, customerPlanID string, query CustomerPlanListPriceAdjustmentsParams, opts ...option.RequestOption) (res *pagination.CursorPage[CustomerPlanListPriceAdjustmentsResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
if customerID == "" {
err = errors.New("missing required customer_id parameter")
return
}
if customerPlanID == "" {
err = errors.New("missing required customer_plan_id parameter")
return
}
path := fmt.Sprintf("customers/%s/plans/%s/priceAdjustments", customerID, customerPlanID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// Lists a customer plans adjustments. See the
// [price adjustments documentation](https://docs.metronome.com/pricing/managing-plans/#price-adjustments)
// for details.
func (r *CustomerPlanService) ListPriceAdjustmentsAutoPaging(ctx context.Context, customerID string, customerPlanID string, query CustomerPlanListPriceAdjustmentsParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[CustomerPlanListPriceAdjustmentsResponse] {
return pagination.NewCursorPageAutoPager(r.ListPriceAdjustments(ctx, customerID, customerPlanID, query, opts...))
}
type CustomerPlanListResponse struct {
// the ID of the customer plan
ID string `json:"id,required" format:"uuid"`
CustomFields map[string]string `json:"custom_fields,required"`
PlanDescription string `json:"plan_description,required"`
// the ID of the plan
PlanID string `json:"plan_id,required" format:"uuid"`
PlanName string `json:"plan_name,required"`
StartingOn time.Time `json:"starting_on,required" format:"date-time"`
EndingBefore time.Time `json:"ending_before" format:"date-time"`
NetPaymentTermsDays float64 `json:"net_payment_terms_days"`
TrialInfo CustomerPlanListResponseTrialInfo `json:"trial_info"`
JSON customerPlanListResponseJSON `json:"-"`
}
// customerPlanListResponseJSON contains the JSON metadata for the struct
// [CustomerPlanListResponse]
type customerPlanListResponseJSON struct {
ID apijson.Field
CustomFields apijson.Field
PlanDescription apijson.Field
PlanID apijson.Field
PlanName apijson.Field
StartingOn apijson.Field
EndingBefore apijson.Field
NetPaymentTermsDays apijson.Field
TrialInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *CustomerPlanListResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r customerPlanListResponseJSON) RawJSON() string {
return r.raw
}
type CustomerPlanListResponseTrialInfo struct {
EndingBefore time.Time `json:"ending_before,required" format:"date-time"`
SpendingCaps []CustomerPlanListResponseTrialInfoSpendingCap `json:"spending_caps,required"`
JSON customerPlanListResponseTrialInfoJSON `json:"-"`
}
// customerPlanListResponseTrialInfoJSON contains the JSON metadata for the struct
// [CustomerPlanListResponseTrialInfo]
type customerPlanListResponseTrialInfoJSON struct {
EndingBefore apijson.Field
SpendingCaps apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *CustomerPlanListResponseTrialInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r customerPlanListResponseTrialInfoJSON) RawJSON() string {
return r.raw
}
type CustomerPlanListResponseTrialInfoSpendingCap struct {
Amount float64 `json:"amount,required"`
AmountRemaining float64 `json:"amount_remaining,required"`
CreditType shared.CreditType `json:"credit_type,required"`
JSON customerPlanListResponseTrialInfoSpendingCapJSON `json:"-"`
}
// customerPlanListResponseTrialInfoSpendingCapJSON contains the JSON metadata for
// the struct [CustomerPlanListResponseTrialInfoSpendingCap]
type customerPlanListResponseTrialInfoSpendingCapJSON struct {
Amount apijson.Field
AmountRemaining apijson.Field
CreditType apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *CustomerPlanListResponseTrialInfoSpendingCap) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r customerPlanListResponseTrialInfoSpendingCapJSON) RawJSON() string {
return r.raw
}
type CustomerPlanAddResponse struct {
Data shared.ID `json:"data,required"`
JSON customerPlanAddResponseJSON `json:"-"`
}
// customerPlanAddResponseJSON contains the JSON metadata for the struct
// [CustomerPlanAddResponse]
type customerPlanAddResponseJSON struct {
Data apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *CustomerPlanAddResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r customerPlanAddResponseJSON) RawJSON() string {
return r.raw
}
type CustomerPlanEndResponse struct {
JSON customerPlanEndResponseJSON `json:"-"`
}
// customerPlanEndResponseJSON contains the JSON metadata for the struct
// [CustomerPlanEndResponse]
type customerPlanEndResponseJSON struct {
raw string
ExtraFields map[string]apijson.Field
}
func (r *CustomerPlanEndResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r customerPlanEndResponseJSON) RawJSON() string {
return r.raw
}
type CustomerPlanListPriceAdjustmentsResponse struct {
ChargeID string `json:"charge_id,required" format:"uuid"`
ChargeType CustomerPlanListPriceAdjustmentsResponseChargeType `json:"charge_type,required"`
Prices []CustomerPlanListPriceAdjustmentsResponsePrice `json:"prices,required"`
StartPeriod float64 `json:"start_period,required"`
Quantity float64 `json:"quantity"`
JSON customerPlanListPriceAdjustmentsResponseJSON `json:"-"`
}
// customerPlanListPriceAdjustmentsResponseJSON contains the JSON metadata for the
// struct [CustomerPlanListPriceAdjustmentsResponse]
type customerPlanListPriceAdjustmentsResponseJSON struct {
ChargeID apijson.Field
ChargeType apijson.Field
Prices apijson.Field
StartPeriod apijson.Field
Quantity apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *CustomerPlanListPriceAdjustmentsResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r customerPlanListPriceAdjustmentsResponseJSON) RawJSON() string {
return r.raw
}
type CustomerPlanListPriceAdjustmentsResponseChargeType string
const (
CustomerPlanListPriceAdjustmentsResponseChargeTypeUsage CustomerPlanListPriceAdjustmentsResponseChargeType = "usage"
CustomerPlanListPriceAdjustmentsResponseChargeTypeFixed CustomerPlanListPriceAdjustmentsResponseChargeType = "fixed"
CustomerPlanListPriceAdjustmentsResponseChargeTypeComposite CustomerPlanListPriceAdjustmentsResponseChargeType = "composite"
CustomerPlanListPriceAdjustmentsResponseChargeTypeMinimum CustomerPlanListPriceAdjustmentsResponseChargeType = "minimum"
CustomerPlanListPriceAdjustmentsResponseChargeTypeSeat CustomerPlanListPriceAdjustmentsResponseChargeType = "seat"
)
func (r CustomerPlanListPriceAdjustmentsResponseChargeType) IsKnown() bool {
switch r {
case CustomerPlanListPriceAdjustmentsResponseChargeTypeUsage, CustomerPlanListPriceAdjustmentsResponseChargeTypeFixed, CustomerPlanListPriceAdjustmentsResponseChargeTypeComposite, CustomerPlanListPriceAdjustmentsResponseChargeTypeMinimum, CustomerPlanListPriceAdjustmentsResponseChargeTypeSeat:
return true
}
return false
}
type CustomerPlanListPriceAdjustmentsResponsePrice struct {
// Determines how the value will be applied.
AdjustmentType CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentType `json:"adjustment_type,required"`
// Used in pricing tiers. Indicates at what metric value the price applies.
Tier float64 `json:"tier"`
Value float64 `json:"value"`
JSON customerPlanListPriceAdjustmentsResponsePriceJSON `json:"-"`
}
// customerPlanListPriceAdjustmentsResponsePriceJSON contains the JSON metadata for
// the struct [CustomerPlanListPriceAdjustmentsResponsePrice]
type customerPlanListPriceAdjustmentsResponsePriceJSON struct {
AdjustmentType apijson.Field
Tier apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *CustomerPlanListPriceAdjustmentsResponsePrice) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r customerPlanListPriceAdjustmentsResponsePriceJSON) RawJSON() string {
return r.raw
}
// Determines how the value will be applied.
type CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentType string
const (
CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentTypeFixed CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentType = "fixed"
CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentTypeQuantity CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentType = "quantity"
CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentTypePercentage CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentType = "percentage"
CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentTypeOverride CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentType = "override"
)
func (r CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentType) IsKnown() bool {
switch r {
case CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentTypeFixed, CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentTypeQuantity, CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentTypePercentage, CustomerPlanListPriceAdjustmentsResponsePricesAdjustmentTypeOverride:
return true
}
return false
}
type CustomerPlanListParams struct {
// Max number of results that should be returned
Limit param.Field[int64] `query:"limit"`
// Cursor that indicates where the next page of results should start.
NextPage param.Field[string] `query:"next_page"`
}
// URLQuery serializes [CustomerPlanListParams]'s query parameters as `url.Values`.
func (r CustomerPlanListParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatComma,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type CustomerPlanAddParams struct {
PlanID param.Field[string] `json:"plan_id,required" format:"uuid"`
// RFC 3339 timestamp for when the plan becomes active for this customer. Must be
// at 0:00 UTC (midnight).
StartingOn param.Field[time.Time] `json:"starting_on,required" format:"date-time"`
// RFC 3339 timestamp for when the plan ends (exclusive) for this customer. Must be
// at 0:00 UTC (midnight).
EndingBefore param.Field[time.Time] `json:"ending_before" format:"date-time"`
// Number of days after issuance of invoice after which the invoice is due (e.g.
// Net 30).
NetPaymentTermsDays param.Field[float64] `json:"net_payment_terms_days"`
// An optional list of overage rates that override the rates of the original plan
// configuration. These new rates will apply to all pricing ramps.
OverageRateAdjustments param.Field[[]CustomerPlanAddParamsOverageRateAdjustment] `json:"overage_rate_adjustments"`
// A list of price adjustments can be applied on top of the pricing in the plans.
// See the
// [price adjustments documentation](https://docs.metronome.com/pricing/managing-plans/#price-adjustments)
// for details.
PriceAdjustments param.Field[[]CustomerPlanAddParamsPriceAdjustment] `json:"price_adjustments"`
// A custom trial can be set for the customer's plan. See the
// [trial configuration documentation](https://docs.metronome.com/provisioning/configure-trials/)
// for details.
TrialSpec param.Field[CustomerPlanAddParamsTrialSpec] `json:"trial_spec"`
}
func (r CustomerPlanAddParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type CustomerPlanAddParamsOverageRateAdjustment struct {
CustomCreditTypeID param.Field[string] `json:"custom_credit_type_id,required" format:"uuid"`
FiatCurrencyCreditTypeID param.Field[string] `json:"fiat_currency_credit_type_id,required" format:"uuid"`
// The overage cost in fiat currency for each credit of the custom credit type.
ToFiatConversionFactor param.Field[float64] `json:"to_fiat_conversion_factor,required"`
}
func (r CustomerPlanAddParamsOverageRateAdjustment) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type CustomerPlanAddParamsPriceAdjustment struct {
AdjustmentType param.Field[CustomerPlanAddParamsPriceAdjustmentsAdjustmentType] `json:"adjustment_type,required"`
ChargeID param.Field[string] `json:"charge_id,required" format:"uuid"`
// Used in price ramps. Indicates how many billing periods pass before the charge
// applies.
StartPeriod param.Field[float64] `json:"start_period,required"`
// the overridden quantity for a fixed charge
Quantity param.Field[float64] `json:"quantity"`
// Used in pricing tiers. Indicates at what metric value the price applies.
Tier param.Field[float64] `json:"tier"`
// The amount of change to a price. Percentage and fixed adjustments can be
// positive or negative. Percentage-based adjustments should be decimals, e.g.
// -0.05 for a 5% discount.
Value param.Field[float64] `json:"value"`
}
func (r CustomerPlanAddParamsPriceAdjustment) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type CustomerPlanAddParamsPriceAdjustmentsAdjustmentType string
const (
CustomerPlanAddParamsPriceAdjustmentsAdjustmentTypePercentage CustomerPlanAddParamsPriceAdjustmentsAdjustmentType = "percentage"
CustomerPlanAddParamsPriceAdjustmentsAdjustmentTypeFixed CustomerPlanAddParamsPriceAdjustmentsAdjustmentType = "fixed"
CustomerPlanAddParamsPriceAdjustmentsAdjustmentTypeOverride CustomerPlanAddParamsPriceAdjustmentsAdjustmentType = "override"
CustomerPlanAddParamsPriceAdjustmentsAdjustmentTypeQuantity CustomerPlanAddParamsPriceAdjustmentsAdjustmentType = "quantity"
)
func (r CustomerPlanAddParamsPriceAdjustmentsAdjustmentType) IsKnown() bool {
switch r {
case CustomerPlanAddParamsPriceAdjustmentsAdjustmentTypePercentage, CustomerPlanAddParamsPriceAdjustmentsAdjustmentTypeFixed, CustomerPlanAddParamsPriceAdjustmentsAdjustmentTypeOverride, CustomerPlanAddParamsPriceAdjustmentsAdjustmentTypeQuantity:
return true
}
return false
}
// A custom trial can be set for the customer's plan. See the
// [trial configuration documentation](https://docs.metronome.com/provisioning/configure-trials/)
// for details.
type CustomerPlanAddParamsTrialSpec struct {
// Length of the trial period in days.
LengthInDays param.Field[float64] `json:"length_in_days,required"`
SpendingCap param.Field[CustomerPlanAddParamsTrialSpecSpendingCap] `json:"spending_cap"`
}
func (r CustomerPlanAddParamsTrialSpec) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type CustomerPlanAddParamsTrialSpecSpendingCap struct {
// The credit amount in the given denomination based on the credit type, e.g. US
// cents.
Amount param.Field[float64] `json:"amount,required"`
// The credit type ID for the spending cap.
CreditTypeID param.Field[string] `json:"credit_type_id,required"`
}
func (r CustomerPlanAddParamsTrialSpecSpendingCap) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type CustomerPlanEndParams struct {
// RFC 3339 timestamp for when the plan ends (exclusive) for this customer. Must be
// at 0:00 UTC (midnight). If not provided, the plan end date will be cleared.
EndingBefore param.Field[time.Time] `json:"ending_before" format:"date-time"`
// If true, plan end date can be before the last finalized invoice date. Any
// invoices generated after the plan end date will be voided.
VoidInvoices param.Field[bool] `json:"void_invoices"`
// Only applicable when void_invoices is set to true. If true, for every invoice
// that is voided we will also attempt to void/delete the stripe invoice (if any).
// Stripe invoices will be voided if finalized or deleted if still in draft state.
VoidStripeInvoices param.Field[bool] `json:"void_stripe_invoices"`
}
func (r CustomerPlanEndParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type CustomerPlanListPriceAdjustmentsParams struct {
// Max number of results that should be returned
Limit param.Field[int64] `query:"limit"`
// Cursor that indicates where the next page of results should start.
NextPage param.Field[string] `query:"next_page"`
}
// URLQuery serializes [CustomerPlanListPriceAdjustmentsParams]'s query parameters
// as `url.Values`.
func (r CustomerPlanListPriceAdjustmentsParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatComma,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}