1// Copyright 2020 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package domainsrdap provides access to the Domains RDAP API. 8// 9// For product documentation, see: https://developers.google.com/domains/rdap/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/domainsrdap/v1" 16// ... 17// ctx := context.Background() 18// domainsrdapService, err := domainsrdap.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// domainsrdapService, err := domainsrdap.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// domainsrdapService, err := domainsrdap.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package domainsrdap // import "google.golang.org/api/domainsrdap/v1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "domainsrdap:v1" 75const apiName = "domainsrdap" 76const apiVersion = "v1" 77const basePath = "https://domainsrdap.googleapis.com/" 78 79// NewService creates a new Service. 80func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 81 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 82 client, endpoint, err := htransport.NewClient(ctx, opts...) 83 if err != nil { 84 return nil, err 85 } 86 s, err := New(client) 87 if err != nil { 88 return nil, err 89 } 90 if endpoint != "" { 91 s.BasePath = endpoint 92 } 93 return s, nil 94} 95 96// New creates a new Service. It uses the provided http.Client for requests. 97// 98// Deprecated: please use NewService instead. 99// To provide a custom HTTP client, use option.WithHTTPClient. 100// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 101func New(client *http.Client) (*Service, error) { 102 if client == nil { 103 return nil, errors.New("client is nil") 104 } 105 s := &Service{client: client, BasePath: basePath} 106 s.Autnum = NewAutnumService(s) 107 s.Domain = NewDomainService(s) 108 s.Entity = NewEntityService(s) 109 s.Ip = NewIpService(s) 110 s.Nameserver = NewNameserverService(s) 111 s.V1 = NewV1Service(s) 112 return s, nil 113} 114 115type Service struct { 116 client *http.Client 117 BasePath string // API endpoint base URL 118 UserAgent string // optional additional User-Agent fragment 119 120 Autnum *AutnumService 121 122 Domain *DomainService 123 124 Entity *EntityService 125 126 Ip *IpService 127 128 Nameserver *NameserverService 129 130 V1 *V1Service 131} 132 133func (s *Service) userAgent() string { 134 if s.UserAgent == "" { 135 return googleapi.UserAgent 136 } 137 return googleapi.UserAgent + " " + s.UserAgent 138} 139 140func NewAutnumService(s *Service) *AutnumService { 141 rs := &AutnumService{s: s} 142 return rs 143} 144 145type AutnumService struct { 146 s *Service 147} 148 149func NewDomainService(s *Service) *DomainService { 150 rs := &DomainService{s: s} 151 return rs 152} 153 154type DomainService struct { 155 s *Service 156} 157 158func NewEntityService(s *Service) *EntityService { 159 rs := &EntityService{s: s} 160 return rs 161} 162 163type EntityService struct { 164 s *Service 165} 166 167func NewIpService(s *Service) *IpService { 168 rs := &IpService{s: s} 169 return rs 170} 171 172type IpService struct { 173 s *Service 174} 175 176func NewNameserverService(s *Service) *NameserverService { 177 rs := &NameserverService{s: s} 178 return rs 179} 180 181type NameserverService struct { 182 s *Service 183} 184 185func NewV1Service(s *Service) *V1Service { 186 rs := &V1Service{s: s} 187 return rs 188} 189 190type V1Service struct { 191 s *Service 192} 193 194// HttpBody: Message that represents an arbitrary HTTP body. It should 195// only be used for 196// payload formats that can't be represented as JSON, such as raw binary 197// or 198// an HTML page. 199// 200// 201// This message can be used both in streaming and non-streaming API 202// methods in 203// the request as well as the response. 204// 205// It can be used as a top-level request field, which is convenient if 206// one 207// wants to extract parameters from either the URL or HTTP template into 208// the 209// request fields and also want access to the raw HTTP body. 210// 211// Example: 212// 213// message GetResourceRequest { 214// // A unique request id. 215// string request_id = 1; 216// 217// // The raw HTTP body is bound to this field. 218// google.api.HttpBody http_body = 2; 219// } 220// 221// service ResourceService { 222// rpc GetResource(GetResourceRequest) returns 223// (google.api.HttpBody); 224// rpc UpdateResource(google.api.HttpBody) returns 225// (google.protobuf.Empty); 226// } 227// 228// Example with streaming methods: 229// 230// service CaldavService { 231// rpc GetCalendar(stream google.api.HttpBody) 232// returns (stream google.api.HttpBody); 233// rpc UpdateCalendar(stream google.api.HttpBody) 234// returns (stream google.api.HttpBody); 235// } 236// 237// Use of this type only changes how the request and response bodies 238// are 239// handled, all other features will continue to work unchanged. 240type HttpBody struct { 241 // ContentType: The HTTP Content-Type header value specifying the 242 // content type of the body. 243 ContentType string `json:"contentType,omitempty"` 244 245 // Data: The HTTP request/response body as raw binary. 246 Data string `json:"data,omitempty"` 247 248 // Extensions: Application specific response metadata. Must be set in 249 // the first response 250 // for streaming APIs. 251 Extensions []googleapi.RawMessage `json:"extensions,omitempty"` 252 253 // ServerResponse contains the HTTP response code and headers from the 254 // server. 255 googleapi.ServerResponse `json:"-"` 256 257 // ForceSendFields is a list of field names (e.g. "ContentType") to 258 // unconditionally include in API requests. By default, fields with 259 // empty values are omitted from API requests. However, any non-pointer, 260 // non-interface field appearing in ForceSendFields will be sent to the 261 // server regardless of whether the field is empty or not. This may be 262 // used to include empty fields in Patch requests. 263 ForceSendFields []string `json:"-"` 264 265 // NullFields is a list of field names (e.g. "ContentType") to include 266 // in API requests with the JSON null value. By default, fields with 267 // empty values are omitted from API requests. However, any field with 268 // an empty value appearing in NullFields will be sent to the server as 269 // null. It is an error if a field in this list has a non-empty value. 270 // This may be used to include null fields in Patch requests. 271 NullFields []string `json:"-"` 272} 273 274func (s *HttpBody) MarshalJSON() ([]byte, error) { 275 type NoMethod HttpBody 276 raw := NoMethod(*s) 277 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 278} 279 280// Link: Links object defined in [section 4.2 of 281// RFC 282// 7483](https://tools.ietf.org/html/rfc7483#section-4.2). 283type Link struct { 284 // Href: Target URL of a link. Example: "http://example.com/previous". 285 Href string `json:"href,omitempty"` 286 287 // Hreflang: Language code of a link. Example: "en". 288 Hreflang string `json:"hreflang,omitempty"` 289 290 // Media: Media type of the link destination. Example: "screen". 291 Media string `json:"media,omitempty"` 292 293 // Rel: Relation type of a link. Example: "previous". 294 Rel string `json:"rel,omitempty"` 295 296 // Title: Title of this link. Example: "title". 297 Title string `json:"title,omitempty"` 298 299 // Type: Content type of the link. Example: "application/json". 300 Type string `json:"type,omitempty"` 301 302 // Value: URL giving context for the link. Example: 303 // "http://example.com/current". 304 Value string `json:"value,omitempty"` 305 306 // ForceSendFields is a list of field names (e.g. "Href") to 307 // unconditionally include in API requests. By default, fields with 308 // empty values are omitted from API requests. However, any non-pointer, 309 // non-interface field appearing in ForceSendFields will be sent to the 310 // server regardless of whether the field is empty or not. This may be 311 // used to include empty fields in Patch requests. 312 ForceSendFields []string `json:"-"` 313 314 // NullFields is a list of field names (e.g. "Href") to include in API 315 // requests with the JSON null value. By default, fields with empty 316 // values are omitted from API requests. However, any field with an 317 // empty value appearing in NullFields will be sent to the server as 318 // null. It is an error if a field in this list has a non-empty value. 319 // This may be used to include null fields in Patch requests. 320 NullFields []string `json:"-"` 321} 322 323func (s *Link) MarshalJSON() ([]byte, error) { 324 type NoMethod Link 325 raw := NoMethod(*s) 326 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 327} 328 329// Notice: Notices object defined in [section 4.3 of 330// RFC 331// 7483](https://tools.ietf.org/html/rfc7483#section-4.3). 332type Notice struct { 333 // Description: Description of the notice. 334 Description []string `json:"description,omitempty"` 335 336 // Links: Link to a document containing more information. 337 Links []*Link `json:"links,omitempty"` 338 339 // Title: Title of a notice. Example: "Terms of Service". 340 Title string `json:"title,omitempty"` 341 342 // Type: Type values defined in [section 10.2.1 of 343 // RFC 344 // 7483](https://tools.ietf.org/html/rfc7483#section-10.2.1) specific to 345 // a 346 // whole response: "result set truncated due to authorization", "result 347 // set 348 // truncated due to excessive load", "result set truncated due 349 // to 350 // unexplainable reasons". 351 Type string `json:"type,omitempty"` 352 353 // ForceSendFields is a list of field names (e.g. "Description") to 354 // unconditionally include in API requests. By default, fields with 355 // empty values are omitted from API requests. However, any non-pointer, 356 // non-interface field appearing in ForceSendFields will be sent to the 357 // server regardless of whether the field is empty or not. This may be 358 // used to include empty fields in Patch requests. 359 ForceSendFields []string `json:"-"` 360 361 // NullFields is a list of field names (e.g. "Description") to include 362 // in API requests with the JSON null value. By default, fields with 363 // empty values are omitted from API requests. However, any field with 364 // an empty value appearing in NullFields will be sent to the server as 365 // null. It is an error if a field in this list has a non-empty value. 366 // This may be used to include null fields in Patch requests. 367 NullFields []string `json:"-"` 368} 369 370func (s *Notice) MarshalJSON() ([]byte, error) { 371 type NoMethod Notice 372 raw := NoMethod(*s) 373 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 374} 375 376// RdapResponse: Response to a general RDAP query. 377type RdapResponse struct { 378 // Description: Error description. 379 Description []string `json:"description,omitempty"` 380 381 // ErrorCode: Error HTTP code. Example: "501". 382 ErrorCode int64 `json:"errorCode,omitempty"` 383 384 // JsonResponse: HTTP response with content type set to 385 // "application/json+rdap". 386 JsonResponse *HttpBody `json:"jsonResponse,omitempty"` 387 388 // Lang: Error language code. Error response info fields are defined in 389 // [section 6 390 // of RFC 7483](https://tools.ietf.org/html/rfc7483#section-6). 391 Lang string `json:"lang,omitempty"` 392 393 // Notices: Notices applying to this response. 394 Notices []*Notice `json:"notices,omitempty"` 395 396 // RdapConformance: RDAP conformance level. 397 RdapConformance []string `json:"rdapConformance,omitempty"` 398 399 // Title: Error title. 400 Title string `json:"title,omitempty"` 401 402 // ServerResponse contains the HTTP response code and headers from the 403 // server. 404 googleapi.ServerResponse `json:"-"` 405 406 // ForceSendFields is a list of field names (e.g. "Description") to 407 // unconditionally include in API requests. By default, fields with 408 // empty values are omitted from API requests. However, any non-pointer, 409 // non-interface field appearing in ForceSendFields will be sent to the 410 // server regardless of whether the field is empty or not. This may be 411 // used to include empty fields in Patch requests. 412 ForceSendFields []string `json:"-"` 413 414 // NullFields is a list of field names (e.g. "Description") to include 415 // in API requests with the JSON null value. By default, fields with 416 // empty values are omitted from API requests. However, any field with 417 // an empty value appearing in NullFields will be sent to the server as 418 // null. It is an error if a field in this list has a non-empty value. 419 // This may be used to include null fields in Patch requests. 420 NullFields []string `json:"-"` 421} 422 423func (s *RdapResponse) MarshalJSON() ([]byte, error) { 424 type NoMethod RdapResponse 425 raw := NoMethod(*s) 426 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 427} 428 429// method id "domainsrdap.autnum.get": 430 431type AutnumGetCall struct { 432 s *Service 433 autnumId string 434 urlParams_ gensupport.URLParams 435 ifNoneMatch_ string 436 ctx_ context.Context 437 header_ http.Header 438} 439 440// Get: The RDAP API recognizes this command from the RDAP specification 441// but 442// does not support it. The response is a formatted 501 error. 443func (r *AutnumService) Get(autnumId string) *AutnumGetCall { 444 c := &AutnumGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 445 c.autnumId = autnumId 446 return c 447} 448 449// Fields allows partial responses to be retrieved. See 450// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 451// for more information. 452func (c *AutnumGetCall) Fields(s ...googleapi.Field) *AutnumGetCall { 453 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 454 return c 455} 456 457// IfNoneMatch sets the optional parameter which makes the operation 458// fail if the object's ETag matches the given value. This is useful for 459// getting updates only after the object has changed since the last 460// request. Use googleapi.IsNotModified to check whether the response 461// error from Do is the result of In-None-Match. 462func (c *AutnumGetCall) IfNoneMatch(entityTag string) *AutnumGetCall { 463 c.ifNoneMatch_ = entityTag 464 return c 465} 466 467// Context sets the context to be used in this call's Do method. Any 468// pending HTTP request will be aborted if the provided context is 469// canceled. 470func (c *AutnumGetCall) Context(ctx context.Context) *AutnumGetCall { 471 c.ctx_ = ctx 472 return c 473} 474 475// Header returns an http.Header that can be modified by the caller to 476// add HTTP headers to the request. 477func (c *AutnumGetCall) Header() http.Header { 478 if c.header_ == nil { 479 c.header_ = make(http.Header) 480 } 481 return c.header_ 482} 483 484func (c *AutnumGetCall) doRequest(alt string) (*http.Response, error) { 485 reqHeaders := make(http.Header) 486 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 487 for k, v := range c.header_ { 488 reqHeaders[k] = v 489 } 490 reqHeaders.Set("User-Agent", c.s.userAgent()) 491 if c.ifNoneMatch_ != "" { 492 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 493 } 494 var body io.Reader = nil 495 c.urlParams_.Set("alt", alt) 496 c.urlParams_.Set("prettyPrint", "false") 497 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/autnum/{autnumId}") 498 urls += "?" + c.urlParams_.Encode() 499 req, err := http.NewRequest("GET", urls, body) 500 if err != nil { 501 return nil, err 502 } 503 req.Header = reqHeaders 504 googleapi.Expand(req.URL, map[string]string{ 505 "autnumId": c.autnumId, 506 }) 507 return gensupport.SendRequest(c.ctx_, c.s.client, req) 508} 509 510// Do executes the "domainsrdap.autnum.get" call. 511// Exactly one of *RdapResponse or error will be non-nil. Any non-2xx 512// status code is an error. Response headers are in either 513// *RdapResponse.ServerResponse.Header or (if a response was returned at 514// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 515// to check whether the returned error was because 516// http.StatusNotModified was returned. 517func (c *AutnumGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { 518 gensupport.SetOptions(c.urlParams_, opts...) 519 res, err := c.doRequest("json") 520 if res != nil && res.StatusCode == http.StatusNotModified { 521 if res.Body != nil { 522 res.Body.Close() 523 } 524 return nil, &googleapi.Error{ 525 Code: res.StatusCode, 526 Header: res.Header, 527 } 528 } 529 if err != nil { 530 return nil, err 531 } 532 defer googleapi.CloseBody(res) 533 if err := googleapi.CheckResponse(res); err != nil { 534 return nil, err 535 } 536 ret := &RdapResponse{ 537 ServerResponse: googleapi.ServerResponse{ 538 Header: res.Header, 539 HTTPStatusCode: res.StatusCode, 540 }, 541 } 542 target := &ret 543 if err := gensupport.DecodeResponse(target, res); err != nil { 544 return nil, err 545 } 546 return ret, nil 547 // { 548 // "description": "The RDAP API recognizes this command from the RDAP specification but\ndoes not support it. The response is a formatted 501 error.", 549 // "flatPath": "v1/autnum/{autnumId}", 550 // "httpMethod": "GET", 551 // "id": "domainsrdap.autnum.get", 552 // "parameterOrder": [ 553 // "autnumId" 554 // ], 555 // "parameters": { 556 // "autnumId": { 557 // "location": "path", 558 // "required": true, 559 // "type": "string" 560 // } 561 // }, 562 // "path": "v1/autnum/{autnumId}", 563 // "response": { 564 // "$ref": "RdapResponse" 565 // } 566 // } 567 568} 569 570// method id "domainsrdap.domain.get": 571 572type DomainGetCall struct { 573 s *Service 574 domainName string 575 urlParams_ gensupport.URLParams 576 ifNoneMatch_ string 577 ctx_ context.Context 578 header_ http.Header 579} 580 581// Get: Look up RDAP information for a domain by name. 582func (r *DomainService) Get(domainName string) *DomainGetCall { 583 c := &DomainGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 584 c.domainName = domainName 585 return c 586} 587 588// Fields allows partial responses to be retrieved. See 589// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 590// for more information. 591func (c *DomainGetCall) Fields(s ...googleapi.Field) *DomainGetCall { 592 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 593 return c 594} 595 596// IfNoneMatch sets the optional parameter which makes the operation 597// fail if the object's ETag matches the given value. This is useful for 598// getting updates only after the object has changed since the last 599// request. Use googleapi.IsNotModified to check whether the response 600// error from Do is the result of In-None-Match. 601func (c *DomainGetCall) IfNoneMatch(entityTag string) *DomainGetCall { 602 c.ifNoneMatch_ = entityTag 603 return c 604} 605 606// Context sets the context to be used in this call's Do method. Any 607// pending HTTP request will be aborted if the provided context is 608// canceled. 609func (c *DomainGetCall) Context(ctx context.Context) *DomainGetCall { 610 c.ctx_ = ctx 611 return c 612} 613 614// Header returns an http.Header that can be modified by the caller to 615// add HTTP headers to the request. 616func (c *DomainGetCall) Header() http.Header { 617 if c.header_ == nil { 618 c.header_ = make(http.Header) 619 } 620 return c.header_ 621} 622 623func (c *DomainGetCall) doRequest(alt string) (*http.Response, error) { 624 reqHeaders := make(http.Header) 625 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 626 for k, v := range c.header_ { 627 reqHeaders[k] = v 628 } 629 reqHeaders.Set("User-Agent", c.s.userAgent()) 630 if c.ifNoneMatch_ != "" { 631 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 632 } 633 var body io.Reader = nil 634 c.urlParams_.Set("alt", alt) 635 c.urlParams_.Set("prettyPrint", "false") 636 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/domain/{+domainName}") 637 urls += "?" + c.urlParams_.Encode() 638 req, err := http.NewRequest("GET", urls, body) 639 if err != nil { 640 return nil, err 641 } 642 req.Header = reqHeaders 643 googleapi.Expand(req.URL, map[string]string{ 644 "domainName": c.domainName, 645 }) 646 return gensupport.SendRequest(c.ctx_, c.s.client, req) 647} 648 649// Do executes the "domainsrdap.domain.get" call. 650// Exactly one of *HttpBody or error will be non-nil. Any non-2xx status 651// code is an error. Response headers are in either 652// *HttpBody.ServerResponse.Header or (if a response was returned at 653// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 654// to check whether the returned error was because 655// http.StatusNotModified was returned. 656func (c *DomainGetCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) { 657 gensupport.SetOptions(c.urlParams_, opts...) 658 res, err := c.doRequest("json") 659 if res != nil && res.StatusCode == http.StatusNotModified { 660 if res.Body != nil { 661 res.Body.Close() 662 } 663 return nil, &googleapi.Error{ 664 Code: res.StatusCode, 665 Header: res.Header, 666 } 667 } 668 if err != nil { 669 return nil, err 670 } 671 defer googleapi.CloseBody(res) 672 if err := googleapi.CheckResponse(res); err != nil { 673 return nil, err 674 } 675 ret := &HttpBody{ 676 ServerResponse: googleapi.ServerResponse{ 677 Header: res.Header, 678 HTTPStatusCode: res.StatusCode, 679 }, 680 } 681 target := &ret 682 if err := gensupport.DecodeResponse(target, res); err != nil { 683 return nil, err 684 } 685 return ret, nil 686 // { 687 // "description": "Look up RDAP information for a domain by name.", 688 // "flatPath": "v1/domain/{domainId}", 689 // "httpMethod": "GET", 690 // "id": "domainsrdap.domain.get", 691 // "parameterOrder": [ 692 // "domainName" 693 // ], 694 // "parameters": { 695 // "domainName": { 696 // "description": "Full domain name to look up. Example: \"example.com\"", 697 // "location": "path", 698 // "pattern": "^[^/]+$", 699 // "required": true, 700 // "type": "string" 701 // } 702 // }, 703 // "path": "v1/domain/{+domainName}", 704 // "response": { 705 // "$ref": "HttpBody" 706 // } 707 // } 708 709} 710 711// method id "domainsrdap.entity.get": 712 713type EntityGetCall struct { 714 s *Service 715 entityId string 716 urlParams_ gensupport.URLParams 717 ifNoneMatch_ string 718 ctx_ context.Context 719 header_ http.Header 720} 721 722// Get: The RDAP API recognizes this command from the RDAP specification 723// but 724// does not support it. The response is a formatted 501 error. 725func (r *EntityService) Get(entityId string) *EntityGetCall { 726 c := &EntityGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 727 c.entityId = entityId 728 return c 729} 730 731// Fields allows partial responses to be retrieved. See 732// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 733// for more information. 734func (c *EntityGetCall) Fields(s ...googleapi.Field) *EntityGetCall { 735 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 736 return c 737} 738 739// IfNoneMatch sets the optional parameter which makes the operation 740// fail if the object's ETag matches the given value. This is useful for 741// getting updates only after the object has changed since the last 742// request. Use googleapi.IsNotModified to check whether the response 743// error from Do is the result of In-None-Match. 744func (c *EntityGetCall) IfNoneMatch(entityTag string) *EntityGetCall { 745 c.ifNoneMatch_ = entityTag 746 return c 747} 748 749// Context sets the context to be used in this call's Do method. Any 750// pending HTTP request will be aborted if the provided context is 751// canceled. 752func (c *EntityGetCall) Context(ctx context.Context) *EntityGetCall { 753 c.ctx_ = ctx 754 return c 755} 756 757// Header returns an http.Header that can be modified by the caller to 758// add HTTP headers to the request. 759func (c *EntityGetCall) Header() http.Header { 760 if c.header_ == nil { 761 c.header_ = make(http.Header) 762 } 763 return c.header_ 764} 765 766func (c *EntityGetCall) doRequest(alt string) (*http.Response, error) { 767 reqHeaders := make(http.Header) 768 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 769 for k, v := range c.header_ { 770 reqHeaders[k] = v 771 } 772 reqHeaders.Set("User-Agent", c.s.userAgent()) 773 if c.ifNoneMatch_ != "" { 774 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 775 } 776 var body io.Reader = nil 777 c.urlParams_.Set("alt", alt) 778 c.urlParams_.Set("prettyPrint", "false") 779 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/entity/{entityId}") 780 urls += "?" + c.urlParams_.Encode() 781 req, err := http.NewRequest("GET", urls, body) 782 if err != nil { 783 return nil, err 784 } 785 req.Header = reqHeaders 786 googleapi.Expand(req.URL, map[string]string{ 787 "entityId": c.entityId, 788 }) 789 return gensupport.SendRequest(c.ctx_, c.s.client, req) 790} 791 792// Do executes the "domainsrdap.entity.get" call. 793// Exactly one of *RdapResponse or error will be non-nil. Any non-2xx 794// status code is an error. Response headers are in either 795// *RdapResponse.ServerResponse.Header or (if a response was returned at 796// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 797// to check whether the returned error was because 798// http.StatusNotModified was returned. 799func (c *EntityGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { 800 gensupport.SetOptions(c.urlParams_, opts...) 801 res, err := c.doRequest("json") 802 if res != nil && res.StatusCode == http.StatusNotModified { 803 if res.Body != nil { 804 res.Body.Close() 805 } 806 return nil, &googleapi.Error{ 807 Code: res.StatusCode, 808 Header: res.Header, 809 } 810 } 811 if err != nil { 812 return nil, err 813 } 814 defer googleapi.CloseBody(res) 815 if err := googleapi.CheckResponse(res); err != nil { 816 return nil, err 817 } 818 ret := &RdapResponse{ 819 ServerResponse: googleapi.ServerResponse{ 820 Header: res.Header, 821 HTTPStatusCode: res.StatusCode, 822 }, 823 } 824 target := &ret 825 if err := gensupport.DecodeResponse(target, res); err != nil { 826 return nil, err 827 } 828 return ret, nil 829 // { 830 // "description": "The RDAP API recognizes this command from the RDAP specification but\ndoes not support it. The response is a formatted 501 error.", 831 // "flatPath": "v1/entity/{entityId}", 832 // "httpMethod": "GET", 833 // "id": "domainsrdap.entity.get", 834 // "parameterOrder": [ 835 // "entityId" 836 // ], 837 // "parameters": { 838 // "entityId": { 839 // "location": "path", 840 // "required": true, 841 // "type": "string" 842 // } 843 // }, 844 // "path": "v1/entity/{entityId}", 845 // "response": { 846 // "$ref": "RdapResponse" 847 // } 848 // } 849 850} 851 852// method id "domainsrdap.ip.get": 853 854type IpGetCall struct { 855 s *Service 856 ipId string 857 ipId1 string 858 urlParams_ gensupport.URLParams 859 ifNoneMatch_ string 860 ctx_ context.Context 861 header_ http.Header 862} 863 864// Get: The RDAP API recognizes this command from the RDAP specification 865// but 866// does not support it. The response is a formatted 501 error. 867func (r *IpService) Get(ipId string, ipId1 string) *IpGetCall { 868 c := &IpGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 869 c.ipId = ipId 870 c.ipId1 = ipId1 871 return c 872} 873 874// Fields allows partial responses to be retrieved. See 875// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 876// for more information. 877func (c *IpGetCall) Fields(s ...googleapi.Field) *IpGetCall { 878 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 879 return c 880} 881 882// IfNoneMatch sets the optional parameter which makes the operation 883// fail if the object's ETag matches the given value. This is useful for 884// getting updates only after the object has changed since the last 885// request. Use googleapi.IsNotModified to check whether the response 886// error from Do is the result of In-None-Match. 887func (c *IpGetCall) IfNoneMatch(entityTag string) *IpGetCall { 888 c.ifNoneMatch_ = entityTag 889 return c 890} 891 892// Context sets the context to be used in this call's Do method. Any 893// pending HTTP request will be aborted if the provided context is 894// canceled. 895func (c *IpGetCall) Context(ctx context.Context) *IpGetCall { 896 c.ctx_ = ctx 897 return c 898} 899 900// Header returns an http.Header that can be modified by the caller to 901// add HTTP headers to the request. 902func (c *IpGetCall) Header() http.Header { 903 if c.header_ == nil { 904 c.header_ = make(http.Header) 905 } 906 return c.header_ 907} 908 909func (c *IpGetCall) doRequest(alt string) (*http.Response, error) { 910 reqHeaders := make(http.Header) 911 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 912 for k, v := range c.header_ { 913 reqHeaders[k] = v 914 } 915 reqHeaders.Set("User-Agent", c.s.userAgent()) 916 if c.ifNoneMatch_ != "" { 917 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 918 } 919 var body io.Reader = nil 920 c.urlParams_.Set("alt", alt) 921 c.urlParams_.Set("prettyPrint", "false") 922 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/ip/{ipId}/{ipId1}") 923 urls += "?" + c.urlParams_.Encode() 924 req, err := http.NewRequest("GET", urls, body) 925 if err != nil { 926 return nil, err 927 } 928 req.Header = reqHeaders 929 googleapi.Expand(req.URL, map[string]string{ 930 "ipId": c.ipId, 931 "ipId1": c.ipId1, 932 }) 933 return gensupport.SendRequest(c.ctx_, c.s.client, req) 934} 935 936// Do executes the "domainsrdap.ip.get" call. 937// Exactly one of *RdapResponse or error will be non-nil. Any non-2xx 938// status code is an error. Response headers are in either 939// *RdapResponse.ServerResponse.Header or (if a response was returned at 940// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 941// to check whether the returned error was because 942// http.StatusNotModified was returned. 943func (c *IpGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { 944 gensupport.SetOptions(c.urlParams_, opts...) 945 res, err := c.doRequest("json") 946 if res != nil && res.StatusCode == http.StatusNotModified { 947 if res.Body != nil { 948 res.Body.Close() 949 } 950 return nil, &googleapi.Error{ 951 Code: res.StatusCode, 952 Header: res.Header, 953 } 954 } 955 if err != nil { 956 return nil, err 957 } 958 defer googleapi.CloseBody(res) 959 if err := googleapi.CheckResponse(res); err != nil { 960 return nil, err 961 } 962 ret := &RdapResponse{ 963 ServerResponse: googleapi.ServerResponse{ 964 Header: res.Header, 965 HTTPStatusCode: res.StatusCode, 966 }, 967 } 968 target := &ret 969 if err := gensupport.DecodeResponse(target, res); err != nil { 970 return nil, err 971 } 972 return ret, nil 973 // { 974 // "description": "The RDAP API recognizes this command from the RDAP specification but\ndoes not support it. The response is a formatted 501 error.", 975 // "flatPath": "v1/ip/{ipId}/{ipId1}", 976 // "httpMethod": "GET", 977 // "id": "domainsrdap.ip.get", 978 // "parameterOrder": [ 979 // "ipId", 980 // "ipId1" 981 // ], 982 // "parameters": { 983 // "ipId": { 984 // "location": "path", 985 // "required": true, 986 // "type": "string" 987 // }, 988 // "ipId1": { 989 // "location": "path", 990 // "required": true, 991 // "type": "string" 992 // } 993 // }, 994 // "path": "v1/ip/{ipId}/{ipId1}", 995 // "response": { 996 // "$ref": "RdapResponse" 997 // } 998 // } 999 1000} 1001 1002// method id "domainsrdap.nameserver.get": 1003 1004type NameserverGetCall struct { 1005 s *Service 1006 nameserverId string 1007 urlParams_ gensupport.URLParams 1008 ifNoneMatch_ string 1009 ctx_ context.Context 1010 header_ http.Header 1011} 1012 1013// Get: The RDAP API recognizes this command from the RDAP specification 1014// but 1015// does not support it. The response is a formatted 501 error. 1016func (r *NameserverService) Get(nameserverId string) *NameserverGetCall { 1017 c := &NameserverGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1018 c.nameserverId = nameserverId 1019 return c 1020} 1021 1022// Fields allows partial responses to be retrieved. See 1023// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1024// for more information. 1025func (c *NameserverGetCall) Fields(s ...googleapi.Field) *NameserverGetCall { 1026 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1027 return c 1028} 1029 1030// IfNoneMatch sets the optional parameter which makes the operation 1031// fail if the object's ETag matches the given value. This is useful for 1032// getting updates only after the object has changed since the last 1033// request. Use googleapi.IsNotModified to check whether the response 1034// error from Do is the result of In-None-Match. 1035func (c *NameserverGetCall) IfNoneMatch(entityTag string) *NameserverGetCall { 1036 c.ifNoneMatch_ = entityTag 1037 return c 1038} 1039 1040// Context sets the context to be used in this call's Do method. Any 1041// pending HTTP request will be aborted if the provided context is 1042// canceled. 1043func (c *NameserverGetCall) Context(ctx context.Context) *NameserverGetCall { 1044 c.ctx_ = ctx 1045 return c 1046} 1047 1048// Header returns an http.Header that can be modified by the caller to 1049// add HTTP headers to the request. 1050func (c *NameserverGetCall) Header() http.Header { 1051 if c.header_ == nil { 1052 c.header_ = make(http.Header) 1053 } 1054 return c.header_ 1055} 1056 1057func (c *NameserverGetCall) doRequest(alt string) (*http.Response, error) { 1058 reqHeaders := make(http.Header) 1059 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1060 for k, v := range c.header_ { 1061 reqHeaders[k] = v 1062 } 1063 reqHeaders.Set("User-Agent", c.s.userAgent()) 1064 if c.ifNoneMatch_ != "" { 1065 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1066 } 1067 var body io.Reader = nil 1068 c.urlParams_.Set("alt", alt) 1069 c.urlParams_.Set("prettyPrint", "false") 1070 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/nameserver/{nameserverId}") 1071 urls += "?" + c.urlParams_.Encode() 1072 req, err := http.NewRequest("GET", urls, body) 1073 if err != nil { 1074 return nil, err 1075 } 1076 req.Header = reqHeaders 1077 googleapi.Expand(req.URL, map[string]string{ 1078 "nameserverId": c.nameserverId, 1079 }) 1080 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1081} 1082 1083// Do executes the "domainsrdap.nameserver.get" call. 1084// Exactly one of *RdapResponse or error will be non-nil. Any non-2xx 1085// status code is an error. Response headers are in either 1086// *RdapResponse.ServerResponse.Header or (if a response was returned at 1087// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1088// to check whether the returned error was because 1089// http.StatusNotModified was returned. 1090func (c *NameserverGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { 1091 gensupport.SetOptions(c.urlParams_, opts...) 1092 res, err := c.doRequest("json") 1093 if res != nil && res.StatusCode == http.StatusNotModified { 1094 if res.Body != nil { 1095 res.Body.Close() 1096 } 1097 return nil, &googleapi.Error{ 1098 Code: res.StatusCode, 1099 Header: res.Header, 1100 } 1101 } 1102 if err != nil { 1103 return nil, err 1104 } 1105 defer googleapi.CloseBody(res) 1106 if err := googleapi.CheckResponse(res); err != nil { 1107 return nil, err 1108 } 1109 ret := &RdapResponse{ 1110 ServerResponse: googleapi.ServerResponse{ 1111 Header: res.Header, 1112 HTTPStatusCode: res.StatusCode, 1113 }, 1114 } 1115 target := &ret 1116 if err := gensupport.DecodeResponse(target, res); err != nil { 1117 return nil, err 1118 } 1119 return ret, nil 1120 // { 1121 // "description": "The RDAP API recognizes this command from the RDAP specification but\ndoes not support it. The response is a formatted 501 error.", 1122 // "flatPath": "v1/nameserver/{nameserverId}", 1123 // "httpMethod": "GET", 1124 // "id": "domainsrdap.nameserver.get", 1125 // "parameterOrder": [ 1126 // "nameserverId" 1127 // ], 1128 // "parameters": { 1129 // "nameserverId": { 1130 // "location": "path", 1131 // "required": true, 1132 // "type": "string" 1133 // } 1134 // }, 1135 // "path": "v1/nameserver/{nameserverId}", 1136 // "response": { 1137 // "$ref": "RdapResponse" 1138 // } 1139 // } 1140 1141} 1142 1143// method id "domainsrdap.getDomains": 1144 1145type V1GetDomainsCall struct { 1146 s *Service 1147 urlParams_ gensupport.URLParams 1148 ifNoneMatch_ string 1149 ctx_ context.Context 1150 header_ http.Header 1151} 1152 1153// GetDomains: The RDAP API recognizes this command from the RDAP 1154// specification but 1155// does not support it. The response is a formatted 501 error. 1156func (r *V1Service) GetDomains() *V1GetDomainsCall { 1157 c := &V1GetDomainsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1158 return c 1159} 1160 1161// Fields allows partial responses to be retrieved. See 1162// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1163// for more information. 1164func (c *V1GetDomainsCall) Fields(s ...googleapi.Field) *V1GetDomainsCall { 1165 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1166 return c 1167} 1168 1169// IfNoneMatch sets the optional parameter which makes the operation 1170// fail if the object's ETag matches the given value. This is useful for 1171// getting updates only after the object has changed since the last 1172// request. Use googleapi.IsNotModified to check whether the response 1173// error from Do is the result of In-None-Match. 1174func (c *V1GetDomainsCall) IfNoneMatch(entityTag string) *V1GetDomainsCall { 1175 c.ifNoneMatch_ = entityTag 1176 return c 1177} 1178 1179// Context sets the context to be used in this call's Do method. Any 1180// pending HTTP request will be aborted if the provided context is 1181// canceled. 1182func (c *V1GetDomainsCall) Context(ctx context.Context) *V1GetDomainsCall { 1183 c.ctx_ = ctx 1184 return c 1185} 1186 1187// Header returns an http.Header that can be modified by the caller to 1188// add HTTP headers to the request. 1189func (c *V1GetDomainsCall) Header() http.Header { 1190 if c.header_ == nil { 1191 c.header_ = make(http.Header) 1192 } 1193 return c.header_ 1194} 1195 1196func (c *V1GetDomainsCall) doRequest(alt string) (*http.Response, error) { 1197 reqHeaders := make(http.Header) 1198 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1199 for k, v := range c.header_ { 1200 reqHeaders[k] = v 1201 } 1202 reqHeaders.Set("User-Agent", c.s.userAgent()) 1203 if c.ifNoneMatch_ != "" { 1204 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1205 } 1206 var body io.Reader = nil 1207 c.urlParams_.Set("alt", alt) 1208 c.urlParams_.Set("prettyPrint", "false") 1209 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/domains") 1210 urls += "?" + c.urlParams_.Encode() 1211 req, err := http.NewRequest("GET", urls, body) 1212 if err != nil { 1213 return nil, err 1214 } 1215 req.Header = reqHeaders 1216 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1217} 1218 1219// Do executes the "domainsrdap.getDomains" call. 1220// Exactly one of *RdapResponse or error will be non-nil. Any non-2xx 1221// status code is an error. Response headers are in either 1222// *RdapResponse.ServerResponse.Header or (if a response was returned at 1223// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1224// to check whether the returned error was because 1225// http.StatusNotModified was returned. 1226func (c *V1GetDomainsCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { 1227 gensupport.SetOptions(c.urlParams_, opts...) 1228 res, err := c.doRequest("json") 1229 if res != nil && res.StatusCode == http.StatusNotModified { 1230 if res.Body != nil { 1231 res.Body.Close() 1232 } 1233 return nil, &googleapi.Error{ 1234 Code: res.StatusCode, 1235 Header: res.Header, 1236 } 1237 } 1238 if err != nil { 1239 return nil, err 1240 } 1241 defer googleapi.CloseBody(res) 1242 if err := googleapi.CheckResponse(res); err != nil { 1243 return nil, err 1244 } 1245 ret := &RdapResponse{ 1246 ServerResponse: googleapi.ServerResponse{ 1247 Header: res.Header, 1248 HTTPStatusCode: res.StatusCode, 1249 }, 1250 } 1251 target := &ret 1252 if err := gensupport.DecodeResponse(target, res); err != nil { 1253 return nil, err 1254 } 1255 return ret, nil 1256 // { 1257 // "description": "The RDAP API recognizes this command from the RDAP specification but\ndoes not support it. The response is a formatted 501 error.", 1258 // "flatPath": "v1/domains", 1259 // "httpMethod": "GET", 1260 // "id": "domainsrdap.getDomains", 1261 // "parameterOrder": [], 1262 // "parameters": {}, 1263 // "path": "v1/domains", 1264 // "response": { 1265 // "$ref": "RdapResponse" 1266 // } 1267 // } 1268 1269} 1270 1271// method id "domainsrdap.getEntities": 1272 1273type V1GetEntitiesCall struct { 1274 s *Service 1275 urlParams_ gensupport.URLParams 1276 ifNoneMatch_ string 1277 ctx_ context.Context 1278 header_ http.Header 1279} 1280 1281// GetEntities: The RDAP API recognizes this command from the RDAP 1282// specification but 1283// does not support it. The response is a formatted 501 error. 1284func (r *V1Service) GetEntities() *V1GetEntitiesCall { 1285 c := &V1GetEntitiesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1286 return c 1287} 1288 1289// Fields allows partial responses to be retrieved. See 1290// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1291// for more information. 1292func (c *V1GetEntitiesCall) Fields(s ...googleapi.Field) *V1GetEntitiesCall { 1293 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1294 return c 1295} 1296 1297// IfNoneMatch sets the optional parameter which makes the operation 1298// fail if the object's ETag matches the given value. This is useful for 1299// getting updates only after the object has changed since the last 1300// request. Use googleapi.IsNotModified to check whether the response 1301// error from Do is the result of In-None-Match. 1302func (c *V1GetEntitiesCall) IfNoneMatch(entityTag string) *V1GetEntitiesCall { 1303 c.ifNoneMatch_ = entityTag 1304 return c 1305} 1306 1307// Context sets the context to be used in this call's Do method. Any 1308// pending HTTP request will be aborted if the provided context is 1309// canceled. 1310func (c *V1GetEntitiesCall) Context(ctx context.Context) *V1GetEntitiesCall { 1311 c.ctx_ = ctx 1312 return c 1313} 1314 1315// Header returns an http.Header that can be modified by the caller to 1316// add HTTP headers to the request. 1317func (c *V1GetEntitiesCall) Header() http.Header { 1318 if c.header_ == nil { 1319 c.header_ = make(http.Header) 1320 } 1321 return c.header_ 1322} 1323 1324func (c *V1GetEntitiesCall) doRequest(alt string) (*http.Response, error) { 1325 reqHeaders := make(http.Header) 1326 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1327 for k, v := range c.header_ { 1328 reqHeaders[k] = v 1329 } 1330 reqHeaders.Set("User-Agent", c.s.userAgent()) 1331 if c.ifNoneMatch_ != "" { 1332 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1333 } 1334 var body io.Reader = nil 1335 c.urlParams_.Set("alt", alt) 1336 c.urlParams_.Set("prettyPrint", "false") 1337 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/entities") 1338 urls += "?" + c.urlParams_.Encode() 1339 req, err := http.NewRequest("GET", urls, body) 1340 if err != nil { 1341 return nil, err 1342 } 1343 req.Header = reqHeaders 1344 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1345} 1346 1347// Do executes the "domainsrdap.getEntities" call. 1348// Exactly one of *RdapResponse or error will be non-nil. Any non-2xx 1349// status code is an error. Response headers are in either 1350// *RdapResponse.ServerResponse.Header or (if a response was returned at 1351// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1352// to check whether the returned error was because 1353// http.StatusNotModified was returned. 1354func (c *V1GetEntitiesCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { 1355 gensupport.SetOptions(c.urlParams_, opts...) 1356 res, err := c.doRequest("json") 1357 if res != nil && res.StatusCode == http.StatusNotModified { 1358 if res.Body != nil { 1359 res.Body.Close() 1360 } 1361 return nil, &googleapi.Error{ 1362 Code: res.StatusCode, 1363 Header: res.Header, 1364 } 1365 } 1366 if err != nil { 1367 return nil, err 1368 } 1369 defer googleapi.CloseBody(res) 1370 if err := googleapi.CheckResponse(res); err != nil { 1371 return nil, err 1372 } 1373 ret := &RdapResponse{ 1374 ServerResponse: googleapi.ServerResponse{ 1375 Header: res.Header, 1376 HTTPStatusCode: res.StatusCode, 1377 }, 1378 } 1379 target := &ret 1380 if err := gensupport.DecodeResponse(target, res); err != nil { 1381 return nil, err 1382 } 1383 return ret, nil 1384 // { 1385 // "description": "The RDAP API recognizes this command from the RDAP specification but\ndoes not support it. The response is a formatted 501 error.", 1386 // "flatPath": "v1/entities", 1387 // "httpMethod": "GET", 1388 // "id": "domainsrdap.getEntities", 1389 // "parameterOrder": [], 1390 // "parameters": {}, 1391 // "path": "v1/entities", 1392 // "response": { 1393 // "$ref": "RdapResponse" 1394 // } 1395 // } 1396 1397} 1398 1399// method id "domainsrdap.getHelp": 1400 1401type V1GetHelpCall struct { 1402 s *Service 1403 urlParams_ gensupport.URLParams 1404 ifNoneMatch_ string 1405 ctx_ context.Context 1406 header_ http.Header 1407} 1408 1409// GetHelp: Get help information for the RDAP API, including links to 1410// documentation. 1411func (r *V1Service) GetHelp() *V1GetHelpCall { 1412 c := &V1GetHelpCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1413 return c 1414} 1415 1416// Fields allows partial responses to be retrieved. See 1417// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1418// for more information. 1419func (c *V1GetHelpCall) Fields(s ...googleapi.Field) *V1GetHelpCall { 1420 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1421 return c 1422} 1423 1424// IfNoneMatch sets the optional parameter which makes the operation 1425// fail if the object's ETag matches the given value. This is useful for 1426// getting updates only after the object has changed since the last 1427// request. Use googleapi.IsNotModified to check whether the response 1428// error from Do is the result of In-None-Match. 1429func (c *V1GetHelpCall) IfNoneMatch(entityTag string) *V1GetHelpCall { 1430 c.ifNoneMatch_ = entityTag 1431 return c 1432} 1433 1434// Context sets the context to be used in this call's Do method. Any 1435// pending HTTP request will be aborted if the provided context is 1436// canceled. 1437func (c *V1GetHelpCall) Context(ctx context.Context) *V1GetHelpCall { 1438 c.ctx_ = ctx 1439 return c 1440} 1441 1442// Header returns an http.Header that can be modified by the caller to 1443// add HTTP headers to the request. 1444func (c *V1GetHelpCall) Header() http.Header { 1445 if c.header_ == nil { 1446 c.header_ = make(http.Header) 1447 } 1448 return c.header_ 1449} 1450 1451func (c *V1GetHelpCall) doRequest(alt string) (*http.Response, error) { 1452 reqHeaders := make(http.Header) 1453 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1454 for k, v := range c.header_ { 1455 reqHeaders[k] = v 1456 } 1457 reqHeaders.Set("User-Agent", c.s.userAgent()) 1458 if c.ifNoneMatch_ != "" { 1459 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1460 } 1461 var body io.Reader = nil 1462 c.urlParams_.Set("alt", alt) 1463 c.urlParams_.Set("prettyPrint", "false") 1464 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/help") 1465 urls += "?" + c.urlParams_.Encode() 1466 req, err := http.NewRequest("GET", urls, body) 1467 if err != nil { 1468 return nil, err 1469 } 1470 req.Header = reqHeaders 1471 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1472} 1473 1474// Do executes the "domainsrdap.getHelp" call. 1475// Exactly one of *HttpBody or error will be non-nil. Any non-2xx status 1476// code is an error. Response headers are in either 1477// *HttpBody.ServerResponse.Header or (if a response was returned at 1478// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1479// to check whether the returned error was because 1480// http.StatusNotModified was returned. 1481func (c *V1GetHelpCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) { 1482 gensupport.SetOptions(c.urlParams_, opts...) 1483 res, err := c.doRequest("json") 1484 if res != nil && res.StatusCode == http.StatusNotModified { 1485 if res.Body != nil { 1486 res.Body.Close() 1487 } 1488 return nil, &googleapi.Error{ 1489 Code: res.StatusCode, 1490 Header: res.Header, 1491 } 1492 } 1493 if err != nil { 1494 return nil, err 1495 } 1496 defer googleapi.CloseBody(res) 1497 if err := googleapi.CheckResponse(res); err != nil { 1498 return nil, err 1499 } 1500 ret := &HttpBody{ 1501 ServerResponse: googleapi.ServerResponse{ 1502 Header: res.Header, 1503 HTTPStatusCode: res.StatusCode, 1504 }, 1505 } 1506 target := &ret 1507 if err := gensupport.DecodeResponse(target, res); err != nil { 1508 return nil, err 1509 } 1510 return ret, nil 1511 // { 1512 // "description": "Get help information for the RDAP API, including links to documentation.", 1513 // "flatPath": "v1/help", 1514 // "httpMethod": "GET", 1515 // "id": "domainsrdap.getHelp", 1516 // "parameterOrder": [], 1517 // "parameters": {}, 1518 // "path": "v1/help", 1519 // "response": { 1520 // "$ref": "HttpBody" 1521 // } 1522 // } 1523 1524} 1525 1526// method id "domainsrdap.getIp": 1527 1528type V1GetIpCall struct { 1529 s *Service 1530 urlParams_ gensupport.URLParams 1531 ifNoneMatch_ string 1532 ctx_ context.Context 1533 header_ http.Header 1534} 1535 1536// GetIp: The RDAP API recognizes this command from the RDAP 1537// specification but 1538// does not support it. The response is a formatted 501 error. 1539func (r *V1Service) GetIp() *V1GetIpCall { 1540 c := &V1GetIpCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1541 return c 1542} 1543 1544// Fields allows partial responses to be retrieved. See 1545// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1546// for more information. 1547func (c *V1GetIpCall) Fields(s ...googleapi.Field) *V1GetIpCall { 1548 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1549 return c 1550} 1551 1552// IfNoneMatch sets the optional parameter which makes the operation 1553// fail if the object's ETag matches the given value. This is useful for 1554// getting updates only after the object has changed since the last 1555// request. Use googleapi.IsNotModified to check whether the response 1556// error from Do is the result of In-None-Match. 1557func (c *V1GetIpCall) IfNoneMatch(entityTag string) *V1GetIpCall { 1558 c.ifNoneMatch_ = entityTag 1559 return c 1560} 1561 1562// Context sets the context to be used in this call's Do method. Any 1563// pending HTTP request will be aborted if the provided context is 1564// canceled. 1565func (c *V1GetIpCall) Context(ctx context.Context) *V1GetIpCall { 1566 c.ctx_ = ctx 1567 return c 1568} 1569 1570// Header returns an http.Header that can be modified by the caller to 1571// add HTTP headers to the request. 1572func (c *V1GetIpCall) Header() http.Header { 1573 if c.header_ == nil { 1574 c.header_ = make(http.Header) 1575 } 1576 return c.header_ 1577} 1578 1579func (c *V1GetIpCall) doRequest(alt string) (*http.Response, error) { 1580 reqHeaders := make(http.Header) 1581 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1582 for k, v := range c.header_ { 1583 reqHeaders[k] = v 1584 } 1585 reqHeaders.Set("User-Agent", c.s.userAgent()) 1586 if c.ifNoneMatch_ != "" { 1587 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1588 } 1589 var body io.Reader = nil 1590 c.urlParams_.Set("alt", alt) 1591 c.urlParams_.Set("prettyPrint", "false") 1592 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/ip") 1593 urls += "?" + c.urlParams_.Encode() 1594 req, err := http.NewRequest("GET", urls, body) 1595 if err != nil { 1596 return nil, err 1597 } 1598 req.Header = reqHeaders 1599 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1600} 1601 1602// Do executes the "domainsrdap.getIp" call. 1603// Exactly one of *HttpBody or error will be non-nil. Any non-2xx status 1604// code is an error. Response headers are in either 1605// *HttpBody.ServerResponse.Header or (if a response was returned at 1606// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1607// to check whether the returned error was because 1608// http.StatusNotModified was returned. 1609func (c *V1GetIpCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) { 1610 gensupport.SetOptions(c.urlParams_, opts...) 1611 res, err := c.doRequest("json") 1612 if res != nil && res.StatusCode == http.StatusNotModified { 1613 if res.Body != nil { 1614 res.Body.Close() 1615 } 1616 return nil, &googleapi.Error{ 1617 Code: res.StatusCode, 1618 Header: res.Header, 1619 } 1620 } 1621 if err != nil { 1622 return nil, err 1623 } 1624 defer googleapi.CloseBody(res) 1625 if err := googleapi.CheckResponse(res); err != nil { 1626 return nil, err 1627 } 1628 ret := &HttpBody{ 1629 ServerResponse: googleapi.ServerResponse{ 1630 Header: res.Header, 1631 HTTPStatusCode: res.StatusCode, 1632 }, 1633 } 1634 target := &ret 1635 if err := gensupport.DecodeResponse(target, res); err != nil { 1636 return nil, err 1637 } 1638 return ret, nil 1639 // { 1640 // "description": "The RDAP API recognizes this command from the RDAP specification but\ndoes not support it. The response is a formatted 501 error.", 1641 // "flatPath": "v1/ip", 1642 // "httpMethod": "GET", 1643 // "id": "domainsrdap.getIp", 1644 // "parameterOrder": [], 1645 // "parameters": {}, 1646 // "path": "v1/ip", 1647 // "response": { 1648 // "$ref": "HttpBody" 1649 // } 1650 // } 1651 1652} 1653 1654// method id "domainsrdap.getNameservers": 1655 1656type V1GetNameserversCall struct { 1657 s *Service 1658 urlParams_ gensupport.URLParams 1659 ifNoneMatch_ string 1660 ctx_ context.Context 1661 header_ http.Header 1662} 1663 1664// GetNameservers: The RDAP API recognizes this command from the RDAP 1665// specification but 1666// does not support it. The response is a formatted 501 error. 1667func (r *V1Service) GetNameservers() *V1GetNameserversCall { 1668 c := &V1GetNameserversCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1669 return c 1670} 1671 1672// Fields allows partial responses to be retrieved. See 1673// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1674// for more information. 1675func (c *V1GetNameserversCall) Fields(s ...googleapi.Field) *V1GetNameserversCall { 1676 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1677 return c 1678} 1679 1680// IfNoneMatch sets the optional parameter which makes the operation 1681// fail if the object's ETag matches the given value. This is useful for 1682// getting updates only after the object has changed since the last 1683// request. Use googleapi.IsNotModified to check whether the response 1684// error from Do is the result of In-None-Match. 1685func (c *V1GetNameserversCall) IfNoneMatch(entityTag string) *V1GetNameserversCall { 1686 c.ifNoneMatch_ = entityTag 1687 return c 1688} 1689 1690// Context sets the context to be used in this call's Do method. Any 1691// pending HTTP request will be aborted if the provided context is 1692// canceled. 1693func (c *V1GetNameserversCall) Context(ctx context.Context) *V1GetNameserversCall { 1694 c.ctx_ = ctx 1695 return c 1696} 1697 1698// Header returns an http.Header that can be modified by the caller to 1699// add HTTP headers to the request. 1700func (c *V1GetNameserversCall) Header() http.Header { 1701 if c.header_ == nil { 1702 c.header_ = make(http.Header) 1703 } 1704 return c.header_ 1705} 1706 1707func (c *V1GetNameserversCall) doRequest(alt string) (*http.Response, error) { 1708 reqHeaders := make(http.Header) 1709 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1710 for k, v := range c.header_ { 1711 reqHeaders[k] = v 1712 } 1713 reqHeaders.Set("User-Agent", c.s.userAgent()) 1714 if c.ifNoneMatch_ != "" { 1715 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1716 } 1717 var body io.Reader = nil 1718 c.urlParams_.Set("alt", alt) 1719 c.urlParams_.Set("prettyPrint", "false") 1720 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/nameservers") 1721 urls += "?" + c.urlParams_.Encode() 1722 req, err := http.NewRequest("GET", urls, body) 1723 if err != nil { 1724 return nil, err 1725 } 1726 req.Header = reqHeaders 1727 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1728} 1729 1730// Do executes the "domainsrdap.getNameservers" call. 1731// Exactly one of *RdapResponse or error will be non-nil. Any non-2xx 1732// status code is an error. Response headers are in either 1733// *RdapResponse.ServerResponse.Header or (if a response was returned at 1734// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1735// to check whether the returned error was because 1736// http.StatusNotModified was returned. 1737func (c *V1GetNameserversCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { 1738 gensupport.SetOptions(c.urlParams_, opts...) 1739 res, err := c.doRequest("json") 1740 if res != nil && res.StatusCode == http.StatusNotModified { 1741 if res.Body != nil { 1742 res.Body.Close() 1743 } 1744 return nil, &googleapi.Error{ 1745 Code: res.StatusCode, 1746 Header: res.Header, 1747 } 1748 } 1749 if err != nil { 1750 return nil, err 1751 } 1752 defer googleapi.CloseBody(res) 1753 if err := googleapi.CheckResponse(res); err != nil { 1754 return nil, err 1755 } 1756 ret := &RdapResponse{ 1757 ServerResponse: googleapi.ServerResponse{ 1758 Header: res.Header, 1759 HTTPStatusCode: res.StatusCode, 1760 }, 1761 } 1762 target := &ret 1763 if err := gensupport.DecodeResponse(target, res); err != nil { 1764 return nil, err 1765 } 1766 return ret, nil 1767 // { 1768 // "description": "The RDAP API recognizes this command from the RDAP specification but\ndoes not support it. The response is a formatted 501 error.", 1769 // "flatPath": "v1/nameservers", 1770 // "httpMethod": "GET", 1771 // "id": "domainsrdap.getNameservers", 1772 // "parameterOrder": [], 1773 // "parameters": {}, 1774 // "path": "v1/nameservers", 1775 // "response": { 1776 // "$ref": "RdapResponse" 1777 // } 1778 // } 1779 1780} 1781