-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdatatypes.go
6827 lines (6104 loc) · 246 KB
/
datatypes.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
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated for API Clients. DO NOT EDIT.
package ngrok
import (
"bytes"
"fmt"
"text/tabwriter"
)
type Empty struct {
}
func (x *Empty) String() string {
return x.GoString()
}
func (x *Empty) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "Empty {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type Item struct {
// a resource identifier
ID string `json:"id,omitempty"`
}
func (x *Item) String() string {
return fmt.Sprintf("Item{ID: %v}", x.ID)
}
func (x *Item) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "Item {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type Paging struct {
BeforeID *string `json:"before_id,omitempty"`
Limit *string `json:"limit,omitempty"`
}
func (x *Paging) String() string {
return x.GoString()
}
func (x *Paging) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "Paging {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tBeforeID\t%v\n", x.BeforeID)
fmt.Fprintf(tw, "\tLimit\t%v\n", x.Limit)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type ItemPaging struct {
// a resource identifier
ID string `json:"id,omitempty"`
BeforeID *string `json:"before_id,omitempty"`
Limit *string `json:"limit,omitempty"`
}
func (x *ItemPaging) String() string {
return fmt.Sprintf("ItemPaging{ID: %v}", x.ID)
}
func (x *ItemPaging) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "ItemPaging {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tBeforeID\t%v\n", x.BeforeID)
fmt.Fprintf(tw, "\tLimit\t%v\n", x.Limit)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type Error struct {
ErrorCode string `json:"error_code,omitempty"`
StatusCode int32 `json:"status_code,omitempty"`
Msg string `json:"msg,omitempty"`
Details map[string]string `json:"details,omitempty"`
}
func (x *Error) String() string {
return x.GoString()
}
func (x *Error) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "Error {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tErrorCode\t%v\n", x.ErrorCode)
fmt.Fprintf(tw, "\tStatusCode\t%v\n", x.StatusCode)
fmt.Fprintf(tw, "\tMsg\t%v\n", x.Msg)
fmt.Fprintf(tw, "\tDetails\t%v\n", x.Details)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type Ref struct {
// a resource identifier
ID string `json:"id,omitempty"`
// a uri for locating a resource
URI string `json:"uri,omitempty"`
}
func (x *Ref) String() string {
return fmt.Sprintf("Ref{ID: %v}", x.ID)
}
func (x *Ref) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "Ref {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AbuseReport struct {
// ID of the abuse report
ID string `json:"id,omitempty"`
// URI of the abuse report API resource
URI string `json:"uri,omitempty"`
// timestamp that the abuse report record was created in RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// a list of URLs containing suspected abusive content
URLs []string `json:"urls,omitempty"`
// arbitrary user-defined data about this abuse report. Optional, max 4096 bytes.
Metadata string `json:"metadata,omitempty"`
// Indicates whether ngrok has processed the abuse report. one of PENDING,
// PROCESSED, or PARTIALLY_PROCESSED
Status string `json:"status,omitempty"`
// an array of hostname statuses related to the report
Hostnames []AbuseReportHostname `json:"hostnames,omitempty"`
}
func (x *AbuseReport) String() string {
return fmt.Sprintf("AbuseReport{ID: %v}", x.ID)
}
func (x *AbuseReport) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AbuseReport {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tCreatedAt\t%v\n", x.CreatedAt)
fmt.Fprintf(tw, "\tURLs\t%v\n", x.URLs)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tStatus\t%v\n", x.Status)
fmt.Fprintf(tw, "\tHostnames\t%v\n", x.Hostnames)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AbuseReportHostname struct {
// the hostname ngrok has parsed out of one of the reported URLs in this abuse
// report
Hostname string `json:"hostname,omitempty"`
// indicates what action ngrok has taken against the hostname. one of PENDING,
// BANNED, UNBANNED, or IGNORE
Status string `json:"status,omitempty"`
}
func (x *AbuseReportHostname) String() string {
return x.GoString()
}
func (x *AbuseReportHostname) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AbuseReportHostname {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tHostname\t%v\n", x.Hostname)
fmt.Fprintf(tw, "\tStatus\t%v\n", x.Status)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AbuseReportCreate struct {
// a list of URLs containing suspected abusive content
URLs []string `json:"urls,omitempty"`
// arbitrary user-defined data about this abuse report. Optional, max 4096 bytes.
Metadata string `json:"metadata,omitempty"`
}
func (x *AbuseReportCreate) String() string {
return x.GoString()
}
func (x *AbuseReportCreate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AbuseReportCreate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tURLs\t%v\n", x.URLs)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AgentIngressCreate struct {
// human-readable description of the use of this Agent Ingress. optional, max 255
// bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this Agent Ingress. optional,
// max 4096 bytes
Metadata string `json:"metadata,omitempty"`
// the domain that you own to be used as the base domain name to generate regional
// agent ingress domains.
Domain string `json:"domain,omitempty"`
// configuration for automatic management of TLS certificates for this domain, or
// null if automatic management is disabled. Optional.
CertificateManagementPolicy *AgentIngressCertPolicy `json:"certificate_management_policy,omitempty"`
}
func (x *AgentIngressCreate) String() string {
return x.GoString()
}
func (x *AgentIngressCreate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AgentIngressCreate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tDomain\t%v\n", x.Domain)
fmt.Fprintf(tw, "\tCertificateManagementPolicy\t%v\n", x.CertificateManagementPolicy)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AgentIngressUpdate struct {
ID string `json:"id,omitempty"`
// human-readable description of the use of this Agent Ingress. optional, max 255
// bytes.
Description *string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this Agent Ingress. optional,
// max 4096 bytes
Metadata *string `json:"metadata,omitempty"`
// configuration for automatic management of TLS certificates for this domain, or
// null if automatic management is disabled. Optional.
CertificateManagementPolicy *AgentIngressCertPolicy `json:"certificate_management_policy,omitempty"`
}
func (x *AgentIngressUpdate) String() string {
return fmt.Sprintf("AgentIngressUpdate{ID: %v}", x.ID)
}
func (x *AgentIngressUpdate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AgentIngressUpdate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tCertificateManagementPolicy\t%v\n", x.CertificateManagementPolicy)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AgentIngress struct {
// unique Agent Ingress resource identifier
ID string `json:"id,omitempty"`
// URI to the API resource of this Agent ingress
URI string `json:"uri,omitempty"`
// human-readable description of the use of this Agent Ingress. optional, max 255
// bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this Agent Ingress. optional,
// max 4096 bytes
Metadata string `json:"metadata,omitempty"`
// the domain that you own to be used as the base domain name to generate regional
// agent ingress domains.
Domain string `json:"domain,omitempty"`
// a list of target values to use as the values of NS records for the domain
// property these values will delegate control over the domain to ngrok
NSTargets []string `json:"ns_targets,omitempty"`
// a list of regional agent ingress domains that are subdomains of the value of
// domain this value may increase over time as ngrok adds more regions
RegionDomains []string `json:"region_domains,omitempty"`
// timestamp when the Agent Ingress was created, RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// configuration for automatic management of TLS certificates for this domain, or
// null if automatic management is disabled
CertificateManagementPolicy *AgentIngressCertPolicy `json:"certificate_management_policy,omitempty"`
// status of the automatic certificate management for this domain, or null if
// automatic management is disabled
CertificateManagementStatus *AgentIngressCertStatus `json:"certificate_management_status,omitempty"`
}
func (x *AgentIngress) String() string {
return fmt.Sprintf("AgentIngress{ID: %v}", x.ID)
}
func (x *AgentIngress) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AgentIngress {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tDomain\t%v\n", x.Domain)
fmt.Fprintf(tw, "\tNSTargets\t%v\n", x.NSTargets)
fmt.Fprintf(tw, "\tRegionDomains\t%v\n", x.RegionDomains)
fmt.Fprintf(tw, "\tCreatedAt\t%v\n", x.CreatedAt)
fmt.Fprintf(tw, "\tCertificateManagementPolicy\t%v\n", x.CertificateManagementPolicy)
fmt.Fprintf(tw, "\tCertificateManagementStatus\t%v\n", x.CertificateManagementStatus)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AgentIngressList struct {
// the list of Agent Ingresses owned by this account
Ingresses []AgentIngress `json:"ingresses,omitempty"`
// URI of the Agent Ingress list API resource
URI string `json:"uri,omitempty"`
// URI of the next page, or null if there is no next page
NextPageURI *string `json:"next_page_uri,omitempty"`
}
func (x *AgentIngressList) String() string {
return x.GoString()
}
func (x *AgentIngressList) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AgentIngressList {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tIngresses\t%v\n", x.Ingresses)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tNextPageURI\t%v\n", x.NextPageURI)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AgentIngressCertPolicy struct {
// certificate authority to request certificates from. The only supported value is
// letsencrypt.
Authority string `json:"authority,omitempty"`
// type of private key to use when requesting certificates. Defaults to rsa, can be
// either rsa or ecdsa.
PrivateKeyType string `json:"private_key_type,omitempty"`
}
func (x *AgentIngressCertPolicy) String() string {
return x.GoString()
}
func (x *AgentIngressCertPolicy) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AgentIngressCertPolicy {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tAuthority\t%v\n", x.Authority)
fmt.Fprintf(tw, "\tPrivateKeyType\t%v\n", x.PrivateKeyType)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AgentIngressCertStatus struct {
// timestamp when the next renewal will be requested, RFC 3339 format
RenewsAt *string `json:"renews_at,omitempty"`
// status of the certificate provisioning job, or null if the certificiate isn't
// being provisioned or renewed
ProvisioningJob *AgentIngressCertJob `json:"provisioning_job,omitempty"`
}
func (x *AgentIngressCertStatus) String() string {
return x.GoString()
}
func (x *AgentIngressCertStatus) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AgentIngressCertStatus {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tRenewsAt\t%v\n", x.RenewsAt)
fmt.Fprintf(tw, "\tProvisioningJob\t%v\n", x.ProvisioningJob)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AgentIngressCertJob struct {
// if present, an error code indicating why provisioning is failing. It may be
// either a temporary condition (INTERNAL_ERROR), or a permanent one the user must
// correct (DNS_ERROR).
ErrorCode *string `json:"error_code,omitempty"`
// a message describing the current status or error
Msg string `json:"msg,omitempty"`
// timestamp when the provisioning job started, RFC 3339 format
StartedAt string `json:"started_at,omitempty"`
// timestamp when the provisioning job will be retried
RetriesAt *string `json:"retries_at,omitempty"`
}
func (x *AgentIngressCertJob) String() string {
return x.GoString()
}
func (x *AgentIngressCertJob) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AgentIngressCertJob {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tErrorCode\t%v\n", x.ErrorCode)
fmt.Fprintf(tw, "\tMsg\t%v\n", x.Msg)
fmt.Fprintf(tw, "\tStartedAt\t%v\n", x.StartedAt)
fmt.Fprintf(tw, "\tRetriesAt\t%v\n", x.RetriesAt)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type APIKeyCreate struct {
// human-readable description of what uses the API key to authenticate. optional,
// max 255 bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined data of this API key. optional, max 4096 bytes
Metadata string `json:"metadata,omitempty"`
// If supplied at credential creation, ownership will be assigned to the specified
// User or Bot. Only admins may specify an owner other than themselves. Defaults to
// the authenticated User or Bot.
OwnerID *string `json:"owner_id,omitempty"`
}
func (x *APIKeyCreate) String() string {
return x.GoString()
}
func (x *APIKeyCreate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "APIKeyCreate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tOwnerID\t%v\n", x.OwnerID)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type APIKeyUpdate struct {
ID string `json:"id,omitempty"`
// human-readable description of what uses the API key to authenticate. optional,
// max 255 bytes.
Description *string `json:"description,omitempty"`
// arbitrary user-defined data of this API key. optional, max 4096 bytes
Metadata *string `json:"metadata,omitempty"`
}
func (x *APIKeyUpdate) String() string {
return fmt.Sprintf("APIKeyUpdate{ID: %v}", x.ID)
}
func (x *APIKeyUpdate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "APIKeyUpdate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type APIKey struct {
// unique API key resource identifier
ID string `json:"id,omitempty"`
// URI to the API resource of this API key
URI string `json:"uri,omitempty"`
// human-readable description of what uses the API key to authenticate. optional,
// max 255 bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined data of this API key. optional, max 4096 bytes
Metadata string `json:"metadata,omitempty"`
// timestamp when the api key was created, RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// the bearer token that can be placed into the Authorization header to
// authenticate request to the ngrok API. This value is only available one time, on
// the API response from key creation. Otherwise it is null.
Token *string `json:"token,omitempty"`
// If supplied at credential creation, ownership will be assigned to the specified
// User or Bot. Only admins may specify an owner other than themselves. Defaults to
// the authenticated User or Bot.
OwnerID *string `json:"owner_id,omitempty"`
}
func (x *APIKey) String() string {
return fmt.Sprintf("APIKey{ID: %v}", x.ID)
}
func (x *APIKey) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "APIKey {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tCreatedAt\t%v\n", x.CreatedAt)
fmt.Fprintf(tw, "\tToken\t%v\n", x.Token)
fmt.Fprintf(tw, "\tOwnerID\t%v\n", x.OwnerID)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type APIKeyList struct {
// the list of API keys for this account
Keys []APIKey `json:"keys,omitempty"`
// URI of the API keys list API resource
URI string `json:"uri,omitempty"`
// URI of the next page, or null if there is no next page
NextPageURI *string `json:"next_page_uri,omitempty"`
}
func (x *APIKeyList) String() string {
return x.GoString()
}
func (x *APIKeyList) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "APIKeyList {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tKeys\t%v\n", x.Keys)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tNextPageURI\t%v\n", x.NextPageURI)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type ApplicationSession struct {
// unique application session resource identifier
ID string `json:"id,omitempty"`
// URI of the application session API resource
URI string `json:"uri,omitempty"`
// URL of the hostport served by this endpoint
PublicURL string `json:"public_url,omitempty"`
// browser session details of the application session
BrowserSession BrowserSession `json:"browser_session,omitempty"`
// application user this session is associated with
ApplicationUser *Ref `json:"application_user,omitempty"`
// timestamp when the user was created in RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// timestamp when the user was last active in RFC 3339 format
LastActive string `json:"last_active,omitempty"`
// timestamp when session expires in RFC 3339 format
ExpiresAt string `json:"expires_at,omitempty"`
// ephemeral endpoint this session is associated with
Endpoint *Ref `json:"endpoint,omitempty"`
// edge this session is associated with, null if the endpoint is agent-initiated
Edge *Ref `json:"edge,omitempty"`
// route this session is associated with, null if the endpoint is agent-initiated
Route *Ref `json:"route,omitempty"`
}
func (x *ApplicationSession) String() string {
return fmt.Sprintf("ApplicationSession{ID: %v}", x.ID)
}
func (x *ApplicationSession) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "ApplicationSession {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tPublicURL\t%v\n", x.PublicURL)
fmt.Fprintf(tw, "\tBrowserSession\t%v\n", x.BrowserSession)
fmt.Fprintf(tw, "\tApplicationUser\t%v\n", x.ApplicationUser)
fmt.Fprintf(tw, "\tCreatedAt\t%v\n", x.CreatedAt)
fmt.Fprintf(tw, "\tLastActive\t%v\n", x.LastActive)
fmt.Fprintf(tw, "\tExpiresAt\t%v\n", x.ExpiresAt)
fmt.Fprintf(tw, "\tEndpoint\t%v\n", x.Endpoint)
fmt.Fprintf(tw, "\tEdge\t%v\n", x.Edge)
fmt.Fprintf(tw, "\tRoute\t%v\n", x.Route)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type ApplicationSessionList struct {
// list of all application sessions on this account
ApplicationSessions []ApplicationSession `json:"application_sessions,omitempty"`
// URI of the application session list API resource
URI string `json:"uri,omitempty"`
// URI of the next page, or null if there is no next page
NextPageURI *string `json:"next_page_uri,omitempty"`
}
func (x *ApplicationSessionList) String() string {
return x.GoString()
}
func (x *ApplicationSessionList) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "ApplicationSessionList {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tApplicationSessions\t%v\n", x.ApplicationSessions)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tNextPageURI\t%v\n", x.NextPageURI)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type BrowserSession struct {
// HTTP User-Agent data
UserAgent UserAgent `json:"user_agent,omitempty"`
// IP address
IPAddress string `json:"ip_address,omitempty"`
// IP geolocation data
Location *Location `json:"location,omitempty"`
}
func (x *BrowserSession) String() string {
return x.GoString()
}
func (x *BrowserSession) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "BrowserSession {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tUserAgent\t%v\n", x.UserAgent)
fmt.Fprintf(tw, "\tIPAddress\t%v\n", x.IPAddress)
fmt.Fprintf(tw, "\tLocation\t%v\n", x.Location)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type UserAgent struct {
// raw User-Agent request header
Raw string `json:"raw,omitempty"`
// browser name (e.g. Chrome)
BrowserName string `json:"browser_name,omitempty"`
// browser version (e.g. 102)
BrowserVersion string `json:"browser_version,omitempty"`
// type of device (e.g. Desktop)
DeviceType string `json:"device_type,omitempty"`
// operating system name (e.g. MacOS)
OSName string `json:"os_name,omitempty"`
// operating system version (e.g. 10.15.7)
OSVersion string `json:"os_version,omitempty"`
}
func (x *UserAgent) String() string {
return x.GoString()
}
func (x *UserAgent) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "UserAgent {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tRaw\t%v\n", x.Raw)
fmt.Fprintf(tw, "\tBrowserName\t%v\n", x.BrowserName)
fmt.Fprintf(tw, "\tBrowserVersion\t%v\n", x.BrowserVersion)
fmt.Fprintf(tw, "\tDeviceType\t%v\n", x.DeviceType)
fmt.Fprintf(tw, "\tOSName\t%v\n", x.OSName)
fmt.Fprintf(tw, "\tOSVersion\t%v\n", x.OSVersion)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type Location struct {
// ISO country code
CountryCode *string `json:"country_code,omitempty"`
// geographical latitude
Latitude *float64 `json:"latitude,omitempty"`
// geographical longitude
Longitude *float64 `json:"longitude,omitempty"`
// accuracy radius of the geographical coordinates
LatLongRadiusKm *uint64 `json:"lat_long_radius_km,omitempty"`
}
func (x *Location) String() string {
return x.GoString()
}
func (x *Location) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "Location {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tCountryCode\t%v\n", x.CountryCode)
fmt.Fprintf(tw, "\tLatitude\t%v\n", x.Latitude)
fmt.Fprintf(tw, "\tLongitude\t%v\n", x.Longitude)
fmt.Fprintf(tw, "\tLatLongRadiusKm\t%v\n", x.LatLongRadiusKm)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type ApplicationUser struct {
// unique application user resource identifier
ID string `json:"id,omitempty"`
// URI of the application user API resource
URI string `json:"uri,omitempty"`
// identity provider that the user authenticated with
IdentityProvider IdentityProvider `json:"identity_provider,omitempty"`
// unique user identifier
ProviderUserID string `json:"provider_user_id,omitempty"`
// user username
Username string `json:"username,omitempty"`
// user email
Email string `json:"email,omitempty"`
// user common name
Name string `json:"name,omitempty"`
// timestamp when the user was created in RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// timestamp when the user was last active in RFC 3339 format
LastActive string `json:"last_active,omitempty"`
// timestamp when the user last signed-in in RFC 3339 format
LastLogin string `json:"last_login,omitempty"`
}
func (x *ApplicationUser) String() string {
return fmt.Sprintf("ApplicationUser{ID: %v}", x.ID)
}
func (x *ApplicationUser) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "ApplicationUser {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tIdentityProvider\t%v\n", x.IdentityProvider)
fmt.Fprintf(tw, "\tProviderUserID\t%v\n", x.ProviderUserID)
fmt.Fprintf(tw, "\tUsername\t%v\n", x.Username)
fmt.Fprintf(tw, "\tEmail\t%v\n", x.Email)
fmt.Fprintf(tw, "\tName\t%v\n", x.Name)
fmt.Fprintf(tw, "\tCreatedAt\t%v\n", x.CreatedAt)
fmt.Fprintf(tw, "\tLastActive\t%v\n", x.LastActive)
fmt.Fprintf(tw, "\tLastLogin\t%v\n", x.LastLogin)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type ApplicationUserList struct {
// list of all application users on this account
ApplicationUsers []ApplicationUser `json:"application_users,omitempty"`
// URI of the application user list API resource
URI string `json:"uri,omitempty"`
// URI of the next page, or null if there is no next page
NextPageURI *string `json:"next_page_uri,omitempty"`
}
func (x *ApplicationUserList) String() string {
return x.GoString()
}
func (x *ApplicationUserList) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "ApplicationUserList {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tApplicationUsers\t%v\n", x.ApplicationUsers)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tNextPageURI\t%v\n", x.NextPageURI)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type IdentityProvider struct {
// name of the identity provider (e.g. Google)
Name string `json:"name,omitempty"`
// URL of the identity provider (e.g. https://accounts.google.com
// (https://accounts.google.com))
URL string `json:"url,omitempty"`
}
func (x *IdentityProvider) String() string {
return x.GoString()
}
func (x *IdentityProvider) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "IdentityProvider {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tName\t%v\n", x.Name)
fmt.Fprintf(tw, "\tURL\t%v\n", x.URL)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type TunnelSession struct {
// version of the ngrok agent that started this ngrok tunnel session
AgentVersion string `json:"agent_version,omitempty"`
// reference to the tunnel credential or ssh credential used by the ngrok agent to
// start this tunnel session
Credential Ref `json:"credential,omitempty"`
// unique tunnel session resource identifier
ID string `json:"id,omitempty"`
// source ip address of the tunnel session
IP string `json:"ip,omitempty"`
// arbitrary user-defined data specified in the metadata property in the ngrok
// configuration file. See the metadata configuration option
Metadata string `json:"metadata,omitempty"`
// operating system of the host the ngrok agent is running on
OS string `json:"os,omitempty"`
// the ngrok region identifier in which this tunnel session was started
Region string `json:"region,omitempty"`
// time when the tunnel session first connected to the ngrok servers
StartedAt string `json:"started_at,omitempty"`
// the transport protocol used to start the tunnel session. Either ngrok/v2 or ssh
Transport string `json:"transport,omitempty"`
// URI to the API resource of the tunnel session
URI string `json:"uri,omitempty"`
}
func (x *TunnelSession) String() string {
return fmt.Sprintf("TunnelSession{ID: %v}", x.ID)
}
func (x *TunnelSession) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "TunnelSession {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tAgentVersion\t%v\n", x.AgentVersion)
fmt.Fprintf(tw, "\tCredential\t%v\n", x.Credential)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tIP\t%v\n", x.IP)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tOS\t%v\n", x.OS)
fmt.Fprintf(tw, "\tRegion\t%v\n", x.Region)
fmt.Fprintf(tw, "\tStartedAt\t%v\n", x.StartedAt)
fmt.Fprintf(tw, "\tTransport\t%v\n", x.Transport)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type TunnelSessionList struct {
// list of all tunnel sessions on this account
TunnelSessions []TunnelSession `json:"tunnel_sessions,omitempty"`
// URI to the API resource of the tunnel session list
URI string `json:"uri,omitempty"`
// URI of the next page, or null if there is no next page
NextPageURI *string `json:"next_page_uri,omitempty"`
}
func (x *TunnelSessionList) String() string {
return x.GoString()
}
func (x *TunnelSessionList) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "TunnelSessionList {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tTunnelSessions\t%v\n", x.TunnelSessions)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tNextPageURI\t%v\n", x.NextPageURI)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type TunnelSessionsUpdate struct {
ID string `json:"id,omitempty"`
}
func (x *TunnelSessionsUpdate) String() string {
return fmt.Sprintf("TunnelSessionsUpdate{ID: %v}", x.ID)
}
func (x *TunnelSessionsUpdate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "TunnelSessionsUpdate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type FailoverBackend struct {
// unique identifier for this Failover backend
ID string `json:"id,omitempty"`
// URI of the FailoverBackend API resource
URI string `json:"uri,omitempty"`
// timestamp when the backend was created, RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// human-readable description of this backend. Optional
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this backend. Optional
Metadata string `json:"metadata,omitempty"`
// the ids of the child backends in order
Backends []string `json:"backends,omitempty"`
}
func (x *FailoverBackend) String() string {
return fmt.Sprintf("FailoverBackend{ID: %v}", x.ID)
}
func (x *FailoverBackend) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "FailoverBackend {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
fmt.Fprintf(tw, "\tCreatedAt\t%v\n", x.CreatedAt)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tBackends\t%v\n", x.Backends)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type FailoverBackendCreate struct {
// human-readable description of this backend. Optional
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this backend. Optional
Metadata string `json:"metadata,omitempty"`
// the ids of the child backends in order
Backends []string `json:"backends,omitempty"`
}
func (x *FailoverBackendCreate) String() string {
return x.GoString()
}
func (x *FailoverBackendCreate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "FailoverBackendCreate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tBackends\t%v\n", x.Backends)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type FailoverBackendUpdate struct {
ID string `json:"id,omitempty"`
// human-readable description of this backend. Optional
Description *string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this backend. Optional
Metadata *string `json:"metadata,omitempty"`
// the ids of the child backends in order
Backends []string `json:"backends,omitempty"`
}
func (x *FailoverBackendUpdate) String() string {
return fmt.Sprintf("FailoverBackendUpdate{ID: %v}", x.ID)
}
func (x *FailoverBackendUpdate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "FailoverBackendUpdate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tBackends\t%v\n", x.Backends)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}