...

Source file src/google.golang.org/api/domainsrdap/v1/domainsrdap-gen.go

Documentation: google.golang.org/api/domainsrdap/v1

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

View as plain text