|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264 |
- // Copyright 2019 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 siteverification provides access to the Google Site Verification API.
- //
- // For product documentation, see: https://developers.google.com/site-verification/
- //
- // Creating a client
- //
- // Usage example:
- //
- // import "google.golang.org/api/siteverification/v1"
- // ...
- // ctx := context.Background()
- // siteverificationService, err := siteverification.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
- //
- // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
- //
- // siteverificationService, err := siteverification.NewService(ctx, option.WithScopes(siteverification.SiteverificationVerifyOnlyScope))
- //
- // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
- //
- // siteverificationService, err := siteverification.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, ...)
- // siteverificationService, err := siteverification.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
- //
- // See https://godoc.org/google.golang.org/api/option/ for details on options.
- package siteverification // import "google.golang.org/api/siteverification/v1"
-
- import (
- "bytes"
- "context"
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "net/http"
- "net/url"
- "strconv"
- "strings"
-
- gensupport "google.golang.org/api/gensupport"
- googleapi "google.golang.org/api/googleapi"
- option "google.golang.org/api/option"
- 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
-
- const apiId = "siteVerification:v1"
- const apiName = "siteVerification"
- const apiVersion = "v1"
- const basePath = "https://www.googleapis.com/siteVerification/v1/"
-
- // OAuth2 scopes used by this API.
- const (
- // Manage the list of sites and domains you control
- SiteverificationScope = "https://www.googleapis.com/auth/siteverification"
-
- // Manage your new site verifications with Google
- SiteverificationVerifyOnlyScope = "https://www.googleapis.com/auth/siteverification.verify_only"
- )
-
- // NewService creates a new Service.
- func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
- scopesOption := option.WithScopes(
- "https://www.googleapis.com/auth/siteverification",
- "https://www.googleapis.com/auth/siteverification.verify_only",
- )
- // NOTE: prepend, so we don't override user-specified scopes.
- opts = append([]option.ClientOption{scopesOption}, opts...)
- 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.WebResource = NewWebResourceService(s)
- return s, nil
- }
-
- type Service struct {
- client *http.Client
- BasePath string // API endpoint base URL
- UserAgent string // optional additional User-Agent fragment
-
- WebResource *WebResourceService
- }
-
- func (s *Service) userAgent() string {
- if s.UserAgent == "" {
- return googleapi.UserAgent
- }
- return googleapi.UserAgent + " " + s.UserAgent
- }
-
- func NewWebResourceService(s *Service) *WebResourceService {
- rs := &WebResourceService{s: s}
- return rs
- }
-
- type WebResourceService struct {
- s *Service
- }
-
- type SiteVerificationWebResourceGettokenRequest struct {
- // Site: The site for which a verification token will be generated.
- Site *SiteVerificationWebResourceGettokenRequestSite `json:"site,omitempty"`
-
- // VerificationMethod: The verification method that will be used to
- // verify this site. For sites, 'FILE' or 'META' methods may be used.
- // For domains, only 'DNS' may be used.
- VerificationMethod string `json:"verificationMethod,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Site") to
- // unconditionally include in API requests. By default, fields with
- // empty 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. "Site") 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 *SiteVerificationWebResourceGettokenRequest) MarshalJSON() ([]byte, error) {
- type NoMethod SiteVerificationWebResourceGettokenRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // SiteVerificationWebResourceGettokenRequestSite: The site for which a
- // verification token will be generated.
- type SiteVerificationWebResourceGettokenRequestSite struct {
- // Identifier: The site identifier. If the type is set to SITE, the
- // identifier is a URL. If the type is set to INET_DOMAIN, the site
- // identifier is a domain name.
- Identifier string `json:"identifier,omitempty"`
-
- // Type: The type of resource to be verified. Can be SITE or INET_DOMAIN
- // (domain name).
- Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Identifier") to
- // unconditionally include in API requests. By default, fields with
- // empty 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. "Identifier") 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 *SiteVerificationWebResourceGettokenRequestSite) MarshalJSON() ([]byte, error) {
- type NoMethod SiteVerificationWebResourceGettokenRequestSite
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- type SiteVerificationWebResourceGettokenResponse struct {
- // Method: The verification method to use in conjunction with this
- // token. For FILE, the token should be placed in the top-level
- // directory of the site, stored inside a file of the same name. For
- // META, the token should be placed in the HEAD tag of the default page
- // that is loaded for the site. For DNS, the token should be placed in a
- // TXT record of the domain.
- Method string `json:"method,omitempty"`
-
- // Token: The verification token. The token must be placed appropriately
- // in order for verification to succeed.
- Token string `json:"token,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Method") to
- // unconditionally include in API requests. By default, fields with
- // empty 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. "Method") 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 *SiteVerificationWebResourceGettokenResponse) MarshalJSON() ([]byte, error) {
- type NoMethod SiteVerificationWebResourceGettokenResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- type SiteVerificationWebResourceListResponse struct {
- // Items: The list of sites that are owned by the authenticated user.
- Items []*SiteVerificationWebResourceResource `json:"items,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty 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. "Items") 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 *SiteVerificationWebResourceListResponse) MarshalJSON() ([]byte, error) {
- type NoMethod SiteVerificationWebResourceListResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- type SiteVerificationWebResourceResource struct {
- // Id: The string used to identify this site. This value should be used
- // in the "id" portion of the REST URL for the Get, Update, and Delete
- // operations.
- Id string `json:"id,omitempty"`
-
- // Owners: The email addresses of all verified owners.
- Owners []string `json:"owners,omitempty"`
-
- // Site: The address and type of a site that is verified or will be
- // verified.
- Site *SiteVerificationWebResourceResourceSite `json:"site,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty 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. "Id") 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 *SiteVerificationWebResourceResource) MarshalJSON() ([]byte, error) {
- type NoMethod SiteVerificationWebResourceResource
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // SiteVerificationWebResourceResourceSite: The address and type of a
- // site that is verified or will be verified.
- type SiteVerificationWebResourceResourceSite struct {
- // Identifier: The site identifier. If the type is set to SITE, the
- // identifier is a URL. If the type is set to INET_DOMAIN, the site
- // identifier is a domain name.
- Identifier string `json:"identifier,omitempty"`
-
- // Type: The site type. Can be SITE or INET_DOMAIN (domain name).
- Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Identifier") to
- // unconditionally include in API requests. By default, fields with
- // empty 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. "Identifier") 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 *SiteVerificationWebResourceResourceSite) MarshalJSON() ([]byte, error) {
- type NoMethod SiteVerificationWebResourceResourceSite
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // method id "siteVerification.webResource.delete":
-
- type WebResourceDeleteCall struct {
- s *Service
- id string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Relinquish ownership of a website or domain.
- func (r *WebResourceService) Delete(id string) *WebResourceDeleteCall {
- c := &WebResourceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.id = id
- 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 *WebResourceDeleteCall) Fields(s ...googleapi.Field) *WebResourceDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *WebResourceDeleteCall) Context(ctx context.Context) *WebResourceDeleteCall {
- 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 *WebResourceDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *WebResourceDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "id": c.id,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "siteVerification.webResource.delete" call.
- func (c *WebResourceDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return err
- }
- return nil
- // {
- // "description": "Relinquish ownership of a website or domain.",
- // "httpMethod": "DELETE",
- // "id": "siteVerification.webResource.delete",
- // "parameterOrder": [
- // "id"
- // ],
- // "parameters": {
- // "id": {
- // "description": "The id of a verified site or domain.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "webResource/{id}",
- // "scopes": [
- // "https://www.googleapis.com/auth/siteverification"
- // ]
- // }
-
- }
-
- // method id "siteVerification.webResource.get":
-
- type WebResourceGetCall struct {
- s *Service
- id string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Get the most current data for a website or domain.
- func (r *WebResourceService) Get(id string) *WebResourceGetCall {
- c := &WebResourceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.id = id
- 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 *WebResourceGetCall) Fields(s ...googleapi.Field) *WebResourceGetCall {
- 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 *WebResourceGetCall) IfNoneMatch(entityTag string) *WebResourceGetCall {
- 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 *WebResourceGetCall) Context(ctx context.Context) *WebResourceGetCall {
- 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 *WebResourceGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *WebResourceGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- 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, "webResource/{id}")
- 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{
- "id": c.id,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "siteVerification.webResource.get" call.
- // Exactly one of *SiteVerificationWebResourceResource or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *SiteVerificationWebResourceResource.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 *WebResourceGetCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, 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 := &SiteVerificationWebResourceResource{
- 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 the most current data for a website or domain.",
- // "httpMethod": "GET",
- // "id": "siteVerification.webResource.get",
- // "parameterOrder": [
- // "id"
- // ],
- // "parameters": {
- // "id": {
- // "description": "The id of a verified site or domain.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "webResource/{id}",
- // "response": {
- // "$ref": "SiteVerificationWebResourceResource"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/siteverification"
- // ]
- // }
-
- }
-
- // method id "siteVerification.webResource.getToken":
-
- type WebResourceGetTokenCall struct {
- s *Service
- siteverificationwebresourcegettokenrequest *SiteVerificationWebResourceGettokenRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // GetToken: Get a verification token for placing on a website or
- // domain.
- func (r *WebResourceService) GetToken(siteverificationwebresourcegettokenrequest *SiteVerificationWebResourceGettokenRequest) *WebResourceGetTokenCall {
- c := &WebResourceGetTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.siteverificationwebresourcegettokenrequest = siteverificationwebresourcegettokenrequest
- 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 *WebResourceGetTokenCall) Fields(s ...googleapi.Field) *WebResourceGetTokenCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *WebResourceGetTokenCall) Context(ctx context.Context) *WebResourceGetTokenCall {
- 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 *WebResourceGetTokenCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *WebResourceGetTokenCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourcegettokenrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "token")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "siteVerification.webResource.getToken" call.
- // Exactly one of *SiteVerificationWebResourceGettokenResponse or error
- // will be non-nil. Any non-2xx status code is an error. Response
- // headers are in either
- // *SiteVerificationWebResourceGettokenResponse.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 *WebResourceGetTokenCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceGettokenResponse, 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 := &SiteVerificationWebResourceGettokenResponse{
- 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 a verification token for placing on a website or domain.",
- // "httpMethod": "POST",
- // "id": "siteVerification.webResource.getToken",
- // "path": "token",
- // "request": {
- // "$ref": "SiteVerificationWebResourceGettokenRequest"
- // },
- // "response": {
- // "$ref": "SiteVerificationWebResourceGettokenResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/siteverification",
- // "https://www.googleapis.com/auth/siteverification.verify_only"
- // ]
- // }
-
- }
-
- // method id "siteVerification.webResource.insert":
-
- type WebResourceInsertCall struct {
- s *Service
- siteverificationwebresourceresource *SiteVerificationWebResourceResource
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Insert: Attempt verification of a website or domain.
- func (r *WebResourceService) Insert(verificationMethod string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourceInsertCall {
- c := &WebResourceInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.urlParams_.Set("verificationMethod", verificationMethod)
- c.siteverificationwebresourceresource = siteverificationwebresourceresource
- 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 *WebResourceInsertCall) Fields(s ...googleapi.Field) *WebResourceInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *WebResourceInsertCall) Context(ctx context.Context) *WebResourceInsertCall {
- 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 *WebResourceInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *WebResourceInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "webResource")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "siteVerification.webResource.insert" call.
- // Exactly one of *SiteVerificationWebResourceResource or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *SiteVerificationWebResourceResource.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 *WebResourceInsertCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, 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 := &SiteVerificationWebResourceResource{
- 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": "Attempt verification of a website or domain.",
- // "httpMethod": "POST",
- // "id": "siteVerification.webResource.insert",
- // "parameterOrder": [
- // "verificationMethod"
- // ],
- // "parameters": {
- // "verificationMethod": {
- // "description": "The method to use for verifying a site or domain.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "webResource",
- // "request": {
- // "$ref": "SiteVerificationWebResourceResource"
- // },
- // "response": {
- // "$ref": "SiteVerificationWebResourceResource"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/siteverification",
- // "https://www.googleapis.com/auth/siteverification.verify_only"
- // ]
- // }
-
- }
-
- // method id "siteVerification.webResource.list":
-
- type WebResourceListCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Get the list of your verified websites and domains.
- func (r *WebResourceService) List() *WebResourceListCall {
- c := &WebResourceListCall{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 *WebResourceListCall) Fields(s ...googleapi.Field) *WebResourceListCall {
- 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 *WebResourceListCall) IfNoneMatch(entityTag string) *WebResourceListCall {
- 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 *WebResourceListCall) Context(ctx context.Context) *WebResourceListCall {
- 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 *WebResourceListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *WebResourceListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- 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, "webResource")
- 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 "siteVerification.webResource.list" call.
- // Exactly one of *SiteVerificationWebResourceListResponse or error will
- // be non-nil. Any non-2xx status code is an error. Response headers are
- // in either
- // *SiteVerificationWebResourceListResponse.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 *WebResourceListCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceListResponse, 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 := &SiteVerificationWebResourceListResponse{
- 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 the list of your verified websites and domains.",
- // "httpMethod": "GET",
- // "id": "siteVerification.webResource.list",
- // "path": "webResource",
- // "response": {
- // "$ref": "SiteVerificationWebResourceListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/siteverification"
- // ]
- // }
-
- }
-
- // method id "siteVerification.webResource.patch":
-
- type WebResourcePatchCall struct {
- s *Service
- id string
- siteverificationwebresourceresource *SiteVerificationWebResourceResource
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Patch: Modify the list of owners for your website or domain. This
- // method supports patch semantics.
- func (r *WebResourceService) Patch(id string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourcePatchCall {
- c := &WebResourcePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.id = id
- c.siteverificationwebresourceresource = siteverificationwebresourceresource
- 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 *WebResourcePatchCall) Fields(s ...googleapi.Field) *WebResourcePatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *WebResourcePatchCall) Context(ctx context.Context) *WebResourcePatchCall {
- 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 *WebResourcePatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *WebResourcePatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "id": c.id,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "siteVerification.webResource.patch" call.
- // Exactly one of *SiteVerificationWebResourceResource or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *SiteVerificationWebResourceResource.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 *WebResourcePatchCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, 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 := &SiteVerificationWebResourceResource{
- 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": "Modify the list of owners for your website or domain. This method supports patch semantics.",
- // "httpMethod": "PATCH",
- // "id": "siteVerification.webResource.patch",
- // "parameterOrder": [
- // "id"
- // ],
- // "parameters": {
- // "id": {
- // "description": "The id of a verified site or domain.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "webResource/{id}",
- // "request": {
- // "$ref": "SiteVerificationWebResourceResource"
- // },
- // "response": {
- // "$ref": "SiteVerificationWebResourceResource"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/siteverification"
- // ]
- // }
-
- }
-
- // method id "siteVerification.webResource.update":
-
- type WebResourceUpdateCall struct {
- s *Service
- id string
- siteverificationwebresourceresource *SiteVerificationWebResourceResource
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Update: Modify the list of owners for your website or domain.
- func (r *WebResourceService) Update(id string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourceUpdateCall {
- c := &WebResourceUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.id = id
- c.siteverificationwebresourceresource = siteverificationwebresourceresource
- 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 *WebResourceUpdateCall) Fields(s ...googleapi.Field) *WebResourceUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *WebResourceUpdateCall) Context(ctx context.Context) *WebResourceUpdateCall {
- 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 *WebResourceUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *WebResourceUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "id": c.id,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "siteVerification.webResource.update" call.
- // Exactly one of *SiteVerificationWebResourceResource or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *SiteVerificationWebResourceResource.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 *WebResourceUpdateCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, 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 := &SiteVerificationWebResourceResource{
- 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": "Modify the list of owners for your website or domain.",
- // "httpMethod": "PUT",
- // "id": "siteVerification.webResource.update",
- // "parameterOrder": [
- // "id"
- // ],
- // "parameters": {
- // "id": {
- // "description": "The id of a verified site or domain.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "webResource/{id}",
- // "request": {
- // "$ref": "SiteVerificationWebResourceResource"
- // },
- // "response": {
- // "$ref": "SiteVerificationWebResourceResource"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/siteverification"
- // ]
- // }
-
- }
|