// Copyright 2022 Google LLC. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated file. DO NOT EDIT. // Package domainsrdap provides access to the Domains RDAP API. // // For product documentation, see: https://developers.google.com/domains/rdap/ // // Creating a client // // Usage example: // // import "google.golang.org/api/domainsrdap/v1" // ... // ctx := context.Background() // domainsrdapService, err := domainsrdap.NewService(ctx) // // In this example, Google Application Default Credentials are used for authentication. // // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // Other authentication options // // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: // // domainsrdapService, err := domainsrdap.NewService(ctx, option.WithAPIKey("AIza...")) // // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // domainsrdapService, err := domainsrdap.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // // See https://godoc.org/google.golang.org/api/option/ for details on options. package domainsrdap // import "google.golang.org/api/domainsrdap/v1" import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "net/http" "net/url" "strconv" "strings" googleapi "google.golang.org/api/googleapi" internal "google.golang.org/api/internal" gensupport "google.golang.org/api/internal/gensupport" option "google.golang.org/api/option" internaloption "google.golang.org/api/option/internaloption" htransport "google.golang.org/api/transport/http" ) // Always reference these packages, just in case the auto-generated code // below doesn't. var _ = bytes.NewBuffer var _ = strconv.Itoa var _ = fmt.Sprintf var _ = json.NewDecoder var _ = io.Copy var _ = url.Parse var _ = gensupport.MarshalJSON var _ = googleapi.Version var _ = errors.New var _ = strings.Replace var _ = context.Canceled var _ = internaloption.WithDefaultEndpoint const apiId = "domainsrdap:v1" const apiName = "domainsrdap" const apiVersion = "v1" const basePath = "https://domainsrdap.googleapis.com/" const mtlsBasePath = "https://domainsrdap.mtls.googleapis.com/" // NewService creates a new Service. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) client, endpoint, err := htransport.NewClient(ctx, opts...) if err != nil { return nil, err } s, err := New(client) if err != nil { return nil, err } if endpoint != "" { s.BasePath = endpoint } return s, nil } // New creates a new Service. It uses the provided http.Client for requests. // // Deprecated: please use NewService instead. // To provide a custom HTTP client, use option.WithHTTPClient. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } s := &Service{client: client, BasePath: basePath} s.Autnum = NewAutnumService(s) s.Domain = NewDomainService(s) s.Entity = NewEntityService(s) s.Ip = NewIpService(s) s.Nameserver = NewNameserverService(s) s.V1 = NewV1Service(s) return s, nil } type Service struct { client *http.Client BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Autnum *AutnumService Domain *DomainService Entity *EntityService Ip *IpService Nameserver *NameserverService V1 *V1Service } func (s *Service) userAgent() string { if s.UserAgent == "" { return googleapi.UserAgent } return googleapi.UserAgent + " " + s.UserAgent } func NewAutnumService(s *Service) *AutnumService { rs := &AutnumService{s: s} return rs } type AutnumService struct { s *Service } func NewDomainService(s *Service) *DomainService { rs := &DomainService{s: s} return rs } type DomainService struct { s *Service } func NewEntityService(s *Service) *EntityService { rs := &EntityService{s: s} return rs } type EntityService struct { s *Service } func NewIpService(s *Service) *IpService { rs := &IpService{s: s} return rs } type IpService struct { s *Service } func NewNameserverService(s *Service) *NameserverService { rs := &NameserverService{s: s} return rs } type NameserverService struct { s *Service } func NewV1Service(s *Service) *V1Service { rs := &V1Service{s: s} return rs } type V1Service struct { s *Service } // HttpBody: Message that represents an arbitrary HTTP body. It should // only be used for payload formats that can't be represented as JSON, // such as raw binary or an HTML page. This message can be used both in // streaming and non-streaming API methods in the request as well as the // response. It can be used as a top-level request field, which is // convenient if one wants to extract parameters from either the URL or // HTTP template into the request fields and also want access to the raw // HTTP body. Example: message GetResourceRequest { // A unique request // id. string request_id = 1; // The raw HTTP body is bound to this // field. google.api.HttpBody http_body = 2; } service ResourceService { // rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); // rpc UpdateResource(google.api.HttpBody) returns // (google.protobuf.Empty); } Example with streaming methods: service // CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns // (stream google.api.HttpBody); rpc UpdateCalendar(stream // google.api.HttpBody) returns (stream google.api.HttpBody); } Use of // this type only changes how the request and response bodies are // handled, all other features will continue to work unchanged. type HttpBody struct { // ContentType: The HTTP Content-Type header value specifying the // content type of the body. ContentType string `json:"contentType,omitempty"` // Data: The HTTP request/response body as raw binary. Data string `json:"data,omitempty"` // Extensions: Application specific response metadata. Must be set in // the first response for streaming APIs. Extensions []googleapi.RawMessage `json:"extensions,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "ContentType") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ContentType") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *HttpBody) MarshalJSON() ([]byte, error) { type NoMethod HttpBody raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Link: Links object defined in section 4.2 of RFC 7483 // (https://tools.ietf.org/html/rfc7483#section-4.2). type Link struct { // Href: Target URL of a link. Example: "http://example.com/previous". Href string `json:"href,omitempty"` // Hreflang: Language code of a link. Example: "en". Hreflang string `json:"hreflang,omitempty"` // Media: Media type of the link destination. Example: "screen". Media string `json:"media,omitempty"` // Rel: Relation type of a link. Example: "previous". Rel string `json:"rel,omitempty"` // Title: Title of this link. Example: "title". Title string `json:"title,omitempty"` // Type: Content type of the link. Example: "application/json". Type string `json:"type,omitempty"` // Value: URL giving context for the link. Example: // "http://example.com/current". Value string `json:"value,omitempty"` // ForceSendFields is a list of field names (e.g. "Href") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Href") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Link) MarshalJSON() ([]byte, error) { type NoMethod Link raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Notice: Notices object defined in section 4.3 of RFC 7483 // (https://tools.ietf.org/html/rfc7483#section-4.3). type Notice struct { // Description: Description of the notice. Description []string `json:"description,omitempty"` // Links: Link to a document containing more information. Links []*Link `json:"links,omitempty"` // Title: Title of a notice. Example: "Terms of Service". Title string `json:"title,omitempty"` // Type: Type values defined in section 10.2.1 of RFC 7483 // (https://tools.ietf.org/html/rfc7483#section-10.2.1) specific to a // whole response: "result set truncated due to authorization", "result // set truncated due to excessive load", "result set truncated due to // unexplainable reasons". Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Description") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Description") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Notice) MarshalJSON() ([]byte, error) { type NoMethod Notice raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // RdapResponse: Response to a general RDAP query. type RdapResponse struct { // Description: Error description. Description []string `json:"description,omitempty"` // ErrorCode: Error HTTP code. Example: "501". ErrorCode int64 `json:"errorCode,omitempty"` // JsonResponse: HTTP response with content type set to // "application/json+rdap". JsonResponse *HttpBody `json:"jsonResponse,omitempty"` // Lang: Error language code. Error response info fields are defined in // section 6 of RFC 7483 // (https://tools.ietf.org/html/rfc7483#section-6). Lang string `json:"lang,omitempty"` // Notices: Notices applying to this response. Notices []*Notice `json:"notices,omitempty"` // RdapConformance: RDAP conformance level. RdapConformance []string `json:"rdapConformance,omitempty"` // Title: Error title. Title string `json:"title,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Description") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Description") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *RdapResponse) MarshalJSON() ([]byte, error) { type NoMethod RdapResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // method id "domainsrdap.autnum.get": type AutnumGetCall struct { s *Service autnumId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: The RDAP API recognizes this command from the RDAP specification // but does not support it. The response is a formatted 501 error. // // - autnumId: . func (r *AutnumService) Get(autnumId string) *AutnumGetCall { c := &AutnumGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.autnumId = autnumId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *AutnumGetCall) Fields(s ...googleapi.Field) *AutnumGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *AutnumGetCall) IfNoneMatch(entityTag string) *AutnumGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *AutnumGetCall) Context(ctx context.Context) *AutnumGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *AutnumGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *AutnumGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/autnum/{autnumId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "autnumId": c.autnumId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "domainsrdap.autnum.get" call. // Exactly one of *RdapResponse or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *RdapResponse.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *AutnumGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &RdapResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.", // "flatPath": "v1/autnum/{autnumId}", // "httpMethod": "GET", // "id": "domainsrdap.autnum.get", // "parameterOrder": [ // "autnumId" // ], // "parameters": { // "autnumId": { // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "v1/autnum/{autnumId}", // "response": { // "$ref": "RdapResponse" // } // } } // method id "domainsrdap.domain.get": type DomainGetCall struct { s *Service domainName string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Look up RDAP information for a domain by name. // // - domainName: Full domain name to look up. Example: "example.com". func (r *DomainService) Get(domainName string) *DomainGetCall { c := &DomainGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.domainName = domainName return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *DomainGetCall) Fields(s ...googleapi.Field) *DomainGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *DomainGetCall) IfNoneMatch(entityTag string) *DomainGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *DomainGetCall) Context(ctx context.Context) *DomainGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *DomainGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *DomainGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/domain/{+domainName}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "domainName": c.domainName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "domainsrdap.domain.get" call. // Exactly one of *HttpBody or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *HttpBody.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *DomainGetCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &HttpBody{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Look up RDAP information for a domain by name.", // "flatPath": "v1/domain/{domainId}", // "httpMethod": "GET", // "id": "domainsrdap.domain.get", // "parameterOrder": [ // "domainName" // ], // "parameters": { // "domainName": { // "description": "Full domain name to look up. Example: \"example.com\"", // "location": "path", // "pattern": "^[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1/domain/{+domainName}", // "response": { // "$ref": "HttpBody" // } // } } // method id "domainsrdap.entity.get": type EntityGetCall struct { s *Service entityId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: The RDAP API recognizes this command from the RDAP specification // but does not support it. The response is a formatted 501 error. // // - entityId: . func (r *EntityService) Get(entityId string) *EntityGetCall { c := &EntityGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.entityId = entityId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EntityGetCall) Fields(s ...googleapi.Field) *EntityGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EntityGetCall) IfNoneMatch(entityTag string) *EntityGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EntityGetCall) Context(ctx context.Context) *EntityGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EntityGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EntityGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/entity/{entityId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "entityId": c.entityId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "domainsrdap.entity.get" call. // Exactly one of *RdapResponse or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *RdapResponse.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *EntityGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &RdapResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.", // "flatPath": "v1/entity/{entityId}", // "httpMethod": "GET", // "id": "domainsrdap.entity.get", // "parameterOrder": [ // "entityId" // ], // "parameters": { // "entityId": { // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "v1/entity/{entityId}", // "response": { // "$ref": "RdapResponse" // } // } } // method id "domainsrdap.ip.get": type IpGetCall struct { s *Service ipId string ipId1 string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: The RDAP API recognizes this command from the RDAP specification // but does not support it. The response is a formatted 501 error. // // - ipId: . // - ipId1: . func (r *IpService) Get(ipId string, ipId1 string) *IpGetCall { c := &IpGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.ipId = ipId c.ipId1 = ipId1 return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *IpGetCall) Fields(s ...googleapi.Field) *IpGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *IpGetCall) IfNoneMatch(entityTag string) *IpGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *IpGetCall) Context(ctx context.Context) *IpGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *IpGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *IpGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/ip/{ipId}/{ipId1}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "ipId": c.ipId, "ipId1": c.ipId1, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "domainsrdap.ip.get" call. // Exactly one of *RdapResponse or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *RdapResponse.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *IpGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &RdapResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.", // "flatPath": "v1/ip/{ipId}/{ipId1}", // "httpMethod": "GET", // "id": "domainsrdap.ip.get", // "parameterOrder": [ // "ipId", // "ipId1" // ], // "parameters": { // "ipId": { // "location": "path", // "required": true, // "type": "string" // }, // "ipId1": { // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "v1/ip/{ipId}/{ipId1}", // "response": { // "$ref": "RdapResponse" // } // } } // method id "domainsrdap.nameserver.get": type NameserverGetCall struct { s *Service nameserverId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: The RDAP API recognizes this command from the RDAP specification // but does not support it. The response is a formatted 501 error. // // - nameserverId: . func (r *NameserverService) Get(nameserverId string) *NameserverGetCall { c := &NameserverGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.nameserverId = nameserverId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *NameserverGetCall) Fields(s ...googleapi.Field) *NameserverGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *NameserverGetCall) IfNoneMatch(entityTag string) *NameserverGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *NameserverGetCall) Context(ctx context.Context) *NameserverGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *NameserverGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *NameserverGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/nameserver/{nameserverId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "nameserverId": c.nameserverId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "domainsrdap.nameserver.get" call. // Exactly one of *RdapResponse or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *RdapResponse.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *NameserverGetCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &RdapResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.", // "flatPath": "v1/nameserver/{nameserverId}", // "httpMethod": "GET", // "id": "domainsrdap.nameserver.get", // "parameterOrder": [ // "nameserverId" // ], // "parameters": { // "nameserverId": { // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "v1/nameserver/{nameserverId}", // "response": { // "$ref": "RdapResponse" // } // } } // method id "domainsrdap.getDomains": type V1GetDomainsCall struct { s *Service urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // GetDomains: The RDAP API recognizes this command from the RDAP // specification but does not support it. The response is a formatted // 501 error. func (r *V1Service) GetDomains() *V1GetDomainsCall { c := &V1GetDomainsCall{s: r.s, urlParams_: make(gensupport.URLParams)} return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *V1GetDomainsCall) Fields(s ...googleapi.Field) *V1GetDomainsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *V1GetDomainsCall) IfNoneMatch(entityTag string) *V1GetDomainsCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *V1GetDomainsCall) Context(ctx context.Context) *V1GetDomainsCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *V1GetDomainsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *V1GetDomainsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/domains") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "domainsrdap.getDomains" call. // Exactly one of *RdapResponse or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *RdapResponse.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *V1GetDomainsCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &RdapResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.", // "flatPath": "v1/domains", // "httpMethod": "GET", // "id": "domainsrdap.getDomains", // "parameterOrder": [], // "parameters": {}, // "path": "v1/domains", // "response": { // "$ref": "RdapResponse" // } // } } // method id "domainsrdap.getEntities": type V1GetEntitiesCall struct { s *Service urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // GetEntities: The RDAP API recognizes this command from the RDAP // specification but does not support it. The response is a formatted // 501 error. func (r *V1Service) GetEntities() *V1GetEntitiesCall { c := &V1GetEntitiesCall{s: r.s, urlParams_: make(gensupport.URLParams)} return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *V1GetEntitiesCall) Fields(s ...googleapi.Field) *V1GetEntitiesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *V1GetEntitiesCall) IfNoneMatch(entityTag string) *V1GetEntitiesCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *V1GetEntitiesCall) Context(ctx context.Context) *V1GetEntitiesCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *V1GetEntitiesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *V1GetEntitiesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/entities") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "domainsrdap.getEntities" call. // Exactly one of *RdapResponse or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *RdapResponse.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *V1GetEntitiesCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &RdapResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.", // "flatPath": "v1/entities", // "httpMethod": "GET", // "id": "domainsrdap.getEntities", // "parameterOrder": [], // "parameters": {}, // "path": "v1/entities", // "response": { // "$ref": "RdapResponse" // } // } } // method id "domainsrdap.getHelp": type V1GetHelpCall struct { s *Service urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // GetHelp: Get help information for the RDAP API, including links to // documentation. func (r *V1Service) GetHelp() *V1GetHelpCall { c := &V1GetHelpCall{s: r.s, urlParams_: make(gensupport.URLParams)} return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *V1GetHelpCall) Fields(s ...googleapi.Field) *V1GetHelpCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *V1GetHelpCall) IfNoneMatch(entityTag string) *V1GetHelpCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *V1GetHelpCall) Context(ctx context.Context) *V1GetHelpCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *V1GetHelpCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *V1GetHelpCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/help") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "domainsrdap.getHelp" call. // Exactly one of *HttpBody or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *HttpBody.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *V1GetHelpCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &HttpBody{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Get help information for the RDAP API, including links to documentation.", // "flatPath": "v1/help", // "httpMethod": "GET", // "id": "domainsrdap.getHelp", // "parameterOrder": [], // "parameters": {}, // "path": "v1/help", // "response": { // "$ref": "HttpBody" // } // } } // method id "domainsrdap.getIp": type V1GetIpCall struct { s *Service urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // GetIp: The RDAP API recognizes this command from the RDAP // specification but does not support it. The response is a formatted // 501 error. func (r *V1Service) GetIp() *V1GetIpCall { c := &V1GetIpCall{s: r.s, urlParams_: make(gensupport.URLParams)} return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *V1GetIpCall) Fields(s ...googleapi.Field) *V1GetIpCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *V1GetIpCall) IfNoneMatch(entityTag string) *V1GetIpCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *V1GetIpCall) Context(ctx context.Context) *V1GetIpCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *V1GetIpCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *V1GetIpCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/ip") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "domainsrdap.getIp" call. // Exactly one of *HttpBody or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *HttpBody.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *V1GetIpCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &HttpBody{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.", // "flatPath": "v1/ip", // "httpMethod": "GET", // "id": "domainsrdap.getIp", // "parameterOrder": [], // "parameters": {}, // "path": "v1/ip", // "response": { // "$ref": "HttpBody" // } // } } // method id "domainsrdap.getNameservers": type V1GetNameserversCall struct { s *Service urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // GetNameservers: The RDAP API recognizes this command from the RDAP // specification but does not support it. The response is a formatted // 501 error. func (r *V1Service) GetNameservers() *V1GetNameserversCall { c := &V1GetNameserversCall{s: r.s, urlParams_: make(gensupport.URLParams)} return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *V1GetNameserversCall) Fields(s ...googleapi.Field) *V1GetNameserversCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *V1GetNameserversCall) IfNoneMatch(entityTag string) *V1GetNameserversCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *V1GetNameserversCall) Context(ctx context.Context) *V1GetNameserversCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *V1GetNameserversCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *V1GetNameserversCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1/nameservers") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "domainsrdap.getNameservers" call. // Exactly one of *RdapResponse or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *RdapResponse.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *V1GetNameserversCall) Do(opts ...googleapi.CallOption) (*RdapResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &RdapResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "The RDAP API recognizes this command from the RDAP specification but does not support it. The response is a formatted 501 error.", // "flatPath": "v1/nameservers", // "httpMethod": "GET", // "id": "domainsrdap.getNameservers", // "parameterOrder": [], // "parameters": {}, // "path": "v1/nameservers", // "response": { // "$ref": "RdapResponse" // } // } }