-
Notifications
You must be signed in to change notification settings - Fork 13
/
datatypes.go
4152 lines (3720 loc) · 155 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 by apic. 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 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 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"`
}
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)
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"`
}
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)
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 CertificateAuthorityCreate struct {
// human-readable description of this Certificate Authority. optional, max 255
// bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this Certificate Authority.
// optional, max 4096 bytes.
Metadata string `json:"metadata,omitempty"`
// raw PEM of the Certificate Authority
CAPEM string `json:"ca_pem,omitempty"`
}
func (x *CertificateAuthorityCreate) String() string {
return x.GoString()
}
func (x *CertificateAuthorityCreate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "CertificateAuthorityCreate {\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, "\tCAPEM\t%v\n", x.CAPEM)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type CertificateAuthorityUpdate struct {
ID string `json:"id,omitempty"`
// human-readable description of this Certificate Authority. optional, max 255
// bytes.
Description *string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this Certificate Authority.
// optional, max 4096 bytes.
Metadata *string `json:"metadata,omitempty"`
}
func (x *CertificateAuthorityUpdate) String() string {
return fmt.Sprintf("CertificateAuthorityUpdate{ID: %v}", x.ID)
}
func (x *CertificateAuthorityUpdate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "CertificateAuthorityUpdate {\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 CertificateAuthority struct {
// unique identifier for this Certificate Authority
ID string `json:"id,omitempty"`
// URI of the Certificate Authority API resource
URI string `json:"uri,omitempty"`
// timestamp when the Certificate Authority was created, RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// human-readable description of this Certificate Authority. optional, max 255
// bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this Certificate Authority.
// optional, max 4096 bytes.
Metadata string `json:"metadata,omitempty"`
// raw PEM of the Certificate Authority
CAPEM string `json:"ca_pem,omitempty"`
// subject common name of the Certificate Authority
SubjectCommonName string `json:"subject_common_name,omitempty"`
// timestamp when this Certificate Authority becomes valid, RFC 3339 format
NotBefore string `json:"not_before,omitempty"`
// timestamp when this Certificate Authority becomes invalid, RFC 3339 format
NotAfter string `json:"not_after,omitempty"`
// set of actions the private key of this Certificate Authority can be used for
KeyUsages []string `json:"key_usages,omitempty"`
// extended set of actions the private key of this Certificate Authority can be
// used for
ExtendedKeyUsages []string `json:"extended_key_usages,omitempty"`
}
func (x *CertificateAuthority) String() string {
return fmt.Sprintf("CertificateAuthority{ID: %v}", x.ID)
}
func (x *CertificateAuthority) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "CertificateAuthority {\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, "\tCAPEM\t%v\n", x.CAPEM)
fmt.Fprintf(tw, "\tSubjectCommonName\t%v\n", x.SubjectCommonName)
fmt.Fprintf(tw, "\tNotBefore\t%v\n", x.NotBefore)
fmt.Fprintf(tw, "\tNotAfter\t%v\n", x.NotAfter)
fmt.Fprintf(tw, "\tKeyUsages\t%v\n", x.KeyUsages)
fmt.Fprintf(tw, "\tExtendedKeyUsages\t%v\n", x.ExtendedKeyUsages)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type CertificateAuthorityList struct {
// the list of all certificate authorities on this account
CertificateAuthorities []CertificateAuthority `json:"certificate_authorities,omitempty"`
// URI of the certificates authorities 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 *CertificateAuthorityList) String() string {
return x.GoString()
}
func (x *CertificateAuthorityList) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "CertificateAuthorityList {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tCertificateAuthorities\t%v\n", x.CertificateAuthorities)
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 CredentialCreate struct {
// human-readable description of who or what will use the credential to
// authenticate. Optional, max 255 bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this credential. Optional, max
// 4096 bytes.
Metadata string `json:"metadata,omitempty"`
// optional list of ACL rules. If unspecified, the credential will have no
// restrictions. The only allowed ACL rule at this time is the bind rule. The bind
// rule allows the caller to restrict what domains and addresses the token is
// allowed to bind. For example, to allow the token to open a tunnel on
// example.ngrok.io your ACL would include the rule bind:example.ngrok.io. Bind
// rules may specify a leading wildcard to match multiple domains with a common
// suffix. For example, you may specify a rule of bind:*.example.com which will
// allow x.example.com, y.example.com, *.example.com, etc. A rule of '*' is
// equivalent to no acl at all and will explicitly permit all actions.
ACL []string `json:"acl,omitempty"`
}
func (x *CredentialCreate) String() string {
return x.GoString()
}
func (x *CredentialCreate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "CredentialCreate {\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, "\tACL\t%v\n", x.ACL)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type CredentialUpdate struct {
ID string `json:"id,omitempty"`
// human-readable description of who or what will use the credential to
// authenticate. Optional, max 255 bytes.
Description *string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this credential. Optional, max
// 4096 bytes.
Metadata *string `json:"metadata,omitempty"`
// optional list of ACL rules. If unspecified, the credential will have no
// restrictions. The only allowed ACL rule at this time is the bind rule. The bind
// rule allows the caller to restrict what domains and addresses the token is
// allowed to bind. For example, to allow the token to open a tunnel on
// example.ngrok.io your ACL would include the rule bind:example.ngrok.io. Bind
// rules may specify a leading wildcard to match multiple domains with a common
// suffix. For example, you may specify a rule of bind:*.example.com which will
// allow x.example.com, y.example.com, *.example.com, etc. A rule of '*' is
// equivalent to no acl at all and will explicitly permit all actions.
ACL *[]string `json:"acl,omitempty"`
}
func (x *CredentialUpdate) String() string {
return fmt.Sprintf("CredentialUpdate{ID: %v}", x.ID)
}
func (x *CredentialUpdate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "CredentialUpdate {\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, "\tACL\t%v\n", x.ACL)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type Credential struct {
// unique tunnel credential resource identifier
ID string `json:"id,omitempty"`
// URI of the tunnel credential API resource
URI string `json:"uri,omitempty"`
// timestamp when the tunnel credential was created, RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// human-readable description of who or what will use the credential to
// authenticate. Optional, max 255 bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this credential. Optional, max
// 4096 bytes.
Metadata string `json:"metadata,omitempty"`
// the credential's authtoken that can be used to authenticate an ngrok client.
// This value is only available one time, on the API response from credential
// creation, otherwise it is null.
Token *string `json:"token,omitempty"`
// optional list of ACL rules. If unspecified, the credential will have no
// restrictions. The only allowed ACL rule at this time is the bind rule. The bind
// rule allows the caller to restrict what domains and addresses the token is
// allowed to bind. For example, to allow the token to open a tunnel on
// example.ngrok.io your ACL would include the rule bind:example.ngrok.io. Bind
// rules may specify a leading wildcard to match multiple domains with a common
// suffix. For example, you may specify a rule of bind:*.example.com which will
// allow x.example.com, y.example.com, *.example.com, etc. A rule of '*' is
// equivalent to no acl at all and will explicitly permit all actions.
ACL []string `json:"acl,omitempty"`
}
func (x *Credential) String() string {
return fmt.Sprintf("Credential{ID: %v}", x.ID)
}
func (x *Credential) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "Credential {\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, "\tToken\t%v\n", x.Token)
fmt.Fprintf(tw, "\tACL\t%v\n", x.ACL)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type CredentialList struct {
// the list of all tunnel credentials on this account
Credentials []Credential `json:"credentials,omitempty"`
// URI of the tunnel credential 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 *CredentialList) String() string {
return x.GoString()
}
func (x *CredentialList) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "CredentialList {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tCredentials\t%v\n", x.Credentials)
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 EventStreamCreate struct {
// Arbitrary user-defined machine-readable data of this Event Stream. Optional, max
// 4096 bytes.
Metadata string `json:"metadata,omitempty"`
// Human-readable description of the Event Stream. Optional, max 255 bytes.
Description string `json:"description,omitempty"`
// A list of protocol-specific fields you want to collect on each event.
Fields []string `json:"fields,omitempty"`
// The protocol that determines which events will be collected. Supported values
// are tcp_connection_closed and http_request_complete.
EventType string `json:"event_type,omitempty"`
// A list of Event Destination IDs which should be used for this Event Stream.
// Event Streams are required to have at least one Event Destination.
DestinationIDs []string `json:"destination_ids,omitempty"`
// The percentage of all events you would like to capture. Valid values range from
// 0.01, representing 1% of all events to 1.00, representing 100% of all events.
SamplingRate float64 `json:"sampling_rate,omitempty"`
}
func (x *EventStreamCreate) String() string {
return x.GoString()
}
func (x *EventStreamCreate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventStreamCreate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tFields\t%v\n", x.Fields)
fmt.Fprintf(tw, "\tEventType\t%v\n", x.EventType)
fmt.Fprintf(tw, "\tDestinationIDs\t%v\n", x.DestinationIDs)
fmt.Fprintf(tw, "\tSamplingRate\t%v\n", x.SamplingRate)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type EventStreamUpdate struct {
// Unique identifier for this Event Stream.
ID string `json:"id,omitempty"`
// Arbitrary user-defined machine-readable data of this Event Stream. Optional, max
// 4096 bytes.
Metadata *string `json:"metadata,omitempty"`
// Human-readable description of the Event Stream. Optional, max 255 bytes.
Description *string `json:"description,omitempty"`
// A list of protocol-specific fields you want to collect on each event.
Fields *[]string `json:"fields,omitempty"`
// A list of Event Destination IDs which should be used for this Event Stream.
// Event Streams are required to have at least one Event Destination.
DestinationIDs *[]string `json:"destination_ids,omitempty"`
// The percentage of all events you would like to capture. Valid values range from
// 0.01, representing 1% of all events to 1.00, representing 100% of all events.
SamplingRate *float64 `json:"sampling_rate,omitempty"`
}
func (x *EventStreamUpdate) String() string {
return fmt.Sprintf("EventStreamUpdate{ID: %v}", x.ID)
}
func (x *EventStreamUpdate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventStreamUpdate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tFields\t%v\n", x.Fields)
fmt.Fprintf(tw, "\tDestinationIDs\t%v\n", x.DestinationIDs)
fmt.Fprintf(tw, "\tSamplingRate\t%v\n", x.SamplingRate)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type EventStreamList struct {
// The list of all Event Streams on this account.
EventStreams []EventStream `json:"event_streams,omitempty"`
// URI of the Event Stream 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 *EventStreamList) String() string {
return x.GoString()
}
func (x *EventStreamList) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventStreamList {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tEventStreams\t%v\n", x.EventStreams)
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 EventStream struct {
// Unique identifier for this Event Stream.
ID string `json:"id,omitempty"`
// URI of the Event Stream API resource.
URI string `json:"uri,omitempty"`
// Timestamp when the Event Stream was created, RFC 3339 format.
CreatedAt string `json:"created_at,omitempty"`
// Arbitrary user-defined machine-readable data of this Event Stream. Optional, max
// 4096 bytes.
Metadata string `json:"metadata,omitempty"`
// Human-readable description of the Event Stream. Optional, max 255 bytes.
Description string `json:"description,omitempty"`
// A list of protocol-specific fields you want to collect on each event.
Fields []string `json:"fields,omitempty"`
// The protocol that determines which events will be collected. Supported values
// are tcp_connection_closed and http_request_complete.
EventType string `json:"event_type,omitempty"`
// A list of Event Destination IDs which should be used for this Event Stream.
// Event Streams are required to have at least one Event Destination.
DestinationIDs []string `json:"destination_ids,omitempty"`
// The percentage of all events you would like to capture. Valid values range from
// 0.01, representing 1% of all events to 1.00, representing 100% of all events.
SamplingRate float64 `json:"sampling_rate,omitempty"`
}
func (x *EventStream) String() string {
return fmt.Sprintf("EventStream{ID: %v}", x.ID)
}
func (x *EventStream) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventStream {\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, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tFields\t%v\n", x.Fields)
fmt.Fprintf(tw, "\tEventType\t%v\n", x.EventType)
fmt.Fprintf(tw, "\tDestinationIDs\t%v\n", x.DestinationIDs)
fmt.Fprintf(tw, "\tSamplingRate\t%v\n", x.SamplingRate)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type EventDestinationCreate struct {
// Arbitrary user-defined machine-readable data of this Event Destination.
// Optional, max 4096 bytes.
Metadata string `json:"metadata,omitempty"`
// Human-readable description of the Event Destination. Optional, max 255 bytes.
Description string `json:"description,omitempty"`
// The output format you would like to serialize events into when sending to their
// target. Currently the only accepted value is JSON.
Format string `json:"format,omitempty"`
// An object that encapsulates where and how to send your events. An event
// destination must contain exactly one of the following objects, leaving the rest
// null: kinesis, firehose, cloudwatch_logs, or s3.
Target EventTarget `json:"target,omitempty"`
}
func (x *EventDestinationCreate) String() string {
return x.GoString()
}
func (x *EventDestinationCreate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventDestinationCreate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tFormat\t%v\n", x.Format)
fmt.Fprintf(tw, "\tTarget\t%v\n", x.Target)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type EventDestinationUpdate struct {
// Unique identifier for this Event Destination.
ID string `json:"id,omitempty"`
// Arbitrary user-defined machine-readable data of this Event Destination.
// Optional, max 4096 bytes.
Metadata *string `json:"metadata,omitempty"`
// Human-readable description of the Event Destination. Optional, max 255 bytes.
Description *string `json:"description,omitempty"`
// The output format you would like to serialize events into when sending to their
// target. Currently the only accepted value is JSON.
Format *string `json:"format,omitempty"`
// An object that encapsulates where and how to send your events. An event
// destination must contain exactly one of the following objects, leaving the rest
// null: kinesis, firehose, cloudwatch_logs, or s3.
Target *EventTarget `json:"target,omitempty"`
}
func (x *EventDestinationUpdate) String() string {
return fmt.Sprintf("EventDestinationUpdate{ID: %v}", x.ID)
}
func (x *EventDestinationUpdate) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventDestinationUpdate {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tFormat\t%v\n", x.Format)
fmt.Fprintf(tw, "\tTarget\t%v\n", x.Target)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type EventDestination struct {
// Unique identifier for this Event Destination.
ID string `json:"id,omitempty"`
// Arbitrary user-defined machine-readable data of this Event Destination.
// Optional, max 4096 bytes.
Metadata string `json:"metadata,omitempty"`
// Timestamp when the Event Destination was created, RFC 3339 format.
CreatedAt string `json:"created_at,omitempty"`
// Human-readable description of the Event Destination. Optional, max 255 bytes.
Description string `json:"description,omitempty"`
// The output format you would like to serialize events into when sending to their
// target. Currently the only accepted value is JSON.
Format string `json:"format,omitempty"`
// An object that encapsulates where and how to send your events. An event
// destination must contain exactly one of the following objects, leaving the rest
// null: kinesis, firehose, cloudwatch_logs, or s3.
Target EventTarget `json:"target,omitempty"`
// URI of the Event Destination API resource.
URI string `json:"uri,omitempty"`
}
func (x *EventDestination) String() string {
return fmt.Sprintf("EventDestination{ID: %v}", x.ID)
}
func (x *EventDestination) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventDestination {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
fmt.Fprintf(tw, "\tCreatedAt\t%v\n", x.CreatedAt)
fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
fmt.Fprintf(tw, "\tFormat\t%v\n", x.Format)
fmt.Fprintf(tw, "\tTarget\t%v\n", x.Target)
fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type EventDestinationList struct {
// The list of all Event Destinations on this account.
EventDestinations []EventDestination `json:"event_destinations,omitempty"`
// URI of the Event Destinations 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 *EventDestinationList) String() string {
return x.GoString()
}
func (x *EventDestinationList) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventDestinationList {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tEventDestinations\t%v\n", x.EventDestinations)
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 EventTarget struct {
// Configuration used to send events to Amazon Kinesis Data Firehose.
Firehose *EventTargetFirehose `json:"firehose,omitempty"`
// Configuration used to send events to Amazon Kinesis.
Kinesis *EventTargetKinesis `json:"kinesis,omitempty"`
// Configuration used to send events to Amazon CloudWatch Logs.
CloudwatchLogs *EventTargetCloudwatchLogs `json:"cloudwatch_logs,omitempty"`
}
func (x *EventTarget) String() string {
return x.GoString()
}
func (x *EventTarget) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventTarget {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tFirehose\t%v\n", x.Firehose)
fmt.Fprintf(tw, "\tKinesis\t%v\n", x.Kinesis)
fmt.Fprintf(tw, "\tCloudwatchLogs\t%v\n", x.CloudwatchLogs)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type EventTargetFirehose struct {
// Configuration for how to authenticate into your AWS account. Exactly one of role
// or creds should be configured.
Auth AWSAuth `json:"auth,omitempty"`
// An Amazon Resource Name specifying the Firehose delivery stream to deposit
// events into.
DeliveryStreamARN string `json:"delivery_stream_arn,omitempty"`
}
func (x *EventTargetFirehose) String() string {
return x.GoString()
}
func (x *EventTargetFirehose) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventTargetFirehose {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tAuth\t%v\n", x.Auth)
fmt.Fprintf(tw, "\tDeliveryStreamARN\t%v\n", x.DeliveryStreamARN)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type EventTargetKinesis struct {
// Configuration for how to authenticate into your AWS account. Exactly one of role
// or creds should be configured.
Auth AWSAuth `json:"auth,omitempty"`
// An Amazon Resource Name specifying the Kinesis stream to deposit events into.
StreamARN string `json:"stream_arn,omitempty"`
}
func (x *EventTargetKinesis) String() string {
return x.GoString()
}
func (x *EventTargetKinesis) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventTargetKinesis {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tAuth\t%v\n", x.Auth)
fmt.Fprintf(tw, "\tStreamARN\t%v\n", x.StreamARN)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type EventTargetCloudwatchLogs struct {
// Configuration for how to authenticate into your AWS account. Exactly one of role
// or creds should be configured.
Auth AWSAuth `json:"auth,omitempty"`
// An Amazon Resource Name specifying the CloudWatch Logs group to deposit events
// into.
LogGroupARN string `json:"log_group_arn,omitempty"`
}
func (x *EventTargetCloudwatchLogs) String() string {
return x.GoString()
}
func (x *EventTargetCloudwatchLogs) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "EventTargetCloudwatchLogs {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tAuth\t%v\n", x.Auth)
fmt.Fprintf(tw, "\tLogGroupARN\t%v\n", x.LogGroupARN)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AWSAuth struct {
// A role for ngrok to assume on your behalf to deposit events into your AWS
// account.
Role *AWSRole `json:"role,omitempty"`
// Credentials to your AWS account if you prefer ngrok to sign in with long-term
// access keys.
Creds *AWSCredentials `json:"creds,omitempty"`
}
func (x *AWSAuth) String() string {
return x.GoString()
}
func (x *AWSAuth) GoString() string {
var b bytes.Buffer
fmt.Fprintf(&b, "AWSAuth {\n")
tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
fmt.Fprintf(tw, "\tRole\t%v\n", x.Role)
fmt.Fprintf(tw, "\tCreds\t%v\n", x.Creds)
tw.Flush()
fmt.Fprintf(&b, "}\n")
return b.String()
}
type AWSRole struct {
// An ARN that specifies the role that ngrok should use to deliver to the
// configured target.
RoleARN string `json:"role_arn,omitempty"`
}