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 package domainsrdap
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "net/http"
61 "net/url"
62 "strconv"
63 "strings"
64
65 googleapi "google.golang.org/api/googleapi"
66 internal "google.golang.org/api/internal"
67 gensupport "google.golang.org/api/internal/gensupport"
68 option "google.golang.org/api/option"
69 internaloption "google.golang.org/api/option/internaloption"
70 htransport "google.golang.org/api/transport/http"
71 )
72
73
74
75 var _ = bytes.NewBuffer
76 var _ = strconv.Itoa
77 var _ = fmt.Sprintf
78 var _ = json.NewDecoder
79 var _ = io.Copy
80 var _ = url.Parse
81 var _ = gensupport.MarshalJSON
82 var _ = googleapi.Version
83 var _ = errors.New
84 var _ = strings.Replace
85 var _ = context.Canceled
86 var _ = internaloption.WithDefaultEndpoint
87 var _ = internal.Version
88
89 const apiId = "domainsrdap:v1"
90 const apiName = "domainsrdap"
91 const apiVersion = "v1"
92 const basePath = "https://domainsrdap.googleapis.com/"
93 const basePathTemplate = "https://domainsrdap.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://domainsrdap.mtls.googleapis.com/"
95
96
97 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
98 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
99 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
100 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
101 opts = append(opts, internaloption.EnableNewAuthLibrary())
102 client, endpoint, err := htransport.NewClient(ctx, opts...)
103 if err != nil {
104 return nil, err
105 }
106 s, err := New(client)
107 if err != nil {
108 return nil, err
109 }
110 if endpoint != "" {
111 s.BasePath = endpoint
112 }
113 return s, nil
114 }
115
116
117
118
119
120
121 func New(client *http.Client) (*Service, error) {
122 if client == nil {
123 return nil, errors.New("client is nil")
124 }
125 s := &Service{client: client, BasePath: basePath}
126 s.Autnum = NewAutnumService(s)
127 s.Domain = NewDomainService(s)
128 s.Entity = NewEntityService(s)
129 s.Ip = NewIpService(s)
130 s.Nameserver = NewNameserverService(s)
131 s.V1 = NewV1Service(s)
132 return s, nil
133 }
134
135 type Service struct {
136 client *http.Client
137 BasePath string
138 UserAgent string
139
140 Autnum *AutnumService
141
142 Domain *DomainService
143
144 Entity *EntityService
145
146 Ip *IpService
147
148 Nameserver *NameserverService
149
150 V1 *V1Service
151 }
152
153 func (s *Service) userAgent() string {
154 if s.UserAgent == "" {
155 return googleapi.UserAgent
156 }
157 return googleapi.UserAgent + " " + s.UserAgent
158 }
159
160 func NewAutnumService(s *Service) *AutnumService {
161 rs := &AutnumService{s: s}
162 return rs
163 }
164
165 type AutnumService struct {
166 s *Service
167 }
168
169 func NewDomainService(s *Service) *DomainService {
170 rs := &DomainService{s: s}
171 return rs
172 }
173
174 type DomainService struct {
175 s *Service
176 }
177
178 func NewEntityService(s *Service) *EntityService {
179 rs := &EntityService{s: s}
180 return rs
181 }
182
183 type EntityService struct {
184 s *Service
185 }
186
187 func NewIpService(s *Service) *IpService {
188 rs := &IpService{s: s}
189 return rs
190 }
191
192 type IpService struct {
193 s *Service
194 }
195
196 func NewNameserverService(s *Service) *NameserverService {
197 rs := &NameserverService{s: s}
198 return rs
199 }
200
201 type NameserverService struct {
202 s *Service
203 }
204
205 func NewV1Service(s *Service) *V1Service {
206 rs := &V1Service{s: s}
207 return rs
208 }
209
210 type V1Service struct {
211 s *Service
212 }
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231 type HttpBody struct {
232
233
234 ContentType string `json:"contentType,omitempty"`
235
236 Data string `json:"data,omitempty"`
237
238
239 Extensions []googleapi.RawMessage `json:"extensions,omitempty"`
240
241
242 googleapi.ServerResponse `json:"-"`
243
244
245
246
247
248 ForceSendFields []string `json:"-"`
249
250
251
252
253 NullFields []string `json:"-"`
254 }
255
256 func (s *HttpBody) MarshalJSON() ([]byte, error) {
257 type NoMethod HttpBody
258 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
259 }
260
261
262
263 type Link struct {
264
265 Href string `json:"href,omitempty"`
266
267 Hreflang string `json:"hreflang,omitempty"`
268
269 Media string `json:"media,omitempty"`
270
271 Rel string `json:"rel,omitempty"`
272
273 Title string `json:"title,omitempty"`
274
275 Type string `json:"type,omitempty"`
276
277
278 Value string `json:"value,omitempty"`
279
280
281
282
283
284 ForceSendFields []string `json:"-"`
285
286
287
288
289 NullFields []string `json:"-"`
290 }
291
292 func (s *Link) MarshalJSON() ([]byte, error) {
293 type NoMethod Link
294 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
295 }
296
297
298
299 type Notice struct {
300
301 Description []string `json:"description,omitempty"`
302
303 Links []*Link `json:"links,omitempty"`
304
305 Title string `json:"title,omitempty"`
306
307
308
309
310 Type string `json:"type,omitempty"`
311
312
313
314
315
316 ForceSendFields []string `json:"-"`
317
318
319
320
321 NullFields []string `json:"-"`
322 }
323
324 func (s *Notice) MarshalJSON() ([]byte, error) {
325 type NoMethod Notice
326 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
327 }
328
329
330 type RdapResponse struct {
331
332 Description []string `json:"description,omitempty"`
333
334 ErrorCode int64 `json:"errorCode,omitempty"`
335
336
337 JsonResponse *HttpBody `json:"jsonResponse,omitempty"`
338
339
340 Lang string `json:"lang,omitempty"`
341
342 Notices []*Notice `json:"notices,omitempty"`
343
344 RdapConformance []string `json:"rdapConformance,omitempty"`
345
346 Title string `json:"title,omitempty"`
347
348
349 googleapi.ServerResponse `json:"-"`
350
351
352
353
354
355 ForceSendFields []string `json:"-"`
356
357
358
359
360 NullFields []string `json:"-"`
361 }
362
363 func (s *RdapResponse) MarshalJSON() ([]byte, error) {
364 type NoMethod RdapResponse
365 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
366 }
367
368 type AutnumGetCall struct {
369 s *Service
370 autnumId string
371 urlParams_ gensupport.URLParams
372 ifNoneMatch_ string
373 ctx_ context.Context
374 header_ http.Header
375 }
376
377
378
379
380
381 func (r *AutnumService) Get(autnumId string) *AutnumGetCall {
382 c := &AutnumGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
383 c.autnumId = autnumId
384 return c
385 }
386
387
388
389
390 func (c *AutnumGetCall) Fields(s ...googleapi.Field) *AutnumGetCall {
391 c.urlParams_.Set("fields", googleapi.CombineFields(s))
392 return c
393 }
394
395
396
397
398 func (c *AutnumGetCall) IfNoneMatch(entityTag string) *AutnumGetCall {
399 c.ifNoneMatch_ = entityTag
400 return c
401 }
402
403
404 func (c *AutnumGetCall) Context(ctx context.Context) *AutnumGetCall {
405 c.ctx_ = ctx
406 return c
407 }
408
409
410
411 func (c *AutnumGetCall) Header() http.Header {
412 if c.header_ == nil {
413 c.header_ = make(http.Header)
414 }
415 return c.header_
416 }
417
418 func (c *AutnumGetCall) doRequest(alt string) (*http.Response, error) {
419 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
420 if c.ifNoneMatch_ != "" {
421 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
422 }
423 var body io.Reader = nil
424 c.urlParams_.Set("alt", alt)
425 c.urlParams_.Set("prettyPrint", "false")
426 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/autnum/{autnumId}")
427 urls += "?" + c.urlParams_.Encode()
428 req, err := http.NewRequest("GET", urls, body)
429 if err != nil {
430 return nil, err
431 }
432 req.Header = reqHeaders
433 googleapi.Expand(req.URL, map[string]string{
434 "autnumId": c.autnumId,
435 })
436 return gensupport.SendRequest(c.ctx_, c.s.client, req)
437 }
438
439
440
441
442
443
444 func (c *AutnumGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) {
445 gensupport.SetOptions(c.urlParams_, opts...)
446 res, err := c.doRequest("json")
447 if res != nil && res.StatusCode == http.StatusNotModified {
448 if res.Body != nil {
449 res.Body.Close()
450 }
451 return nil, gensupport.WrapError(&googleapi.Error{
452 Code: res.StatusCode,
453 Header: res.Header,
454 })
455 }
456 if err != nil {
457 return nil, err
458 }
459 defer googleapi.CloseBody(res)
460 if err := googleapi.CheckResponse(res); err != nil {
461 return nil, gensupport.WrapError(err)
462 }
463 ret := &RdapResponse{
464 ServerResponse: googleapi.ServerResponse{
465 Header: res.Header,
466 HTTPStatusCode: res.StatusCode,
467 },
468 }
469 target := &ret
470 if err := gensupport.DecodeResponse(target, res); err != nil {
471 return nil, err
472 }
473 return ret, nil
474 }
475
476 type DomainGetCall struct {
477 s *Service
478 domainName string
479 urlParams_ gensupport.URLParams
480 ifNoneMatch_ string
481 ctx_ context.Context
482 header_ http.Header
483 }
484
485
486
487
488 func (r *DomainService) Get(domainName string) *DomainGetCall {
489 c := &DomainGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
490 c.domainName = domainName
491 return c
492 }
493
494
495
496
497 func (c *DomainGetCall) Fields(s ...googleapi.Field) *DomainGetCall {
498 c.urlParams_.Set("fields", googleapi.CombineFields(s))
499 return c
500 }
501
502
503
504
505 func (c *DomainGetCall) IfNoneMatch(entityTag string) *DomainGetCall {
506 c.ifNoneMatch_ = entityTag
507 return c
508 }
509
510
511 func (c *DomainGetCall) Context(ctx context.Context) *DomainGetCall {
512 c.ctx_ = ctx
513 return c
514 }
515
516
517
518 func (c *DomainGetCall) Header() http.Header {
519 if c.header_ == nil {
520 c.header_ = make(http.Header)
521 }
522 return c.header_
523 }
524
525 func (c *DomainGetCall) doRequest(alt string) (*http.Response, error) {
526 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
527 if c.ifNoneMatch_ != "" {
528 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
529 }
530 var body io.Reader = nil
531 c.urlParams_.Set("alt", alt)
532 c.urlParams_.Set("prettyPrint", "false")
533 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/domain/{+domainName}")
534 urls += "?" + c.urlParams_.Encode()
535 req, err := http.NewRequest("GET", urls, body)
536 if err != nil {
537 return nil, err
538 }
539 req.Header = reqHeaders
540 googleapi.Expand(req.URL, map[string]string{
541 "domainName": c.domainName,
542 })
543 return gensupport.SendRequest(c.ctx_, c.s.client, req)
544 }
545
546
547
548
549
550
551 func (c *DomainGetCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
552 gensupport.SetOptions(c.urlParams_, opts...)
553 res, err := c.doRequest("json")
554 if res != nil && res.StatusCode == http.StatusNotModified {
555 if res.Body != nil {
556 res.Body.Close()
557 }
558 return nil, gensupport.WrapError(&googleapi.Error{
559 Code: res.StatusCode,
560 Header: res.Header,
561 })
562 }
563 if err != nil {
564 return nil, err
565 }
566 defer googleapi.CloseBody(res)
567 if err := googleapi.CheckResponse(res); err != nil {
568 return nil, gensupport.WrapError(err)
569 }
570 ret := &HttpBody{
571 ServerResponse: googleapi.ServerResponse{
572 Header: res.Header,
573 HTTPStatusCode: res.StatusCode,
574 },
575 }
576 target := &ret
577 if err := gensupport.DecodeResponse(target, res); err != nil {
578 return nil, err
579 }
580 return ret, nil
581 }
582
583 type EntityGetCall struct {
584 s *Service
585 entityId string
586 urlParams_ gensupport.URLParams
587 ifNoneMatch_ string
588 ctx_ context.Context
589 header_ http.Header
590 }
591
592
593
594
595
596 func (r *EntityService) Get(entityId string) *EntityGetCall {
597 c := &EntityGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
598 c.entityId = entityId
599 return c
600 }
601
602
603
604
605 func (c *EntityGetCall) Fields(s ...googleapi.Field) *EntityGetCall {
606 c.urlParams_.Set("fields", googleapi.CombineFields(s))
607 return c
608 }
609
610
611
612
613 func (c *EntityGetCall) IfNoneMatch(entityTag string) *EntityGetCall {
614 c.ifNoneMatch_ = entityTag
615 return c
616 }
617
618
619 func (c *EntityGetCall) Context(ctx context.Context) *EntityGetCall {
620 c.ctx_ = ctx
621 return c
622 }
623
624
625
626 func (c *EntityGetCall) Header() http.Header {
627 if c.header_ == nil {
628 c.header_ = make(http.Header)
629 }
630 return c.header_
631 }
632
633 func (c *EntityGetCall) doRequest(alt string) (*http.Response, error) {
634 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
635 if c.ifNoneMatch_ != "" {
636 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
637 }
638 var body io.Reader = nil
639 c.urlParams_.Set("alt", alt)
640 c.urlParams_.Set("prettyPrint", "false")
641 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/entity/{entityId}")
642 urls += "?" + c.urlParams_.Encode()
643 req, err := http.NewRequest("GET", urls, body)
644 if err != nil {
645 return nil, err
646 }
647 req.Header = reqHeaders
648 googleapi.Expand(req.URL, map[string]string{
649 "entityId": c.entityId,
650 })
651 return gensupport.SendRequest(c.ctx_, c.s.client, req)
652 }
653
654
655
656
657
658
659 func (c *EntityGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) {
660 gensupport.SetOptions(c.urlParams_, opts...)
661 res, err := c.doRequest("json")
662 if res != nil && res.StatusCode == http.StatusNotModified {
663 if res.Body != nil {
664 res.Body.Close()
665 }
666 return nil, gensupport.WrapError(&googleapi.Error{
667 Code: res.StatusCode,
668 Header: res.Header,
669 })
670 }
671 if err != nil {
672 return nil, err
673 }
674 defer googleapi.CloseBody(res)
675 if err := googleapi.CheckResponse(res); err != nil {
676 return nil, gensupport.WrapError(err)
677 }
678 ret := &RdapResponse{
679 ServerResponse: googleapi.ServerResponse{
680 Header: res.Header,
681 HTTPStatusCode: res.StatusCode,
682 },
683 }
684 target := &ret
685 if err := gensupport.DecodeResponse(target, res); err != nil {
686 return nil, err
687 }
688 return ret, nil
689 }
690
691 type IpGetCall struct {
692 s *Service
693 ipId string
694 ipId1 string
695 urlParams_ gensupport.URLParams
696 ifNoneMatch_ string
697 ctx_ context.Context
698 header_ http.Header
699 }
700
701
702
703
704
705
706 func (r *IpService) Get(ipId string, ipId1 string) *IpGetCall {
707 c := &IpGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
708 c.ipId = ipId
709 c.ipId1 = ipId1
710 return c
711 }
712
713
714
715
716 func (c *IpGetCall) Fields(s ...googleapi.Field) *IpGetCall {
717 c.urlParams_.Set("fields", googleapi.CombineFields(s))
718 return c
719 }
720
721
722
723
724 func (c *IpGetCall) IfNoneMatch(entityTag string) *IpGetCall {
725 c.ifNoneMatch_ = entityTag
726 return c
727 }
728
729
730 func (c *IpGetCall) Context(ctx context.Context) *IpGetCall {
731 c.ctx_ = ctx
732 return c
733 }
734
735
736
737 func (c *IpGetCall) Header() http.Header {
738 if c.header_ == nil {
739 c.header_ = make(http.Header)
740 }
741 return c.header_
742 }
743
744 func (c *IpGetCall) doRequest(alt string) (*http.Response, error) {
745 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
746 if c.ifNoneMatch_ != "" {
747 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
748 }
749 var body io.Reader = nil
750 c.urlParams_.Set("alt", alt)
751 c.urlParams_.Set("prettyPrint", "false")
752 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/ip/{ipId}/{ipId1}")
753 urls += "?" + c.urlParams_.Encode()
754 req, err := http.NewRequest("GET", urls, body)
755 if err != nil {
756 return nil, err
757 }
758 req.Header = reqHeaders
759 googleapi.Expand(req.URL, map[string]string{
760 "ipId": c.ipId,
761 "ipId1": c.ipId1,
762 })
763 return gensupport.SendRequest(c.ctx_, c.s.client, req)
764 }
765
766
767
768
769
770
771 func (c *IpGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) {
772 gensupport.SetOptions(c.urlParams_, opts...)
773 res, err := c.doRequest("json")
774 if res != nil && res.StatusCode == http.StatusNotModified {
775 if res.Body != nil {
776 res.Body.Close()
777 }
778 return nil, gensupport.WrapError(&googleapi.Error{
779 Code: res.StatusCode,
780 Header: res.Header,
781 })
782 }
783 if err != nil {
784 return nil, err
785 }
786 defer googleapi.CloseBody(res)
787 if err := googleapi.CheckResponse(res); err != nil {
788 return nil, gensupport.WrapError(err)
789 }
790 ret := &RdapResponse{
791 ServerResponse: googleapi.ServerResponse{
792 Header: res.Header,
793 HTTPStatusCode: res.StatusCode,
794 },
795 }
796 target := &ret
797 if err := gensupport.DecodeResponse(target, res); err != nil {
798 return nil, err
799 }
800 return ret, nil
801 }
802
803 type NameserverGetCall struct {
804 s *Service
805 nameserverId string
806 urlParams_ gensupport.URLParams
807 ifNoneMatch_ string
808 ctx_ context.Context
809 header_ http.Header
810 }
811
812
813
814
815
816 func (r *NameserverService) Get(nameserverId string) *NameserverGetCall {
817 c := &NameserverGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
818 c.nameserverId = nameserverId
819 return c
820 }
821
822
823
824
825 func (c *NameserverGetCall) Fields(s ...googleapi.Field) *NameserverGetCall {
826 c.urlParams_.Set("fields", googleapi.CombineFields(s))
827 return c
828 }
829
830
831
832
833 func (c *NameserverGetCall) IfNoneMatch(entityTag string) *NameserverGetCall {
834 c.ifNoneMatch_ = entityTag
835 return c
836 }
837
838
839 func (c *NameserverGetCall) Context(ctx context.Context) *NameserverGetCall {
840 c.ctx_ = ctx
841 return c
842 }
843
844
845
846 func (c *NameserverGetCall) Header() http.Header {
847 if c.header_ == nil {
848 c.header_ = make(http.Header)
849 }
850 return c.header_
851 }
852
853 func (c *NameserverGetCall) doRequest(alt string) (*http.Response, error) {
854 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
855 if c.ifNoneMatch_ != "" {
856 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
857 }
858 var body io.Reader = nil
859 c.urlParams_.Set("alt", alt)
860 c.urlParams_.Set("prettyPrint", "false")
861 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/nameserver/{nameserverId}")
862 urls += "?" + c.urlParams_.Encode()
863 req, err := http.NewRequest("GET", urls, body)
864 if err != nil {
865 return nil, err
866 }
867 req.Header = reqHeaders
868 googleapi.Expand(req.URL, map[string]string{
869 "nameserverId": c.nameserverId,
870 })
871 return gensupport.SendRequest(c.ctx_, c.s.client, req)
872 }
873
874
875
876
877
878
879 func (c *NameserverGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) {
880 gensupport.SetOptions(c.urlParams_, opts...)
881 res, err := c.doRequest("json")
882 if res != nil && res.StatusCode == http.StatusNotModified {
883 if res.Body != nil {
884 res.Body.Close()
885 }
886 return nil, gensupport.WrapError(&googleapi.Error{
887 Code: res.StatusCode,
888 Header: res.Header,
889 })
890 }
891 if err != nil {
892 return nil, err
893 }
894 defer googleapi.CloseBody(res)
895 if err := googleapi.CheckResponse(res); err != nil {
896 return nil, gensupport.WrapError(err)
897 }
898 ret := &RdapResponse{
899 ServerResponse: googleapi.ServerResponse{
900 Header: res.Header,
901 HTTPStatusCode: res.StatusCode,
902 },
903 }
904 target := &ret
905 if err := gensupport.DecodeResponse(target, res); err != nil {
906 return nil, err
907 }
908 return ret, nil
909 }
910
911 type V1GetDomainsCall struct {
912 s *Service
913 urlParams_ gensupport.URLParams
914 ifNoneMatch_ string
915 ctx_ context.Context
916 header_ http.Header
917 }
918
919
920
921 func (r *V1Service) GetDomains() *V1GetDomainsCall {
922 c := &V1GetDomainsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
923 return c
924 }
925
926
927
928
929 func (c *V1GetDomainsCall) Fields(s ...googleapi.Field) *V1GetDomainsCall {
930 c.urlParams_.Set("fields", googleapi.CombineFields(s))
931 return c
932 }
933
934
935
936
937 func (c *V1GetDomainsCall) IfNoneMatch(entityTag string) *V1GetDomainsCall {
938 c.ifNoneMatch_ = entityTag
939 return c
940 }
941
942
943 func (c *V1GetDomainsCall) Context(ctx context.Context) *V1GetDomainsCall {
944 c.ctx_ = ctx
945 return c
946 }
947
948
949
950 func (c *V1GetDomainsCall) Header() http.Header {
951 if c.header_ == nil {
952 c.header_ = make(http.Header)
953 }
954 return c.header_
955 }
956
957 func (c *V1GetDomainsCall) doRequest(alt string) (*http.Response, error) {
958 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
959 if c.ifNoneMatch_ != "" {
960 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
961 }
962 var body io.Reader = nil
963 c.urlParams_.Set("alt", alt)
964 c.urlParams_.Set("prettyPrint", "false")
965 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/domains")
966 urls += "?" + c.urlParams_.Encode()
967 req, err := http.NewRequest("GET", urls, body)
968 if err != nil {
969 return nil, err
970 }
971 req.Header = reqHeaders
972 return gensupport.SendRequest(c.ctx_, c.s.client, req)
973 }
974
975
976
977
978
979
980 func (c *V1GetDomainsCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) {
981 gensupport.SetOptions(c.urlParams_, opts...)
982 res, err := c.doRequest("json")
983 if res != nil && res.StatusCode == http.StatusNotModified {
984 if res.Body != nil {
985 res.Body.Close()
986 }
987 return nil, gensupport.WrapError(&googleapi.Error{
988 Code: res.StatusCode,
989 Header: res.Header,
990 })
991 }
992 if err != nil {
993 return nil, err
994 }
995 defer googleapi.CloseBody(res)
996 if err := googleapi.CheckResponse(res); err != nil {
997 return nil, gensupport.WrapError(err)
998 }
999 ret := &RdapResponse{
1000 ServerResponse: googleapi.ServerResponse{
1001 Header: res.Header,
1002 HTTPStatusCode: res.StatusCode,
1003 },
1004 }
1005 target := &ret
1006 if err := gensupport.DecodeResponse(target, res); err != nil {
1007 return nil, err
1008 }
1009 return ret, nil
1010 }
1011
1012 type V1GetEntitiesCall struct {
1013 s *Service
1014 urlParams_ gensupport.URLParams
1015 ifNoneMatch_ string
1016 ctx_ context.Context
1017 header_ http.Header
1018 }
1019
1020
1021
1022
1023 func (r *V1Service) GetEntities() *V1GetEntitiesCall {
1024 c := &V1GetEntitiesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1025 return c
1026 }
1027
1028
1029
1030
1031 func (c *V1GetEntitiesCall) Fields(s ...googleapi.Field) *V1GetEntitiesCall {
1032 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1033 return c
1034 }
1035
1036
1037
1038
1039 func (c *V1GetEntitiesCall) IfNoneMatch(entityTag string) *V1GetEntitiesCall {
1040 c.ifNoneMatch_ = entityTag
1041 return c
1042 }
1043
1044
1045 func (c *V1GetEntitiesCall) Context(ctx context.Context) *V1GetEntitiesCall {
1046 c.ctx_ = ctx
1047 return c
1048 }
1049
1050
1051
1052 func (c *V1GetEntitiesCall) Header() http.Header {
1053 if c.header_ == nil {
1054 c.header_ = make(http.Header)
1055 }
1056 return c.header_
1057 }
1058
1059 func (c *V1GetEntitiesCall) doRequest(alt string) (*http.Response, error) {
1060 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1061 if c.ifNoneMatch_ != "" {
1062 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1063 }
1064 var body io.Reader = nil
1065 c.urlParams_.Set("alt", alt)
1066 c.urlParams_.Set("prettyPrint", "false")
1067 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/entities")
1068 urls += "?" + c.urlParams_.Encode()
1069 req, err := http.NewRequest("GET", urls, body)
1070 if err != nil {
1071 return nil, err
1072 }
1073 req.Header = reqHeaders
1074 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1075 }
1076
1077
1078
1079
1080
1081
1082 func (c *V1GetEntitiesCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) {
1083 gensupport.SetOptions(c.urlParams_, opts...)
1084 res, err := c.doRequest("json")
1085 if res != nil && res.StatusCode == http.StatusNotModified {
1086 if res.Body != nil {
1087 res.Body.Close()
1088 }
1089 return nil, gensupport.WrapError(&googleapi.Error{
1090 Code: res.StatusCode,
1091 Header: res.Header,
1092 })
1093 }
1094 if err != nil {
1095 return nil, err
1096 }
1097 defer googleapi.CloseBody(res)
1098 if err := googleapi.CheckResponse(res); err != nil {
1099 return nil, gensupport.WrapError(err)
1100 }
1101 ret := &RdapResponse{
1102 ServerResponse: googleapi.ServerResponse{
1103 Header: res.Header,
1104 HTTPStatusCode: res.StatusCode,
1105 },
1106 }
1107 target := &ret
1108 if err := gensupport.DecodeResponse(target, res); err != nil {
1109 return nil, err
1110 }
1111 return ret, nil
1112 }
1113
1114 type V1GetHelpCall struct {
1115 s *Service
1116 urlParams_ gensupport.URLParams
1117 ifNoneMatch_ string
1118 ctx_ context.Context
1119 header_ http.Header
1120 }
1121
1122
1123
1124 func (r *V1Service) GetHelp() *V1GetHelpCall {
1125 c := &V1GetHelpCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1126 return c
1127 }
1128
1129
1130
1131
1132 func (c *V1GetHelpCall) Fields(s ...googleapi.Field) *V1GetHelpCall {
1133 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1134 return c
1135 }
1136
1137
1138
1139
1140 func (c *V1GetHelpCall) IfNoneMatch(entityTag string) *V1GetHelpCall {
1141 c.ifNoneMatch_ = entityTag
1142 return c
1143 }
1144
1145
1146 func (c *V1GetHelpCall) Context(ctx context.Context) *V1GetHelpCall {
1147 c.ctx_ = ctx
1148 return c
1149 }
1150
1151
1152
1153 func (c *V1GetHelpCall) Header() http.Header {
1154 if c.header_ == nil {
1155 c.header_ = make(http.Header)
1156 }
1157 return c.header_
1158 }
1159
1160 func (c *V1GetHelpCall) doRequest(alt string) (*http.Response, error) {
1161 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1162 if c.ifNoneMatch_ != "" {
1163 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1164 }
1165 var body io.Reader = nil
1166 c.urlParams_.Set("alt", alt)
1167 c.urlParams_.Set("prettyPrint", "false")
1168 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/help")
1169 urls += "?" + c.urlParams_.Encode()
1170 req, err := http.NewRequest("GET", urls, body)
1171 if err != nil {
1172 return nil, err
1173 }
1174 req.Header = reqHeaders
1175 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1176 }
1177
1178
1179
1180
1181
1182
1183 func (c *V1GetHelpCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
1184 gensupport.SetOptions(c.urlParams_, opts...)
1185 res, err := c.doRequest("json")
1186 if res != nil && res.StatusCode == http.StatusNotModified {
1187 if res.Body != nil {
1188 res.Body.Close()
1189 }
1190 return nil, gensupport.WrapError(&googleapi.Error{
1191 Code: res.StatusCode,
1192 Header: res.Header,
1193 })
1194 }
1195 if err != nil {
1196 return nil, err
1197 }
1198 defer googleapi.CloseBody(res)
1199 if err := googleapi.CheckResponse(res); err != nil {
1200 return nil, gensupport.WrapError(err)
1201 }
1202 ret := &HttpBody{
1203 ServerResponse: googleapi.ServerResponse{
1204 Header: res.Header,
1205 HTTPStatusCode: res.StatusCode,
1206 },
1207 }
1208 target := &ret
1209 if err := gensupport.DecodeResponse(target, res); err != nil {
1210 return nil, err
1211 }
1212 return ret, nil
1213 }
1214
1215 type V1GetIpCall struct {
1216 s *Service
1217 urlParams_ gensupport.URLParams
1218 ifNoneMatch_ string
1219 ctx_ context.Context
1220 header_ http.Header
1221 }
1222
1223
1224
1225 func (r *V1Service) GetIp() *V1GetIpCall {
1226 c := &V1GetIpCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1227 return c
1228 }
1229
1230
1231
1232
1233 func (c *V1GetIpCall) Fields(s ...googleapi.Field) *V1GetIpCall {
1234 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1235 return c
1236 }
1237
1238
1239
1240
1241 func (c *V1GetIpCall) IfNoneMatch(entityTag string) *V1GetIpCall {
1242 c.ifNoneMatch_ = entityTag
1243 return c
1244 }
1245
1246
1247 func (c *V1GetIpCall) Context(ctx context.Context) *V1GetIpCall {
1248 c.ctx_ = ctx
1249 return c
1250 }
1251
1252
1253
1254 func (c *V1GetIpCall) Header() http.Header {
1255 if c.header_ == nil {
1256 c.header_ = make(http.Header)
1257 }
1258 return c.header_
1259 }
1260
1261 func (c *V1GetIpCall) doRequest(alt string) (*http.Response, error) {
1262 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1263 if c.ifNoneMatch_ != "" {
1264 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1265 }
1266 var body io.Reader = nil
1267 c.urlParams_.Set("alt", alt)
1268 c.urlParams_.Set("prettyPrint", "false")
1269 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/ip")
1270 urls += "?" + c.urlParams_.Encode()
1271 req, err := http.NewRequest("GET", urls, body)
1272 if err != nil {
1273 return nil, err
1274 }
1275 req.Header = reqHeaders
1276 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1277 }
1278
1279
1280
1281
1282
1283
1284 func (c *V1GetIpCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
1285 gensupport.SetOptions(c.urlParams_, opts...)
1286 res, err := c.doRequest("json")
1287 if res != nil && res.StatusCode == http.StatusNotModified {
1288 if res.Body != nil {
1289 res.Body.Close()
1290 }
1291 return nil, gensupport.WrapError(&googleapi.Error{
1292 Code: res.StatusCode,
1293 Header: res.Header,
1294 })
1295 }
1296 if err != nil {
1297 return nil, err
1298 }
1299 defer googleapi.CloseBody(res)
1300 if err := googleapi.CheckResponse(res); err != nil {
1301 return nil, gensupport.WrapError(err)
1302 }
1303 ret := &HttpBody{
1304 ServerResponse: googleapi.ServerResponse{
1305 Header: res.Header,
1306 HTTPStatusCode: res.StatusCode,
1307 },
1308 }
1309 target := &ret
1310 if err := gensupport.DecodeResponse(target, res); err != nil {
1311 return nil, err
1312 }
1313 return ret, nil
1314 }
1315
1316 type V1GetNameserversCall struct {
1317 s *Service
1318 urlParams_ gensupport.URLParams
1319 ifNoneMatch_ string
1320 ctx_ context.Context
1321 header_ http.Header
1322 }
1323
1324
1325
1326
1327 func (r *V1Service) GetNameservers() *V1GetNameserversCall {
1328 c := &V1GetNameserversCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1329 return c
1330 }
1331
1332
1333
1334
1335 func (c *V1GetNameserversCall) Fields(s ...googleapi.Field) *V1GetNameserversCall {
1336 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1337 return c
1338 }
1339
1340
1341
1342
1343 func (c *V1GetNameserversCall) IfNoneMatch(entityTag string) *V1GetNameserversCall {
1344 c.ifNoneMatch_ = entityTag
1345 return c
1346 }
1347
1348
1349 func (c *V1GetNameserversCall) Context(ctx context.Context) *V1GetNameserversCall {
1350 c.ctx_ = ctx
1351 return c
1352 }
1353
1354
1355
1356 func (c *V1GetNameserversCall) Header() http.Header {
1357 if c.header_ == nil {
1358 c.header_ = make(http.Header)
1359 }
1360 return c.header_
1361 }
1362
1363 func (c *V1GetNameserversCall) doRequest(alt string) (*http.Response, error) {
1364 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1365 if c.ifNoneMatch_ != "" {
1366 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1367 }
1368 var body io.Reader = nil
1369 c.urlParams_.Set("alt", alt)
1370 c.urlParams_.Set("prettyPrint", "false")
1371 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/nameservers")
1372 urls += "?" + c.urlParams_.Encode()
1373 req, err := http.NewRequest("GET", urls, body)
1374 if err != nil {
1375 return nil, err
1376 }
1377 req.Header = reqHeaders
1378 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1379 }
1380
1381
1382
1383
1384
1385
1386 func (c *V1GetNameserversCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) {
1387 gensupport.SetOptions(c.urlParams_, opts...)
1388 res, err := c.doRequest("json")
1389 if res != nil && res.StatusCode == http.StatusNotModified {
1390 if res.Body != nil {
1391 res.Body.Close()
1392 }
1393 return nil, gensupport.WrapError(&googleapi.Error{
1394 Code: res.StatusCode,
1395 Header: res.Header,
1396 })
1397 }
1398 if err != nil {
1399 return nil, err
1400 }
1401 defer googleapi.CloseBody(res)
1402 if err := googleapi.CheckResponse(res); err != nil {
1403 return nil, gensupport.WrapError(err)
1404 }
1405 ret := &RdapResponse{
1406 ServerResponse: googleapi.ServerResponse{
1407 Header: res.Header,
1408 HTTPStatusCode: res.StatusCode,
1409 },
1410 }
1411 target := &ret
1412 if err := gensupport.DecodeResponse(target, res); err != nil {
1413 return nil, err
1414 }
1415 return ret, nil
1416 }
1417
View as plain text