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