Movatterモバイル変換


[0]ホーム

URL:


siteverification

package
v0.257.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2025 License:BSD-3-ClauseImports:18Imported by:3

Details

Repository

github.com/googleapis/google-api-go-client

Links

Documentation

Overview

Package siteverification provides access to the Google Site Verification API.

For product documentation, see:https://developers.google.com/site-verification/

Library status

These client libraries are officially supported by Google. However, thislibrary is considered complete and is in maintenance mode. This meansthat we will address critical bugs and security issues but will not addany new features.

When possible, we recommend using our newer[Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)that are still actively being worked and iterated on.

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 forauthentication. For information on how to create and obtain ApplicationDefault Credentials, seehttps://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, usegoogle.golang.org/api/option.WithScopes:

siteverificationService, err := siteverification.NewService(ctx, option.WithScopes(siteverification.SiteverificationVerifyOnlyScope))

To use an API key for authentication (note: some APIs do not support APIkeys), usegoogle.golang.org/api/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 OAuthflow, usegoogle.golang.org/api/option.WithTokenSource:

config := &oauth2.Config{...}// ...token, err := config.Exchange(ctx, ...)siteverificationService, err := siteverification.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

Seegoogle.golang.org/api/option.ClientOption for details on options.

Index

Constants

View Source
const (// Manage the list of sites and domains you controlSiteverificationScope = "https://www.googleapis.com/auth/siteverification"// Manage your new site verifications with GoogleSiteverificationVerifyOnlyScope = "https://www.googleapis.com/auth/siteverification.verify_only")

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

typeService

type Service struct {BasePathstring// API endpoint base URLUserAgentstring// optional additional User-Agent fragmentWebResource *WebResourceService// contains filtered or unexported fields}

funcNewdeprecated

func New(client *http.Client) (*Service,error)

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.

funcNewServiceadded inv0.3.0

func NewService(ctxcontext.Context, opts ...option.ClientOption) (*Service,error)

NewService creates a new Service.

typeSiteVerificationWebResourceGettokenRequest

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.VerificationMethodstring `json:"verificationMethod,omitempty"`// ForceSendFields is a list of field names (e.g. "Site") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.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. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

func (SiteVerificationWebResourceGettokenRequest)MarshalJSON

typeSiteVerificationWebResourceGettokenRequestSite

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.Identifierstring `json:"identifier,omitempty"`// Type: The type of resource to be verified. Can be SITE or INET_DOMAIN// (domain name).Typestring `json:"type,omitempty"`// ForceSendFields is a list of field names (e.g. "Identifier") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.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. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

SiteVerificationWebResourceGettokenRequestSite: The site for which averification token will be generated.

func (SiteVerificationWebResourceGettokenRequestSite)MarshalJSON

typeSiteVerificationWebResourceGettokenResponse

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.Methodstring `json:"method,omitempty"`// Token: The verification token. The token must be placed appropriately in// order for verification to succeed.Tokenstring `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 or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.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. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

func (SiteVerificationWebResourceGettokenResponse)MarshalJSON

typeSiteVerificationWebResourceListResponse

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 or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.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. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

func (SiteVerificationWebResourceListResponse)MarshalJSON

typeSiteVerificationWebResourceResource

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.Idstring `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 or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.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. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

func (SiteVerificationWebResourceResource)MarshalJSON

typeSiteVerificationWebResourceResourceSite

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.Identifierstring `json:"identifier,omitempty"`// Type: The site type. Can be SITE or INET_DOMAIN (domain name).Typestring `json:"type,omitempty"`// ForceSendFields is a list of field names (e.g. "Identifier") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.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. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

SiteVerificationWebResourceResourceSite: The address and type of a site thatis verified or will be verified.

func (SiteVerificationWebResourceResourceSite)MarshalJSON

typeWebResourceDeleteCall

type WebResourceDeleteCall struct {// contains filtered or unexported fields}

func (*WebResourceDeleteCall)Context

Context sets the context to be used in this call's Do method.

func (*WebResourceDeleteCall)Do

Do executes the "siteVerification.webResource.delete" call.

func (*WebResourceDeleteCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*WebResourceDeleteCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeWebResourceGetCall

type WebResourceGetCall struct {// contains filtered or unexported fields}

func (*WebResourceGetCall)Context

Context sets the context to be used in this call's Do method.

func (*WebResourceGetCall)Do

Do executes the "siteVerification.webResource.get" call.Any non-2xx status code is an error. Response headers are in either*SiteVerificationWebResourceResource.ServerResponse.Header or (if a responsewas returned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error was becausehttp.StatusNotModified was returned.

func (*WebResourceGetCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*WebResourceGetCall)Header

func (c *WebResourceGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*WebResourceGetCall)IfNoneMatch

func (c *WebResourceGetCall) IfNoneMatch(entityTagstring) *WebResourceGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

typeWebResourceGetTokenCall

type WebResourceGetTokenCall struct {// contains filtered or unexported fields}

func (*WebResourceGetTokenCall)Context

Context sets the context to be used in this call's Do method.

func (*WebResourceGetTokenCall)Do

Do executes the "siteVerification.webResource.getToken" call.Any non-2xx status code is an error. Response headers are in either*SiteVerificationWebResourceGettokenResponse.ServerResponse.Header or (if aresponse was returned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error was becausehttp.StatusNotModified was returned.

func (*WebResourceGetTokenCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*WebResourceGetTokenCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeWebResourceInsertCall

type WebResourceInsertCall struct {// contains filtered or unexported fields}

func (*WebResourceInsertCall)Context

Context sets the context to be used in this call's Do method.

func (*WebResourceInsertCall)Do

Do executes the "siteVerification.webResource.insert" call.Any non-2xx status code is an error. Response headers are in either*SiteVerificationWebResourceResource.ServerResponse.Header or (if a responsewas returned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error was becausehttp.StatusNotModified was returned.

func (*WebResourceInsertCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*WebResourceInsertCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeWebResourceListCall

type WebResourceListCall struct {// contains filtered or unexported fields}

func (*WebResourceListCall)Context

Context sets the context to be used in this call's Do method.

func (*WebResourceListCall)Do

Do executes the "siteVerification.webResource.list" call.Any non-2xx status code is an error. Response headers are in either*SiteVerificationWebResourceListResponse.ServerResponse.Header or (if aresponse was returned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error was becausehttp.StatusNotModified was returned.

func (*WebResourceListCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*WebResourceListCall)Header

func (c *WebResourceListCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*WebResourceListCall)IfNoneMatch

func (c *WebResourceListCall) IfNoneMatch(entityTagstring) *WebResourceListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

typeWebResourcePatchCall

type WebResourcePatchCall struct {// contains filtered or unexported fields}

func (*WebResourcePatchCall)Context

Context sets the context to be used in this call's Do method.

func (*WebResourcePatchCall)Do

Do executes the "siteVerification.webResource.patch" call.Any non-2xx status code is an error. Response headers are in either*SiteVerificationWebResourceResource.ServerResponse.Header or (if a responsewas returned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error was becausehttp.StatusNotModified was returned.

func (*WebResourcePatchCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*WebResourcePatchCall)Header

func (c *WebResourcePatchCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeWebResourceService

type WebResourceService struct {// contains filtered or unexported fields}

funcNewWebResourceService

func NewWebResourceService(s *Service) *WebResourceService

func (*WebResourceService)Delete

Delete: Relinquish ownership of a website or domain.

- id: The id of a verified site or domain.

func (*WebResourceService)Get

Get: Get the most current data for a website or domain.

- id: The id of a verified site or domain.

func (*WebResourceService)GetToken

func (r *WebResourceService) GetToken(siteverificationwebresourcegettokenrequest *SiteVerificationWebResourceGettokenRequest) *WebResourceGetTokenCall

GetToken: Get a verification token for placing on a website or domain.

func (*WebResourceService)Insert

func (r *WebResourceService) Insert(verificationMethodstring, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourceInsertCall

Insert: Attempt verification of a website or domain.

- verificationMethod: The method to use for verifying a site or domain.

func (*WebResourceService)List

List: Get the list of your verified websites and domains.

func (*WebResourceService)Patch

func (r *WebResourceService) Patch(idstring, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourcePatchCall

Patch: Modify the list of owners for your website or domain. This methodsupports patch semantics.

- id: The id of a verified site or domain.

func (*WebResourceService)Update

func (r *WebResourceService) Update(idstring, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourceUpdateCall

Update: Modify the list of owners for your website or domain.

- id: The id of a verified site or domain.

typeWebResourceUpdateCall

type WebResourceUpdateCall struct {// contains filtered or unexported fields}

func (*WebResourceUpdateCall)Context

Context sets the context to be used in this call's Do method.

func (*WebResourceUpdateCall)Do

Do executes the "siteVerification.webResource.update" call.Any non-2xx status code is an error. Response headers are in either*SiteVerificationWebResourceResource.ServerResponse.Header or (if a responsewas returned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error was becausehttp.StatusNotModified was returned.

func (*WebResourceUpdateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*WebResourceUpdateCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp