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, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any 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 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 google.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 API keys), use google.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 OAuth flow, use google.golang.org/api/option.WithTokenSource:
config := &oauth2.Config{...} // ... token, err := config.Exchange(ctx, ...) siteverificationService, err := siteverification.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
See google.golang.org/api/option.ClientOption for details on options.
Index ¶
- Constants
- type Service
- type SiteVerificationWebResourceGettokenRequest
- type SiteVerificationWebResourceGettokenRequestSite
- type SiteVerificationWebResourceGettokenResponse
- type SiteVerificationWebResourceListResponse
- type SiteVerificationWebResourceResource
- type SiteVerificationWebResourceResourceSite
- type WebResourceDeleteCall
- type WebResourceGetCall
- func (c *WebResourceGetCall) Context(ctx context.Context) *WebResourceGetCall
- func (c *WebResourceGetCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, error)
- func (c *WebResourceGetCall) Fields(s ...googleapi.Field) *WebResourceGetCall
- func (c *WebResourceGetCall) Header() http.Header
- func (c *WebResourceGetCall) IfNoneMatch(entityTag string) *WebResourceGetCall
- type WebResourceGetTokenCall
- func (c *WebResourceGetTokenCall) Context(ctx context.Context) *WebResourceGetTokenCall
- func (c *WebResourceGetTokenCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceGettokenResponse, error)
- func (c *WebResourceGetTokenCall) Fields(s ...googleapi.Field) *WebResourceGetTokenCall
- func (c *WebResourceGetTokenCall) Header() http.Header
- type WebResourceInsertCall
- func (c *WebResourceInsertCall) Context(ctx context.Context) *WebResourceInsertCall
- func (c *WebResourceInsertCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, error)
- func (c *WebResourceInsertCall) Fields(s ...googleapi.Field) *WebResourceInsertCall
- func (c *WebResourceInsertCall) Header() http.Header
- type WebResourceListCall
- func (c *WebResourceListCall) Context(ctx context.Context) *WebResourceListCall
- func (c *WebResourceListCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceListResponse, error)
- func (c *WebResourceListCall) Fields(s ...googleapi.Field) *WebResourceListCall
- func (c *WebResourceListCall) Header() http.Header
- func (c *WebResourceListCall) IfNoneMatch(entityTag string) *WebResourceListCall
- type WebResourcePatchCall
- func (c *WebResourcePatchCall) Context(ctx context.Context) *WebResourcePatchCall
- func (c *WebResourcePatchCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, error)
- func (c *WebResourcePatchCall) Fields(s ...googleapi.Field) *WebResourcePatchCall
- func (c *WebResourcePatchCall) Header() http.Header
- type WebResourceService
- func (r *WebResourceService) Delete(id string) *WebResourceDeleteCall
- func (r *WebResourceService) Get(id string) *WebResourceGetCall
- func (r *WebResourceService) GetToken(...) *WebResourceGetTokenCall
- func (r *WebResourceService) Insert(verificationMethod string, ...) *WebResourceInsertCall
- func (r *WebResourceService) List() *WebResourceListCall
- func (r *WebResourceService) Patch(id string, ...) *WebResourcePatchCall
- func (r *WebResourceService) Update(id string, ...) *WebResourceUpdateCall
- type WebResourceUpdateCall
- func (c *WebResourceUpdateCall) Context(ctx context.Context) *WebResourceUpdateCall
- func (c *WebResourceUpdateCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, error)
- func (c *WebResourceUpdateCall) Fields(s ...googleapi.Field) *WebResourceUpdateCall
- func (c *WebResourceUpdateCall) Header() http.Header
Constants ¶
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" )
OAuth2 scopes used by this API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment WebResource *WebResourceService // contains filtered or unexported fields }
func New
deprecated
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 NewService ¶
NewService creates a new Service.
type SiteVerificationWebResourceGettokenRequest ¶
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 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 ¶
func (s SiteVerificationWebResourceGettokenRequest) MarshalJSON() ([]byte, error)
type SiteVerificationWebResourceGettokenRequestSite ¶
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 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 a verification token will be generated.
func (SiteVerificationWebResourceGettokenRequestSite) MarshalJSON ¶
func (s SiteVerificationWebResourceGettokenRequestSite) MarshalJSON() ([]byte, error)
type SiteVerificationWebResourceGettokenResponse ¶
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 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 ¶
func (s SiteVerificationWebResourceGettokenResponse) MarshalJSON() ([]byte, error)
type SiteVerificationWebResourceListResponse ¶
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 ¶
func (s SiteVerificationWebResourceListResponse) MarshalJSON() ([]byte, error)
type SiteVerificationWebResourceResource ¶
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 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 ¶
func (s SiteVerificationWebResourceResource) MarshalJSON() ([]byte, error)
type SiteVerificationWebResourceResourceSite ¶
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 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 that is verified or will be verified.
func (SiteVerificationWebResourceResourceSite) MarshalJSON ¶
func (s SiteVerificationWebResourceResourceSite) MarshalJSON() ([]byte, error)
type WebResourceDeleteCall ¶
type WebResourceDeleteCall struct {
// contains filtered or unexported fields
}
func (*WebResourceDeleteCall) Context ¶
func (c *WebResourceDeleteCall) Context(ctx context.Context) *WebResourceDeleteCall
Context sets the context to be used in this call's Do method.
func (*WebResourceDeleteCall) Do ¶
func (c *WebResourceDeleteCall) Do(opts ...googleapi.CallOption) error
Do executes the "siteVerification.webResource.delete" call.
func (*WebResourceDeleteCall) Fields ¶
func (c *WebResourceDeleteCall) Fields(s ...googleapi.Field) *WebResourceDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*WebResourceDeleteCall) Header ¶
func (c *WebResourceDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type WebResourceGetCall ¶
type WebResourceGetCall struct {
// contains filtered or unexported fields
}
func (*WebResourceGetCall) Context ¶
func (c *WebResourceGetCall) Context(ctx context.Context) *WebResourceGetCall
Context sets the context to be used in this call's Do method.
func (*WebResourceGetCall) Do ¶
func (c *WebResourceGetCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, error)
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 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 (*WebResourceGetCall) Fields ¶
func (c *WebResourceGetCall) Fields(s ...googleapi.Field) *WebResourceGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*WebResourceGetCall) Header ¶
func (c *WebResourceGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*WebResourceGetCall) IfNoneMatch ¶
func (c *WebResourceGetCall) IfNoneMatch(entityTag string) *WebResourceGetCall
IfNoneMatch sets an 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.
type WebResourceGetTokenCall ¶
type WebResourceGetTokenCall struct {
// contains filtered or unexported fields
}
func (*WebResourceGetTokenCall) Context ¶
func (c *WebResourceGetTokenCall) Context(ctx context.Context) *WebResourceGetTokenCall
Context sets the context to be used in this call's Do method.
func (*WebResourceGetTokenCall) Do ¶
func (c *WebResourceGetTokenCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceGettokenResponse, error)
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 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 (*WebResourceGetTokenCall) Fields ¶
func (c *WebResourceGetTokenCall) Fields(s ...googleapi.Field) *WebResourceGetTokenCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*WebResourceGetTokenCall) Header ¶
func (c *WebResourceGetTokenCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type WebResourceInsertCall ¶
type WebResourceInsertCall struct {
// contains filtered or unexported fields
}
func (*WebResourceInsertCall) Context ¶
func (c *WebResourceInsertCall) Context(ctx context.Context) *WebResourceInsertCall
Context sets the context to be used in this call's Do method.
func (*WebResourceInsertCall) Do ¶
func (c *WebResourceInsertCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, error)
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 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 (*WebResourceInsertCall) Fields ¶
func (c *WebResourceInsertCall) Fields(s ...googleapi.Field) *WebResourceInsertCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*WebResourceInsertCall) Header ¶
func (c *WebResourceInsertCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type WebResourceListCall ¶
type WebResourceListCall struct {
// contains filtered or unexported fields
}
func (*WebResourceListCall) Context ¶
func (c *WebResourceListCall) Context(ctx context.Context) *WebResourceListCall
Context sets the context to be used in this call's Do method.
func (*WebResourceListCall) Do ¶
func (c *WebResourceListCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceListResponse, error)
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 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 (*WebResourceListCall) Fields ¶
func (c *WebResourceListCall) Fields(s ...googleapi.Field) *WebResourceListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*WebResourceListCall) Header ¶
func (c *WebResourceListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*WebResourceListCall) IfNoneMatch ¶
func (c *WebResourceListCall) IfNoneMatch(entityTag string) *WebResourceListCall
IfNoneMatch sets an 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.
type WebResourcePatchCall ¶
type WebResourcePatchCall struct {
// contains filtered or unexported fields
}
func (*WebResourcePatchCall) Context ¶
func (c *WebResourcePatchCall) Context(ctx context.Context) *WebResourcePatchCall
Context sets the context to be used in this call's Do method.
func (*WebResourcePatchCall) Do ¶
func (c *WebResourcePatchCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, error)
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 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 (*WebResourcePatchCall) Fields ¶
func (c *WebResourcePatchCall) Fields(s ...googleapi.Field) *WebResourcePatchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*WebResourcePatchCall) Header ¶
func (c *WebResourcePatchCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type WebResourceService ¶
type WebResourceService struct {
// contains filtered or unexported fields
}
func NewWebResourceService ¶
func NewWebResourceService(s *Service) *WebResourceService
func (*WebResourceService) Delete ¶
func (r *WebResourceService) Delete(id string) *WebResourceDeleteCall
Delete: Relinquish ownership of a website or domain.
- id: The id of a verified site or domain.
func (*WebResourceService) Get ¶
func (r *WebResourceService) Get(id string) *WebResourceGetCall
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(verificationMethod string, 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 ¶
func (r *WebResourceService) List() *WebResourceListCall
List: Get the list of your verified websites and domains.
func (*WebResourceService) Patch ¶
func (r *WebResourceService) Patch(id string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourcePatchCall
Patch: Modify the list of owners for your website or domain. This method supports patch semantics.
- id: The id of a verified site or domain.
func (*WebResourceService) Update ¶
func (r *WebResourceService) Update(id string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourceUpdateCall
Update: Modify the list of owners for your website or domain.
- id: The id of a verified site or domain.
type WebResourceUpdateCall ¶
type WebResourceUpdateCall struct {
// contains filtered or unexported fields
}
func (*WebResourceUpdateCall) Context ¶
func (c *WebResourceUpdateCall) Context(ctx context.Context) *WebResourceUpdateCall
Context sets the context to be used in this call's Do method.
func (*WebResourceUpdateCall) Do ¶
func (c *WebResourceUpdateCall) Do(opts ...googleapi.CallOption) (*SiteVerificationWebResourceResource, error)
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 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 (*WebResourceUpdateCall) Fields ¶
func (c *WebResourceUpdateCall) Fields(s ...googleapi.Field) *WebResourceUpdateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*WebResourceUpdateCall) Header ¶
func (c *WebResourceUpdateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.