/
gatewayconfiguration.go
841 lines (723 loc) · 27.6 KB
/
gatewayconfiguration.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
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package zero_trust
import (
"context"
"fmt"
"net/http"
"time"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
)
// GatewayConfigurationService contains methods and other services that help with
// interacting with the cloudflare 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 [NewGatewayConfigurationService]
// method instead.
type GatewayConfigurationService struct {
Options []option.RequestOption
}
// NewGatewayConfigurationService 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 NewGatewayConfigurationService(opts ...option.RequestOption) (r *GatewayConfigurationService) {
r = &GatewayConfigurationService{}
r.Options = opts
return
}
// Updates the current Zero Trust account configuration.
func (r *GatewayConfigurationService) Update(ctx context.Context, params GatewayConfigurationUpdateParams, opts ...option.RequestOption) (res *GatewayConfigurationUpdateResponse, err error) {
opts = append(r.Options[:], opts...)
var env GatewayConfigurationUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%s/gateway/configuration", params.AccountID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// Patches the current Zero Trust account configuration. This endpoint can update a
// single subcollection of settings such as `antivirus`, `tls_decrypt`,
// `activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or
// `custom_certificate`, without updating the entire configuration object. Returns
// an error if any collection of settings is not properly configured.
func (r *GatewayConfigurationService) Edit(ctx context.Context, params GatewayConfigurationEditParams, opts ...option.RequestOption) (res *GatewayConfigurationEditResponse, err error) {
opts = append(r.Options[:], opts...)
var env GatewayConfigurationEditResponseEnvelope
path := fmt.Sprintf("accounts/%s/gateway/configuration", params.AccountID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// Fetches the current Zero Trust account configuration.
func (r *GatewayConfigurationService) Get(ctx context.Context, query GatewayConfigurationGetParams, opts ...option.RequestOption) (res *GatewayConfigurationGetResponse, err error) {
opts = append(r.Options[:], opts...)
var env GatewayConfigurationGetResponseEnvelope
path := fmt.Sprintf("accounts/%s/gateway/configuration", query.AccountID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// Activity log settings.
type ActivityLogSettings struct {
// Enable activity logging.
Enabled bool `json:"enabled"`
JSON activityLogSettingsJSON `json:"-"`
}
// activityLogSettingsJSON contains the JSON metadata for the struct
// [ActivityLogSettings]
type activityLogSettingsJSON struct {
Enabled apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ActivityLogSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r activityLogSettingsJSON) RawJSON() string {
return r.raw
}
// Activity log settings.
type ActivityLogSettingsParam struct {
// Enable activity logging.
Enabled param.Field[bool] `json:"enabled"`
}
func (r ActivityLogSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Anti-virus settings.
type AntiVirusSettings struct {
// Enable anti-virus scanning on downloads.
EnabledDownloadPhase bool `json:"enabled_download_phase"`
// Enable anti-virus scanning on uploads.
EnabledUploadPhase bool `json:"enabled_upload_phase"`
// Block requests for files that cannot be scanned.
FailClosed bool `json:"fail_closed"`
// Configure a message to display on the user's device when an antivirus search is
// performed.
NotificationSettings NotificationSettings `json:"notification_settings"`
JSON antiVirusSettingsJSON `json:"-"`
}
// antiVirusSettingsJSON contains the JSON metadata for the struct
// [AntiVirusSettings]
type antiVirusSettingsJSON struct {
EnabledDownloadPhase apijson.Field
EnabledUploadPhase apijson.Field
FailClosed apijson.Field
NotificationSettings apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AntiVirusSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r antiVirusSettingsJSON) RawJSON() string {
return r.raw
}
// Anti-virus settings.
type AntiVirusSettingsParam struct {
// Enable anti-virus scanning on downloads.
EnabledDownloadPhase param.Field[bool] `json:"enabled_download_phase"`
// Enable anti-virus scanning on uploads.
EnabledUploadPhase param.Field[bool] `json:"enabled_upload_phase"`
// Block requests for files that cannot be scanned.
FailClosed param.Field[bool] `json:"fail_closed"`
// Configure a message to display on the user's device when an antivirus search is
// performed.
NotificationSettings param.Field[NotificationSettingsParam] `json:"notification_settings"`
}
func (r AntiVirusSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Block page layout settings.
type BlockPageSettings struct {
// Block page background color in #rrggbb format.
BackgroundColor string `json:"background_color"`
// Enable only cipher suites and TLS versions compliant with FIPS 140-2.
Enabled bool `json:"enabled"`
// Block page footer text.
FooterText string `json:"footer_text"`
// Block page header text.
HeaderText string `json:"header_text"`
// Full URL to the logo file.
LogoPath string `json:"logo_path"`
// Admin email for users to contact.
MailtoAddress string `json:"mailto_address"`
// Subject line for emails created from block page.
MailtoSubject string `json:"mailto_subject"`
// Block page title.
Name string `json:"name"`
// Suppress detailed info at the bottom of the block page.
SuppressFooter bool `json:"suppress_footer"`
JSON blockPageSettingsJSON `json:"-"`
}
// blockPageSettingsJSON contains the JSON metadata for the struct
// [BlockPageSettings]
type blockPageSettingsJSON struct {
BackgroundColor apijson.Field
Enabled apijson.Field
FooterText apijson.Field
HeaderText apijson.Field
LogoPath apijson.Field
MailtoAddress apijson.Field
MailtoSubject apijson.Field
Name apijson.Field
SuppressFooter apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *BlockPageSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r blockPageSettingsJSON) RawJSON() string {
return r.raw
}
// Block page layout settings.
type BlockPageSettingsParam struct {
// Block page background color in #rrggbb format.
BackgroundColor param.Field[string] `json:"background_color"`
// Enable only cipher suites and TLS versions compliant with FIPS 140-2.
Enabled param.Field[bool] `json:"enabled"`
// Block page footer text.
FooterText param.Field[string] `json:"footer_text"`
// Block page header text.
HeaderText param.Field[string] `json:"header_text"`
// Full URL to the logo file.
LogoPath param.Field[string] `json:"logo_path"`
// Admin email for users to contact.
MailtoAddress param.Field[string] `json:"mailto_address"`
// Subject line for emails created from block page.
MailtoSubject param.Field[string] `json:"mailto_subject"`
// Block page title.
Name param.Field[string] `json:"name"`
// Suppress detailed info at the bottom of the block page.
SuppressFooter param.Field[bool] `json:"suppress_footer"`
}
func (r BlockPageSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// DLP body scanning settings.
type BodyScanningSettings struct {
// Set the inspection mode to either `deep` or `shallow`.
InspectionMode string `json:"inspection_mode"`
JSON bodyScanningSettingsJSON `json:"-"`
}
// bodyScanningSettingsJSON contains the JSON metadata for the struct
// [BodyScanningSettings]
type bodyScanningSettingsJSON struct {
InspectionMode apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *BodyScanningSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r bodyScanningSettingsJSON) RawJSON() string {
return r.raw
}
// DLP body scanning settings.
type BodyScanningSettingsParam struct {
// Set the inspection mode to either `deep` or `shallow`.
InspectionMode param.Field[string] `json:"inspection_mode"`
}
func (r BodyScanningSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Browser isolation settings.
type BrowserIsolationSettings struct {
// Enable non-identity onramp support for Browser Isolation.
NonIdentityEnabled bool `json:"non_identity_enabled"`
// Enable Clientless Browser Isolation.
URLBrowserIsolationEnabled bool `json:"url_browser_isolation_enabled"`
JSON browserIsolationSettingsJSON `json:"-"`
}
// browserIsolationSettingsJSON contains the JSON metadata for the struct
// [BrowserIsolationSettings]
type browserIsolationSettingsJSON struct {
NonIdentityEnabled apijson.Field
URLBrowserIsolationEnabled apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *BrowserIsolationSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r browserIsolationSettingsJSON) RawJSON() string {
return r.raw
}
// Browser isolation settings.
type BrowserIsolationSettingsParam struct {
// Enable non-identity onramp support for Browser Isolation.
NonIdentityEnabled param.Field[bool] `json:"non_identity_enabled"`
// Enable Clientless Browser Isolation.
URLBrowserIsolationEnabled param.Field[bool] `json:"url_browser_isolation_enabled"`
}
func (r BrowserIsolationSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Custom certificate settings for BYO-PKI.
type CustomCertificateSettings struct {
// Enable use of custom certificate authority for signing Gateway traffic.
Enabled bool `json:"enabled,required"`
// UUID of certificate (ID from MTLS certificate store).
ID string `json:"id"`
// Certificate status (internal).
BindingStatus string `json:"binding_status"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON customCertificateSettingsJSON `json:"-"`
}
// customCertificateSettingsJSON contains the JSON metadata for the struct
// [CustomCertificateSettings]
type customCertificateSettingsJSON struct {
Enabled apijson.Field
ID apijson.Field
BindingStatus apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *CustomCertificateSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r customCertificateSettingsJSON) RawJSON() string {
return r.raw
}
// Custom certificate settings for BYO-PKI.
type CustomCertificateSettingsParam struct {
// Enable use of custom certificate authority for signing Gateway traffic.
Enabled param.Field[bool] `json:"enabled,required"`
// UUID of certificate (ID from MTLS certificate store).
ID param.Field[string] `json:"id"`
}
func (r CustomCertificateSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Extended e-mail matching settings.
type ExtendedEmailMatching struct {
// Enable matching all variants of user emails (with + or . modifiers) used as
// criteria in Firewall policies.
Enabled bool `json:"enabled"`
JSON extendedEmailMatchingJSON `json:"-"`
}
// extendedEmailMatchingJSON contains the JSON metadata for the struct
// [ExtendedEmailMatching]
type extendedEmailMatchingJSON struct {
Enabled apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ExtendedEmailMatching) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r extendedEmailMatchingJSON) RawJSON() string {
return r.raw
}
// Extended e-mail matching settings.
type ExtendedEmailMatchingParam struct {
// Enable matching all variants of user emails (with + or . modifiers) used as
// criteria in Firewall policies.
Enabled param.Field[bool] `json:"enabled"`
}
func (r ExtendedEmailMatchingParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// FIPS settings.
type FipsSettings struct {
// Enable only cipher suites and TLS versions compliant with FIPS 140-2.
TLS bool `json:"tls"`
JSON fipsSettingsJSON `json:"-"`
}
// fipsSettingsJSON contains the JSON metadata for the struct [FipsSettings]
type fipsSettingsJSON struct {
TLS apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *FipsSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r fipsSettingsJSON) RawJSON() string {
return r.raw
}
// FIPS settings.
type FipsSettingsParam struct {
// Enable only cipher suites and TLS versions compliant with FIPS 140-2.
TLS param.Field[bool] `json:"tls"`
}
func (r FipsSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// account settings.
type GatewayConfigurationSettings struct {
// Activity log settings.
ActivityLog ActivityLogSettings `json:"activity_log"`
// Anti-virus settings.
Antivirus AntiVirusSettings `json:"antivirus"`
// Block page layout settings.
BlockPage BlockPageSettings `json:"block_page"`
// DLP body scanning settings.
BodyScanning BodyScanningSettings `json:"body_scanning"`
// Browser isolation settings.
BrowserIsolation BrowserIsolationSettings `json:"browser_isolation"`
// Custom certificate settings for BYO-PKI.
CustomCertificate CustomCertificateSettings `json:"custom_certificate"`
// Extended e-mail matching settings.
ExtendedEmailMatching ExtendedEmailMatching `json:"extended_email_matching"`
// FIPS settings.
Fips FipsSettings `json:"fips"`
// Protocol Detection settings.
ProtocolDetection ProtocolDetection `json:"protocol_detection"`
// TLS interception settings.
TLSDecrypt TLSSettings `json:"tls_decrypt"`
JSON gatewayConfigurationSettingsJSON `json:"-"`
}
// gatewayConfigurationSettingsJSON contains the JSON metadata for the struct
// [GatewayConfigurationSettings]
type gatewayConfigurationSettingsJSON struct {
ActivityLog apijson.Field
Antivirus apijson.Field
BlockPage apijson.Field
BodyScanning apijson.Field
BrowserIsolation apijson.Field
CustomCertificate apijson.Field
ExtendedEmailMatching apijson.Field
Fips apijson.Field
ProtocolDetection apijson.Field
TLSDecrypt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *GatewayConfigurationSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r gatewayConfigurationSettingsJSON) RawJSON() string {
return r.raw
}
// account settings.
type GatewayConfigurationSettingsParam struct {
// Activity log settings.
ActivityLog param.Field[ActivityLogSettingsParam] `json:"activity_log"`
// Anti-virus settings.
Antivirus param.Field[AntiVirusSettingsParam] `json:"antivirus"`
// Block page layout settings.
BlockPage param.Field[BlockPageSettingsParam] `json:"block_page"`
// DLP body scanning settings.
BodyScanning param.Field[BodyScanningSettingsParam] `json:"body_scanning"`
// Browser isolation settings.
BrowserIsolation param.Field[BrowserIsolationSettingsParam] `json:"browser_isolation"`
// Custom certificate settings for BYO-PKI.
CustomCertificate param.Field[CustomCertificateSettingsParam] `json:"custom_certificate"`
// Extended e-mail matching settings.
ExtendedEmailMatching param.Field[ExtendedEmailMatchingParam] `json:"extended_email_matching"`
// FIPS settings.
Fips param.Field[FipsSettingsParam] `json:"fips"`
// Protocol Detection settings.
ProtocolDetection param.Field[ProtocolDetectionParam] `json:"protocol_detection"`
// TLS interception settings.
TLSDecrypt param.Field[TLSSettingsParam] `json:"tls_decrypt"`
}
func (r GatewayConfigurationSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Configure a message to display on the user's device when an antivirus search is
// performed.
type NotificationSettings struct {
// Set notification on
Enabled bool `json:"enabled"`
// Customize the message shown in the notification.
Msg string `json:"msg"`
// Optional URL to direct users to additional information. If not set, the
// notification will open a block page.
SupportURL string `json:"support_url"`
JSON notificationSettingsJSON `json:"-"`
}
// notificationSettingsJSON contains the JSON metadata for the struct
// [NotificationSettings]
type notificationSettingsJSON struct {
Enabled apijson.Field
Msg apijson.Field
SupportURL apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *NotificationSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r notificationSettingsJSON) RawJSON() string {
return r.raw
}
// Configure a message to display on the user's device when an antivirus search is
// performed.
type NotificationSettingsParam struct {
// Set notification on
Enabled param.Field[bool] `json:"enabled"`
// Customize the message shown in the notification.
Msg param.Field[string] `json:"msg"`
// Optional URL to direct users to additional information. If not set, the
// notification will open a block page.
SupportURL param.Field[string] `json:"support_url"`
}
func (r NotificationSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Protocol Detection settings.
type ProtocolDetection struct {
// Enable detecting protocol on initial bytes of client traffic.
Enabled bool `json:"enabled"`
JSON protocolDetectionJSON `json:"-"`
}
// protocolDetectionJSON contains the JSON metadata for the struct
// [ProtocolDetection]
type protocolDetectionJSON struct {
Enabled apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ProtocolDetection) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r protocolDetectionJSON) RawJSON() string {
return r.raw
}
// Protocol Detection settings.
type ProtocolDetectionParam struct {
// Enable detecting protocol on initial bytes of client traffic.
Enabled param.Field[bool] `json:"enabled"`
}
func (r ProtocolDetectionParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// TLS interception settings.
type TLSSettings struct {
// Enable inspecting encrypted HTTP traffic.
Enabled bool `json:"enabled"`
JSON tlsSettingsJSON `json:"-"`
}
// tlsSettingsJSON contains the JSON metadata for the struct [TLSSettings]
type tlsSettingsJSON struct {
Enabled apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *TLSSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r tlsSettingsJSON) RawJSON() string {
return r.raw
}
// TLS interception settings.
type TLSSettingsParam struct {
// Enable inspecting encrypted HTTP traffic.
Enabled param.Field[bool] `json:"enabled"`
}
func (r TLSSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// account settings.
type GatewayConfigurationUpdateResponse struct {
CreatedAt time.Time `json:"created_at" format:"date-time"`
// account settings.
Settings GatewayConfigurationSettings `json:"settings"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON gatewayConfigurationUpdateResponseJSON `json:"-"`
}
// gatewayConfigurationUpdateResponseJSON contains the JSON metadata for the struct
// [GatewayConfigurationUpdateResponse]
type gatewayConfigurationUpdateResponseJSON struct {
CreatedAt apijson.Field
Settings apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *GatewayConfigurationUpdateResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r gatewayConfigurationUpdateResponseJSON) RawJSON() string {
return r.raw
}
// account settings.
type GatewayConfigurationEditResponse struct {
CreatedAt time.Time `json:"created_at" format:"date-time"`
// account settings.
Settings GatewayConfigurationSettings `json:"settings"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON gatewayConfigurationEditResponseJSON `json:"-"`
}
// gatewayConfigurationEditResponseJSON contains the JSON metadata for the struct
// [GatewayConfigurationEditResponse]
type gatewayConfigurationEditResponseJSON struct {
CreatedAt apijson.Field
Settings apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *GatewayConfigurationEditResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r gatewayConfigurationEditResponseJSON) RawJSON() string {
return r.raw
}
// account settings.
type GatewayConfigurationGetResponse struct {
CreatedAt time.Time `json:"created_at" format:"date-time"`
// account settings.
Settings GatewayConfigurationSettings `json:"settings"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
JSON gatewayConfigurationGetResponseJSON `json:"-"`
}
// gatewayConfigurationGetResponseJSON contains the JSON metadata for the struct
// [GatewayConfigurationGetResponse]
type gatewayConfigurationGetResponseJSON struct {
CreatedAt apijson.Field
Settings apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *GatewayConfigurationGetResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r gatewayConfigurationGetResponseJSON) RawJSON() string {
return r.raw
}
type GatewayConfigurationUpdateParams struct {
AccountID param.Field[string] `path:"account_id,required"`
// account settings.
Settings param.Field[GatewayConfigurationSettingsParam] `json:"settings"`
}
func (r GatewayConfigurationUpdateParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type GatewayConfigurationUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful
Success GatewayConfigurationUpdateResponseEnvelopeSuccess `json:"success,required"`
// account settings.
Result GatewayConfigurationUpdateResponse `json:"result"`
JSON gatewayConfigurationUpdateResponseEnvelopeJSON `json:"-"`
}
// gatewayConfigurationUpdateResponseEnvelopeJSON contains the JSON metadata for
// the struct [GatewayConfigurationUpdateResponseEnvelope]
type gatewayConfigurationUpdateResponseEnvelopeJSON struct {
Errors apijson.Field
Messages apijson.Field
Success apijson.Field
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *GatewayConfigurationUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r gatewayConfigurationUpdateResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
// Whether the API call was successful
type GatewayConfigurationUpdateResponseEnvelopeSuccess bool
const (
GatewayConfigurationUpdateResponseEnvelopeSuccessTrue GatewayConfigurationUpdateResponseEnvelopeSuccess = true
)
func (r GatewayConfigurationUpdateResponseEnvelopeSuccess) IsKnown() bool {
switch r {
case GatewayConfigurationUpdateResponseEnvelopeSuccessTrue:
return true
}
return false
}
type GatewayConfigurationEditParams struct {
AccountID param.Field[string] `path:"account_id,required"`
// account settings.
Settings param.Field[GatewayConfigurationSettingsParam] `json:"settings"`
}
func (r GatewayConfigurationEditParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type GatewayConfigurationEditResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful
Success GatewayConfigurationEditResponseEnvelopeSuccess `json:"success,required"`
// account settings.
Result GatewayConfigurationEditResponse `json:"result"`
JSON gatewayConfigurationEditResponseEnvelopeJSON `json:"-"`
}
// gatewayConfigurationEditResponseEnvelopeJSON contains the JSON metadata for the
// struct [GatewayConfigurationEditResponseEnvelope]
type gatewayConfigurationEditResponseEnvelopeJSON struct {
Errors apijson.Field
Messages apijson.Field
Success apijson.Field
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *GatewayConfigurationEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r gatewayConfigurationEditResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
// Whether the API call was successful
type GatewayConfigurationEditResponseEnvelopeSuccess bool
const (
GatewayConfigurationEditResponseEnvelopeSuccessTrue GatewayConfigurationEditResponseEnvelopeSuccess = true
)
func (r GatewayConfigurationEditResponseEnvelopeSuccess) IsKnown() bool {
switch r {
case GatewayConfigurationEditResponseEnvelopeSuccessTrue:
return true
}
return false
}
type GatewayConfigurationGetParams struct {
AccountID param.Field[string] `path:"account_id,required"`
}
type GatewayConfigurationGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful
Success GatewayConfigurationGetResponseEnvelopeSuccess `json:"success,required"`
// account settings.
Result GatewayConfigurationGetResponse `json:"result"`
JSON gatewayConfigurationGetResponseEnvelopeJSON `json:"-"`
}
// gatewayConfigurationGetResponseEnvelopeJSON contains the JSON metadata for the
// struct [GatewayConfigurationGetResponseEnvelope]
type gatewayConfigurationGetResponseEnvelopeJSON struct {
Errors apijson.Field
Messages apijson.Field
Success apijson.Field
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *GatewayConfigurationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r gatewayConfigurationGetResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
// Whether the API call was successful
type GatewayConfigurationGetResponseEnvelopeSuccess bool
const (
GatewayConfigurationGetResponseEnvelopeSuccessTrue GatewayConfigurationGetResponseEnvelopeSuccess = true
)
func (r GatewayConfigurationGetResponseEnvelopeSuccess) IsKnown() bool {
switch r {
case GatewayConfigurationGetResponseEnvelopeSuccessTrue:
return true
}
return false
}