blob: 145261902372a43ca5bef1a7f168f7ee047ba78f [file] [log] [blame]
// Copyright 2020 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 logging provides access to the Cloud Logging API.
//
// This package is DEPRECATED. Use package cloud.google.com/go/logging instead.
//
// For product documentation, see: https://cloud.google.com/logging/docs/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/logging/v2"
// ...
// ctx := context.Background()
// loggingService, err := logging.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// loggingService, err := logging.NewService(ctx, option.WithScopes(logging.LoggingWriteScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// loggingService, err := logging.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// loggingService, err := logging.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package logging // import "google.golang.org/api/logging/v2"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "logging:v2"
const apiName = "logging"
const apiVersion = "v2"
const basePath = "https://logging.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// View your data across Google Cloud Platform services
CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
// Administrate log data for your projects
LoggingAdminScope = "https://www.googleapis.com/auth/logging.admin"
// View log data for your projects
LoggingReadScope = "https://www.googleapis.com/auth/logging.read"
// Submit log data for your projects
LoggingWriteScope = "https://www.googleapis.com/auth/logging.write"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/logging.admin",
"https://www.googleapis.com/auth/logging.read",
"https://www.googleapis.com/auth/logging.write",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
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.BillingAccounts = NewBillingAccountsService(s)
s.Entries = NewEntriesService(s)
s.Exclusions = NewExclusionsService(s)
s.Folders = NewFoldersService(s)
s.Locations = NewLocationsService(s)
s.Logs = NewLogsService(s)
s.MonitoredResourceDescriptors = NewMonitoredResourceDescriptorsService(s)
s.Organizations = NewOrganizationsService(s)
s.Projects = NewProjectsService(s)
s.Sinks = NewSinksService(s)
s.V2 = NewV2Service(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
BillingAccounts *BillingAccountsService
Entries *EntriesService
Exclusions *ExclusionsService
Folders *FoldersService
Locations *LocationsService
Logs *LogsService
MonitoredResourceDescriptors *MonitoredResourceDescriptorsService
Organizations *OrganizationsService
Projects *ProjectsService
Sinks *SinksService
V2 *V2Service
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewBillingAccountsService(s *Service) *BillingAccountsService {
rs := &BillingAccountsService{s: s}
rs.Buckets = NewBillingAccountsBucketsService(s)
rs.Exclusions = NewBillingAccountsExclusionsService(s)
rs.Locations = NewBillingAccountsLocationsService(s)
rs.Logs = NewBillingAccountsLogsService(s)
rs.Sinks = NewBillingAccountsSinksService(s)
return rs
}
type BillingAccountsService struct {
s *Service
Buckets *BillingAccountsBucketsService
Exclusions *BillingAccountsExclusionsService
Locations *BillingAccountsLocationsService
Logs *BillingAccountsLogsService
Sinks *BillingAccountsSinksService
}
func NewBillingAccountsBucketsService(s *Service) *BillingAccountsBucketsService {
rs := &BillingAccountsBucketsService{s: s}
return rs
}
type BillingAccountsBucketsService struct {
s *Service
}
func NewBillingAccountsExclusionsService(s *Service) *BillingAccountsExclusionsService {
rs := &BillingAccountsExclusionsService{s: s}
return rs
}
type BillingAccountsExclusionsService struct {
s *Service
}
func NewBillingAccountsLocationsService(s *Service) *BillingAccountsLocationsService {
rs := &BillingAccountsLocationsService{s: s}
rs.Buckets = NewBillingAccountsLocationsBucketsService(s)
return rs
}
type BillingAccountsLocationsService struct {
s *Service
Buckets *BillingAccountsLocationsBucketsService
}
func NewBillingAccountsLocationsBucketsService(s *Service) *BillingAccountsLocationsBucketsService {
rs := &BillingAccountsLocationsBucketsService{s: s}
return rs
}
type BillingAccountsLocationsBucketsService struct {
s *Service
}
func NewBillingAccountsLogsService(s *Service) *BillingAccountsLogsService {
rs := &BillingAccountsLogsService{s: s}
return rs
}
type BillingAccountsLogsService struct {
s *Service
}
func NewBillingAccountsSinksService(s *Service) *BillingAccountsSinksService {
rs := &BillingAccountsSinksService{s: s}
return rs
}
type BillingAccountsSinksService struct {
s *Service
}
func NewEntriesService(s *Service) *EntriesService {
rs := &EntriesService{s: s}
return rs
}
type EntriesService struct {
s *Service
}
func NewExclusionsService(s *Service) *ExclusionsService {
rs := &ExclusionsService{s: s}
return rs
}
type ExclusionsService struct {
s *Service
}
func NewFoldersService(s *Service) *FoldersService {
rs := &FoldersService{s: s}
rs.Exclusions = NewFoldersExclusionsService(s)
rs.Locations = NewFoldersLocationsService(s)
rs.Logs = NewFoldersLogsService(s)
rs.Sinks = NewFoldersSinksService(s)
return rs
}
type FoldersService struct {
s *Service
Exclusions *FoldersExclusionsService
Locations *FoldersLocationsService
Logs *FoldersLogsService
Sinks *FoldersSinksService
}
func NewFoldersExclusionsService(s *Service) *FoldersExclusionsService {
rs := &FoldersExclusionsService{s: s}
return rs
}
type FoldersExclusionsService struct {
s *Service
}
func NewFoldersLocationsService(s *Service) *FoldersLocationsService {
rs := &FoldersLocationsService{s: s}
rs.Buckets = NewFoldersLocationsBucketsService(s)
return rs
}
type FoldersLocationsService struct {
s *Service
Buckets *FoldersLocationsBucketsService
}
func NewFoldersLocationsBucketsService(s *Service) *FoldersLocationsBucketsService {
rs := &FoldersLocationsBucketsService{s: s}
return rs
}
type FoldersLocationsBucketsService struct {
s *Service
}
func NewFoldersLogsService(s *Service) *FoldersLogsService {
rs := &FoldersLogsService{s: s}
return rs
}
type FoldersLogsService struct {
s *Service
}
func NewFoldersSinksService(s *Service) *FoldersSinksService {
rs := &FoldersSinksService{s: s}
return rs
}
type FoldersSinksService struct {
s *Service
}
func NewLocationsService(s *Service) *LocationsService {
rs := &LocationsService{s: s}
rs.Buckets = NewLocationsBucketsService(s)
return rs
}
type LocationsService struct {
s *Service
Buckets *LocationsBucketsService
}
func NewLocationsBucketsService(s *Service) *LocationsBucketsService {
rs := &LocationsBucketsService{s: s}
return rs
}
type LocationsBucketsService struct {
s *Service
}
func NewLogsService(s *Service) *LogsService {
rs := &LogsService{s: s}
return rs
}
type LogsService struct {
s *Service
}
func NewMonitoredResourceDescriptorsService(s *Service) *MonitoredResourceDescriptorsService {
rs := &MonitoredResourceDescriptorsService{s: s}
return rs
}
type MonitoredResourceDescriptorsService struct {
s *Service
}
func NewOrganizationsService(s *Service) *OrganizationsService {
rs := &OrganizationsService{s: s}
rs.Exclusions = NewOrganizationsExclusionsService(s)
rs.Locations = NewOrganizationsLocationsService(s)
rs.Logs = NewOrganizationsLogsService(s)
rs.Sinks = NewOrganizationsSinksService(s)
return rs
}
type OrganizationsService struct {
s *Service
Exclusions *OrganizationsExclusionsService
Locations *OrganizationsLocationsService
Logs *OrganizationsLogsService
Sinks *OrganizationsSinksService
}
func NewOrganizationsExclusionsService(s *Service) *OrganizationsExclusionsService {
rs := &OrganizationsExclusionsService{s: s}
return rs
}
type OrganizationsExclusionsService struct {
s *Service
}
func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService {
rs := &OrganizationsLocationsService{s: s}
rs.Buckets = NewOrganizationsLocationsBucketsService(s)
return rs
}
type OrganizationsLocationsService struct {
s *Service
Buckets *OrganizationsLocationsBucketsService
}
func NewOrganizationsLocationsBucketsService(s *Service) *OrganizationsLocationsBucketsService {
rs := &OrganizationsLocationsBucketsService{s: s}
return rs
}
type OrganizationsLocationsBucketsService struct {
s *Service
}
func NewOrganizationsLogsService(s *Service) *OrganizationsLogsService {
rs := &OrganizationsLogsService{s: s}
return rs
}
type OrganizationsLogsService struct {
s *Service
}
func NewOrganizationsSinksService(s *Service) *OrganizationsSinksService {
rs := &OrganizationsSinksService{s: s}
return rs
}
type OrganizationsSinksService struct {
s *Service
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Exclusions = NewProjectsExclusionsService(s)
rs.Locations = NewProjectsLocationsService(s)
rs.Logs = NewProjectsLogsService(s)
rs.Metrics = NewProjectsMetricsService(s)
rs.Sinks = NewProjectsSinksService(s)
return rs
}
type ProjectsService struct {
s *Service
Exclusions *ProjectsExclusionsService
Locations *ProjectsLocationsService
Logs *ProjectsLogsService
Metrics *ProjectsMetricsService
Sinks *ProjectsSinksService
}
func NewProjectsExclusionsService(s *Service) *ProjectsExclusionsService {
rs := &ProjectsExclusionsService{s: s}
return rs
}
type ProjectsExclusionsService struct {
s *Service
}
func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
rs := &ProjectsLocationsService{s: s}
rs.Buckets = NewProjectsLocationsBucketsService(s)
return rs
}
type ProjectsLocationsService struct {
s *Service
Buckets *ProjectsLocationsBucketsService
}
func NewProjectsLocationsBucketsService(s *Service) *ProjectsLocationsBucketsService {
rs := &ProjectsLocationsBucketsService{s: s}
return rs
}
type ProjectsLocationsBucketsService struct {
s *Service
}
func NewProjectsLogsService(s *Service) *ProjectsLogsService {
rs := &ProjectsLogsService{s: s}
return rs
}
type ProjectsLogsService struct {
s *Service
}
func NewProjectsMetricsService(s *Service) *ProjectsMetricsService {
rs := &ProjectsMetricsService{s: s}
return rs
}
type ProjectsMetricsService struct {
s *Service
}
func NewProjectsSinksService(s *Service) *ProjectsSinksService {
rs := &ProjectsSinksService{s: s}
return rs
}
type ProjectsSinksService struct {
s *Service
}
func NewSinksService(s *Service) *SinksService {
rs := &SinksService{s: s}
return rs
}
type SinksService struct {
s *Service
}
func NewV2Service(s *Service) *V2Service {
rs := &V2Service{s: s}
return rs
}
type V2Service struct {
s *Service
}
// BigQueryOptions: Options that change functionality of a sink
// exporting data to BigQuery.
type BigQueryOptions struct {
// UsePartitionedTables: Optional. Whether to use BigQuery's partition
// tables (https://cloud.google.com/bigquery/docs/partitioned-tables).
// By default, Logging creates dated tables based on the log entries'
// timestamps, e.g. syslog_20170523. With partitioned tables the date
// suffix is no longer present and special query syntax
// (https://cloud.google.com/bigquery/docs/querying-partitioned-tables)
// has to be used instead. In both cases, tables are sharded based on
// UTC timezone.
UsePartitionedTables bool `json:"usePartitionedTables,omitempty"`
// UsesTimestampColumnPartitioning: Output only. True if new timestamp
// column based partitioning is in use, false if legacy ingestion-time
// partitioning is in use. All new sinks will have this field set true
// and will use timestamp column based partitioning. If
// use_partitioned_tables is false, this value has no meaning and will
// be false. Legacy sinks using partitioned tables will have this field
// set to false.
UsesTimestampColumnPartitioning bool `json:"usesTimestampColumnPartitioning,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "UsePartitionedTables") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "UsePartitionedTables") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BigQueryOptions) MarshalJSON() ([]byte, error) {
type NoMethod BigQueryOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketOptions: BucketOptions describes the bucket boundaries used to
// create a histogram for the distribution. The buckets can be in a
// linear sequence, an exponential sequence, or each bucket can be
// specified explicitly. BucketOptions does not include the number of
// values in each bucket.A bucket has an inclusive lower bound and
// exclusive upper bound for the values that are counted for that
// bucket. The upper bound of a bucket must be strictly greater than the
// lower bound. The sequence of N buckets for a distribution consists of
// an underflow bucket (number 0), zero or more finite buckets (number 1
// through N - 2) and an overflow bucket (number N - 1). The buckets are
// contiguous: the lower bound of bucket i (i > 0) is the same as the
// upper bound of bucket i - 1. The buckets span the whole range of
// finite values: lower bound of the underflow bucket is -infinity and
// the upper bound of the overflow bucket is +infinity. The finite
// buckets are so-called because both bounds are finite.
type BucketOptions struct {
// ExplicitBuckets: The explicit buckets.
ExplicitBuckets *Explicit `json:"explicitBuckets,omitempty"`
// ExponentialBuckets: The exponential buckets.
ExponentialBuckets *Exponential `json:"exponentialBuckets,omitempty"`
// LinearBuckets: The linear bucket.
LinearBuckets *Linear `json:"linearBuckets,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExplicitBuckets") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ExplicitBuckets") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BucketOptions) MarshalJSON() ([]byte, error) {
type NoMethod BucketOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CmekSettings: Describes the customer-managed encryption key (CMEK)
// settings associated with a project, folder, organization, billing
// account, or flexible resource.Note: CMEK for the Logs Router can
// currently only be configured for GCP organizations. Once configured,
// it applies to all projects and folders in the GCP organization.See
// Enabling CMEK for Logs Router
// (https://cloud.google.com/logging/docs/routing/managed-encryption)
// for more information.
type CmekSettings struct {
// KmsKeyName: The resource name for the configured Cloud KMS key.KMS
// key name format:
// "projects/PROJECT_ID/locations/LOCATION/keyRings/KEYRING/cryptoKeys/KE
// Y"For example:
// "projects/my-project-id/locations/my-region/keyRings/key-ring-name/cry
// ptoKeys/key-name"To enable CMEK for the Logs Router, set this field
// to a valid kms_key_name for which the associated service account has
// the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned
// for the key.The Cloud KMS key used by the Log Router can be updated
// by changing the kms_key_name to a new valid key name. Encryption
// operations that are in progress will be completed with the key that
// was in use when they started. Decryption operations will be completed
// using the key that was used at the time of encryption unless access
// to that key has been revoked.To disable CMEK for the Logs Router, set
// this field to an empty string.See Enabling CMEK for Logs Router
// (https://cloud.google.com/logging/docs/routing/managed-encryption)
// for more information.
KmsKeyName string `json:"kmsKeyName,omitempty"`
// Name: Output only. The resource name of the CMEK settings.
Name string `json:"name,omitempty"`
// ServiceAccountId: Output only. The service account that will be used
// by the Logs Router to access your Cloud KMS key.Before enabling CMEK
// for Logs Router, you must first assign the role
// roles/cloudkms.cryptoKeyEncrypterDecrypter to the service account
// that the Logs Router will use to access your Cloud KMS key. Use
// GetCmekSettings to obtain the service account ID.See Enabling CMEK
// for Logs Router
// (https://cloud.google.com/logging/docs/routing/managed-encryption)
// for more information.
ServiceAccountId string `json:"serviceAccountId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "KmsKeyName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "KmsKeyName") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CmekSettings) MarshalJSON() ([]byte, error) {
type NoMethod CmekSettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Empty: 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);
// }
// The JSON representation for Empty is empty JSON object {}.
type Empty struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// Explicit: Specifies a set of buckets with arbitrary widths.There are
// size(bounds) + 1 (= N) buckets. Bucket i has the following
// boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i <
// N); boundsi - 1The bounds field must contain at least one element. If
// bounds has only one element, then there are no finite buckets, and
// that single element is the common boundary of the overflow and
// underflow buckets.
type Explicit struct {
// Bounds: The values must be monotonically increasing.
Bounds []float64 `json:"bounds,omitempty"`
// ForceSendFields is a list of field names (e.g. "Bounds") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Bounds") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Explicit) MarshalJSON() ([]byte, error) {
type NoMethod Explicit
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Exponential: Specifies an exponential sequence of buckets that have a
// width that is proportional to the value of the lower bound. Each
// bucket represents a constant relative uncertainty on a specific value
// in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket
// i has the following boundaries:Upper bound (0 <= i < N-1): scale *
// (growth_factor ^ i). Lower bound (1 <= i < N): scale *
// (growth_factor ^ (i - 1)).
type Exponential struct {
// GrowthFactor: Must be greater than 1.
GrowthFactor float64 `json:"growthFactor,omitempty"`
// NumFiniteBuckets: Must be greater than 0.
NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
// Scale: Must be greater than 0.
Scale float64 `json:"scale,omitempty"`
// ForceSendFields is a list of field names (e.g. "GrowthFactor") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "GrowthFactor") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Exponential) MarshalJSON() ([]byte, error) {
type NoMethod Exponential
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *Exponential) UnmarshalJSON(data []byte) error {
type NoMethod Exponential
var s1 struct {
GrowthFactor gensupport.JSONFloat64 `json:"growthFactor"`
Scale gensupport.JSONFloat64 `json:"scale"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.GrowthFactor = float64(s1.GrowthFactor)
s.Scale = float64(s1.Scale)
return nil
}
// HttpRequest: A common proto for logging HTTP requests. Only contains
// semantics defined by the HTTP specification. Product-specific logging
// information MUST be defined in a separate message.
type HttpRequest struct {
// CacheFillBytes: The number of HTTP response bytes inserted into
// cache. Set only when a cache fill was attempted.
CacheFillBytes int64 `json:"cacheFillBytes,omitempty,string"`
// CacheHit: Whether or not an entity was served from cache (with or
// without validation).
CacheHit bool `json:"cacheHit,omitempty"`
// CacheLookup: Whether or not a cache lookup was attempted.
CacheLookup bool `json:"cacheLookup,omitempty"`
// CacheValidatedWithOriginServer: Whether or not the response was
// validated with the origin server before being served from cache. This
// field is only meaningful if cache_hit is True.
CacheValidatedWithOriginServer bool `json:"cacheValidatedWithOriginServer,omitempty"`
// Latency: The request processing latency on the server, from the time
// the request was received until the response was sent.
Latency string `json:"latency,omitempty"`
// Protocol: Protocol used for the request. Examples: "HTTP/1.1",
// "HTTP/2", "websocket"
Protocol string `json:"protocol,omitempty"`
// Referer: The referer URL of the request, as defined in HTTP/1.1
// Header Field Definitions
// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
Referer string `json:"referer,omitempty"`
// RemoteIp: The IP address (IPv4 or IPv6) of the client that issued the
// HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".
RemoteIp string `json:"remoteIp,omitempty"`
// RequestMethod: The request method. Examples: "GET", "HEAD", "PUT",
// "POST".
RequestMethod string `json:"requestMethod,omitempty"`
// RequestSize: The size of the HTTP request message in bytes, including
// the request headers and the request body.
RequestSize int64 `json:"requestSize,omitempty,string"`
// RequestUrl: The scheme (http, https), the host name, the path and the
// query portion of the URL that was requested. Example:
// "http://example.com/some/info?color=red".
RequestUrl string `json:"requestUrl,omitempty"`
// ResponseSize: The size of the HTTP response message sent back to the
// client, in bytes, including the response headers and the response
// body.
ResponseSize int64 `json:"responseSize,omitempty,string"`
// ServerIp: The IP address (IPv4 or IPv6) of the origin server that the
// request was sent to.
ServerIp string `json:"serverIp,omitempty"`
// Status: The response code indicating the status of response.
// Examples: 200, 404.
Status int64 `json:"status,omitempty"`
// UserAgent: The user agent sent by the client. Example: "Mozilla/4.0
// (compatible; MSIE 6.0; Windows 98; Q312461; .NET
// CLR 1.0.3705)".
UserAgent string `json:"userAgent,omitempty"`
// ForceSendFields is a list of field names (e.g. "CacheFillBytes") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CacheFillBytes") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *HttpRequest) MarshalJSON() ([]byte, error) {
type NoMethod HttpRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LabelDescriptor: A description of a label.
type LabelDescriptor struct {
// Description: A human-readable description for the label.
Description string `json:"description,omitempty"`
// Key: The label key.
Key string `json:"key,omitempty"`
// ValueType: The type of data that can be assigned to the label.
//
// Possible values:
// "STRING" - A variable-length string. This is the default.
// "BOOL" - Boolean; true or false.
// "INT64" - A 64-bit signed integer.
ValueType string `json:"valueType,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LabelDescriptor) MarshalJSON() ([]byte, error) {
type NoMethod LabelDescriptor
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Linear: Specifies a linear sequence of buckets that all have the same
// width (except overflow and underflow). Each bucket represents a
// constant absolute uncertainty on the specific value in the
// bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has
// the following boundaries:Upper bound (0 <= i < N-1): offset + (width
// * i). Lower bound (1 <= i < N): offset + (width * (i - 1)).
type Linear struct {
// NumFiniteBuckets: Must be greater than 0.
NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
// Offset: Lower bound of the first bucket.
Offset float64 `json:"offset,omitempty"`
// Width: Must be greater than 0.
Width float64 `json:"width,omitempty"`
// ForceSendFields is a list of field names (e.g. "NumFiniteBuckets") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NumFiniteBuckets") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Linear) MarshalJSON() ([]byte, error) {
type NoMethod Linear
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *Linear) UnmarshalJSON(data []byte) error {
type NoMethod Linear
var s1 struct {
Offset gensupport.JSONFloat64 `json:"offset"`
Width gensupport.JSONFloat64 `json:"width"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Offset = float64(s1.Offset)
s.Width = float64(s1.Width)
return nil
}
// ListBucketsResponse: The response from ListBuckets (Beta).
type ListBucketsResponse struct {
// Buckets: A list of buckets.
Buckets []*LogBucket `json:"buckets,omitempty"`
// NextPageToken: If there might be more results than appear in this
// response, then nextPageToken is included. To get the next set of
// results, call the same method again using the value of nextPageToken
// as pageToken.
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. "Buckets") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Buckets") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListBucketsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListBucketsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListExclusionsResponse: Result returned from ListExclusions.
type ListExclusionsResponse struct {
// Exclusions: A list of exclusions.
Exclusions []*LogExclusion `json:"exclusions,omitempty"`
// NextPageToken: If there might be more results than appear in this
// response, then nextPageToken is included. To get the next set of
// results, call the same method again using the value of nextPageToken
// as pageToken.
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. "Exclusions") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Exclusions") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListExclusionsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListExclusionsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListLogEntriesRequest: The parameters to ListLogEntries.
type ListLogEntriesRequest struct {
// Filter: Optional. A filter that chooses which log entries to return.
// See Advanced Logs Queries
// (https://cloud.google.com/logging/docs/view/advanced-queries). Only
// log entries that match the filter are returned. An empty filter
// matches all log entries in the resources listed in resource_names.
// Referencing a parent resource that is not listed in resource_names
// will cause the filter to return no results. The maximum length of the
// filter is 20000 characters.
Filter string `json:"filter,omitempty"`
// OrderBy: Optional. How the results should be sorted. Presently, the
// only permitted values are "timestamp asc" (default) and "timestamp
// desc". The first option returns entries in order of increasing values
// of LogEntry.timestamp (oldest first), and the second option returns
// entries in order of decreasing timestamps (newest first). Entries
// with equal timestamps are returned in order of their insert_id
// values.
OrderBy string `json:"orderBy,omitempty"`
// PageSize: Optional. The maximum number of results to return from this
// request. Non-positive values are ignored. The presence of
// next_page_token in the response indicates that more results might be
// available.
PageSize int64 `json:"pageSize,omitempty"`
// PageToken: Optional. If present, then retrieve the next batch of
// results from the preceding call to this method. page_token must be
// the value of next_page_token from the previous response. The values
// of other method parameters should be identical to those in the
// previous call.
PageToken string `json:"pageToken,omitempty"`
// ProjectIds: Optional. Deprecated. Use resource_names instead. One or
// more project identifiers or project numbers from which to retrieve
// log entries. Example: "my-project-1A".
ProjectIds []string `json:"projectIds,omitempty"`
// ResourceNames: Required. Names of one or more parent resources from
// which to retrieve log
// entries:
// "projects/[PROJECT_ID]"
// "organizations/[ORGANIZATION_ID]"
// "bi
// llingAccounts/[BILLING_ACCOUNT_ID]"
// "folders/[FOLDER_ID]"
// Projects listed in the project_ids field are added to this list.
ResourceNames []string `json:"resourceNames,omitempty"`
// ForceSendFields is a list of field names (e.g. "Filter") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Filter") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListLogEntriesRequest) MarshalJSON() ([]byte, error) {
type NoMethod ListLogEntriesRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListLogEntriesResponse: Result returned from ListLogEntries.
type ListLogEntriesResponse struct {
// Entries: A list of log entries. If entries is empty, nextPageToken
// may still be returned, indicating that more entries may exist. See
// nextPageToken for more information.
Entries []*LogEntry `json:"entries,omitempty"`
// NextPageToken: If there might be more results than those appearing in
// this response, then nextPageToken is included. To get the next set of
// results, call this method again using the value of nextPageToken as
// pageToken.If a value for next_page_token appears and the entries
// field is empty, it means that the search found no log entries so far
// but it did not have time to search all the possible log entries.
// Retry the method with this value for page_token to continue the
// search. Alternatively, consider speeding up the search by changing
// your filter to specify a single log name or resource type, or to
// narrow the time range of the search.
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. "Entries") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Entries") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListLogEntriesResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListLogEntriesResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListLogMetricsResponse: Result returned from ListLogMetrics.
type ListLogMetricsResponse struct {
// Metrics: A list of logs-based metrics.
Metrics []*LogMetric `json:"metrics,omitempty"`
// NextPageToken: If there might be more results than appear in this
// response, then nextPageToken is included. To get the next set of
// results, call this method again using the value of nextPageToken as
// pageToken.
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. "Metrics") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Metrics") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListLogMetricsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListLogMetricsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListLogsResponse: Result returned from ListLogs.
type ListLogsResponse struct {
// LogNames: A list of log names. For example,
// "projects/my-project/logs/syslog" or
// "organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity
// ".
LogNames []string `json:"logNames,omitempty"`
// NextPageToken: If there might be more results than those appearing in
// this response, then nextPageToken is included. To get the next set of
// results, call this method again using the value of nextPageToken as
// pageToken.
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. "LogNames") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "LogNames") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListLogsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListLogsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListMonitoredResourceDescriptorsResponse: Result returned from
// ListMonitoredResourceDescriptors.
type ListMonitoredResourceDescriptorsResponse struct {
// NextPageToken: If there might be more results than those appearing in
// this response, then nextPageToken is included. To get the next set of
// results, call this method again using the value of nextPageToken as
// pageToken.
NextPageToken string `json:"nextPageToken,omitempty"`
// ResourceDescriptors: A list of resource descriptors.
ResourceDescriptors []*MonitoredResourceDescriptor `json:"resourceDescriptors,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 values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListMonitoredResourceDescriptorsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListMonitoredResourceDescriptorsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListSinksResponse: Result returned from ListSinks.
type ListSinksResponse struct {
// NextPageToken: If there might be more results than appear in this
// response, then nextPageToken is included. To get the next set of
// results, call the same method again using the value of nextPageToken
// as pageToken.
NextPageToken string `json:"nextPageToken,omitempty"`
// Sinks: A list of sinks.
Sinks []*LogSink `json:"sinks,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 values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListSinksResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListSinksResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogBucket: Describes a repository of logs (Beta).
type LogBucket struct {
// CreateTime: Output only. The creation timestamp of the bucket. This
// is not set for any of the default buckets.
CreateTime string `json:"createTime,omitempty"`
// Description: Describes this bucket.
Description string `json:"description,omitempty"`
// LifecycleState: Output only. The bucket lifecycle state.
//
// Possible values:
// "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. This is only
// used/useful for distinguishing unset values.
// "ACTIVE" - The normal and active state.
// "DELETE_REQUESTED" - The bucket has been marked for deletion by the
// user.
LifecycleState string `json:"lifecycleState,omitempty"`
// Name: The resource name of the bucket. For example:
// "projects/my-project-id/locations/my-location/buckets/my-bucket-id
// The supported locations are: "global" "us-central1"For the location
// of global it is unspecified where logs are actually stored. Once a
// bucket has been created, the location can not be changed.
Name string `json:"name,omitempty"`
// RetentionDays: Logs will be retained by default for this amount of
// time, after which they will automatically be deleted. The minimum
// retention period is 1 day. If this value is set to zero at bucket
// creation time, the default time of 30 days will be used.
RetentionDays int64 `json:"retentionDays,omitempty"`
// UpdateTime: Output only. The last update timestamp of the bucket.
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. "CreateTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CreateTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogBucket) MarshalJSON() ([]byte, error) {
type NoMethod LogBucket
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogEntry: An individual entry in a log.
type LogEntry struct {
// HttpRequest: Optional. Information about the HTTP request associated
// with this log entry, if applicable.
HttpRequest *HttpRequest `json:"httpRequest,omitempty"`
// InsertId: Optional. A unique identifier for the log entry. If you
// provide a value, then Logging considers other log entries in the same
// project, with the same timestamp, and with the same insert_id to be
// duplicates which are removed in a single query result. However, there
// are no guarantees of de-duplication in the export of logs.If the
// insert_id is omitted when writing a log entry, the Logging API
// assigns its own unique identifier in this field.In queries, the
// insert_id is also used to order log entries that have the same
// log_name and timestamp values.
InsertId string `json:"insertId,omitempty"`
// JsonPayload: The log entry payload, represented as a structure that
// is expressed as a JSON object.
JsonPayload googleapi.RawMessage `json:"jsonPayload,omitempty"`
// Labels: Optional. A set of user-defined (key, value) data that
// provides additional information about the log entry.
Labels map[string]string `json:"labels,omitempty"`
// LogName: Required. The resource name of the log to which this log
// entry
// belongs:
// "projects/[PROJECT_ID]/logs/[LOG_ID]"
// "organizations/[ORGANIZ
// ATION_ID]/logs/[LOG_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[L
// OG_ID]"
// "folders/[FOLDER_ID]/logs/[LOG_ID]"
// A project number may be used in place of PROJECT_ID. The project
// number is translated to its corresponding PROJECT_ID internally and
// the log_name field will contain PROJECT_ID in queries and
// exports.[LOG_ID] must be URL-encoded within log_name. Example:
// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Fa
// ctivity". [LOG_ID] must be less than 512 characters long and can only
// include the following characters: upper and lower case alphanumeric
// characters, forward-slash, underscore, hyphen, and period.For
// backward compatibility, if log_name begins with a forward-slash, such
// as /projects/..., then the log entry is ingested as usual but the
// forward-slash is removed. Listing the log entry will not show the
// leading slash and filtering for a log name with a leading slash will
// never return any results.
LogName string `json:"logName,omitempty"`
// Metadata: Output only. Deprecated. Additional metadata about the
// monitored resource.Only k8s_container, k8s_pod, and k8s_node
// MonitoredResources have this field populated for GKE versions older
// than 1.12.6. For GKE versions 1.12.6 and above, the metadata field
// has been deprecated. The Kubernetes pod labels that used to be in
// metadata.userLabels will now be present in the labels field with a
// key prefix of k8s-pod/. The system labels that were present in the
// metadata.systemLabels field will no longer be available in the
// LogEntry.
Metadata *MonitoredResourceMetadata `json:"metadata,omitempty"`
// Operation: Optional. Information about an operation associated with
// the log entry, if applicable.
Operation *LogEntryOperation `json:"operation,omitempty"`
// ProtoPayload: The log entry payload, represented as a protocol
// buffer. Some Google Cloud Platform services use this field for their
// log entry payloads.The following protocol buffer types are supported;
// user-defined types are not
// supported:"type.googleapis.com/google.cloud.audit.AuditLog"
// "type.googleapis.com/google.appengine.logging.v1.RequestLog"
ProtoPayload googleapi.RawMessage `json:"protoPayload,omitempty"`
// ReceiveTimestamp: Output only. The time the log entry was received by
// Logging.
ReceiveTimestamp string `json:"receiveTimestamp,omitempty"`
// Resource: Required. The monitored resource that produced this log
// entry.Example: a log entry that reports a database error would be
// associated with the monitored resource designating the particular
// database that reported the error.
Resource *MonitoredResource `json:"resource,omitempty"`
// Severity: Optional. The severity of the log entry. The default value
// is LogSeverity.DEFAULT.
//
// Possible values:
// "DEFAULT" - (0) The log entry has no assigned severity level.
// "DEBUG" - (100) Debug or trace information.
// "INFO" - (200) Routine information, such as ongoing status or
// performance.
// "NOTICE" - (300) Normal but significant events, such as start up,
// shut down, or a configuration change.
// "WARNING" - (400) Warning events might cause problems.
// "ERROR" - (500) Error events are likely to cause problems.
// "CRITICAL" - (600) Critical events cause more severe problems or
// outages.
// "ALERT" - (700) A person must take an action immediately.
// "EMERGENCY" - (800) One or more systems are unusable.
Severity string `json:"severity,omitempty"`
// SourceLocation: Optional. Source code location information associated
// with the log entry, if any.
SourceLocation *LogEntrySourceLocation `json:"sourceLocation,omitempty"`
// SpanId: Optional. The span ID within the trace associated with the
// log entry.For Trace spans, this is the same format that the Trace API
// v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such
// as 000000000000004a.
SpanId string `json:"spanId,omitempty"`
// TextPayload: The log entry payload, represented as a Unicode string
// (UTF-8).
TextPayload string `json:"textPayload,omitempty"`
// Timestamp: Optional. The time the event described by the log entry
// occurred. This time is used to compute the log entry's age and to
// enforce the logs retention period. If this field is omitted in a new
// log entry, then Logging assigns it the current time. Timestamps have
// nanosecond accuracy, but trailing zeros in the fractional seconds
// might be omitted when the timestamp is displayed.Incoming log entries
// must have timestamps that don't exceed the logs retention period
// (https://cloud.google.com/logging/quotas#logs_retention_periods) in
// the past, and that don't exceed 24 hours in the future. Log entries
// outside those time boundaries aren't ingested by Logging.
Timestamp string `json:"timestamp,omitempty"`
// Trace: Optional. Resource name of the trace associated with the log
// entry, if any. If it contains a relative resource name, the name is
// assumed to be relative to //tracing.googleapis.com. Example:
// projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824
Trace string `json:"trace,omitempty"`
// TraceSampled: Optional. The sampling decision of the trace associated
// with the log entry.True means that the trace resource name in the
// trace field was sampled for storage in a trace backend. False means
// that the trace was not sampled for storage when this log entry was
// written, or the sampling decision was unknown at the time. A
// non-sampled trace value is still useful as a request correlation
// identifier. The default is False.
TraceSampled bool `json:"traceSampled,omitempty"`
// ForceSendFields is a list of field names (e.g. "HttpRequest") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "HttpRequest") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogEntry) MarshalJSON() ([]byte, error) {
type NoMethod LogEntry
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogEntryOperation: Additional information about a potentially
// long-running operation with which a log entry is associated.
type LogEntryOperation struct {
// First: Optional. Set this to True if this is the first log entry in
// the operation.
First bool `json:"first,omitempty"`
// Id: Optional. An arbitrary operation identifier. Log entries with the
// same identifier are assumed to be part of the same operation.
Id string `json:"id,omitempty"`
// Last: Optional. Set this to True if this is the last log entry in the
// operation.
Last bool `json:"last,omitempty"`
// Producer: Optional. An arbitrary producer identifier. The combination
// of id and producer must be globally unique. Examples for producer:
// "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication".
Producer string `json:"producer,omitempty"`
// ForceSendFields is a list of field names (e.g. "First") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "First") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogEntryOperation) MarshalJSON() ([]byte, error) {
type NoMethod LogEntryOperation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogEntrySourceLocation: Additional information about the source code
// location that produced the log entry.
type LogEntrySourceLocation struct {
// File: Optional. Source file name. Depending on the runtime
// environment, this might be a simple name or a fully-qualified name.
File string `json:"file,omitempty"`
// Function: Optional. Human-readable name of the function or method
// being invoked, with optional context such as the class or package
// name. This information may be used in contexts such as the logs
// viewer, where a file and line number are less meaningful. The format
// can vary by language. For example: qual.if.ied.Class.method (Java),
// dir/package.func (Go), function (Python).
Function string `json:"function,omitempty"`
// Line: Optional. Line within the source file. 1-based; 0 indicates no
// line number available.
Line int64 `json:"line,omitempty,string"`
// ForceSendFields is a list of field names (e.g. "File") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "File") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogEntrySourceLocation) MarshalJSON() ([]byte, error) {
type NoMethod LogEntrySourceLocation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogExclusion: Specifies a set of log entries that are not to be
// stored in Logging. If your GCP resource receives a large volume of
// logs, you can use exclusions to reduce your chargeable logs.
// Exclusions are processed after log sinks, so you can export log
// entries before they are excluded. Note that organization-level and
// folder-level exclusions don't apply to child resources, and that you
// can't exclude audit log entries.
type LogExclusion struct {
// CreateTime: Output only. The creation timestamp of the exclusion.This
// field may not be present for older exclusions.
CreateTime string `json:"createTime,omitempty"`
// Description: Optional. A description of this exclusion.
Description string `json:"description,omitempty"`
// Disabled: Optional. If set to True, then this exclusion is disabled
// and it does not exclude any log entries. You can update an exclusion
// to change the value of this field.
Disabled bool `json:"disabled,omitempty"`
// Filter: Required. An advanced logs filter
// (https://cloud.google.com/logging/docs/view/advanced-queries) that
// matches the log entries to be excluded. By using the sample function
// (https://cloud.google.com/logging/docs/view/advanced-queries#sample),
// you can exclude less than 100% of the matching log entries. For
// example, the following query matches 99% of low-severity log entries
// from Google Cloud Storage buckets:"resource.type=gcs_bucket
// severity<ERROR sample(insertId, 0.99)"
Filter string `json:"filter,omitempty"`
// Name: Required. A client-assigned identifier, such as
// "load-balancer-exclusion". Identifiers are limited to 100 characters
// and can include only letters, digits, underscores, hyphens, and
// periods. First character has to be alphanumeric.
Name string `json:"name,omitempty"`
// UpdateTime: Output only. The last update timestamp of the
// exclusion.This field may not be present for older exclusions.
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. "CreateTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CreateTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogExclusion) MarshalJSON() ([]byte, error) {
type NoMethod LogExclusion
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogLine: Application log line emitted while processing a request.
type LogLine struct {
// LogMessage: App-provided log message.
LogMessage string `json:"logMessage,omitempty"`
// Severity: Severity of this log entry.
//
// Possible values:
// "DEFAULT" - (0) The log entry has no assigned severity level.
// "DEBUG" - (100) Debug or trace information.
// "INFO" - (200) Routine information, such as ongoing status or
// performance.
// "NOTICE" - (300) Normal but significant events, such as start up,
// shut down, or a configuration change.
// "WARNING" - (400) Warning events might cause problems.
// "ERROR" - (500) Error events are likely to cause problems.
// "CRITICAL" - (600) Critical events cause more severe problems or
// outages.
// "ALERT" - (700) A person must take an action immediately.
// "EMERGENCY" - (800) One or more systems are unusable.
Severity string `json:"severity,omitempty"`
// SourceLocation: Where in the source code this log message was
// written.
SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
// Time: Approximate time when this log entry was made.
Time string `json:"time,omitempty"`
// ForceSendFields is a list of field names (e.g. "LogMessage") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "LogMessage") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogLine) MarshalJSON() ([]byte, error) {
type NoMethod LogLine
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogMetric: Describes a logs-based metric. The value of the metric is
// the number of log entries that match a logs filter in a given time
// interval.Logs-based metric can also be used to extract values from
// logs and create a a distribution of the values. The distribution
// records the statistics of the extracted values along with an optional
// histogram of the values as specified by the bucket options.
type LogMetric struct {
// BucketOptions: Optional. The bucket_options are required when the
// logs-based metric is using a DISTRIBUTION value type and it describes
// the bucket boundaries used to create a histogram of the extracted
// values.
BucketOptions *BucketOptions `json:"bucketOptions,omitempty"`
// CreateTime: Output only. The creation timestamp of the metric.This
// field may not be present for older metrics.
CreateTime string `json:"createTime,omitempty"`
// Description: Optional. A description of this metric, which is used in
// documentation. The maximum length of the description is 8000
// characters.
Description string `json:"description,omitempty"`
// Filter: Required. An advanced logs filter
// (https://cloud.google.com/logging/docs/view/advanced_filters) which
// is used to match log entries. Example:
// "resource.type=gae_app AND severity>=ERROR"
// The maximum length of the filter is 20000 characters.
Filter string `json:"filter,omitempty"`
// LabelExtractors: Optional. A map from a label key string to an
// extractor expression which is used to extract data from a log entry
// field and assign as the label value. Each label key specified in the
// LabelDescriptor must have an associated extractor expression in this
// map. The syntax of the extractor expression is the same as for the
// value_extractor field.The extracted value is converted to the type
// defined in the label descriptor. If the either the extraction or the
// type conversion fails, the label will have a default value. The
// default value for a string label is an empty string, for an integer
// label its 0, and for a boolean label its false.Note that there are
// upper bounds on the maximum number of labels and the number of active
// time series that are allowed in a project.
LabelExtractors map[string]string `json:"labelExtractors,omitempty"`
// MetricDescriptor: Optional. The metric descriptor associated with the
// logs-based metric. If unspecified, it uses a default metric
// descriptor with a DELTA metric kind, INT64 value type, with no labels
// and a unit of "1". Such a metric counts the number of log entries
// matching the filter expression.The name, type, and description fields
// in the metric_descriptor are output only, and is constructed using
// the name and description field in the LogMetric.To create a
// logs-based metric that records a distribution of log values, a DELTA
// metric kind with a DISTRIBUTION value type must be used along with a
// value_extractor expression in the LogMetric.Each label in the metric
// descriptor must have a matching label name as the key and an
// extractor expression as the value in the label_extractors map.The
// metric_kind and value_type fields in the metric_descriptor cannot be
// updated once initially configured. New labels can be added in the
// metric_descriptor, but existing labels cannot be modified except for
// their description.
MetricDescriptor *MetricDescriptor `json:"metricDescriptor,omitempty"`
// Name: Required. The client-assigned metric identifier. Examples:
// "error_count", "nginx/requests".Metric identifiers are limited to 100
// characters and can include only the following characters: A-Z, a-z,
// 0-9, and the special characters _-.,+!*',()%/. The forward-slash
// character (/) denotes a hierarchy of name pieces, and it cannot be
// the first character of the name.The metric identifier in this field
// must not be URL-encoded
// (https://en.wikipedia.org/wiki/Percent-encoding). However, when the
// metric identifier appears as the [METRIC_ID] part of a metric_name
// API parameter, then the metric identifier must be URL-encoded.
// Example: "projects/my-project/metrics/nginx%2Frequests".
Name string `json:"name,omitempty"`
// UpdateTime: Output only. The last update timestamp of the metric.This
// field may not be present for older metrics.
UpdateTime string `json:"updateTime,omitempty"`
// ValueExtractor: Optional. A value_extractor is required when using a
// distribution logs-based metric to extract the values to record from a
// log entry. Two functions are supported for value extraction:
// EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1.
// field: The name of the log entry field from which the value is to be
// extracted. 2. regex: A regular expression using the Google RE2
// syntax (https://github.com/google/re2/wiki/Syntax) with a single
// capture group to extract data from the specified log entry field.
// The value of the field is converted to a string before applying the
// regex. It is an error to specify a regex that does not include
// exactly one capture group.The result of the extraction must be
// convertible to a double type, as the distribution always records
// double values. If either the extraction or the conversion to double
// fails, then those values are not recorded in the
// distribution.Example: REGEXP_EXTRACT(jsonPayload.request,
// ".*quantity=(\d+).*")
ValueExtractor string `json:"valueExtractor,omitempty"`
// Version: Deprecated. The API version that created or updated this
// metric. The v2 format is used by default and cannot be changed.
//
// Possible values:
// "V2" - Logging API v2.
// "V1" - Logging API v1.
Version string `json:"version,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "BucketOptions") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BucketOptions") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogMetric) MarshalJSON() ([]byte, error) {
type NoMethod LogMetric
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogSink: Describes a sink used to export log entries to one of the
// following destinations in any project: a Cloud Storage bucket, a
// BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls
// which log entries are exported. The sink must be created within a
// project, organization, billing account, or folder.
type LogSink struct {
// BigqueryOptions: Optional. Options that affect sinks exporting data
// to BigQuery.
BigqueryOptions *BigQueryOptions `json:"bigqueryOptions,omitempty"`
// CreateTime: Output only. The creation timestamp of the sink.This
// field may not be present for older sinks.
CreateTime string `json:"createTime,omitempty"`
// Description: Optional. A description of this sink. The maximum length
// of the description is 8000 characters.
Description string `json:"description,omitempty"`
// Destination: Required. The export
// destination:
// "storage.googleapis.com/[GCS_BUCKET]"
// "bigquery.googleapi
// s.com/projects/[PROJECT_ID]/datasets/[DATASET]"
// "pubsub.googleapis.com
// /projects/[PROJECT_ID]/topics/[TOPIC_ID]"
// The sink's writer_identity, set when the sink is created, must have
// permission to write to the destination or else the log entries are
// not exported. For more information, see Exporting Logs with Sinks
// (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
Destination string `json:"destination,omitempty"`
// Disabled: Optional. If set to True, then this sink is disabled and it
// does not export any log entries.
Disabled bool `json:"disabled,omitempty"`
// Filter: Optional. An advanced logs filter
// (https://cloud.google.com/logging/docs/view/advanced-queries). The
// only exported log entries are those that are in the resource owning
// the sink and that match the filter. For
// example:
// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
//
Filter string `json:"filter,omitempty"`
// IncludeChildren: Optional. This field applies only to sinks owned by
// organizations and folders. If the field is false, the default, only
// the logs owned by the sink's parent resource are available for
// export. If the field is true, then logs from all the projects,
// folders, and billing accounts contained in the sink's parent resource
// are also available for export. Whether a particular log entry from
// the children is exported depends on the sink's filter expression. For
// example, if this field is true, then the filter
// resource.type=gce_instance would export all Compute Engine VM
// instance log entries from all projects in the sink's parent. To only
// export entries from certain child projects, filter on the project
// part of the log name:
// logName:("projects/test-project1/" OR "projects/test-project2/")
// AND
// resource.type=gce_instance
//
IncludeChildren bool `json:"includeChildren,omitempty"`
// Name: Required. The client-assigned sink identifier, unique within
// the project. Example: "my-syslog-errors-to-pubsub". Sink identifiers
// are limited to 100 characters and can include only the following
// characters: upper and lower-case alphanumeric characters,
// underscores, hyphens, and periods. First character has to be
// alphanumeric.
Name string `json:"name,omitempty"`
// OutputVersionFormat: Deprecated. This field is unused.
//
// Possible values:
// "VERSION_FORMAT_UNSPECIFIED" - An unspecified format version that
// will default to V2.
// "V2" - LogEntry version 2 format.
// "V1" - LogEntry version 1 format.
OutputVersionFormat string `json:"outputVersionFormat,omitempty"`
// UpdateTime: Output only. The last update timestamp of the sink.This
// field may not be present for older sinks.
UpdateTime string `json:"updateTime,omitempty"`
// WriterIdentity: Output only. An IAM identity&mdash;a service account
// or group&mdash;under which Logging writes the exported log entries to
// the sink's destination. This field is set by sinks.create and
// sinks.update based on the value of unique_writer_identity in those
// methods.Until you grant this identity write-access to the
// destination, log entry exports from this sink will fail. For more
// information, see Granting Access for a Resource
// (https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#
// granting_access_to_a_service_account_for_a_resource). Consult the
// destination service's documentation to determine the appropriate IAM
// roles to assign to the identity.
WriterIdentity string `json:"writerIdentity,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "BigqueryOptions") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BigqueryOptions") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *LogSink) MarshalJSON() ([]byte, error) {
type NoMethod LogSink
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MetricDescriptor: Defines a metric type and its schema. Once a metric
// descriptor is created, deleting or altering it stops data collection
// and makes the metric type's existing data unusable.
type MetricDescriptor struct {
// Description: A detailed description of the metric, which can be used
// in documentation.
Description string `json:"description,omitempty"`
// DisplayName: A concise name for the metric, which can be displayed in
// user interfaces. Use sentence case without an ending period, for
// example "Request count". This field is optional but it is recommended
// to be set for any metrics associated with user-visible concepts, such
// as Quota.
DisplayName string `json:"displayName,omitempty"`
// Labels: The set of labels that can be used to describe a specific
// instance of this metric type. For example, the
// appengine.googleapis.com/http/server/response_latencies metric type
// has a label for the HTTP response code, response_code, so you can
// look at latencies for successful responses or just for responses that
// failed.
Labels []*LabelDescriptor `json:"labels,omitempty"`
// LaunchStage: Optional. The launch stage of the metric definition.
//
// Possible values:
// "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
// "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
// use it.
// "PRELAUNCH" - Prelaunch features are hidden from users and are only
// visible internally.
// "EARLY_ACCESS" - Early Access features are limited to a closed
// group of testers. To use these features, you must sign up in advance
// and sign a Trusted Tester agreement (which includes confidentiality
// provisions). These features may be unstable, changed in
// backward-incompatible ways, and are not guaranteed to be released.
// "ALPHA" - Alpha is a limited availability test for releases before
// they are cleared for widespread use. By Alpha, all significant design
// issues are resolved and we are in the process of verifying
// functionality. Alpha customers need to apply for access, agree to
// applicable terms, and have their projects whitelisted. Alpha releases
// don’t have to be feature complete, no SLAs are provided, and there
// are no technical support obligations, but they will be far enough
// along that customers can actually use them in test environments or
// for limited-use tests -- just like they would in normal production
// cases.
// "BETA" - Beta is the point at which we are ready to open a release
// for any customer to use. There are no SLA or technical support
// obligations in a Beta release. Products will be complete from a
// feature perspective, but may have some open outstanding issues. Beta
// releases are suitable for limited production use cases.
// "GA" - GA features are open to all developers and are considered
// stable and fully qualified for production use.
// "DEPRECATED" - Deprecated features are scheduled to be shut down
// and removed. For more information, see the “Deprecation Policy”
// section of our Terms of Service (https://cloud.google.com/terms/) and
// the Google Cloud Platform Subject to the Deprecation Policy
// (https://cloud.google.com/terms/deprecation) documentation.
LaunchStage string `json:"launchStage,omitempty"`
// Metadata: Optional. Metadata which can be used to guide usage of the
// metric.
Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"`
// MetricKind: Whether the metric records instantaneous values, changes
// to a value, etc. Some combinations of metric_kind and value_type
// might not be supported.
//
// Possible values:
// "METRIC_KIND_UNSPECIFIED" - Do not use this default value.
// "GAUGE" - An instantaneous measurement of a value.
// "DELTA" - The change in a value during a time interval.
// "CUMULATIVE" - A value accumulated over a time interval. Cumulative
// measurements in a time series should have the same start time and
// increasing end times, until an event resets the cumulative value to
// zero and sets a new start time for the following points.
MetricKind string `json:"metricKind,omitempty"`
// MonitoredResourceTypes: Read-only. If present, then a time series,
// which is identified partially by a metric type and a
// MonitoredResourceDescriptor, that is associated with this metric type
// can only be associated with one of the monitored resource types
// listed here.
MonitoredResourceTypes []string `json:"monitoredResourceTypes,omitempty"`
// Name: The resource name of the metric descriptor.
Name string `json:"name,omitempty"`
// Type: The metric type, including its DNS name prefix. The type is not
// URL-encoded. All user-defined metric types have the DNS name
// custom.googleapis.com or external.googleapis.com. Metric types should
// use a natural hierarchical grouping. For
// example:
// "custom.googleapis.com/invoice/paid/amount"
// "external.googlea
// pis.com/prometheus/up"
// "appengine.googleapis.com/http/server/response_
// latencies"
//
Type string `json:"type,omitempty"`
// Unit: The units in which the metric value is reported. It is only
// applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The
// unit defines the representation of the stored metric values.Different
// systems may scale the values to be more easily displayed (so a value
// of 0.02KBy might be displayed as 20By, and a value of 3523KBy might
// be displayed as 3.5MBy). However, if the unit is KBy, then the value
// of the metric is always in thousands of bytes, no matter how it may
// be displayed..If you want a custom metric to record the exact number
// of CPU-seconds used by a job, you can create an INT64 CUMULATIVE
// metric whose unit is s{CPU} (or equivalently 1s{CPU} or just s). If
// the job uses 12,005 CPU-seconds, then the value is written as
// 12005.Alternatively, if you want a custom metric to record data in a
// more granular way, you can create a DOUBLE CUMULATIVE metric whose
// unit is ks{CPU}, and then write the value 12.005 (which is
// 12005/1000), or use Kis{CPU} and write 11.723 (which is
// 12005/1024).The supported units are a subset of The Unified Code for
// Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic
// units (UNIT)
// bit bit
// By byte
// s second
// min minute
// h hour
// d dayPrefixes (PREFIX)
// k kilo (10^3)
// M mega (10^6)
// G giga (10^9)
// T tera (10^12)
// P peta (10^15)
// E exa (10^18)
// Z zetta (10^21)
// Y yotta (10^24)
// m milli (10^-3)
// u micro (10^-6)
// n nano (10^-9)
// p pico (10^-12)
// f femto (10^-15)
// a atto (10^-18)
// z zepto (10^-21)
// y yocto (10^-24)
// Ki kibi (2^10)
// Mi mebi (2^20)
// Gi gibi (2^30)
// Ti tebi (2^40)
// Pi pebi (2^50)GrammarThe grammar also includes these connectors:
// / division or ratio (as an infix operator). For examples,
// kBy/{email} or MiBy/10ms (although you should almost never have /s
// in a metric unit; rates should always be computed at query time from
// the underlying cumulative or delta value).
// . multiplication or composition (as an infix operator). For
// examples, GBy.d or k{watt}.h.The grammar for a unit is as
// follows:
// Expression = Component { "." Component } { "/" Component }
// ;
//
// Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
// | Annotation
// | "1"
// ;
//
// Annotation = "{" NAME "}" ;
// Notes:
// Annotation is just a comment if it follows a UNIT. If the annotation
// is used alone, then the unit is equivalent to 1. For examples,
// {request}/s == 1/s, By{transmitted}/s == By/s.
// NAME is a sequence of non-blank printable ASCII characters not
// containing { or }.
// 1 represents a unitary dimensionless unit
// (https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such as
// in 1/s. It is typically used when none of the basic units are
// appropriate. For example, "new users per day" can be represented as
// 1/d or {new-users}/d (and a metric value 5 would mean "5 new users).
// Alternatively, "thousands of page views per day" would be
// represented as 1000/d or k1/d or k{page_views}/d (and a metric value
// of 5.3 would mean "5300 page views per day").
// % represents dimensionless value of 1/100, and annotates values
// giving a percentage (so the metric values are typically in the range
// of 0..100, and a metric value 3 means "3 percent").
// 10^2.% indicates a metric contains a ratio, typically in the range
// 0..1, that will be multiplied by 100 and displayed as a percentage
// (so a metric value 0.03 means "3 percent").
Unit string `json:"unit,omitempty"`
// ValueType: Whether the measurement is an integer, a floating-point
// number, etc. Some combinations of metric_kind and value_type might
// not be supported.
//
// Possible values:
// "VALUE_TYPE_UNSPECIFIED" - Do not use this default value.
// "BOOL" - The value is a boolean. This value type can be used only
// if the metric kind is GAUGE.
// "INT64" - The value is a signed 64-bit integer.
// "DOUBLE" - The value is a double precision floating point number.
// "STRING" - The value is a text string. This value type can be used
// only if the metric kind is GAUGE.
// "DISTRIBUTION" - The value is a Distribution.
// "MONEY" - The value is money.
ValueType string `json:"valueType,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MetricDescriptor) MarshalJSON() ([]byte, error) {
type NoMethod MetricDescriptor
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MetricDescriptorMetadata: Additional annotations that can be used to
// guide the usage of a metric.
type MetricDescriptorMetadata struct {
// IngestDelay: The delay of data points caused by ingestion. Data
// points older than this age are guaranteed to be ingested and
// available to be read, excluding data loss due to errors.
IngestDelay string `json:"ingestDelay,omitempty"`
// LaunchStage: Deprecated. Must use the MetricDescriptor.launch_stage
// instead.
//
// Possible values:
// "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
// "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
// use it.
// "PRELAUNCH" - Prelaunch features are hidden from users and are only
// visible internally.
// "EARLY_ACCESS" - Early Access features are limited to a closed
// group of testers. To use these features, you must sign up in advance
// and sign a Trusted Tester agreement (which includes confidentiality
// provisions). These features may be unstable, changed in
// backward-incompatible ways, and are not guaranteed to be released.
// "ALPHA" - Alpha is a limited availability test for releases before
// they are cleared for widespread use. By Alpha, all significant design
// issues are resolved and we are in the process of verifying
// functionality. Alpha customers need to apply for access, agree to
// applicable terms, and have their projects whitelisted. Alpha releases
// don’t have to be feature complete, no SLAs are provided, and there
// are no technical support obligations, but they will be far enough
// along that customers can actually use them in test environments or
// for limited-use tests -- just like they would in normal production
// cases.
// "BETA" - Beta is the point at which we are ready to open a release
// for any customer to use. There are no SLA or technical support
// obligations in a Beta release. Products will be complete from a
// feature perspective, but may have some open outstanding issues. Beta
// releases are suitable for limited production use cases.
// "GA" - GA features are open to all developers and are considered
// stable and fully qualified for production use.
// "DEPRECATED" - Deprecated features are scheduled to be shut down
// and removed. For more information, see the “Deprecation Policy”
// section of our Terms of Service (https://cloud.google.com/terms/) and
// the Google Cloud Platform Subject to the Deprecation Policy
// (https://cloud.google.com/terms/deprecation) documentation.
LaunchStage string `json:"launchStage,omitempty"`
// SamplePeriod: The sampling period of metric data points. For metrics
// which are written periodically, consecutive data points are stored at
// this time interval, excluding data loss due to errors. Metrics with a
// higher granularity have a smaller sampling period.
SamplePeriod string `json:"samplePeriod,omitempty"`
// ForceSendFields is a list of field names (e.g. "IngestDelay") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "IngestDelay") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) {
type NoMethod MetricDescriptorMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MonitoredResource: An object representing a resource that can be used
// for monitoring, logging, billing, or other purposes. Examples include
// virtual machine instances, databases, and storage devices such as
// disks. The type field identifies a MonitoredResourceDescriptor object
// that describes the resource's schema. Information in the labels field
// identifies the actual resource and its attributes according to the
// schema. For example, a particular Compute Engine VM instance could be
// represented by the following object, because the
// MonitoredResourceDescriptor for "gce_instance" has labels
// "instance_id" and "zone":
// { "type": "gce_instance",
// "labels": { "instance_id": "12345678901234",
// "zone": "us-central1-a" }}
//
type MonitoredResource struct {
// Labels: Required. Values for all of the labels listed in the
// associated monitored resource descriptor. For example, Compute Engine
// VM instances use the labels "project_id", "instance_id", and "zone".
Labels map[string]string `json:"labels,omitempty"`
// Type: Required. The monitored resource type. This field must match
// the type field of a MonitoredResourceDescriptor object. For example,
// the type of a Compute Engine VM instance is gce_instance.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Labels") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Labels") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MonitoredResource) MarshalJSON() ([]byte, error) {
type NoMethod MonitoredResource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MonitoredResourceDescriptor: An object that describes the schema of a
// MonitoredResource object using a type name and a set of labels. For
// example, the monitored resource descriptor for Google Compute Engine
// VM instances has a type of "gce_instance" and specifies the use of
// the labels "instance_id" and "zone" to identify particular VM
// instances.Different APIs can support different monitored resource
// types. APIs generally provide a list method that returns the
// monitored resource descriptors used by the API.
type MonitoredResourceDescriptor struct {
// Description: Optional. A detailed description of the monitored
// resource type that might be used in documentation.
Description string `json:"description,omitempty"`
// DisplayName: Optional. A concise name for the monitored resource type
// that might be displayed in user interfaces. It should be a Title
// Cased Noun Phrase, without any article or other determiners. For
// example, "Google Cloud SQL Database".
DisplayName string `json:"displayName,omitempty"`
// Labels: Required. A set of labels used to describe instances of this
// monitored resource type. For example, an individual Google Cloud SQL
// database is identified by values for the labels "database_id" and
// "zone".
Labels []*LabelDescriptor `json:"labels,omitempty"`
// LaunchStage: Optional. The launch stage of the monitored resource
// definition.
//
// Possible values:
// "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
// "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
// use it.
// "PRELAUNCH" - Prelaunch features are hidden from users and are only
// visible internally.
// "EARLY_ACCESS" - Early Access features are limited to a closed
// group of testers. To use these features, you must sign up in advance
// and sign a Trusted Tester agreement (which includes confidentiality
// provisions). These features may be unstable, changed in
// backward-incompatible ways, and are not guaranteed to be released.
// "ALPHA" - Alpha is a limited availability test for releases before
// they are cleared for widespread use. By Alpha, all significant design
// issues are resolved and we are in the process of verifying
// functionality. Alpha customers need to apply for access, agree to
// applicable terms, and have their projects whitelisted. Alpha releases
// don’t have to be feature complete, no SLAs are provided, and there
// are no technical support obligations, but they will be far enough
// along that customers can actually use them in test environments or
// for limited-use tests -- just like they would in normal production
// cases.
// "BETA" - Beta is the point at which we are ready to open a release
// for any customer to use. There are no SLA or technical support
// obligations in a Beta release. Products will be complete from a
// feature perspective, but may have some open outstanding issues. Beta
// releases are suitable for limited production use cases.
// "GA" - GA features are open to all developers and are considered
// stable and fully qualified for production use.
// "DEPRECATED" - Deprecated features are scheduled to be shut down
// and removed. For more information, see the “Deprecation Policy”
// section of our Terms of Service (https://cloud.google.com/terms/) and
// the Google Cloud Platform Subject to the Deprecation Policy
// (https://cloud.google.com/terms/deprecation) documentation.
LaunchStage string `json:"launchStage,omitempty"`
// Name: Optional. The resource name of the monitored resource
// descriptor:
// "projects/{project_id}/monitoredResourceDescriptors/{type}" where
// {type} is the value of the type field in this object and {project_id}
// is a project ID that provides API-specific context for accessing the
// type. APIs that do not use project information can use the resource
// name format "monitoredResourceDescriptors/{type}".
Name string `json:"name,omitempty"`
// Type: Required. The monitored resource type. For example, the type
// "cloudsql_database" represents databases in Google Cloud SQL. The
// maximum length of this value is 256 characters.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) {
type NoMethod MonitoredResourceDescriptor
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MonitoredResourceMetadata: Auxiliary metadata for a MonitoredResource
// object. MonitoredResource objects contain the minimum set of
// information to uniquely identify a monitored resource instance. There
// is some other useful auxiliary metadata. Monitoring and Logging use
// an ingestion pipeline to extract metadata for cloud resources of all
// types, and store the metadata in this message.
type MonitoredResourceMetadata struct {
// SystemLabels: Output only. Values for predefined system metadata
// labels. System labels are a kind of metadata extracted by Google,
// including "machine_image", "vpc", "subnet_id", "security_group",
// "name", etc. System label values can be only strings, Boolean values,
// or a list of strings. For example:
// { "name": "my-test-instance",
// "security_group": ["a", "b", "c"],
// "spot_instance": false }
//
SystemLabels googleapi.RawMessage `json:"systemLabels,omitempty"`
// UserLabels: Output only. A map of user-defined metadata labels.
UserLabels map[string]string `json:"userLabels,omitempty"`
// ForceSendFields is a list of field names (e.g. "SystemLabels") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "SystemLabels") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MonitoredResourceMetadata) MarshalJSON() ([]byte, error) {
type NoMethod MonitoredResourceMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// RequestLog: Complete log information about a single HTTP request to
// an App Engine application.
type RequestLog struct {
// AppEngineRelease: App Engine release version.
AppEngineRelease string `json:"appEngineRelease,omitempty"`
// AppId: Application that handled this request.
AppId string `json:"appId,omitempty"`
// Cost: An indication of the relative cost of serving this request.
Cost float64 `json:"cost,omitempty"`
// EndTime: Time when the request finished.
EndTime string `json:"endTime,omitempty"`
// Finished: Whether this request is finished or active.
Finished bool `json:"finished,omitempty"`
// First: Whether this is the first RequestLog entry for this request.
// If an active request has several RequestLog entries written to
// Stackdriver Logging, then this field will be set for one of them.
First bool `json:"first,omitempty"`
// Host: Internet host and port number of the resource being requested.
Host string `json:"host,omitempty"`
// HttpVersion: HTTP version of request. Example: "HTTP/1.1".
HttpVersion string `json:"httpVersion,omitempty"`
// InstanceId: An identifier for the instance that handled the request.
InstanceId string `json:"instanceId,omitempty"`
// InstanceIndex: If the instance processing this request belongs to a
// manually scaled module, then this is the 0-based index of the
// instance. Otherwise, this value is -1.
InstanceIndex int64 `json:"instanceIndex,omitempty"`
// Ip: Origin IP address.
Ip string `json:"ip,omitempty"`
// Latency: Latency of the request.
Latency string `json:"latency,omitempty"`
// Line: A list of log lines emitted by the application while serving
// this request.
Line []*LogLine `json:"line,omitempty"`
// MegaCycles: Number of CPU megacycles used to process request.
MegaCycles int64 `json:"megaCycles,omitempty,string"`
// Method: Request method. Example: "GET", "HEAD", "PUT", "POST",
// "DELETE".
Method string `json:"method,omitempty"`
// ModuleId: Module of the application that handled this request.
ModuleId string `json:"moduleId,omitempty"`
// Nickname: The logged-in user who made the request.Most likely, this
// is the part of the user's email before the @ sign. The field value is
// the same for different requests from the same user, but different
// users can have similar names. This information is also available to
// the application via the App Engine Users API.This field will be
// populated starting with App Engine 1.9.21.
Nickname string `json:"nickname,omitempty"`
// PendingTime: Time this request spent in the pending request queue.
PendingTime string `json:"pendingTime,omitempty"`
// Referrer: Referrer URL of request.
Referrer string `json:"referrer,omitempty"`
// RequestId: Globally unique identifier for a request, which is based
// on the request start time. Request IDs for requests which started
// later will compare greater as strings than those for requests which
// started earlier.
RequestId string `json:"requestId,omitempty"`
// Resource: Contains the path and query portion of the URL that was
// requested. For example, if the URL was
// "http://example.com/app?name=val", the resource would be
// "/app?name=val". The fragment identifier, which is identified by the
// # character, is not included.
Resource string `json:"resource,omitempty"`
// ResponseSize: Size in bytes sent back to client by request.
ResponseSize int64 `json:"responseSize,omitempty,string"`
// SourceReference: Source code for the application that handled this
// request. There can be more than one source reference per deployed
// application if source code is distributed among multiple
// repositories.
SourceReference []*SourceReference `json:"sourceReference,omitempty"`
// StartTime: Time when the request started.
StartTime string `json:"startTime,omitempty"`
// Status: HTTP response status code. Example: 200, 404.
Status int64 `json:"status,omitempty"`
// TaskName: Task name of the request, in the case of an offline
// request.
TaskName string `json:"taskName,omitempty"`
// TaskQueueName: Queue name of the request, in the case of an offline
// request.
TaskQueueName string `json:"taskQueueName,omitempty"`
// TraceId: Stackdriver Trace identifier for this request.
TraceId string `json:"traceId,omitempty"`
// TraceSampled: If true, the value in the 'trace_id' field was sampled
// for storage in a trace backend.
TraceSampled bool `json:"traceSampled,omitempty"`
// UrlMapEntry: File or class that handled the request.
UrlMapEntry string `json:"urlMapEntry,omitempty"`
// UserAgent: User agent that made the request.
UserAgent string `json:"userAgent,omitempty"`
// VersionId: Version of the application that handled this request.
VersionId string `json:"versionId,omitempty"`
// WasLoadingRequest: Whether this was a loading request for the
// instance.
WasLoadingRequest bool `json:"wasLoadingRequest,omitempty"`
// ForceSendFields is a list of field names (e.g. "AppEngineRelease") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AppEngineRelease") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *RequestLog) MarshalJSON() ([]byte, error) {
type NoMethod RequestLog
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *RequestLog) UnmarshalJSON(data []byte) error {
type NoMethod RequestLog
var s1 struct {
Cost gensupport.JSONFloat64 `json:"cost"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Cost = float64(s1.Cost)
return nil
}
// SourceLocation: Specifies a location in a source code file.
type SourceLocation struct {
// File: Source file name. Depending on the runtime environment, this
// might be a simple name or a fully-qualified name.
File string `json:"file,omitempty"`
// FunctionName: Human-readable name of the function or method being
// invoked, with optional context such as the class or package name.
// This information is used in contexts such as the logs viewer, where a
// file and line number are less meaningful. The format can vary by
// language. For example: qual.if.ied.Class.method (Java),
// dir/package.func (Go), function (Python).
FunctionName string `json:"functionName,omitempty"`
// Line: Line within the source file.
Line int64 `json:"line,omitempty,string"`
// ForceSendFields is a list of field names (e.g. "File") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "File") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SourceLocation) MarshalJSON() ([]byte, error) {
type NoMethod SourceLocation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SourceReference: A reference to a particular snapshot of the source
// tree used to build and deploy an application.
type SourceReference struct {
// Repository: Optional. A URI string identifying the repository.
// Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
Repository string `json:"repository,omitempty"`
// RevisionId: The canonical and persistent identifier of the deployed
// revision. Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
RevisionId string `json:"revisionId,omitempty"`
// ForceSendFields is a list of field names (e.g. "Repository") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Repository") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SourceReference) MarshalJSON() ([]byte, error) {
type NoMethod SourceReference
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// WriteLogEntriesRequest: The parameters to WriteLogEntries.
type WriteLogEntriesRequest struct {
// DryRun: Optional. If true, the request should expect normal response,
// but the entries won't be persisted nor exported. Useful for checking
// whether the logging API endpoints are working properly before sending
// valuable data.
DryRun bool `json:"dryRun,omitempty"`
// Entries: Required. The log entries to send to Logging. The order of
// log entries in this list does not matter. Values supplied in this
// method's log_name, resource, and labels fields are copied into those
// log entries in this list that do not include values for their
// corresponding fields. For more information, see the LogEntry type.If
// the timestamp or insert_id fields are missing in log entries, then
// this method supplies the current time or a unique identifier,
// respectively. The supplied values are chosen so that, among the log
// entries that did not supply their own values, the entries earlier in
// the list will sort before the entries later in the list. See the
// entries.list method.Log entries with timestamps that are more than
// the logs retention period
// (https://cloud.google.com/logging/quota-policy) in the past or more
// than 24 hours in the future will not be available when calling
// entries.list. However, those log entries can still be exported with
// LogSinks
// (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).To
// improve throughput and to avoid exceeding the quota limit
// (https://cloud.google.com/logging/quota-policy) for calls to
// entries.write, you should try to include several log entries in this
// list, rather than calling this method for each individual log entry.
Entries []*LogEntry `json:"entries,omitempty"`
// Labels: Optional. Default labels that are added to the labels field
// of all log entries in entries. If a log entry already has a label
// with the same key as a label in this parameter, then the log entry's
// label is not changed. See LogEntry.
Labels map[string]string `json:"labels,omitempty"`
// LogName: Optional. A default log resource name that is assigned to
// all log entries in entries that do not specify a value for
// log_name:
// "projects/[PROJECT_ID]/logs/[LOG_ID]"
// "organizations/[ORGANI
// ZATION_ID]/logs/[LOG_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[
// LOG_ID]"
// "folders/[FOLDER_ID]/logs/[LOG_ID]"
// [LOG_ID] must be URL-encoded. For
// example:
// "projects/my-project-id/logs/syslog"
// "organizations/123456789
// 0/logs/cloudresourcemanager.googleapis.com%2Factivity"
// The permission logging.logEntries.create is needed on each project,
// organization, billing account, or folder that is receiving new log
// entries, whether the resource is specified in logName or in an
// individual log entry.
LogName string `json:"logName,omitempty"`
// PartialSuccess: Optional. Whether valid entries should be written
// even if some other entries fail due to INVALID_ARGUMENT or
// PERMISSION_DENIED errors. If any entry is not written, then the
// response status is the error associated with one of the failed
// entries and the response includes error details keyed by the entries'
// zero-based index in the entries.write method.
PartialSuccess bool `json:"partialSuccess,omitempty"`
// Resource: Optional. A default monitored resource object that is
// assigned to all log entries in entries that do not specify a value
// for resource. Example:
// { "type": "gce_instance",
// "labels": {
// "zone": "us-central1-a", "instance_id": "00000000000000000000"
// }}
// See LogEntry.
Resource *MonitoredResource `json:"resource,omitempty"`
// ForceSendFields is a list of field names (e.g. "DryRun") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DryRun") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *WriteLogEntriesRequest) MarshalJSON() ([]byte, error) {
type NoMethod WriteLogEntriesRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// WriteLogEntriesResponse: Result returned from WriteLogEntries.
type WriteLogEntriesResponse struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// method id "logging.billingAccounts.buckets.get":
type BillingAccountsBucketsGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets a bucket (Beta).
func (r *BillingAccountsBucketsService) Get(name string) *BillingAccountsBucketsGetCall {
c := &BillingAccountsBucketsGetCall{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 information.
func (c *BillingAccountsBucketsGetCall) Fields(s ...googleapi.Field) *BillingAccountsBucketsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *BillingAccountsBucketsGetCall) IfNoneMatch(entityTag string) *BillingAccountsBucketsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *BillingAccountsBucketsGetCall) Context(ctx context.Context) *BillingAccountsBucketsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *BillingAccountsBucketsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *BillingAccountsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200514")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "logging.billingAccounts.buckets.get" call.
// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *LogBucket.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 *BillingAccountsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &LogBucket{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Gets a bucket (Beta).",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}",
// "httpMethod": "GET",
// "id": "logging.billingAccounts.buckets.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The resource name of the bucket:\n\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"\n\"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"\n\"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"\nExample: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+/buckets/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+name}",
// "response": {
// "$ref": "LogBucket"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloud-platform.read-only",
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.read"
// ]
// }
}
// method id "logging.billingAccounts.exclusions.create":
type BillingAccountsExclusionsCreateCall struct {
s *Service
parent string
logexclusion *LogExclusion
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a new exclusion in a specified parent resource. Only
// log entries belonging to that resource can be excluded. You can have
// up to 10 exclusions in a resource.
func (r *BillingAccountsExclusionsService) Create(parent string, logexclusion *LogExclusion) *BillingAccountsExclusionsCreateCall {
c := &BillingAccountsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.logexclusion = logexclusion
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *BillingAccountsExclusionsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *BillingAccountsExclusionsCreateCall) Context(ctx context.Context) *BillingAccountsExclusionsCreateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *BillingAccountsExclusionsCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *BillingAccountsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200514")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
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 "logging.billingAccounts.exclusions.create" call.
// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *LogExclusion.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 *BillingAccountsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &LogExclusion{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions",
// "httpMethod": "POST",
// "id": "logging.billingAccounts.exclusions.create",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The parent resource in which to create the exclusion:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+parent}/exclusions",
// "request": {
// "$ref": "LogExclusion"
// },
// "response": {
// "$ref": "LogExclusion"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.billingAccounts.exclusions.delete":
type BillingAccountsExclusionsDeleteCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes an exclusion.
func (r *BillingAccountsExclusionsService) Delete(name string) *BillingAccountsExclusionsDeleteCall {
c := &BillingAccountsExclusionsDeleteCall{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 information.
func (c *BillingAccountsExclusionsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *BillingAccountsExclusionsDeleteCall) Context(ctx context.Context) *BillingAccountsExclusionsDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *BillingAccountsExclusionsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *BillingAccountsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200514")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "logging.billingAccounts.exclusions.delete" call.
// Exactly one of *Empty or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Empty.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 *BillingAccountsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Empty{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes an exclusion.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
// "httpMethod": "DELETE",
// "id": "logging.billingAccounts.exclusions.delete",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The resource name of an existing exclusion to delete:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+name}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.billingAccounts.exclusions.get":
type BillingAccountsExclusionsGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the description of an exclusion.
func (r *BillingAccountsExclusionsService) Get(name string) *BillingAccountsExclusionsGetCall {
c := &BillingAccountsExclusionsGetCall{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 information.
func (c *BillingAccountsExclusionsGetCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *BillingAccountsExclusionsGetCall) IfNoneMatch(entityTag string) *BillingAccountsExclusionsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *BillingAccountsExclusionsGetCall) Context(ctx context.Context) *BillingAccountsExclusionsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *BillingAccountsExclusionsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *BillingAccountsExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200514")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "logging.billingAccounts.exclusions.get" call.
// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *LogExclusion.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 *BillingAccountsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &LogExclusion{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Gets the description of an exclusion.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
// "httpMethod": "GET",
// "id": "logging.billingAccounts.exclusions.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The resource name of an existing exclusion:\n\"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\"\n\"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\"\n\"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\"\nExample: \"projects/my-project-id/exclusions/my-exclusion-id\".",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+name}",
// "response": {
// "$ref": "LogExclusion"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/cloud-platform.read-only",
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.read"
// ]
// }
}
// method id "logging.billingAccounts.exclusions.list":
type BillingAccountsExclusionsListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists all the exclusions in a parent resource.
func (r *BillingAccountsExclusionsService) List(parent string) *BillingAccountsExclusionsListCall {
c := &BillingAccountsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of results to return from this request. Non-positive values are
// ignored. The presence of nextPageToken in the response indicates that
// more results might be available.
func (c *BillingAccountsExclusionsListCall) PageSize(pageSize int64) *BillingAccountsExclusionsListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": If present, then
// retrieve the next batch of results from the preceding call to this
// method. pageToken must be the value of nextPageToken from the
// previous response. The values of other method parameters should be
// identical to those in the previous call.
func (c *BillingAccountsExclusionsListCall) PageToken(pageToken string) *BillingAccountsExclusionsListCall {
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 information.
func (c *BillingAccountsExclusionsListCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *BillingAccountsExclusionsListCall) IfNoneMatch(entityTag string) *BillingAccountsExclusionsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *BillingAccountsExclusionsListCall) Context(ctx context.Context) *BillingAccountsExclusionsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *BillingAccountsExclusionsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *BillingAccountsExclusionsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200514")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
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 "logging.billingAccounts.exclusions.list" call.
// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListExclusionsResponse.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 *BillingAccountsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ListExclusionsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all the exclusions in a parent resource.",