blob: f3cae6115e5d818e441cc24fbe55ecfa42c932d2 [file] [log] [blame]
// Copyright 2024 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 firebaseappcheck provides access to the Firebase App Check API.
//
// For product documentation, see: https://firebase.google.com/docs/app-check
//
// # 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/firebaseappcheck/v1"
// ...
// ctx := context.Background()
// firebaseappcheckService, err := firebaseappcheck.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]:
//
// firebaseappcheckService, err := firebaseappcheck.NewService(ctx, option.WithScopes(firebaseappcheck.FirebaseScope))
//
// To use an API key for authentication (note: some APIs do not support API
// keys), use [google.golang.org/api/option.WithAPIKey]:
//
// firebaseappcheckService, err := firebaseappcheck.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, ...)
// firebaseappcheckService, err := firebaseappcheck.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See [google.golang.org/api/option.ClientOption] for details on options.
package firebaseappcheck // import "google.golang.org/api/firebaseappcheck/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
internal "google.golang.org/api/internal"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
var _ = internal.Version
const apiId = "firebaseappcheck:v1"
const apiName = "firebaseappcheck"
const apiVersion = "v1"
const basePath = "https://firebaseappcheck.googleapis.com/"
const basePathTemplate = "https://firebaseappcheck.UNIVERSE_DOMAIN/"
const mtlsBasePath = "https://firebaseappcheck.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, edit, configure, and delete your Google Cloud data and see the email
// address for your Google Account.
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// View and administer all your Firebase data and settings
FirebaseScope = "https://www.googleapis.com/auth/firebase"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := internaloption.WithDefaultScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
opts = append(opts, internaloption.EnableNewAuthLibrary())
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.Jwks = NewJwksService(s)
s.OauthClients = NewOauthClientsService(s)
s.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Jwks *JwksService
OauthClients *OauthClientsService
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewJwksService(s *Service) *JwksService {
rs := &JwksService{s: s}
return rs
}
type JwksService struct {
s *Service
}
func NewOauthClientsService(s *Service) *OauthClientsService {
rs := &OauthClientsService{s: s}
return rs
}
type OauthClientsService struct {
s *Service
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Apps = NewProjectsAppsService(s)
rs.Services = NewProjectsServicesService(s)
return rs
}
type ProjectsService struct {
s *Service
Apps *ProjectsAppsService
Services *ProjectsServicesService
}
func NewProjectsAppsService(s *Service) *ProjectsAppsService {
rs := &ProjectsAppsService{s: s}
rs.AppAttestConfig = NewProjectsAppsAppAttestConfigService(s)
rs.DebugTokens = NewProjectsAppsDebugTokensService(s)
rs.DeviceCheckConfig = NewProjectsAppsDeviceCheckConfigService(s)
rs.PlayIntegrityConfig = NewProjectsAppsPlayIntegrityConfigService(s)
rs.RecaptchaEnterpriseConfig = NewProjectsAppsRecaptchaEnterpriseConfigService(s)
rs.RecaptchaV3Config = NewProjectsAppsRecaptchaV3ConfigService(s)
rs.SafetyNetConfig = NewProjectsAppsSafetyNetConfigService(s)
return rs
}
type ProjectsAppsService struct {
s *Service
AppAttestConfig *ProjectsAppsAppAttestConfigService
DebugTokens *ProjectsAppsDebugTokensService
DeviceCheckConfig *ProjectsAppsDeviceCheckConfigService
PlayIntegrityConfig *ProjectsAppsPlayIntegrityConfigService
RecaptchaEnterpriseConfig *ProjectsAppsRecaptchaEnterpriseConfigService
RecaptchaV3Config *ProjectsAppsRecaptchaV3ConfigService
SafetyNetConfig *ProjectsAppsSafetyNetConfigService
}
func NewProjectsAppsAppAttestConfigService(s *Service) *ProjectsAppsAppAttestConfigService {
rs := &ProjectsAppsAppAttestConfigService{s: s}
return rs
}
type ProjectsAppsAppAttestConfigService struct {
s *Service
}
func NewProjectsAppsDebugTokensService(s *Service) *ProjectsAppsDebugTokensService {
rs := &ProjectsAppsDebugTokensService{s: s}
return rs
}
type ProjectsAppsDebugTokensService struct {
s *Service
}
func NewProjectsAppsDeviceCheckConfigService(s *Service) *ProjectsAppsDeviceCheckConfigService {
rs := &ProjectsAppsDeviceCheckConfigService{s: s}
return rs
}
type ProjectsAppsDeviceCheckConfigService struct {
s *Service
}
func NewProjectsAppsPlayIntegrityConfigService(s *Service) *ProjectsAppsPlayIntegrityConfigService {
rs := &ProjectsAppsPlayIntegrityConfigService{s: s}
return rs
}
type ProjectsAppsPlayIntegrityConfigService struct {
s *Service
}
func NewProjectsAppsRecaptchaEnterpriseConfigService(s *Service) *ProjectsAppsRecaptchaEnterpriseConfigService {
rs := &ProjectsAppsRecaptchaEnterpriseConfigService{s: s}
return rs
}
type ProjectsAppsRecaptchaEnterpriseConfigService struct {
s *Service
}
func NewProjectsAppsRecaptchaV3ConfigService(s *Service) *ProjectsAppsRecaptchaV3ConfigService {
rs := &ProjectsAppsRecaptchaV3ConfigService{s: s}
return rs
}
type ProjectsAppsRecaptchaV3ConfigService struct {
s *Service
}
func NewProjectsAppsSafetyNetConfigService(s *Service) *ProjectsAppsSafetyNetConfigService {
rs := &ProjectsAppsSafetyNetConfigService{s: s}
return rs
}
type ProjectsAppsSafetyNetConfigService struct {
s *Service
}
func NewProjectsServicesService(s *Service) *ProjectsServicesService {
rs := &ProjectsServicesService{s: s}
return rs
}
type ProjectsServicesService struct {
s *Service
}
// GoogleFirebaseAppcheckV1AppAttestConfig: An app's App Attest configuration
// object. This configuration controls certain properties of the
// `AppCheckToken` returned by ExchangeAppAttestAttestation and
// ExchangeAppAttestAssertion, such as its ttl. Note that the Team ID
// registered with your app is used as part of the validation process. Please
// register it via the Firebase Console or programmatically via the Firebase
// Management Service
// (https://firebase.google.com/docs/projects/api/reference/rest/v11/projects.iosApps/patch).
type GoogleFirebaseAppcheckV1AppAttestConfig struct {
// Name: Required. The relative resource name of the App Attest configuration
// object, in the format: ```
// projects/{project_number}/apps/{app_id}/appAttestConfig ```
Name string `json:"name,omitempty"`
// TokenTtl: Specifies the duration for which App Check tokens exchanged from
// App Attest artifacts will be valid. If unset, a default value of 1 hour is
// assumed. Must be between 30 minutes and 7 days, inclusive.
TokenTtl string `json:"tokenTtl,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 (s *GoogleFirebaseAppcheckV1AppAttestConfig) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1AppAttestConfig
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1AppCheckToken: Encapsulates an *App Check token*,
// which are used to access Firebase services protected by App Check.
type GoogleFirebaseAppcheckV1AppCheckToken struct {
// Token: The App Check token. App Check tokens are signed JWTs
// (https://tools.ietf.org/html/rfc7519) containing claims that identify the
// attested app and Firebase project. This token is used to access Firebase
// services protected by App Check. These tokens can also be verified by your
// own custom backends
// (https://firebase.google.com/docs/app-check/custom-resource-backend) using
// the Firebase Admin SDK.
Token string `json:"token,omitempty"`
// Ttl: The duration from the time this token is minted until its expiration.
// This field is intended to ease client-side token management, since the
// client may have clock skew, but is still able to accurately measure a
// duration.
Ttl string `json:"ttl,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Token") 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. "Token") 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 (s *GoogleFirebaseAppcheckV1AppCheckToken) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1AppCheckToken
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1BatchGetAppAttestConfigsResponse: Response message
// for the BatchGetAppAttestConfigs method.
type GoogleFirebaseAppcheckV1BatchGetAppAttestConfigsResponse struct {
// Configs: AppAttestConfigs retrieved.
Configs []*GoogleFirebaseAppcheckV1AppAttestConfig `json:"configs,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Configs") 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. "Configs") 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 (s *GoogleFirebaseAppcheckV1BatchGetAppAttestConfigsResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1BatchGetAppAttestConfigsResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1BatchGetDeviceCheckConfigsResponse: Response message
// for the BatchGetDeviceCheckConfigs method.
type GoogleFirebaseAppcheckV1BatchGetDeviceCheckConfigsResponse struct {
// Configs: DeviceCheckConfigs retrieved.
Configs []*GoogleFirebaseAppcheckV1DeviceCheckConfig `json:"configs,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Configs") 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. "Configs") 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 (s *GoogleFirebaseAppcheckV1BatchGetDeviceCheckConfigsResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1BatchGetDeviceCheckConfigsResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1BatchGetPlayIntegrityConfigsResponse: Response
// message for the BatchGetPlayIntegrityConfigs method.
type GoogleFirebaseAppcheckV1BatchGetPlayIntegrityConfigsResponse struct {
// Configs: PlayIntegrityConfigs retrieved.
Configs []*GoogleFirebaseAppcheckV1PlayIntegrityConfig `json:"configs,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Configs") 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. "Configs") 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 (s *GoogleFirebaseAppcheckV1BatchGetPlayIntegrityConfigsResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1BatchGetPlayIntegrityConfigsResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1BatchGetRecaptchaEnterpriseConfigsResponse: Response
// message for the BatchGetRecaptchaEnterpriseConfigs method.
type GoogleFirebaseAppcheckV1BatchGetRecaptchaEnterpriseConfigsResponse struct {
// Configs: RecaptchaEnterpriseConfigs retrieved.
Configs []*GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig `json:"configs,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Configs") 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. "Configs") 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 (s *GoogleFirebaseAppcheckV1BatchGetRecaptchaEnterpriseConfigsResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1BatchGetRecaptchaEnterpriseConfigsResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1BatchGetRecaptchaV3ConfigsResponse: Response message
// for the BatchGetRecaptchaV3Configs method.
type GoogleFirebaseAppcheckV1BatchGetRecaptchaV3ConfigsResponse struct {
// Configs: RecaptchaV3Configs retrieved.
Configs []*GoogleFirebaseAppcheckV1RecaptchaV3Config `json:"configs,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Configs") 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. "Configs") 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 (s *GoogleFirebaseAppcheckV1BatchGetRecaptchaV3ConfigsResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1BatchGetRecaptchaV3ConfigsResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1BatchGetSafetyNetConfigsResponse: Response message
// for the BatchGetSafetyNetConfigs method.
type GoogleFirebaseAppcheckV1BatchGetSafetyNetConfigsResponse struct {
// Configs: SafetyNetConfigs retrieved.
Configs []*GoogleFirebaseAppcheckV1SafetyNetConfig `json:"configs,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Configs") 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. "Configs") 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 (s *GoogleFirebaseAppcheckV1BatchGetSafetyNetConfigsResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1BatchGetSafetyNetConfigsResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1BatchUpdateServicesRequest: Request message for the
// BatchUpdateServices method.
type GoogleFirebaseAppcheckV1BatchUpdateServicesRequest struct {
// Requests: Required. The request messages specifying the Services to update.
// A maximum of 100 objects can be updated in a batch.
Requests []*GoogleFirebaseAppcheckV1UpdateServiceRequest `json:"requests,omitempty"`
// UpdateMask: Optional. A comma-separated list of names of fields in the
// Services to update. Example: `display_name`. If the `update_mask` field is
// set in both this request and any of the UpdateServiceRequest messages, they
// must match or the entire batch fails and no updates will be committed.
UpdateMask string `json:"updateMask,omitempty"`
// ForceSendFields is a list of field names (e.g. "Requests") 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. "Requests") 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 (s *GoogleFirebaseAppcheckV1BatchUpdateServicesRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1BatchUpdateServicesRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1BatchUpdateServicesResponse: Response message for
// the BatchUpdateServices method.
type GoogleFirebaseAppcheckV1BatchUpdateServicesResponse struct {
// Services: Service objects after the updates have been applied.
Services []*GoogleFirebaseAppcheckV1Service `json:"services,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Services") 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. "Services") 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 (s *GoogleFirebaseAppcheckV1BatchUpdateServicesResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1BatchUpdateServicesResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1DebugToken: A *debug token* is a secret used during
// the development or integration testing of an app. It essentially allows the
// development or integration testing to bypass app attestation while still
// allowing App Check to enforce protection on supported production Firebase
// services.
type GoogleFirebaseAppcheckV1DebugToken struct {
// DisplayName: Required. A human readable display name used to identify this
// debug token.
DisplayName string `json:"displayName,omitempty"`
// Name: Required. The relative resource name of the debug token, in the
// format: ```
// projects/{project_number}/apps/{app_id}/debugTokens/{debug_token_id} ```
Name string `json:"name,omitempty"`
// Token: Required. Input only. Immutable. The secret token itself. Must be
// provided during creation, and must be a UUID4, case insensitive. This field
// is immutable once set, and cannot be provided during an UpdateDebugToken
// request. You can, however, delete this debug token using DeleteDebugToken to
// revoke it. For security reasons, this field will never be populated in any
// response.
Token string `json:"token,omitempty"`
// UpdateTime: Output only. Timestamp when this debug token was most recently
// updated.
UpdateTime string `json:"updateTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "DisplayName") 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. "DisplayName") 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 (s *GoogleFirebaseAppcheckV1DebugToken) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1DebugToken
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1DeviceCheckConfig: An app's DeviceCheck
// configuration object. This configuration is used by ExchangeDeviceCheckToken
// to validate device tokens issued to apps by DeviceCheck. It also controls
// certain properties of the returned `AppCheckToken`, such as its ttl. Note
// that the Team ID registered with your app is used as part of the validation
// process. Please register it via the Firebase Console or programmatically via
// the Firebase Management Service
// (https://firebase.google.com/docs/projects/api/reference/rest/v11/projects.iosApps/patch).
type GoogleFirebaseAppcheckV1DeviceCheckConfig struct {
// KeyId: Required. The key identifier of a private key enabled with
// DeviceCheck, created in your Apple Developer account.
KeyId string `json:"keyId,omitempty"`
// Name: Required. The relative resource name of the DeviceCheck configuration
// object, in the format: ```
// projects/{project_number}/apps/{app_id}/deviceCheckConfig ```
Name string `json:"name,omitempty"`
// PrivateKey: Required. Input only. The contents of the private key (`.p8`)
// file associated with the key specified by `key_id`. For security reasons,
// this field will never be populated in any response.
PrivateKey string `json:"privateKey,omitempty"`
// PrivateKeySet: Output only. Whether the `private_key` field was previously
// set. Since we will never return the `private_key` field, this field is the
// only way to find out whether it was previously set.
PrivateKeySet bool `json:"privateKeySet,omitempty"`
// TokenTtl: Specifies the duration for which App Check tokens exchanged from
// DeviceCheck tokens will be valid. If unset, a default value of 1 hour is
// assumed. Must be between 30 minutes and 7 days, inclusive.
TokenTtl string `json:"tokenTtl,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "KeyId") 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. "KeyId") 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 (s *GoogleFirebaseAppcheckV1DeviceCheckConfig) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1DeviceCheckConfig
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest: Request message
// for the ExchangeAppAttestAssertion method.
type GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest struct {
// Artifact: Required. The artifact returned by a previous call to
// ExchangeAppAttestAttestation.
Artifact string `json:"artifact,omitempty"`
// Assertion: Required. The CBOR-encoded assertion returned by the client-side
// App Attest API.
Assertion string `json:"assertion,omitempty"`
// Challenge: Required. A one-time challenge returned by an immediately prior
// call to GenerateAppAttestChallenge.
Challenge string `json:"challenge,omitempty"`
// LimitedUse: Specifies whether this attestation is for use in a *limited use*
// (`true`) or *session based* (`false`) context. To enable this attestation to
// be used with the *replay protection* feature, set this to `true`. The
// default value is `false`.
LimitedUse bool `json:"limitedUse,omitempty"`
// ForceSendFields is a list of field names (e.g. "Artifact") 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. "Artifact") 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 (s *GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest: Request message
// for the ExchangeAppAttestAttestation method.
type GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest struct {
// AttestationStatement: Required. The App Attest statement returned by the
// client-side App Attest API. This is a base64url encoded CBOR object in the
// JSON response.
AttestationStatement string `json:"attestationStatement,omitempty"`
// Challenge: Required. A one-time challenge returned by an immediately prior
// call to GenerateAppAttestChallenge.
Challenge string `json:"challenge,omitempty"`
// KeyId: Required. The key ID generated by App Attest for the client app.
KeyId string `json:"keyId,omitempty"`
// LimitedUse: Specifies whether this attestation is for use in a *limited use*
// (`true`) or *session based* (`false`) context. To enable this attestation to
// be used with the *replay protection* feature, set this to `true`. The
// default value is `false`.
LimitedUse bool `json:"limitedUse,omitempty"`
// ForceSendFields is a list of field names (e.g. "AttestationStatement") 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. "AttestationStatement") 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 (s *GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse: Response
// message for the ExchangeAppAttestAttestation method.
type GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse struct {
// AppCheckToken: Encapsulates an App Check token.
AppCheckToken *GoogleFirebaseAppcheckV1AppCheckToken `json:"appCheckToken,omitempty"`
// Artifact: An artifact that can be used in future calls to
// ExchangeAppAttestAssertion.
Artifact string `json:"artifact,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AppCheckToken") 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. "AppCheckToken") 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 (s *GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ExchangeCustomTokenRequest: Request message for the
// ExchangeCustomToken method.
type GoogleFirebaseAppcheckV1ExchangeCustomTokenRequest struct {
// CustomToken: Required. A custom token signed using your project's Admin SDK
// service account credentials.
CustomToken string `json:"customToken,omitempty"`
// LimitedUse: Specifies whether this attestation is for use in a *limited use*
// (`true`) or *session based* (`false`) context. To enable this attestation to
// be used with the *replay protection* feature, set this to `true`. The
// default value is `false`.
LimitedUse bool `json:"limitedUse,omitempty"`
// ForceSendFields is a list of field names (e.g. "CustomToken") 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. "CustomToken") 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 (s *GoogleFirebaseAppcheckV1ExchangeCustomTokenRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ExchangeCustomTokenRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest: Request message for the
// ExchangeDebugToken method.
type GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest struct {
// DebugToken: Required. A debug token secret. This string must match a debug
// token secret previously created using CreateDebugToken.
DebugToken string `json:"debugToken,omitempty"`
// LimitedUse: Specifies whether this attestation is for use in a *limited use*
// (`true`) or *session based* (`false`) context. To enable this attestation to
// be used with the *replay protection* feature, set this to `true`. The
// default value is `false`.
LimitedUse bool `json:"limitedUse,omitempty"`
// ForceSendFields is a list of field names (e.g. "DebugToken") 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. "DebugToken") 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 (s *GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ExchangeDeviceCheckTokenRequest: Request message for
// the ExchangeDeviceCheckToken method.
type GoogleFirebaseAppcheckV1ExchangeDeviceCheckTokenRequest struct {
// DeviceToken: Required. The `device_token` as returned by Apple's client-side
// DeviceCheck API
// (https://developer.apple.com/documentation/devicecheck/dcdevice). This is
// the base64 encoded `Data` (Swift) or `NSData` (ObjC) object.
DeviceToken string `json:"deviceToken,omitempty"`
// LimitedUse: Specifies whether this attestation is for use in a *limited use*
// (`true`) or *session based* (`false`) context. To enable this attestation to
// be used with the *replay protection* feature, set this to `true`. The
// default value is `false`.
LimitedUse bool `json:"limitedUse,omitempty"`
// ForceSendFields is a list of field names (e.g. "DeviceToken") 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. "DeviceToken") 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 (s *GoogleFirebaseAppcheckV1ExchangeDeviceCheckTokenRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ExchangeDeviceCheckTokenRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ExchangePlayIntegrityTokenRequest: Request message
// for the ExchangePlayIntegrityToken method.
type GoogleFirebaseAppcheckV1ExchangePlayIntegrityTokenRequest struct {
// LimitedUse: Specifies whether this attestation is for use in a *limited use*
// (`true`) or *session based* (`false`) context. To enable this attestation to
// be used with the *replay protection* feature, set this to `true`. The
// default value is `false`.
LimitedUse bool `json:"limitedUse,omitempty"`
// PlayIntegrityToken: Required. The integrity verdict response token from Play
// Integrity
// (https://developer.android.com/google/play/integrity/verdict#decrypt-verify)
// issued to your app.
PlayIntegrityToken string `json:"playIntegrityToken,omitempty"`
// ForceSendFields is a list of field names (e.g. "LimitedUse") 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. "LimitedUse") 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 (s *GoogleFirebaseAppcheckV1ExchangePlayIntegrityTokenRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ExchangePlayIntegrityTokenRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ExchangeRecaptchaEnterpriseTokenRequest: Request
// message for the ExchangeRecaptchaEnterpriseToken method.
type GoogleFirebaseAppcheckV1ExchangeRecaptchaEnterpriseTokenRequest struct {
// LimitedUse: Specifies whether this attestation is for use in a *limited use*
// (`true`) or *session based* (`false`) context. To enable this attestation to
// be used with the *replay protection* feature, set this to `true`. The
// default value is `false`.
LimitedUse bool `json:"limitedUse,omitempty"`
// RecaptchaEnterpriseToken: Required. The reCAPTCHA token as returned by the
// reCAPTCHA Enterprise JavaScript API
// (https://cloud.google.com/recaptcha-enterprise/docs/instrument-web-pages).
RecaptchaEnterpriseToken string `json:"recaptchaEnterpriseToken,omitempty"`
// ForceSendFields is a list of field names (e.g. "LimitedUse") 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. "LimitedUse") 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 (s *GoogleFirebaseAppcheckV1ExchangeRecaptchaEnterpriseTokenRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ExchangeRecaptchaEnterpriseTokenRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ExchangeRecaptchaV3TokenRequest: Request message for
// the ExchangeRecaptchaV3Token method.
type GoogleFirebaseAppcheckV1ExchangeRecaptchaV3TokenRequest struct {
// LimitedUse: Specifies whether this attestation is for use in a *limited use*
// (`true`) or *session based* (`false`) context. To enable this attestation to
// be used with the *replay protection* feature, set this to `true`. The
// default value is `false`.
LimitedUse bool `json:"limitedUse,omitempty"`
// RecaptchaV3Token: Required. The reCAPTCHA token as returned by the reCAPTCHA
// v3 JavaScript API (https://developers.google.com/recaptcha/docs/v3).
RecaptchaV3Token string `json:"recaptchaV3Token,omitempty"`
// ForceSendFields is a list of field names (e.g. "LimitedUse") 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. "LimitedUse") 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 (s *GoogleFirebaseAppcheckV1ExchangeRecaptchaV3TokenRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ExchangeRecaptchaV3TokenRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ExchangeSafetyNetTokenRequest: Request message for
// the ExchangeSafetyNetToken method.
type GoogleFirebaseAppcheckV1ExchangeSafetyNetTokenRequest struct {
// SafetyNetToken: Required. The SafetyNet attestation response
// (https://developer.android.com/training/safetynet/attestation#request-attestation-step)
// issued to your app.
SafetyNetToken string `json:"safetyNetToken,omitempty"`
// ForceSendFields is a list of field names (e.g. "SafetyNetToken") 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. "SafetyNetToken") 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 (s *GoogleFirebaseAppcheckV1ExchangeSafetyNetTokenRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ExchangeSafetyNetTokenRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1GenerateAppAttestChallengeRequest: Request message
// for the GenerateAppAttestChallenge method.
type GoogleFirebaseAppcheckV1GenerateAppAttestChallengeRequest struct {
}
// GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse: Response message
// for the GenerateAppAttestChallenge method.
type GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse struct {
// Challenge: A one-time use challenge for the client to pass to the App Attest
// API.
Challenge string `json:"challenge,omitempty"`
// Ttl: The duration from the time this challenge is minted until its
// expiration. This field is intended to ease client-side token management,
// since the client may have clock skew, but is still able to accurately
// measure a duration.
Ttl string `json:"ttl,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Challenge") 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. "Challenge") 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 (s *GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeRequest: Request
// message for the GeneratePlayIntegrityChallenge method.
type GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeRequest struct {
}
// GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeResponse: Response
// message for the GeneratePlayIntegrityChallenge method.
type GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeResponse struct {
// Challenge: A one-time use challenge
// (https://developer.android.com/google/play/integrity/verdict#protect-against-replay-attacks)
// for the client to pass to the Play Integrity API.
Challenge string `json:"challenge,omitempty"`
// Ttl: The duration from the time this challenge is minted until its
// expiration. This field is intended to ease client-side token management,
// since the client may have clock skew, but is still able to accurately
// measure a duration.
Ttl string `json:"ttl,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Challenge") 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. "Challenge") 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 (s *GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ListDebugTokensResponse: Response message for the
// ListDebugTokens method.
type GoogleFirebaseAppcheckV1ListDebugTokensResponse struct {
// DebugTokens: The DebugTokens retrieved.
DebugTokens []*GoogleFirebaseAppcheckV1DebugToken `json:"debugTokens,omitempty"`
// NextPageToken: If the result list is too large to fit in a single response,
// then a token is returned. If the string is empty or omitted, then this
// response is the last page of results. This token can be used in a subsequent
// call to ListDebugTokens to find the next group of DebugTokens. Page tokens
// are short-lived and should not be persisted.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "DebugTokens") 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. "DebugTokens") 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 (s *GoogleFirebaseAppcheckV1ListDebugTokensResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ListDebugTokensResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1ListServicesResponse: Response message for the
// ListServices method.
type GoogleFirebaseAppcheckV1ListServicesResponse struct {
// NextPageToken: If the result list is too large to fit in a single response,
// then a token is returned. If the string is empty or omitted, then this
// response is the last page of results. This token can be used in a subsequent
// call to ListServices to find the next group of Services. Page tokens are
// short-lived and should not be persisted.
NextPageToken string `json:"nextPageToken,omitempty"`
// Services: The Services retrieved.
Services []*GoogleFirebaseAppcheckV1Service `json:"services,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") 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. "NextPageToken") 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 (s *GoogleFirebaseAppcheckV1ListServicesResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1ListServicesResponse
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1PlayIntegrityConfig: An app's Play Integrity
// configuration object. This configuration controls certain properties of the
// `AppCheckToken` returned by ExchangePlayIntegrityToken, such as its ttl.
// Note that your registered SHA-256 certificate fingerprints are used to
// validate tokens issued by the Play Integrity API; please register them via
// the Firebase Console or programmatically via the Firebase Management Service
// (https://firebase.google.com/docs/projects/api/reference/rest/v1beta1/projects.androidApps.sha/create).
type GoogleFirebaseAppcheckV1PlayIntegrityConfig struct {
// Name: Required. The relative resource name of the Play Integrity
// configuration object, in the format: ```
// projects/{project_number}/apps/{app_id}/playIntegrityConfig ```
Name string `json:"name,omitempty"`
// TokenTtl: Specifies the duration for which App Check tokens exchanged from
// Play Integrity tokens will be valid. If unset, a default value of 1 hour is
// assumed. Must be between 30 minutes and 7 days, inclusive.
TokenTtl string `json:"tokenTtl,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 (s *GoogleFirebaseAppcheckV1PlayIntegrityConfig) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1PlayIntegrityConfig
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1PublicJwk: A JWK as specified by section 4 of RFC
// 7517 (https://tools.ietf.org/html/rfc7517#section-4) and section 6.3.1 of
// RFC 7518 (https://tools.ietf.org/html/rfc7518#section-6.3.1).
type GoogleFirebaseAppcheckV1PublicJwk struct {
// Alg: See section 4.4 of RFC 7517
// (https://tools.ietf.org/html/rfc7517#section-4.4).
Alg string `json:"alg,omitempty"`
// E: See section 6.3.1.2 of RFC 7518
// (https://tools.ietf.org/html/rfc7518#section-6.3.1.2).
E string `json:"e,omitempty"`
// Kid: See section 4.5 of RFC 7517
// (https://tools.ietf.org/html/rfc7517#section-4.5).
Kid string `json:"kid,omitempty"`
// Kty: See section 4.1 of RFC 7517
// (https://tools.ietf.org/html/rfc7517#section-4.1).
Kty string `json:"kty,omitempty"`
// N: See section 6.3.1.1 of RFC 7518
// (https://tools.ietf.org/html/rfc7518#section-6.3.1.1).
N string `json:"n,omitempty"`
// Use: See section 4.2 of RFC 7517
// (https://tools.ietf.org/html/rfc7517#section-4.2).
Use string `json:"use,omitempty"`
// ForceSendFields is a list of field names (e.g. "Alg") 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. "Alg") 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 (s *GoogleFirebaseAppcheckV1PublicJwk) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1PublicJwk
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1PublicJwkSet: The currently active set of public
// keys that can be used to verify App Check tokens. This object is a JWK set
// as specified by section 5 of RFC 7517
// (https://tools.ietf.org/html/rfc7517#section-5). For security, the response
// **must not** be cached for longer than six hours.
type GoogleFirebaseAppcheckV1PublicJwkSet struct {
// Keys: The set of public keys. See section 5.1 of RFC 7517
// (https://tools.ietf.org/html/rfc7517#section-5).
Keys []*GoogleFirebaseAppcheckV1PublicJwk `json:"keys,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Keys") 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. "Keys") 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 (s *GoogleFirebaseAppcheckV1PublicJwkSet) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1PublicJwkSet
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig: An app's reCAPTCHA
// Enterprise configuration object. This configuration is used by
// ExchangeRecaptchaEnterpriseToken to validate reCAPTCHA tokens issued to apps
// by reCAPTCHA Enterprise. It also controls certain properties of the returned
// `AppCheckToken`, such as its ttl.
type GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig struct {
// Name: Required. The relative resource name of the reCAPTCHA Enterprise
// configuration object, in the format: ```
// projects/{project_number}/apps/{app_id}/recaptchaEnterpriseConfig ```
Name string `json:"name,omitempty"`
// SiteKey: The score-based site key created in reCAPTCHA Enterprise
// (https://cloud.google.com/recaptcha-enterprise/docs/create-key#creating_a_site_key)
// used to invoke reCAPTCHA and generate the reCAPTCHA tokens
// (https://cloud.google.com/recaptcha-enterprise/docs/instrument-web-pages)
// for your application. Important: This is *not* the `site_secret` (as it is
// in reCAPTCHA v3), but rather your score-based reCAPTCHA Enterprise site key.
SiteKey string `json:"siteKey,omitempty"`
// TokenTtl: Specifies the duration for which App Check tokens exchanged from
// reCAPTCHA Enterprise tokens will be valid. If unset, a default value of 1
// hour is assumed. Must be between 30 minutes and 7 days, inclusive.
TokenTtl string `json:"tokenTtl,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 (s *GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1RecaptchaV3Config: An app's reCAPTCHA v3
// configuration object. This configuration is used by ExchangeRecaptchaV3Token
// to validate reCAPTCHA tokens issued to apps by reCAPTCHA v3. It also
// controls certain properties of the returned `AppCheckToken`, such as its
// ttl.
type GoogleFirebaseAppcheckV1RecaptchaV3Config struct {
// Name: Required. The relative resource name of the reCAPTCHA v3 configuration
// object, in the format: ```
// projects/{project_number}/apps/{app_id}/recaptchaV3Config ```
Name string `json:"name,omitempty"`
// SiteSecret: Required. Input only. The site secret used to identify your
// service for reCAPTCHA v3 verification. For security reasons, this field will
// never be populated in any response.
SiteSecret string `json:"siteSecret,omitempty"`
// SiteSecretSet: Output only. Whether the `site_secret` field was previously
// set. Since we will never return the `site_secret` field, this field is the
// only way to find out whether it was previously set.
SiteSecretSet bool `json:"siteSecretSet,omitempty"`
// TokenTtl: Specifies the duration for which App Check tokens exchanged from
// reCAPTCHA tokens will be valid. If unset, a default value of 1 day is
// assumed. Must be between 30 minutes and 7 days, inclusive.
TokenTtl string `json:"tokenTtl,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 (s *GoogleFirebaseAppcheckV1RecaptchaV3Config) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1RecaptchaV3Config
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1SafetyNetConfig: An app's SafetyNet configuration
// object. This configuration controls certain properties of the
// `AppCheckToken` returned by ExchangeSafetyNetToken, such as its ttl. Note
// that your registered SHA-256 certificate fingerprints are used to validate
// tokens issued by SafetyNet; please register them via the Firebase Console or
// programmatically via the Firebase Management Service
// (https://firebase.google.com/docs/projects/api/reference/rest/v11/projects.androidApps.sha/create).
type GoogleFirebaseAppcheckV1SafetyNetConfig struct {
// Name: Required. The relative resource name of the SafetyNet configuration
// object, in the format: ```
// projects/{project_number}/apps/{app_id}/safetyNetConfig ```
Name string `json:"name,omitempty"`
// TokenTtl: Specifies the duration for which App Check tokens exchanged from
// SafetyNet tokens will be valid. If unset, a default value of 1 hour is
// assumed. Must be between 30 minutes and 7 days, inclusive.
TokenTtl string `json:"tokenTtl,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 (s *GoogleFirebaseAppcheckV1SafetyNetConfig) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1SafetyNetConfig
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1Service: The enforcement configuration for a
// Firebase service supported by App Check.
type GoogleFirebaseAppcheckV1Service struct {
// EnforcementMode: Required. The App Check enforcement mode for this service.
//
// Possible values:
// "OFF" - Firebase App Check is not enforced for the service, nor are App
// Check metrics collected. Though the service is not protected by App Check in
// this mode, other applicable protections, such as user authorization, are
// still enforced. An unconfigured service is in this mode by default.
// "UNENFORCED" - Firebase App Check is not enforced for the service. App
// Check metrics are collected to help you decide when to turn on enforcement
// for the service. Though the service is not protected by App Check in this
// mode, other applicable protections, such as user authorization, are still
// enforced. Some services require certain conditions to be met before they
// will work with App Check, such as requiring you to upgrade to a specific
// service tier. Until those requirements are met for a service, this
// `UNENFORCED` setting will have no effect and App Check will not work with
// that service.
// "ENFORCED" - Firebase App Check is enforced for the service. The service
// will reject any request that attempts to access your project's resources if
// it does not have valid App Check token attached, with some exceptions
// depending on the service; for example, some services will still allow
// requests bearing the developer's privileged service account credentials
// without an App Check token. App Check metrics continue to be collected to
// help you detect issues with your App Check integration and monitor the
// composition of your callers. While the service is protected by App Check,
// other applicable protections, such as user authorization, continue to be
// enforced at the same time. Use caution when choosing to enforce App Check on
// a Firebase service. If your users have not updated to an App Check capable
// version of your app, their apps will no longer be able to use your Firebase
// services that are enforcing App Check. App Check metrics can help you decide
// whether to enforce App Check on your Firebase services. If your app has not
// launched yet, you should enable enforcement immediately, since there are no
// outdated clients in use. Some services require certain conditions to be met
// before they will work with App Check, such as requiring you to upgrade to a
// specific service tier. Until those requirements are met for a service, this
// `ENFORCED` setting will have no effect and App Check will not work with that
// service.
EnforcementMode string `json:"enforcementMode,omitempty"`
// Name: Required. The relative resource name of the service configuration
// object, in the format: ``` projects/{project_number}/services/{service_id}
// ``` Note that the `service_id` element must be a supported service ID.
// Currently, the following service IDs are supported: *
// `firebasestorage.googleapis.com` (Cloud Storage for Firebase) *
// `firebasedatabase.googleapis.com` (Firebase Realtime Database) *
// `firestore.googleapis.com` (Cloud Firestore)
Name string `json:"name,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "EnforcementMode") 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. "EnforcementMode") 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 (s *GoogleFirebaseAppcheckV1Service) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1Service
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseAppcheckV1UpdateServiceRequest: Request message for the
// UpdateService method as well as an individual update message for the
// BatchUpdateServices method.
type GoogleFirebaseAppcheckV1UpdateServiceRequest struct {
// Service: Required. The Service to update. The Service's `name` field is used
// to identify the Service to be updated, in the format: ```
// projects/{project_number}/services/{service_id} ``` Note that the
// `service_id` element must be a supported service ID. Currently, the
// following service IDs are supported: * `firebasestorage.googleapis.com`
// (Cloud Storage for Firebase) * `firebasedatabase.googleapis.com` (Firebase
// Realtime Database) * `firestore.googleapis.com` (Cloud Firestore)
Service *GoogleFirebaseAppcheckV1Service `json:"service,omitempty"`
// UpdateMask: Required. A comma-separated list of names of fields in the
// Service to update. Example: `enforcement_mode`.
UpdateMask string `json:"updateMask,omitempty"`
// ForceSendFields is a list of field names (e.g. "Service") 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. "Service") 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 (s *GoogleFirebaseAppcheckV1UpdateServiceRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseAppcheckV1UpdateServiceRequest
return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
}
// GoogleProtobufEmpty: A generic empty message that you can re-use to avoid
// defining duplicated empty messages in your APIs. A typical example is to use
// it as the request or the response type of an API method. For instance:
// service Foo { rpc Bar(google.protobuf.Empty) returns
// (google.protobuf.Empty); }
type GoogleProtobufEmpty struct {
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
}
type JwksGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Returns a public JWK set as specified by RFC 7517
// (https://tools.ietf.org/html/rfc7517) that can be used to verify App Check
// tokens. Exactly one of the public keys in the returned set will successfully
// validate any App Check token that is currently valid.
//
// - name: The relative resource name to the public JWK set. Must always be
// exactly the string `jwks`.
func (r *JwksService) Get(name string) *JwksGetCall {
c := &JwksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *JwksGetCall) Fields(s ...googleapi.Field) *JwksGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *JwksGetCall) IfNoneMatch(entityTag string) *JwksGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *JwksGetCall) Context(ctx context.Context) *JwksGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *JwksGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *JwksGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.jwks.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1PublicJwkSet.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 *JwksGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1PublicJwkSet, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1PublicJwkSet{
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
}
type OauthClientsExchangeAppAttestAssertionCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangeappattestassertionrequest *GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeAppAttestAssertion: Accepts an App Attest assertion and an artifact
// previously obtained from ExchangeAppAttestAttestation and verifies those
// with Apple. If valid, returns an AppCheckToken.
//
// - app: The relative resource name of the iOS app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *OauthClientsService) ExchangeAppAttestAssertion(appid string, googlefirebaseappcheckv1exchangeappattestassertionrequest *GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest) *OauthClientsExchangeAppAttestAssertionCall {
c := &OauthClientsExchangeAppAttestAssertionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangeappattestassertionrequest = googlefirebaseappcheckv1exchangeappattestassertionrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *OauthClientsExchangeAppAttestAssertionCall) Fields(s ...googleapi.Field) *OauthClientsExchangeAppAttestAssertionCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *OauthClientsExchangeAppAttestAssertionCall) Context(ctx context.Context) *OauthClientsExchangeAppAttestAssertionCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *OauthClientsExchangeAppAttestAssertionCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OauthClientsExchangeAppAttestAssertionCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangeappattestassertionrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeAppAttestAssertion")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.oauthClients.exchangeAppAttestAssertion" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppCheckToken.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 *OauthClientsExchangeAppAttestAssertionCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppCheckToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppCheckToken{
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
}
type OauthClientsExchangeAppAttestAttestationCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangeappattestattestationrequest *GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeAppAttestAttestation: Accepts an App Attest CBOR attestation and
// verifies it with Apple using your preconfigured team and bundle IDs. If
// valid, returns an attestation artifact that can later be exchanged for an
// AppCheckToken using ExchangeAppAttestAssertion. For convenience and
// performance, this method's response object will also contain an
// AppCheckToken (if the verification is successful).
//
// - app: The relative resource name of the iOS app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *OauthClientsService) ExchangeAppAttestAttestation(appid string, googlefirebaseappcheckv1exchangeappattestattestationrequest *GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest) *OauthClientsExchangeAppAttestAttestationCall {
c := &OauthClientsExchangeAppAttestAttestationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangeappattestattestationrequest = googlefirebaseappcheckv1exchangeappattestattestationrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *OauthClientsExchangeAppAttestAttestationCall) Fields(s ...googleapi.Field) *OauthClientsExchangeAppAttestAttestationCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *OauthClientsExchangeAppAttestAttestationCall) Context(ctx context.Context) *OauthClientsExchangeAppAttestAttestationCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *OauthClientsExchangeAppAttestAttestationCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OauthClientsExchangeAppAttestAttestationCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangeappattestattestationrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeAppAttestAttestation")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.oauthClients.exchangeAppAttestAttestation" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse.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 *OauthClientsExchangeAppAttestAttestationCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse{
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
}
type OauthClientsExchangeDebugTokenCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangedebugtokenrequest *GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeDebugToken: Validates a debug token secret that you have previously
// created using CreateDebugToken. If valid, returns an AppCheckToken. Note
// that a restrictive quota is enforced on this method to prevent accidental
// exposure of the app to abuse.
//
// - app: The relative resource name of the app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *OauthClientsService) ExchangeDebugToken(appid string, googlefirebaseappcheckv1exchangedebugtokenrequest *GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest) *OauthClientsExchangeDebugTokenCall {
c := &OauthClientsExchangeDebugTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangedebugtokenrequest = googlefirebaseappcheckv1exchangedebugtokenrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *OauthClientsExchangeDebugTokenCall) Fields(s ...googleapi.Field) *OauthClientsExchangeDebugTokenCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *OauthClientsExchangeDebugTokenCall) Context(ctx context.Context) *OauthClientsExchangeDebugTokenCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *OauthClientsExchangeDebugTokenCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OauthClientsExchangeDebugTokenCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangedebugtokenrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeDebugToken")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.oauthClients.exchangeDebugToken" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppCheckToken.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 *OauthClientsExchangeDebugTokenCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppCheckToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppCheckToken{
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
}
type OauthClientsGenerateAppAttestChallengeCall struct {
s *Service
appid string
googlefirebaseappcheckv1generateappattestchallengerequest *GoogleFirebaseAppcheckV1GenerateAppAttestChallengeRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// GenerateAppAttestChallenge: Generates a challenge that protects the
// integrity of an immediately following call to ExchangeAppAttestAttestation
// or ExchangeAppAttestAssertion. A challenge should not be reused for multiple
// calls.
//
// - app: The relative resource name of the iOS app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *OauthClientsService) GenerateAppAttestChallenge(appid string, googlefirebaseappcheckv1generateappattestchallengerequest *GoogleFirebaseAppcheckV1GenerateAppAttestChallengeRequest) *OauthClientsGenerateAppAttestChallengeCall {
c := &OauthClientsGenerateAppAttestChallengeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1generateappattestchallengerequest = googlefirebaseappcheckv1generateappattestchallengerequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *OauthClientsGenerateAppAttestChallengeCall) Fields(s ...googleapi.Field) *OauthClientsGenerateAppAttestChallengeCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *OauthClientsGenerateAppAttestChallengeCall) Context(ctx context.Context) *OauthClientsGenerateAppAttestChallengeCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *OauthClientsGenerateAppAttestChallengeCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OauthClientsGenerateAppAttestChallengeCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1generateappattestchallengerequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:generateAppAttestChallenge")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.oauthClients.generateAppAttestChallenge" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse.ServerResponse.He
// ader 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 *OauthClientsGenerateAppAttestChallengeCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse{
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
}
type ProjectsAppsExchangeAppAttestAssertionCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangeappattestassertionrequest *GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeAppAttestAssertion: Accepts an App Attest assertion and an artifact
// previously obtained from ExchangeAppAttestAttestation and verifies those
// with Apple. If valid, returns an AppCheckToken.
//
// - app: The relative resource name of the iOS app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) ExchangeAppAttestAssertion(appid string, googlefirebaseappcheckv1exchangeappattestassertionrequest *GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest) *ProjectsAppsExchangeAppAttestAssertionCall {
c := &ProjectsAppsExchangeAppAttestAssertionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangeappattestassertionrequest = googlefirebaseappcheckv1exchangeappattestassertionrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsExchangeAppAttestAssertionCall) Fields(s ...googleapi.Field) *ProjectsAppsExchangeAppAttestAssertionCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsExchangeAppAttestAssertionCall) Context(ctx context.Context) *ProjectsAppsExchangeAppAttestAssertionCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsExchangeAppAttestAssertionCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsExchangeAppAttestAssertionCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangeappattestassertionrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeAppAttestAssertion")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.exchangeAppAttestAssertion" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppCheckToken.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 *ProjectsAppsExchangeAppAttestAssertionCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppCheckToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppCheckToken{
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
}
type ProjectsAppsExchangeAppAttestAttestationCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangeappattestattestationrequest *GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeAppAttestAttestation: Accepts an App Attest CBOR attestation and
// verifies it with Apple using your preconfigured team and bundle IDs. If
// valid, returns an attestation artifact that can later be exchanged for an
// AppCheckToken using ExchangeAppAttestAssertion. For convenience and
// performance, this method's response object will also contain an
// AppCheckToken (if the verification is successful).
//
// - app: The relative resource name of the iOS app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) ExchangeAppAttestAttestation(appid string, googlefirebaseappcheckv1exchangeappattestattestationrequest *GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest) *ProjectsAppsExchangeAppAttestAttestationCall {
c := &ProjectsAppsExchangeAppAttestAttestationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangeappattestattestationrequest = googlefirebaseappcheckv1exchangeappattestattestationrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsExchangeAppAttestAttestationCall) Fields(s ...googleapi.Field) *ProjectsAppsExchangeAppAttestAttestationCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsExchangeAppAttestAttestationCall) Context(ctx context.Context) *ProjectsAppsExchangeAppAttestAttestationCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsExchangeAppAttestAttestationCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsExchangeAppAttestAttestationCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangeappattestattestationrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeAppAttestAttestation")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.exchangeAppAttestAttestation" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse.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 *ProjectsAppsExchangeAppAttestAttestationCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse{
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
}
type ProjectsAppsExchangeCustomTokenCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangecustomtokenrequest *GoogleFirebaseAppcheckV1ExchangeCustomTokenRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeCustomToken: Validates a custom token signed using your project's
// Admin SDK service account credentials. If valid, returns an AppCheckToken.
//
// - app: The relative resource name of the app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) ExchangeCustomToken(appid string, googlefirebaseappcheckv1exchangecustomtokenrequest *GoogleFirebaseAppcheckV1ExchangeCustomTokenRequest) *ProjectsAppsExchangeCustomTokenCall {
c := &ProjectsAppsExchangeCustomTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangecustomtokenrequest = googlefirebaseappcheckv1exchangecustomtokenrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsExchangeCustomTokenCall) Fields(s ...googleapi.Field) *ProjectsAppsExchangeCustomTokenCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsExchangeCustomTokenCall) Context(ctx context.Context) *ProjectsAppsExchangeCustomTokenCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsExchangeCustomTokenCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsExchangeCustomTokenCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangecustomtokenrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeCustomToken")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.exchangeCustomToken" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppCheckToken.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 *ProjectsAppsExchangeCustomTokenCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppCheckToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppCheckToken{
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
}
type ProjectsAppsExchangeDebugTokenCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangedebugtokenrequest *GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeDebugToken: Validates a debug token secret that you have previously
// created using CreateDebugToken. If valid, returns an AppCheckToken. Note
// that a restrictive quota is enforced on this method to prevent accidental
// exposure of the app to abuse.
//
// - app: The relative resource name of the app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) ExchangeDebugToken(appid string, googlefirebaseappcheckv1exchangedebugtokenrequest *GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest) *ProjectsAppsExchangeDebugTokenCall {
c := &ProjectsAppsExchangeDebugTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangedebugtokenrequest = googlefirebaseappcheckv1exchangedebugtokenrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsExchangeDebugTokenCall) Fields(s ...googleapi.Field) *ProjectsAppsExchangeDebugTokenCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsExchangeDebugTokenCall) Context(ctx context.Context) *ProjectsAppsExchangeDebugTokenCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsExchangeDebugTokenCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsExchangeDebugTokenCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangedebugtokenrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeDebugToken")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.exchangeDebugToken" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppCheckToken.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 *ProjectsAppsExchangeDebugTokenCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppCheckToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppCheckToken{
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
}
type ProjectsAppsExchangeDeviceCheckTokenCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangedevicechecktokenrequest *GoogleFirebaseAppcheckV1ExchangeDeviceCheckTokenRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeDeviceCheckToken: Accepts a `device_token`
// (https://developer.apple.com/documentation/devicecheck/dcdevice) issued by
// DeviceCheck, and attempts to validate it with Apple. If valid, returns an
// AppCheckToken.
//
// - app: The relative resource name of the iOS app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) ExchangeDeviceCheckToken(appid string, googlefirebaseappcheckv1exchangedevicechecktokenrequest *GoogleFirebaseAppcheckV1ExchangeDeviceCheckTokenRequest) *ProjectsAppsExchangeDeviceCheckTokenCall {
c := &ProjectsAppsExchangeDeviceCheckTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangedevicechecktokenrequest = googlefirebaseappcheckv1exchangedevicechecktokenrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsExchangeDeviceCheckTokenCall) Fields(s ...googleapi.Field) *ProjectsAppsExchangeDeviceCheckTokenCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsExchangeDeviceCheckTokenCall) Context(ctx context.Context) *ProjectsAppsExchangeDeviceCheckTokenCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsExchangeDeviceCheckTokenCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsExchangeDeviceCheckTokenCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangedevicechecktokenrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeDeviceCheckToken")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.exchangeDeviceCheckToken" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppCheckToken.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 *ProjectsAppsExchangeDeviceCheckTokenCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppCheckToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppCheckToken{
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
}
type ProjectsAppsExchangePlayIntegrityTokenCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangeplayintegritytokenrequest *GoogleFirebaseAppcheckV1ExchangePlayIntegrityTokenRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangePlayIntegrityToken: Validates an integrity verdict response token
// from Play Integrity
// (https://developer.android.com/google/play/integrity/verdict#decrypt-verify).
// If valid, returns an AppCheckToken.
//
// - app: The relative resource name of the Android app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) ExchangePlayIntegrityToken(appid string, googlefirebaseappcheckv1exchangeplayintegritytokenrequest *GoogleFirebaseAppcheckV1ExchangePlayIntegrityTokenRequest) *ProjectsAppsExchangePlayIntegrityTokenCall {
c := &ProjectsAppsExchangePlayIntegrityTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangeplayintegritytokenrequest = googlefirebaseappcheckv1exchangeplayintegritytokenrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsExchangePlayIntegrityTokenCall) Fields(s ...googleapi.Field) *ProjectsAppsExchangePlayIntegrityTokenCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsExchangePlayIntegrityTokenCall) Context(ctx context.Context) *ProjectsAppsExchangePlayIntegrityTokenCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsExchangePlayIntegrityTokenCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsExchangePlayIntegrityTokenCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangeplayintegritytokenrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangePlayIntegrityToken")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.exchangePlayIntegrityToken" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppCheckToken.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 *ProjectsAppsExchangePlayIntegrityTokenCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppCheckToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppCheckToken{
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
}
type ProjectsAppsExchangeRecaptchaEnterpriseTokenCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangerecaptchaenterprisetokenrequest *GoogleFirebaseAppcheckV1ExchangeRecaptchaEnterpriseTokenRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeRecaptchaEnterpriseToken: Validates a reCAPTCHA Enterprise response
// token
// (https://cloud.google.com/recaptcha-enterprise/docs/create-assessment#retrieve_token).
// If valid, returns an AppCheckToken.
//
// - app: The relative resource name of the web app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) ExchangeRecaptchaEnterpriseToken(appid string, googlefirebaseappcheckv1exchangerecaptchaenterprisetokenrequest *GoogleFirebaseAppcheckV1ExchangeRecaptchaEnterpriseTokenRequest) *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall {
c := &ProjectsAppsExchangeRecaptchaEnterpriseTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangerecaptchaenterprisetokenrequest = googlefirebaseappcheckv1exchangerecaptchaenterprisetokenrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall) Fields(s ...googleapi.Field) *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall) Context(ctx context.Context) *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangerecaptchaenterprisetokenrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeRecaptchaEnterpriseToken")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.exchangeRecaptchaEnterpriseToken" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppCheckToken.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 *ProjectsAppsExchangeRecaptchaEnterpriseTokenCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppCheckToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppCheckToken{
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
}
type ProjectsAppsExchangeRecaptchaV3TokenCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangerecaptchav3tokenrequest *GoogleFirebaseAppcheckV1ExchangeRecaptchaV3TokenRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeRecaptchaV3Token: Validates a reCAPTCHA v3 response token
// (https://developers.google.com/recaptcha/docs/v3). If valid, returns an
// AppCheckToken.
//
// - app: The relative resource name of the web app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) ExchangeRecaptchaV3Token(appid string, googlefirebaseappcheckv1exchangerecaptchav3tokenrequest *GoogleFirebaseAppcheckV1ExchangeRecaptchaV3TokenRequest) *ProjectsAppsExchangeRecaptchaV3TokenCall {
c := &ProjectsAppsExchangeRecaptchaV3TokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangerecaptchav3tokenrequest = googlefirebaseappcheckv1exchangerecaptchav3tokenrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsExchangeRecaptchaV3TokenCall) Fields(s ...googleapi.Field) *ProjectsAppsExchangeRecaptchaV3TokenCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsExchangeRecaptchaV3TokenCall) Context(ctx context.Context) *ProjectsAppsExchangeRecaptchaV3TokenCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsExchangeRecaptchaV3TokenCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsExchangeRecaptchaV3TokenCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangerecaptchav3tokenrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeRecaptchaV3Token")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.exchangeRecaptchaV3Token" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppCheckToken.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 *ProjectsAppsExchangeRecaptchaV3TokenCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppCheckToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppCheckToken{
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
}
type ProjectsAppsExchangeSafetyNetTokenCall struct {
s *Service
appid string
googlefirebaseappcheckv1exchangesafetynettokenrequest *GoogleFirebaseAppcheckV1ExchangeSafetyNetTokenRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ExchangeSafetyNetToken: Validates a SafetyNet token
// (https://developer.android.com/training/safetynet/attestation#request-attestation-step).
// If valid, returns an AppCheckToken.
//
// - app: The relative resource name of the Android app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) ExchangeSafetyNetToken(appid string, googlefirebaseappcheckv1exchangesafetynettokenrequest *GoogleFirebaseAppcheckV1ExchangeSafetyNetTokenRequest) *ProjectsAppsExchangeSafetyNetTokenCall {
c := &ProjectsAppsExchangeSafetyNetTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1exchangesafetynettokenrequest = googlefirebaseappcheckv1exchangesafetynettokenrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsExchangeSafetyNetTokenCall) Fields(s ...googleapi.Field) *ProjectsAppsExchangeSafetyNetTokenCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsExchangeSafetyNetTokenCall) Context(ctx context.Context) *ProjectsAppsExchangeSafetyNetTokenCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsExchangeSafetyNetTokenCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsExchangeSafetyNetTokenCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1exchangesafetynettokenrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:exchangeSafetyNetToken")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.exchangeSafetyNetToken" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppCheckToken.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 *ProjectsAppsExchangeSafetyNetTokenCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppCheckToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppCheckToken{
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
}
type ProjectsAppsGenerateAppAttestChallengeCall struct {
s *Service
appid string
googlefirebaseappcheckv1generateappattestchallengerequest *GoogleFirebaseAppcheckV1GenerateAppAttestChallengeRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// GenerateAppAttestChallenge: Generates a challenge that protects the
// integrity of an immediately following call to ExchangeAppAttestAttestation
// or ExchangeAppAttestAssertion. A challenge should not be reused for multiple
// calls.
//
// - app: The relative resource name of the iOS app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) GenerateAppAttestChallenge(appid string, googlefirebaseappcheckv1generateappattestchallengerequest *GoogleFirebaseAppcheckV1GenerateAppAttestChallengeRequest) *ProjectsAppsGenerateAppAttestChallengeCall {
c := &ProjectsAppsGenerateAppAttestChallengeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1generateappattestchallengerequest = googlefirebaseappcheckv1generateappattestchallengerequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsGenerateAppAttestChallengeCall) Fields(s ...googleapi.Field) *ProjectsAppsGenerateAppAttestChallengeCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsGenerateAppAttestChallengeCall) Context(ctx context.Context) *ProjectsAppsGenerateAppAttestChallengeCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsGenerateAppAttestChallengeCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsGenerateAppAttestChallengeCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1generateappattestchallengerequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:generateAppAttestChallenge")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.generateAppAttestChallenge" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse.ServerResponse.He
// ader 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 *ProjectsAppsGenerateAppAttestChallengeCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse{
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
}
type ProjectsAppsGeneratePlayIntegrityChallengeCall struct {
s *Service
appid string
googlefirebaseappcheckv1generateplayintegritychallengerequest *GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// GeneratePlayIntegrityChallenge: Generates a challenge that protects the
// integrity of an immediately following integrity verdict request to the Play
// Integrity API. The next call to ExchangePlayIntegrityToken using the
// resulting integrity token will verify the presence and validity of the
// challenge. A challenge should not be reused for multiple calls.
//
// - app: The relative resource name of the app, in the format: ```
// projects/{project_number}/apps/{app_id} ``` If necessary, the
// `project_number` element can be replaced with the project ID of the
// Firebase project. Learn more about using project identifiers in Google's
// AIP 2510 (https://google.aip.dev/cloud/2510) standard.
func (r *ProjectsAppsService) GeneratePlayIntegrityChallenge(appid string, googlefirebaseappcheckv1generateplayintegritychallengerequest *GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeRequest) *ProjectsAppsGeneratePlayIntegrityChallengeCall {
c := &ProjectsAppsGeneratePlayIntegrityChallengeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.appid = appid
c.googlefirebaseappcheckv1generateplayintegritychallengerequest = googlefirebaseappcheckv1generateplayintegritychallengerequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsGeneratePlayIntegrityChallengeCall) Fields(s ...googleapi.Field) *ProjectsAppsGeneratePlayIntegrityChallengeCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsGeneratePlayIntegrityChallengeCall) Context(ctx context.Context) *ProjectsAppsGeneratePlayIntegrityChallengeCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsGeneratePlayIntegrityChallengeCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsGeneratePlayIntegrityChallengeCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1generateplayintegritychallengerequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+app}:generatePlayIntegrityChallenge")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"app": c.appid,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.generatePlayIntegrityChallenge" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeResponse.ServerRespons
// e.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 *ProjectsAppsGeneratePlayIntegrityChallengeCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeResponse{
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
}
type ProjectsAppsAppAttestConfigBatchGetCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// BatchGet: Atomically gets the AppAttestConfigs for the specified list of
// apps.
//
// - parent: The parent project name shared by all AppAttestConfigs being
// retrieved, in the format ``` projects/{project_number} ``` The parent
// collection in the `name` field of any resource being retrieved must match
// this field, or the entire batch fails.
func (r *ProjectsAppsAppAttestConfigService) BatchGet(parent string) *ProjectsAppsAppAttestConfigBatchGetCall {
c := &ProjectsAppsAppAttestConfigBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// Names sets the optional parameter "names": Required. The relative resource
// names of the AppAttestConfigs to retrieve, in the format ```
// projects/{project_number}/apps/{app_id}/appAttestConfig ``` A maximum of 100
// objects can be retrieved in a batch.
func (c *ProjectsAppsAppAttestConfigBatchGetCall) Names(names ...string) *ProjectsAppsAppAttestConfigBatchGetCall {
c.urlParams_.SetMulti("names", append([]string{}, names...))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsAppAttestConfigBatchGetCall) Fields(s ...googleapi.Field) *ProjectsAppsAppAttestConfigBatchGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsAppAttestConfigBatchGetCall) IfNoneMatch(entityTag string) *ProjectsAppsAppAttestConfigBatchGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsAppAttestConfigBatchGetCall) Context(ctx context.Context) *ProjectsAppsAppAttestConfigBatchGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsAppAttestConfigBatchGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsAppAttestConfigBatchGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/appAttestConfig:batchGet")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.appAttestConfig.batchGet" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1BatchGetAppAttestConfigsResponse.ServerResponse.Head
// er 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 *ProjectsAppsAppAttestConfigBatchGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1BatchGetAppAttestConfigsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1BatchGetAppAttestConfigsResponse{
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
}
type ProjectsAppsAppAttestConfigGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the AppAttestConfig for the specified app.
//
// - name: The relative resource name of the AppAttestConfig, in the format:
// ``` projects/{project_number}/apps/{app_id}/appAttestConfig ```.
func (r *ProjectsAppsAppAttestConfigService) Get(name string) *ProjectsAppsAppAttestConfigGetCall {
c := &ProjectsAppsAppAttestConfigGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsAppAttestConfigGetCall) Fields(s ...googleapi.Field) *ProjectsAppsAppAttestConfigGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsAppAttestConfigGetCall) IfNoneMatch(entityTag string) *ProjectsAppsAppAttestConfigGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsAppAttestConfigGetCall) Context(ctx context.Context) *ProjectsAppsAppAttestConfigGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsAppAttestConfigGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsAppAttestConfigGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.appAttestConfig.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppAttestConfig.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 *ProjectsAppsAppAttestConfigGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppAttestConfig, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppAttestConfig{
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
}
type ProjectsAppsAppAttestConfigPatchCall struct {
s *Service
name string
googlefirebaseappcheckv1appattestconfig *GoogleFirebaseAppcheckV1AppAttestConfig
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates the AppAttestConfig for the specified app. While this
// configuration is incomplete or invalid, the app will be unable to exchange
// AppAttest tokens for App Check tokens.
//
// - name: The relative resource name of the App Attest configuration object,
// in the format: ``` projects/{project_number}/apps/{app_id}/appAttestConfig
// ```.
func (r *ProjectsAppsAppAttestConfigService) Patch(name string, googlefirebaseappcheckv1appattestconfig *GoogleFirebaseAppcheckV1AppAttestConfig) *ProjectsAppsAppAttestConfigPatchCall {
c := &ProjectsAppsAppAttestConfigPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.googlefirebaseappcheckv1appattestconfig = googlefirebaseappcheckv1appattestconfig
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// comma-separated list of names of fields in the AppAttestConfig to update.
// Example: `token_ttl`.
func (c *ProjectsAppsAppAttestConfigPatchCall) UpdateMask(updateMask string) *ProjectsAppsAppAttestConfigPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsAppAttestConfigPatchCall) Fields(s ...googleapi.Field) *ProjectsAppsAppAttestConfigPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsAppAttestConfigPatchCall) Context(ctx context.Context) *ProjectsAppsAppAttestConfigPatchCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsAppAttestConfigPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsAppAttestConfigPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1appattestconfig)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.appAttestConfig.patch" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1AppAttestConfig.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 *ProjectsAppsAppAttestConfigPatchCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1AppAttestConfig, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1AppAttestConfig{
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
}
type ProjectsAppsDebugTokensCreateCall struct {
s *Service
parent string
googlefirebaseappcheckv1debugtoken *GoogleFirebaseAppcheckV1DebugToken
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a new DebugToken for the specified app. For security
// reasons, after the creation operation completes, the `token` field cannot be
// updated or retrieved, but you can revoke the debug token using
// DeleteDebugToken. Each app can have a maximum of 20 debug tokens.
//
// - parent: The relative resource name of the parent app in which the
// specified DebugToken will be created, in the format: ```
// projects/{project_number}/apps/{app_id} ```.
func (r *ProjectsAppsDebugTokensService) Create(parent string, googlefirebaseappcheckv1debugtoken *GoogleFirebaseAppcheckV1DebugToken) *ProjectsAppsDebugTokensCreateCall {
c := &ProjectsAppsDebugTokensCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.googlefirebaseappcheckv1debugtoken = googlefirebaseappcheckv1debugtoken
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsDebugTokensCreateCall) Fields(s ...googleapi.Field) *ProjectsAppsDebugTokensCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsDebugTokensCreateCall) Context(ctx context.Context) *ProjectsAppsDebugTokensCreateCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsDebugTokensCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsDebugTokensCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1debugtoken)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/debugTokens")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.debugTokens.create" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1DebugToken.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 *ProjectsAppsDebugTokensCreateCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1DebugToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1DebugToken{
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
}
type ProjectsAppsDebugTokensDeleteCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes the specified DebugToken. A deleted debug token cannot be
// used to exchange for an App Check token. Use this method when you suspect
// the secret `token` has been compromised or when you no longer need the debug
// token.
//
// - name: The relative resource name of the DebugToken to delete, in the
// format: ```
// projects/{project_number}/apps/{app_id}/debugTokens/{debug_token_id} ```.
func (r *ProjectsAppsDebugTokensService) Delete(name string) *ProjectsAppsDebugTokensDeleteCall {
c := &ProjectsAppsDebugTokensDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsDebugTokensDeleteCall) Fields(s ...googleapi.Field) *ProjectsAppsDebugTokensDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsDebugTokensDeleteCall) Context(ctx context.Context) *ProjectsAppsDebugTokensDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsDebugTokensDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsDebugTokensDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.debugTokens.delete" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleProtobufEmpty.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 *ProjectsAppsDebugTokensDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleProtobufEmpty{
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
}
type ProjectsAppsDebugTokensGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the specified DebugToken. For security reasons, the `token` field
// is never populated in the response.
//
// - name: The relative resource name of the debug token, in the format: ```
// projects/{project_number}/apps/{app_id}/debugTokens/{debug_token_id} ```.
func (r *ProjectsAppsDebugTokensService) Get(name string) *ProjectsAppsDebugTokensGetCall {
c := &ProjectsAppsDebugTokensGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsDebugTokensGetCall) Fields(s ...googleapi.Field) *ProjectsAppsDebugTokensGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsDebugTokensGetCall) IfNoneMatch(entityTag string) *ProjectsAppsDebugTokensGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsDebugTokensGetCall) Context(ctx context.Context) *ProjectsAppsDebugTokensGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsDebugTokensGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsDebugTokensGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.debugTokens.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1DebugToken.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 *ProjectsAppsDebugTokensGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1DebugToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1DebugToken{
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
}
type ProjectsAppsDebugTokensListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists all DebugTokens for the specified app. For security reasons, the
// `token` field is never populated in the response.
//
// - parent: The relative resource name of the parent app for which to list
// each associated DebugToken, in the format: ```
// projects/{project_number}/apps/{app_id} ```.
func (r *ProjectsAppsDebugTokensService) List(parent string) *ProjectsAppsDebugTokensListCall {
c := &ProjectsAppsDebugTokensListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number of
// DebugTokens to return in the response. Note that an app can have at most 20
// debug tokens. The server may return fewer than this at its own discretion.
// If no value is specified (or too large a value is specified), the server
// will impose its own limit.
func (c *ProjectsAppsDebugTokensListCall) PageSize(pageSize int64) *ProjectsAppsDebugTokensListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": Token returned from a
// previous call to ListDebugTokens indicating where in the set of DebugTokens
// to resume listing. Provide this to retrieve the subsequent page. When
// paginating, all other parameters provided to ListDebugTokens must match the
// call that provided the page token; if they do not match, the result is
// undefined.
func (c *ProjectsAppsDebugTokensListCall) PageToken(pageToken string) *ProjectsAppsDebugTokensListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsDebugTokensListCall) Fields(s ...googleapi.Field) *ProjectsAppsDebugTokensListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsDebugTokensListCall) IfNoneMatch(entityTag string) *ProjectsAppsDebugTokensListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsDebugTokensListCall) Context(ctx context.Context) *ProjectsAppsDebugTokensListCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsDebugTokensListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsDebugTokensListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/debugTokens")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.debugTokens.list" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1ListDebugTokensResponse.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 *ProjectsAppsDebugTokensListCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1ListDebugTokensResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1ListDebugTokensResponse{
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
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *ProjectsAppsDebugTokensListCall) Pages(ctx context.Context, f func(*GoogleFirebaseAppcheckV1ListDebugTokensResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken"))
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
type ProjectsAppsDebugTokensPatchCall struct {
s *Service
name string
googlefirebaseappcheckv1debugtoken *GoogleFirebaseAppcheckV1DebugToken
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates the specified DebugToken. For security reasons, the `token`
// field cannot be updated, nor will it be populated in the response, but you
// can revoke the debug token using DeleteDebugToken.
//
// - name: The relative resource name of the debug token, in the format: ```
// projects/{project_number}/apps/{app_id}/debugTokens/{debug_token_id} ```.
func (r *ProjectsAppsDebugTokensService) Patch(name string, googlefirebaseappcheckv1debugtoken *GoogleFirebaseAppcheckV1DebugToken) *ProjectsAppsDebugTokensPatchCall {
c := &ProjectsAppsDebugTokensPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.googlefirebaseappcheckv1debugtoken = googlefirebaseappcheckv1debugtoken
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// comma-separated list of names of fields in the DebugToken to update.
// Example: `display_name`.
func (c *ProjectsAppsDebugTokensPatchCall) UpdateMask(updateMask string) *ProjectsAppsDebugTokensPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsDebugTokensPatchCall) Fields(s ...googleapi.Field) *ProjectsAppsDebugTokensPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsDebugTokensPatchCall) Context(ctx context.Context) *ProjectsAppsDebugTokensPatchCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsDebugTokensPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsDebugTokensPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1debugtoken)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.debugTokens.patch" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1DebugToken.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 *ProjectsAppsDebugTokensPatchCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1DebugToken, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1DebugToken{
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
}
type ProjectsAppsDeviceCheckConfigBatchGetCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// BatchGet: Atomically gets the DeviceCheckConfigs for the specified list of
// apps. For security reasons, the `private_key` field is never populated in
// the response.
//
// - parent: The parent project name shared by all DeviceCheckConfigs being
// retrieved, in the format ``` projects/{project_number} ``` The parent
// collection in the `name` field of any resource being retrieved must match
// this field, or the entire batch fails.
func (r *ProjectsAppsDeviceCheckConfigService) BatchGet(parent string) *ProjectsAppsDeviceCheckConfigBatchGetCall {
c := &ProjectsAppsDeviceCheckConfigBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// Names sets the optional parameter "names": Required. The relative resource
// names of the DeviceCheckConfigs to retrieve, in the format ```
// projects/{project_number}/apps/{app_id}/deviceCheckConfig ``` A maximum of
// 100 objects can be retrieved in a batch.
func (c *ProjectsAppsDeviceCheckConfigBatchGetCall) Names(names ...string) *ProjectsAppsDeviceCheckConfigBatchGetCall {
c.urlParams_.SetMulti("names", append([]string{}, names...))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsDeviceCheckConfigBatchGetCall) Fields(s ...googleapi.Field) *ProjectsAppsDeviceCheckConfigBatchGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsDeviceCheckConfigBatchGetCall) IfNoneMatch(entityTag string) *ProjectsAppsDeviceCheckConfigBatchGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsDeviceCheckConfigBatchGetCall) Context(ctx context.Context) *ProjectsAppsDeviceCheckConfigBatchGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsDeviceCheckConfigBatchGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsDeviceCheckConfigBatchGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/deviceCheckConfig:batchGet")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.deviceCheckConfig.batchGet" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1BatchGetDeviceCheckConfigsResponse.ServerResponse.He
// ader 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 *ProjectsAppsDeviceCheckConfigBatchGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1BatchGetDeviceCheckConfigsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1BatchGetDeviceCheckConfigsResponse{
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
}
type ProjectsAppsDeviceCheckConfigGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the DeviceCheckConfig for the specified app. For security reasons,
// the `private_key` field is never populated in the response.
//
// - name: The relative resource name of the DeviceCheckConfig, in the format:
// ``` projects/{project_number}/apps/{app_id}/deviceCheckConfig ```.
func (r *ProjectsAppsDeviceCheckConfigService) Get(name string) *ProjectsAppsDeviceCheckConfigGetCall {
c := &ProjectsAppsDeviceCheckConfigGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsDeviceCheckConfigGetCall) Fields(s ...googleapi.Field) *ProjectsAppsDeviceCheckConfigGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsDeviceCheckConfigGetCall) IfNoneMatch(entityTag string) *ProjectsAppsDeviceCheckConfigGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsDeviceCheckConfigGetCall) Context(ctx context.Context) *ProjectsAppsDeviceCheckConfigGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsDeviceCheckConfigGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsDeviceCheckConfigGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.deviceCheckConfig.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1DeviceCheckConfig.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 *ProjectsAppsDeviceCheckConfigGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1DeviceCheckConfig, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1DeviceCheckConfig{
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
}
type ProjectsAppsDeviceCheckConfigPatchCall struct {
s *Service
name string
googlefirebaseappcheckv1devicecheckconfig *GoogleFirebaseAppcheckV1DeviceCheckConfig
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates the DeviceCheckConfig for the specified app. While this
// configuration is incomplete or invalid, the app will be unable to exchange
// DeviceCheck tokens for App Check tokens. For security reasons, the
// `private_key` field is never populated in the response.
//
// - name: The relative resource name of the DeviceCheck configuration object,
// in the format: ```
// projects/{project_number}/apps/{app_id}/deviceCheckConfig ```.
func (r *ProjectsAppsDeviceCheckConfigService) Patch(name string, googlefirebaseappcheckv1devicecheckconfig *GoogleFirebaseAppcheckV1DeviceCheckConfig) *ProjectsAppsDeviceCheckConfigPatchCall {
c := &ProjectsAppsDeviceCheckConfigPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.googlefirebaseappcheckv1devicecheckconfig = googlefirebaseappcheckv1devicecheckconfig
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// comma-separated list of names of fields in the DeviceCheckConfig to update.
// Example: `key_id,private_key`.
func (c *ProjectsAppsDeviceCheckConfigPatchCall) UpdateMask(updateMask string) *ProjectsAppsDeviceCheckConfigPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsDeviceCheckConfigPatchCall) Fields(s ...googleapi.Field) *ProjectsAppsDeviceCheckConfigPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsDeviceCheckConfigPatchCall) Context(ctx context.Context) *ProjectsAppsDeviceCheckConfigPatchCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsDeviceCheckConfigPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsDeviceCheckConfigPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1devicecheckconfig)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.deviceCheckConfig.patch" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1DeviceCheckConfig.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 *ProjectsAppsDeviceCheckConfigPatchCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1DeviceCheckConfig, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1DeviceCheckConfig{
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
}
type ProjectsAppsPlayIntegrityConfigBatchGetCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// BatchGet: Atomically gets the PlayIntegrityConfigs for the specified list of
// apps.
//
// - parent: The parent project name shared by all PlayIntegrityConfigs being
// retrieved, in the format ``` projects/{project_number} ``` The parent
// collection in the `name` field of any resource being retrieved must match
// this field, or the entire batch fails.
func (r *ProjectsAppsPlayIntegrityConfigService) BatchGet(parent string) *ProjectsAppsPlayIntegrityConfigBatchGetCall {
c := &ProjectsAppsPlayIntegrityConfigBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// Names sets the optional parameter "names": Required. The relative resource
// names of the PlayIntegrityConfigs to retrieve, in the format ```
// projects/{project_number}/apps/{app_id}/playIntegrityConfig ``` A maximum of
// 100 objects can be retrieved in a batch.
func (c *ProjectsAppsPlayIntegrityConfigBatchGetCall) Names(names ...string) *ProjectsAppsPlayIntegrityConfigBatchGetCall {
c.urlParams_.SetMulti("names", append([]string{}, names...))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsPlayIntegrityConfigBatchGetCall) Fields(s ...googleapi.Field) *ProjectsAppsPlayIntegrityConfigBatchGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsPlayIntegrityConfigBatchGetCall) IfNoneMatch(entityTag string) *ProjectsAppsPlayIntegrityConfigBatchGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsPlayIntegrityConfigBatchGetCall) Context(ctx context.Context) *ProjectsAppsPlayIntegrityConfigBatchGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsPlayIntegrityConfigBatchGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsPlayIntegrityConfigBatchGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/playIntegrityConfig:batchGet")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.playIntegrityConfig.batchGet" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1BatchGetPlayIntegrityConfigsResponse.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 *ProjectsAppsPlayIntegrityConfigBatchGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1BatchGetPlayIntegrityConfigsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1BatchGetPlayIntegrityConfigsResponse{
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
}
type ProjectsAppsPlayIntegrityConfigGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the PlayIntegrityConfig for the specified app.
//
// - name: The relative resource name of the PlayIntegrityConfig, in the
// format: ``` projects/{project_number}/apps/{app_id}/playIntegrityConfig
// ```.
func (r *ProjectsAppsPlayIntegrityConfigService) Get(name string) *ProjectsAppsPlayIntegrityConfigGetCall {
c := &ProjectsAppsPlayIntegrityConfigGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsPlayIntegrityConfigGetCall) Fields(s ...googleapi.Field) *ProjectsAppsPlayIntegrityConfigGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsPlayIntegrityConfigGetCall) IfNoneMatch(entityTag string) *ProjectsAppsPlayIntegrityConfigGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsPlayIntegrityConfigGetCall) Context(ctx context.Context) *ProjectsAppsPlayIntegrityConfigGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsPlayIntegrityConfigGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsPlayIntegrityConfigGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.playIntegrityConfig.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1PlayIntegrityConfig.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 *ProjectsAppsPlayIntegrityConfigGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1PlayIntegrityConfig, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1PlayIntegrityConfig{
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
}
type ProjectsAppsPlayIntegrityConfigPatchCall struct {
s *Service
name string
googlefirebaseappcheckv1playintegrityconfig *GoogleFirebaseAppcheckV1PlayIntegrityConfig
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates the PlayIntegrityConfig for the specified app. While this
// configuration is incomplete or invalid, the app will be unable to exchange
// Play Integrity tokens for App Check tokens.
//
// - name: The relative resource name of the Play Integrity configuration
// object, in the format: ```
// projects/{project_number}/apps/{app_id}/playIntegrityConfig ```.
func (r *ProjectsAppsPlayIntegrityConfigService) Patch(name string, googlefirebaseappcheckv1playintegrityconfig *GoogleFirebaseAppcheckV1PlayIntegrityConfig) *ProjectsAppsPlayIntegrityConfigPatchCall {
c := &ProjectsAppsPlayIntegrityConfigPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.googlefirebaseappcheckv1playintegrityconfig = googlefirebaseappcheckv1playintegrityconfig
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// comma-separated list of names of fields in the PlayIntegrityConfig to
// update. Example: `token_ttl`.
func (c *ProjectsAppsPlayIntegrityConfigPatchCall) UpdateMask(updateMask string) *ProjectsAppsPlayIntegrityConfigPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsPlayIntegrityConfigPatchCall) Fields(s ...googleapi.Field) *ProjectsAppsPlayIntegrityConfigPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsPlayIntegrityConfigPatchCall) Context(ctx context.Context) *ProjectsAppsPlayIntegrityConfigPatchCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsPlayIntegrityConfigPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsPlayIntegrityConfigPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1playintegrityconfig)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.playIntegrityConfig.patch" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1PlayIntegrityConfig.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 *ProjectsAppsPlayIntegrityConfigPatchCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1PlayIntegrityConfig, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1PlayIntegrityConfig{
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
}
type ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// BatchGet: Atomically gets the RecaptchaEnterpriseConfigs for the specified
// list of apps.
//
// - parent: The parent project name shared by all RecaptchaEnterpriseConfigs
// being retrieved, in the format ``` projects/{project_number} ``` The
// parent collection in the `name` field of any resource being retrieved must
// match this field, or the entire batch fails.
func (r *ProjectsAppsRecaptchaEnterpriseConfigService) BatchGet(parent string) *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall {
c := &ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// Names sets the optional parameter "names": Required. The relative resource
// names of the RecaptchaEnterpriseConfigs to retrieve, in the format: ```
// projects/{project_number}/apps/{app_id}/recaptchaEnterpriseConfig ``` A
// maximum of 100 objects can be retrieved in a batch.
func (c *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall) Names(names ...string) *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall {
c.urlParams_.SetMulti("names", append([]string{}, names...))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall) Fields(s ...googleapi.Field) *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall) IfNoneMatch(entityTag string) *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall) Context(ctx context.Context) *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/recaptchaEnterpriseConfig:batchGet")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.recaptchaEnterpriseConfig.batchGet" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1BatchGetRecaptchaEnterpriseConfigsResponse.ServerRes
// ponse.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 *ProjectsAppsRecaptchaEnterpriseConfigBatchGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1BatchGetRecaptchaEnterpriseConfigsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1BatchGetRecaptchaEnterpriseConfigsResponse{
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
}
type ProjectsAppsRecaptchaEnterpriseConfigGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the RecaptchaEnterpriseConfig for the specified app.
//
// - name: The relative resource name of the RecaptchaEnterpriseConfig, in the
// format: ```
// projects/{project_number}/apps/{app_id}/recaptchaEnterpriseConfig ```.
func (r *ProjectsAppsRecaptchaEnterpriseConfigService) Get(name string) *ProjectsAppsRecaptchaEnterpriseConfigGetCall {
c := &ProjectsAppsRecaptchaEnterpriseConfigGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsRecaptchaEnterpriseConfigGetCall) Fields(s ...googleapi.Field) *ProjectsAppsRecaptchaEnterpriseConfigGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsRecaptchaEnterpriseConfigGetCall) IfNoneMatch(entityTag string) *ProjectsAppsRecaptchaEnterpriseConfigGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsRecaptchaEnterpriseConfigGetCall) Context(ctx context.Context) *ProjectsAppsRecaptchaEnterpriseConfigGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsRecaptchaEnterpriseConfigGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsRecaptchaEnterpriseConfigGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.recaptchaEnterpriseConfig.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig.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 *ProjectsAppsRecaptchaEnterpriseConfigGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig{
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
}
type ProjectsAppsRecaptchaEnterpriseConfigPatchCall struct {
s *Service
name string
googlefirebaseappcheckv1recaptchaenterpriseconfig *GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates the RecaptchaEnterpriseConfig for the specified app. While
// this configuration is incomplete or invalid, the app will be unable to
// exchange reCAPTCHA Enterprise tokens for App Check tokens.
//
// - name: The relative resource name of the reCAPTCHA Enterprise configuration
// object, in the format: ```
// projects/{project_number}/apps/{app_id}/recaptchaEnterpriseConfig ```.
func (r *ProjectsAppsRecaptchaEnterpriseConfigService) Patch(name string, googlefirebaseappcheckv1recaptchaenterpriseconfig *GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig) *ProjectsAppsRecaptchaEnterpriseConfigPatchCall {
c := &ProjectsAppsRecaptchaEnterpriseConfigPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.googlefirebaseappcheckv1recaptchaenterpriseconfig = googlefirebaseappcheckv1recaptchaenterpriseconfig
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// comma-separated list of names of fields in the RecaptchaEnterpriseConfig to
// update. Example: `site_key`.
func (c *ProjectsAppsRecaptchaEnterpriseConfigPatchCall) UpdateMask(updateMask string) *ProjectsAppsRecaptchaEnterpriseConfigPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsRecaptchaEnterpriseConfigPatchCall) Fields(s ...googleapi.Field) *ProjectsAppsRecaptchaEnterpriseConfigPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsRecaptchaEnterpriseConfigPatchCall) Context(ctx context.Context) *ProjectsAppsRecaptchaEnterpriseConfigPatchCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsRecaptchaEnterpriseConfigPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsRecaptchaEnterpriseConfigPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1recaptchaenterpriseconfig)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.recaptchaEnterpriseConfig.patch" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig.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 *ProjectsAppsRecaptchaEnterpriseConfigPatchCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1RecaptchaEnterpriseConfig{
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
}
type ProjectsAppsRecaptchaV3ConfigBatchGetCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// BatchGet: Atomically gets the RecaptchaV3Configs for the specified list of
// apps. For security reasons, the `site_secret` field is never populated in
// the response.
//
// - parent: The parent project name shared by all RecaptchaV3Configs being
// retrieved, in the format ``` projects/{project_number} ``` The parent
// collection in the `name` field of any resource being retrieved must match
// this field, or the entire batch fails.
func (r *ProjectsAppsRecaptchaV3ConfigService) BatchGet(parent string) *ProjectsAppsRecaptchaV3ConfigBatchGetCall {
c := &ProjectsAppsRecaptchaV3ConfigBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// Names sets the optional parameter "names": Required. The relative resource
// names of the RecaptchaV3Configs to retrieve, in the format: ```
// projects/{project_number}/apps/{app_id}/recaptchaV3Config ``` A maximum of
// 100 objects can be retrieved in a batch.
func (c *ProjectsAppsRecaptchaV3ConfigBatchGetCall) Names(names ...string) *ProjectsAppsRecaptchaV3ConfigBatchGetCall {
c.urlParams_.SetMulti("names", append([]string{}, names...))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsRecaptchaV3ConfigBatchGetCall) Fields(s ...googleapi.Field) *ProjectsAppsRecaptchaV3ConfigBatchGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsRecaptchaV3ConfigBatchGetCall) IfNoneMatch(entityTag string) *ProjectsAppsRecaptchaV3ConfigBatchGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsRecaptchaV3ConfigBatchGetCall) Context(ctx context.Context) *ProjectsAppsRecaptchaV3ConfigBatchGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsRecaptchaV3ConfigBatchGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsRecaptchaV3ConfigBatchGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/recaptchaV3Config:batchGet")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.recaptchaV3Config.batchGet" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1BatchGetRecaptchaV3ConfigsResponse.ServerResponse.He
// ader 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 *ProjectsAppsRecaptchaV3ConfigBatchGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1BatchGetRecaptchaV3ConfigsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1BatchGetRecaptchaV3ConfigsResponse{
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
}
type ProjectsAppsRecaptchaV3ConfigGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the RecaptchaV3Config for the specified app. For security reasons,
// the `site_secret` field is never populated in the response.
//
// - name: The relative resource name of the RecaptchaV3Config, in the format:
// ``` projects/{project_number}/apps/{app_id}/recaptchaV3Config ```.
func (r *ProjectsAppsRecaptchaV3ConfigService) Get(name string) *ProjectsAppsRecaptchaV3ConfigGetCall {
c := &ProjectsAppsRecaptchaV3ConfigGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsRecaptchaV3ConfigGetCall) Fields(s ...googleapi.Field) *ProjectsAppsRecaptchaV3ConfigGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsRecaptchaV3ConfigGetCall) IfNoneMatch(entityTag string) *ProjectsAppsRecaptchaV3ConfigGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsRecaptchaV3ConfigGetCall) Context(ctx context.Context) *ProjectsAppsRecaptchaV3ConfigGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsRecaptchaV3ConfigGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsRecaptchaV3ConfigGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.recaptchaV3Config.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1RecaptchaV3Config.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 *ProjectsAppsRecaptchaV3ConfigGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1RecaptchaV3Config, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1RecaptchaV3Config{
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
}
type ProjectsAppsRecaptchaV3ConfigPatchCall struct {
s *Service
name string
googlefirebaseappcheckv1recaptchav3config *GoogleFirebaseAppcheckV1RecaptchaV3Config
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates the RecaptchaV3Config for the specified app. While this
// configuration is incomplete or invalid, the app will be unable to exchange
// reCAPTCHA V3 tokens for App Check tokens. For security reasons, the
// `site_secret` field is never populated in the response.
//
// - name: The relative resource name of the reCAPTCHA v3 configuration object,
// in the format: ```
// projects/{project_number}/apps/{app_id}/recaptchaV3Config ```.
func (r *ProjectsAppsRecaptchaV3ConfigService) Patch(name string, googlefirebaseappcheckv1recaptchav3config *GoogleFirebaseAppcheckV1RecaptchaV3Config) *ProjectsAppsRecaptchaV3ConfigPatchCall {
c := &ProjectsAppsRecaptchaV3ConfigPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.googlefirebaseappcheckv1recaptchav3config = googlefirebaseappcheckv1recaptchav3config
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// comma-separated list of names of fields in the RecaptchaV3Config to update.
// Example: `site_secret`.
func (c *ProjectsAppsRecaptchaV3ConfigPatchCall) UpdateMask(updateMask string) *ProjectsAppsRecaptchaV3ConfigPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsRecaptchaV3ConfigPatchCall) Fields(s ...googleapi.Field) *ProjectsAppsRecaptchaV3ConfigPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsRecaptchaV3ConfigPatchCall) Context(ctx context.Context) *ProjectsAppsRecaptchaV3ConfigPatchCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsRecaptchaV3ConfigPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsRecaptchaV3ConfigPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1recaptchav3config)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.recaptchaV3Config.patch" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1RecaptchaV3Config.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 *ProjectsAppsRecaptchaV3ConfigPatchCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1RecaptchaV3Config, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1RecaptchaV3Config{
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
}
type ProjectsAppsSafetyNetConfigBatchGetCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// BatchGet: Atomically gets the SafetyNetConfigs for the specified list of
// apps.
//
// - parent: The parent project name shared by all SafetyNetConfigs being
// retrieved, in the format ``` projects/{project_number} ``` The parent
// collection in the `name` field of any resource being retrieved must match
// this field, or the entire batch fails.
func (r *ProjectsAppsSafetyNetConfigService) BatchGet(parent string) *ProjectsAppsSafetyNetConfigBatchGetCall {
c := &ProjectsAppsSafetyNetConfigBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// Names sets the optional parameter "names": Required. The relative resource
// names of the SafetyNetConfigs to retrieve, in the format ```
// projects/{project_number}/apps/{app_id}/safetyNetConfig ``` A maximum of 100
// objects can be retrieved in a batch.
func (c *ProjectsAppsSafetyNetConfigBatchGetCall) Names(names ...string) *ProjectsAppsSafetyNetConfigBatchGetCall {
c.urlParams_.SetMulti("names", append([]string{}, names...))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsSafetyNetConfigBatchGetCall) Fields(s ...googleapi.Field) *ProjectsAppsSafetyNetConfigBatchGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsSafetyNetConfigBatchGetCall) IfNoneMatch(entityTag string) *ProjectsAppsSafetyNetConfigBatchGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsSafetyNetConfigBatchGetCall) Context(ctx context.Context) *ProjectsAppsSafetyNetConfigBatchGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsSafetyNetConfigBatchGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsSafetyNetConfigBatchGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apps/-/safetyNetConfig:batchGet")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.safetyNetConfig.batchGet" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1BatchGetSafetyNetConfigsResponse.ServerResponse.Head
// er 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 *ProjectsAppsSafetyNetConfigBatchGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1BatchGetSafetyNetConfigsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1BatchGetSafetyNetConfigsResponse{
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
}
type ProjectsAppsSafetyNetConfigGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the SafetyNetConfig for the specified app.
//
// - name: The relative resource name of the SafetyNetConfig, in the format:
// ``` projects/{project_number}/apps/{app_id}/safetyNetConfig ```.
func (r *ProjectsAppsSafetyNetConfigService) Get(name string) *ProjectsAppsSafetyNetConfigGetCall {
c := &ProjectsAppsSafetyNetConfigGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsSafetyNetConfigGetCall) Fields(s ...googleapi.Field) *ProjectsAppsSafetyNetConfigGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsAppsSafetyNetConfigGetCall) IfNoneMatch(entityTag string) *ProjectsAppsSafetyNetConfigGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsSafetyNetConfigGetCall) Context(ctx context.Context) *ProjectsAppsSafetyNetConfigGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsSafetyNetConfigGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsSafetyNetConfigGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.safetyNetConfig.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1SafetyNetConfig.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 *ProjectsAppsSafetyNetConfigGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1SafetyNetConfig, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1SafetyNetConfig{
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
}
type ProjectsAppsSafetyNetConfigPatchCall struct {
s *Service
name string
googlefirebaseappcheckv1safetynetconfig *GoogleFirebaseAppcheckV1SafetyNetConfig
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates the SafetyNetConfig for the specified app. While this
// configuration is incomplete or invalid, the app will be unable to exchange
// SafetyNet tokens for App Check tokens.
//
// - name: The relative resource name of the SafetyNet configuration object, in
// the format: ``` projects/{project_number}/apps/{app_id}/safetyNetConfig
// ```.
func (r *ProjectsAppsSafetyNetConfigService) Patch(name string, googlefirebaseappcheckv1safetynetconfig *GoogleFirebaseAppcheckV1SafetyNetConfig) *ProjectsAppsSafetyNetConfigPatchCall {
c := &ProjectsAppsSafetyNetConfigPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.googlefirebaseappcheckv1safetynetconfig = googlefirebaseappcheckv1safetynetconfig
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// comma-separated list of names of fields in the SafetyNetConfig to update.
// Example: `token_ttl`.
func (c *ProjectsAppsSafetyNetConfigPatchCall) UpdateMask(updateMask string) *ProjectsAppsSafetyNetConfigPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAppsSafetyNetConfigPatchCall) Fields(s ...googleapi.Field) *ProjectsAppsSafetyNetConfigPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAppsSafetyNetConfigPatchCall) Context(ctx context.Context) *ProjectsAppsSafetyNetConfigPatchCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAppsSafetyNetConfigPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAppsSafetyNetConfigPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1safetynetconfig)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.apps.safetyNetConfig.patch" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1SafetyNetConfig.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 *ProjectsAppsSafetyNetConfigPatchCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1SafetyNetConfig, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1SafetyNetConfig{
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
}
type ProjectsServicesBatchUpdateCall struct {
s *Service
parent string
googlefirebaseappcheckv1batchupdateservicesrequest *GoogleFirebaseAppcheckV1BatchUpdateServicesRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// BatchUpdate: Atomically updates the specified Service configurations.
//
// - parent: The parent project name shared by all Service configurations being
// updated, in the format ``` projects/{project_number} ``` The parent
// collection in the `name` field of any resource being updated must match
// this field, or the entire batch fails.
func (r *ProjectsServicesService) BatchUpdate(parent string, googlefirebaseappcheckv1batchupdateservicesrequest *GoogleFirebaseAppcheckV1BatchUpdateServicesRequest) *ProjectsServicesBatchUpdateCall {
c := &ProjectsServicesBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.googlefirebaseappcheckv1batchupdateservicesrequest = googlefirebaseappcheckv1batchupdateservicesrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsServicesBatchUpdateCall) Fields(s ...googleapi.Field) *ProjectsServicesBatchUpdateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsServicesBatchUpdateCall) Context(ctx context.Context) *ProjectsServicesBatchUpdateCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsServicesBatchUpdateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsServicesBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1batchupdateservicesrequest)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/services:batchUpdate")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.services.batchUpdate" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1BatchUpdateServicesResponse.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 *ProjectsServicesBatchUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1BatchUpdateServicesResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1BatchUpdateServicesResponse{
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
}
type ProjectsServicesGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the Service configuration for the specified service name.
//
// - name: The relative resource name of the Service to retrieve, in the
// format: ``` projects/{project_number}/services/{service_id} ``` Note that
// the `service_id` element must be a supported service ID. Currently, the
// following service IDs are supported: * `firebasestorage.googleapis.com`
// (Cloud Storage for Firebase) * `firebasedatabase.googleapis.com` (Firebase
// Realtime Database) * `firestore.googleapis.com` (Cloud Firestore).
func (r *ProjectsServicesService) Get(name string) *ProjectsServicesGetCall {
c := &ProjectsServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsServicesGetCall) Fields(s ...googleapi.Field) *ProjectsServicesGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsServicesGetCall) IfNoneMatch(entityTag string) *ProjectsServicesGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsServicesGetCall) Context(ctx context.Context) *ProjectsServicesGetCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsServicesGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsServicesGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.services.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1Service.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 *ProjectsServicesGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1Service, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1Service{
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
}
type ProjectsServicesListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists all Service configurations for the specified project. Only
// Services which were explicitly configured using UpdateService or
// BatchUpdateServices will be returned.
//
// - parent: The relative resource name of the parent project for which to list
// each associated Service, in the format: ``` projects/{project_number} ```.
func (r *ProjectsServicesService) List(parent string) *ProjectsServicesListCall {
c := &ProjectsServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number of
// Services to return in the response. Only explicitly configured services are
// returned. The server may return fewer than this at its own discretion. If no
// value is specified (or too large a value is specified), the server will
// impose its own limit.
func (c *ProjectsServicesListCall) PageSize(pageSize int64) *ProjectsServicesListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": Token returned from a
// previous call to ListServices indicating where in the set of Services to
// resume listing. Provide this to retrieve the subsequent page. When
// paginating, all other parameters provided to ListServices must match the
// call that provided the page token; if they do not match, the result is
// undefined.
func (c *ProjectsServicesListCall) PageToken(pageToken string) *ProjectsServicesListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsServicesListCall) Fields(s ...googleapi.Field) *ProjectsServicesListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// 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.
func (c *ProjectsServicesListCall) IfNoneMatch(entityTag string) *ProjectsServicesListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsServicesListCall) Context(ctx context.Context) *ProjectsServicesListCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsServicesListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsServicesListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/services")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.services.list" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1ListServicesResponse.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 *ProjectsServicesListCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1ListServicesResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1ListServicesResponse{
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
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *ProjectsServicesListCall) Pages(ctx context.Context, f func(*GoogleFirebaseAppcheckV1ListServicesResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken"))
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
type ProjectsServicesPatchCall struct {
s *Service
name string
googlefirebaseappcheckv1service *GoogleFirebaseAppcheckV1Service
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates the specified Service configuration.
//
// - name: The relative resource name of the service configuration object, in
// the format: ``` projects/{project_number}/services/{service_id} ``` Note
// that the `service_id` element must be a supported service ID. Currently,
// the following service IDs are supported: *
// `firebasestorage.googleapis.com` (Cloud Storage for Firebase) *
// `firebasedatabase.googleapis.com` (Firebase Realtime Database) *
// `firestore.googleapis.com` (Cloud Firestore).
func (r *ProjectsServicesService) Patch(name string, googlefirebaseappcheckv1service *GoogleFirebaseAppcheckV1Service) *ProjectsServicesPatchCall {
c := &ProjectsServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.googlefirebaseappcheckv1service = googlefirebaseappcheckv1service
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// comma-separated list of names of fields in the Service to update. Example:
// `enforcement_mode`.
func (c *ProjectsServicesPatchCall) UpdateMask(updateMask string) *ProjectsServicesPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsServicesPatchCall) Fields(s ...googleapi.Field) *ProjectsServicesPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsServicesPatchCall) Context(ctx context.Context) *ProjectsServicesPatchCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsServicesPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsServicesPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirebaseappcheckv1service)
if err != nil {
return nil, err
}
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebaseappcheck.projects.services.patch" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseAppcheckV1Service.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 *ProjectsServicesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseAppcheckV1Service, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
}
ret := &GoogleFirebaseAppcheckV1Service{
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
}