2019-05-01 20:20:21 +00:00
// Copyright 2019 Google LLC.
2018-12-20 21:43:52 +00:00
// 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.
2017-09-15 02:15:14 +00:00
// Package logging provides access to the Stackdriver Logging API.
//
2018-09-18 19:50:17 +00:00
// This package is DEPRECATED. Use package cloud.google.com/go/logging instead.
//
2019-05-01 20:20:21 +00:00
// For product documentation, see: https://cloud.google.com/logging/docs/
//
// Creating a client
2017-09-15 02:15:14 +00:00
//
// Usage example:
//
// import "google.golang.org/api/logging/v2"
// ...
2019-05-01 20:20:21 +00:00
// 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.
2017-09-15 02:15:14 +00:00
package logging // import "google.golang.org/api/logging/v2"
import (
"bytes"
2018-12-20 21:43:52 +00:00
"context"
2017-09-15 02:15:14 +00:00
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
2018-11-15 23:37:19 +00:00
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
2019-05-01 20:20:21 +00:00
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
2017-09-15 02:15:14 +00:00
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes . NewBuffer
var _ = strconv . Itoa
var _ = fmt . Sprintf
var _ = json . NewDecoder
var _ = io . Copy
var _ = url . Parse
var _ = gensupport . MarshalJSON
var _ = googleapi . Version
var _ = errors . New
var _ = strings . Replace
var _ = context . Canceled
const apiId = "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"
)
2019-05-01 20:20:21 +00:00
// 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 ... )
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.
2017-09-15 02:15:14 +00:00
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 )
2018-09-18 19:50:17 +00:00
s . Exclusions = NewExclusionsService ( s )
2017-09-15 02:15:14 +00:00
s . Folders = NewFoldersService ( s )
2018-09-18 19:50:17 +00:00
s . Logs = NewLogsService ( s )
2017-09-15 02:15:14 +00:00
s . MonitoredResourceDescriptors = NewMonitoredResourceDescriptorsService ( s )
s . Organizations = NewOrganizationsService ( s )
s . Projects = NewProjectsService ( s )
2018-09-18 19:50:17 +00:00
s . Sinks = NewSinksService ( s )
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
Exclusions * ExclusionsService
2017-09-15 02:15:14 +00:00
Folders * FoldersService
2018-09-18 19:50:17 +00:00
Logs * LogsService
2017-09-15 02:15:14 +00:00
MonitoredResourceDescriptors * MonitoredResourceDescriptorsService
Organizations * OrganizationsService
Projects * ProjectsService
2018-09-18 19:50:17 +00:00
Sinks * SinksService
2017-09-15 02:15:14 +00:00
}
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 . Exclusions = NewBillingAccountsExclusionsService ( s )
rs . Logs = NewBillingAccountsLogsService ( s )
rs . Sinks = NewBillingAccountsSinksService ( s )
return rs
}
type BillingAccountsService struct {
s * Service
Exclusions * BillingAccountsExclusionsService
Logs * BillingAccountsLogsService
Sinks * BillingAccountsSinksService
}
func NewBillingAccountsExclusionsService ( s * Service ) * BillingAccountsExclusionsService {
rs := & BillingAccountsExclusionsService { s : s }
return rs
}
type BillingAccountsExclusionsService 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
}
2018-09-18 19:50:17 +00:00
func NewExclusionsService ( s * Service ) * ExclusionsService {
rs := & ExclusionsService { s : s }
return rs
}
type ExclusionsService struct {
s * Service
}
2017-09-15 02:15:14 +00:00
func NewFoldersService ( s * Service ) * FoldersService {
rs := & FoldersService { s : s }
rs . Exclusions = NewFoldersExclusionsService ( s )
rs . Logs = NewFoldersLogsService ( s )
rs . Sinks = NewFoldersSinksService ( s )
return rs
}
type FoldersService struct {
s * Service
Exclusions * FoldersExclusionsService
Logs * FoldersLogsService
Sinks * FoldersSinksService
}
func NewFoldersExclusionsService ( s * Service ) * FoldersExclusionsService {
rs := & FoldersExclusionsService { s : s }
return rs
}
type FoldersExclusionsService 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
}
2018-09-18 19:50:17 +00:00
func NewLogsService ( s * Service ) * LogsService {
rs := & LogsService { s : s }
return rs
}
type LogsService struct {
s * Service
}
2017-09-15 02:15:14 +00:00
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 . Logs = NewOrganizationsLogsService ( s )
rs . Sinks = NewOrganizationsSinksService ( s )
return rs
}
type OrganizationsService struct {
s * Service
Exclusions * OrganizationsExclusionsService
Logs * OrganizationsLogsService
Sinks * OrganizationsSinksService
}
func NewOrganizationsExclusionsService ( s * Service ) * OrganizationsExclusionsService {
rs := & OrganizationsExclusionsService { s : s }
return rs
}
type OrganizationsExclusionsService 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 . Logs = NewProjectsLogsService ( s )
rs . Metrics = NewProjectsMetricsService ( s )
rs . Sinks = NewProjectsSinksService ( s )
return rs
}
type ProjectsService struct {
s * Service
Exclusions * ProjectsExclusionsService
Logs * ProjectsLogsService
Metrics * ProjectsMetricsService
Sinks * ProjectsSinksService
}
func NewProjectsExclusionsService ( s * Service ) * ProjectsExclusionsService {
rs := & ProjectsExclusionsService { s : s }
return rs
}
type ProjectsExclusionsService 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
}
2018-09-18 19:50:17 +00:00
func NewSinksService ( s * Service ) * SinksService {
rs := & SinksService { s : s }
return rs
}
type SinksService struct {
s * Service
}
2017-09-15 02:15:14 +00:00
// 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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod BucketOptions
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod Explicit
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod Exponential
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
return gensupport . MarshalJSON ( raw , s . ForceSendFields , s . NullFields )
}
func ( s * Exponential ) UnmarshalJSON ( data [ ] byte ) error {
2018-09-18 19:50:17 +00:00
type NoMethod Exponential
2017-09-15 02:15:14 +00:00
var s1 struct {
GrowthFactor gensupport . JSONFloat64 ` json:"growthFactor" `
Scale gensupport . JSONFloat64 ` json:"scale" `
2018-09-18 19:50:17 +00:00
* NoMethod
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
s1 . NoMethod = ( * NoMethod ) ( s )
2017-09-15 02:15:14 +00:00
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
2019-05-01 20:20:21 +00:00
// (compatible; MSIE 6.0; Windows 98; Q312461; .NET
// CLR 1.0.3705)".
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod HttpRequest
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod LabelDescriptor
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod Linear
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
return gensupport . MarshalJSON ( raw , s . ForceSendFields , s . NullFields )
}
func ( s * Linear ) UnmarshalJSON ( data [ ] byte ) error {
2018-09-18 19:50:17 +00:00
type NoMethod Linear
2017-09-15 02:15:14 +00:00
var s1 struct {
Offset gensupport . JSONFloat64 ` json:"offset" `
Width gensupport . JSONFloat64 ` json:"width" `
2018-09-18 19:50:17 +00:00
* NoMethod
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
s1 . NoMethod = ( * NoMethod ) ( s )
2017-09-15 02:15:14 +00:00
if err := json . Unmarshal ( data , & s1 ) ; err != nil {
return err
}
s . Offset = float64 ( s1 . Offset )
s . Width = float64 ( s1 . Width )
return nil
}
// 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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod ListExclusionsResponse
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 Filters. 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: Deprecated. Use resource_names instead. One or more
// project identifiers or project numbers from which to retrieve log
2019-05-01 20:20:21 +00:00
// entries. Example: "my-project-1A".
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod ListLogEntriesRequest
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod ListLogEntriesResponse
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod ListLogMetricsResponse
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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/syslog" or
// "organizations/123/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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod ListLogsResponse
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod ListMonitoredResourceDescriptorsResponse
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod ListSinksResponse
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
// 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 can be removed. If omitted in new log entries, then
// Logging assigns its own unique identifier. The insert_id is also used
// to order log entries that have the same timestamp value.
2017-09-15 02:15:14 +00:00
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]"
2018-09-18 19:50:17 +00:00
// A project number may optionally be used in place of PROJECT_ID. The
// project number is translated to its corresponding PROJECT_ID
2019-05-01 20:20:21 +00:00
// internally and the log_name field will contain PROJECT_ID in queries
2018-09-18 19:50:17 +00:00
// and exports.[LOG_ID] must be URL-encoded within log_name. Example:
2017-09-15 02:15:14 +00:00
// "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" `
2019-05-01 20:20:21 +00:00
// Metadata: Deprecated. Output only. 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 Stackdriver system labels that were
// present in the metadata.systemLabels field will no longer be
// available in the LogEntry.
2018-09-18 19:50:17 +00:00
Metadata * MonitoredResourceMetadata ` json:"metadata,omitempty" `
2017-09-15 02:15:14 +00:00
// 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.
ProtoPayload googleapi . RawMessage ` json:"protoPayload,omitempty" `
// ReceiveTimestamp: Output only. The time the log entry was received by
2018-09-18 19:50:17 +00:00
// Logging.
2017-09-15 02:15:14 +00:00
ReceiveTimestamp string ` json:"receiveTimestamp,omitempty" `
2018-09-18 19:50:17 +00:00
// Resource: Required. The primary monitored resource associated with
2019-05-01 20:20:21 +00:00
// this log entry.Example: a log entry that reports a database error
2018-09-18 19:50:17 +00:00
// would be associated with the monitored resource designating the
// particular database that reported the error.
2017-09-15 02:15:14 +00:00
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" `
2018-09-18 19:50:17 +00:00
// SpanId: Optional. The span ID within the trace associated with the
2019-05-01 20:20:21 +00:00
// 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 <code>"000000000000004a"</code>.
2018-09-18 19:50:17 +00:00
SpanId string ` json:"spanId,omitempty" `
2017-09-15 02:15:14 +00:00
// 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
2018-09-18 19:50:17 +00:00
// 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
// should have timestamps that are no more than the logs retention
// period in the past, and no more than 24 hours in the future. Log
// entries outside those time boundaries will not be available when
// calling entries.list, but those log entries can still be exported
// with LogSinks.
2017-09-15 02:15:14 +00:00
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" `
2018-11-15 23:37:19 +00:00
// TraceSampled: Optional. The sampling decision of the trace associated
2019-05-01 20:20:21 +00:00
// with the log entry.True means that the trace resource name in the
2018-11-15 23:37:19 +00:00
// 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" `
2017-09-15 02:15:14 +00:00
// 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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod LogEntry
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod LogEntryOperation
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod LogEntrySourceLocation
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
return gensupport . MarshalJSON ( raw , s . ForceSendFields , s . NullFields )
}
// LogExclusion: Specifies a set of log entries that are not to be
2018-09-18 19:50:17 +00:00
// stored in Logging. If your project receives a large volume of logs,
// you might be able to use exclusions to reduce your chargeable logs.
// Exclusions are processed after log sinks, so you can export log
// entries before they are excluded. Audit log entries and log entries
// from Amazon Web Services are never excluded.
2017-09-15 02:15:14 +00:00
type LogExclusion struct {
2019-05-01 20:20:21 +00:00
// CreateTime: Output only. The creation timestamp of the exclusion.This
// field may not be present for older exclusions.
CreateTime string ` json:"createTime,omitempty" `
2017-09-15 02:15:14 +00:00
// Description: Optional. A description of this exclusion.
Description string ` json:"description,omitempty" `
// Disabled: Optional. If set to True, then this exclusion is disabled
2019-05-01 20:20:21 +00:00
// and it does not exclude any log entries. You can update an exclusion
2017-09-15 02:15:14 +00:00
// to change the value of this field.
Disabled bool ` json:"disabled,omitempty" `
// Filter: Required. An advanced logs filter that matches the log
// entries to be excluded. By using the sample function, you can exclude
// less than 100% of the matching log entries. For example, the
// following filter matches 99% of low-severity log entries from load
2018-09-18 19:50:17 +00:00
// balancers:"resource.type=http_load_balancer severity<ERROR
// sample(insertId, 0.99)"
2017-09-15 02:15:14 +00:00
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.
Name string ` json:"name,omitempty" `
2019-05-01 20:20:21 +00:00
// UpdateTime: Output only. The last update timestamp of the
// exclusion.This field may not be present for older exclusions.
UpdateTime string ` json:"updateTime,omitempty" `
2017-09-15 02:15:14 +00:00
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi . ServerResponse ` json:"-" `
2019-05-01 20:20:21 +00:00
// ForceSendFields is a list of field names (e.g. "CreateTime") to
2017-09-15 02:15:14 +00:00
// 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:"-" `
2019-05-01 20:20:21 +00:00
// 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
2017-09-15 02:15:14 +00:00
// 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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod LogExclusion
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod LogLine
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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" `
2019-05-01 20:20:21 +00:00
// CreateTime: Output only. The creation timestamp of the metric.This
// field may not be present for older metrics.
CreateTime string ` json:"createTime,omitempty" `
2017-09-15 02:15:14 +00:00
// Description: Optional. A description of this metric, which is used in
2018-11-15 23:37:19 +00:00
// documentation. The maximum length of the description is 8000
// characters.
2017-09-15 02:15:14 +00:00
Description string ` json:"description,omitempty" `
// Filter: Required. An advanced logs filter 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" `
2019-05-01 20:20:21 +00:00
// UpdateTime: Output only. The last update timestamp of the metric.This
// field may not be present for older metrics.
UpdateTime string ` json:"updateTime,omitempty" `
2017-09-15 02:15:14 +00:00
// 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:
2018-09-18 19:50:17 +00:00
// "V2" - Logging API v2.
// "V1" - Logging API v1.
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod LogMetric
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 {
2019-05-01 20:20:21 +00:00
// CreateTime: Output only. The creation timestamp of the sink.This
// field may not be present for older sinks.
CreateTime string ` json:"createTime,omitempty" `
2017-09-15 02:15:14 +00:00
// 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
2019-05-01 20:20:21 +00:00
// not exported. For more information, see Exporting Logs with Sinks.
2017-09-15 02:15:14 +00:00
Destination string ` json:"destination,omitempty" `
// Filter: Optional. An advanced logs filter. 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.
Name string ` json:"name,omitempty" `
// OutputVersionFormat: Deprecated. The log entry format to use for this
// sink's exported log entries. The v2 format is used by default and
// cannot be changed.
//
// 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" `
2019-05-01 20:20:21 +00:00
// UpdateTime: Output only. The last update timestamp of the sink.This
// field may not be present for older sinks.
UpdateTime string ` json:"updateTime,omitempty" `
2017-09-15 02:15:14 +00:00
// WriterIdentity: Output only. An IAM identity—a service account
2018-09-18 19:50:17 +00:00
// or group—under which Logging writes the exported log entries to
// the sink's destination. This field is set by sinks.create and
2019-05-01 20:20:21 +00:00
// sinks.update based on the value of unique_writer_identity in those
2018-09-18 19:50:17 +00:00
// methods.Until you grant this identity write-access to the
// destination, log entry exports from this sink will fail. For more
2019-05-01 20:20:21 +00:00
// information, see Granting Access for a Resource. Consult the
2018-09-18 19:50:17 +00:00
// destination service's documentation to determine the appropriate IAM
// roles to assign to the identity.
2017-09-15 02:15:14 +00:00
WriterIdentity string ` json:"writerIdentity,omitempty" `
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi . ServerResponse ` json:"-" `
2019-05-01 20:20:21 +00:00
// ForceSendFields is a list of field names (e.g. "CreateTime") to
2017-09-15 02:15:14 +00:00
// 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:"-" `
2019-05-01 20:20:21 +00:00
// 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
2017-09-15 02:15:14 +00:00
// 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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod LogSink
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
// 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.
2017-09-15 02:15:14 +00:00
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" `
2018-09-18 19:50:17 +00:00
// Metadata: Optional. Metadata which can be used to guide usage of the
// metric.
Metadata * MetricDescriptorMetadata ` json:"metadata,omitempty" `
2017-09-15 02:15:14 +00:00
// 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" `
2018-09-18 19:50:17 +00:00
// Name: The resource name of the metric descriptor.
2017-09-15 02:15:14 +00:00
Name string ` json:"name,omitempty" `
// Type: The metric type, including its DNS name prefix. The type is not
2018-09-18 19:50:17 +00:00
// 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
2017-09-15 02:15:14 +00:00
// example:
// "custom.googleapis.com/invoice/paid/amount"
2018-09-18 19:50:17 +00:00
// "external.googlea
// pis.com/prometheus/up"
// "appengine.googleapis.com/http/server/response_
// latencies"
2017-09-15 02:15:14 +00:00
//
Type string ` json:"type,omitempty" `
// Unit: The unit in which the metric value is reported. It is only
// applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. 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)
2018-09-18 19:50:17 +00:00
// Ti tebi (2**40)GrammarThe grammar also includes these connectors:
2017-09-15 02:15:14 +00:00
// / division (as an infix operator, e.g. 1/s).
// . multiplication (as an infix operator, e.g. GBy.d)The grammar for a
// unit is as follows:
// Expression = Component { "." Component } { "/" Component }
// ;
//
2018-09-18 19:50:17 +00:00
// Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
2017-09-15 02:15:14 +00:00
// | Annotation
// | "1"
// ;
//
// Annotation = "{" NAME "}" ;
// Notes:
// Annotation is just a comment if it follows a UNIT and is equivalent
// to 1 if it is used alone. For examples, {requests}/s == 1/s,
// By{transmitted}/s == By/s.
// NAME is a sequence of non-blank printable ASCII characters not
// containing '{' or '}'.
2018-09-18 19:50:17 +00:00
// 1 represents dimensionless value 1, such as in 1/s.
// % represents dimensionless value 1/100, and annotates values giving
// a percentage.
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
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: The launch stage of the metric definition.
//
// Possible values:
// "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
// "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 )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod MonitoredResource
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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" `
// 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 ) {
2018-09-18 19:50:17 +00:00
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 )
2017-09-15 02:15:14 +00:00
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" `
2018-09-18 19:50:17 +00:00
// TraceSampled: If true, the value in the 'trace_id' field was sampled
// for storage in a trace backend.
TraceSampled bool ` json:"traceSampled,omitempty" `
2017-09-15 02:15:14 +00:00
// 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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod RequestLog
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
return gensupport . MarshalJSON ( raw , s . ForceSendFields , s . NullFields )
}
func ( s * RequestLog ) UnmarshalJSON ( data [ ] byte ) error {
2018-09-18 19:50:17 +00:00
type NoMethod RequestLog
2017-09-15 02:15:14 +00:00
var s1 struct {
Cost gensupport . JSONFloat64 ` json:"cost" `
2018-09-18 19:50:17 +00:00
* NoMethod
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
s1 . NoMethod = ( * NoMethod ) ( s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod SourceLocation
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod SourceReference
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
return gensupport . MarshalJSON ( raw , s . ForceSendFields , s . NullFields )
}
// WriteLogEntriesRequest: The parameters to WriteLogEntries.
type WriteLogEntriesRequest struct {
2018-09-18 19:50:17 +00:00
// 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 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.To improve
// throughput and to avoid exceeding the quota limit 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.
2017-09-15 02:15:14 +00:00
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]"
2018-11-15 23:37:19 +00:00
// [LOG_ID] must be URL-encoded. For
// example:
// "projects/my-project-id/logs/syslog"
// "organizations/123456789
// 0/logs/cloudresourcemanager.googleapis.com%2Factivity"
// The permission <code>logging.logEntries.create</code> is needed on
// each project, organization, billing account, or folder that is
// receiving new log entries, whether the resource is specified in
// <code>logName</code> or in an individual log entry.
2017-09-15 02:15:14 +00:00
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" `
2018-09-18 19:50:17 +00:00
// ForceSendFields is a list of field names (e.g. "DryRun") to
2017-09-15 02:15:14 +00:00
// 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:"-" `
2018-09-18 19:50:17 +00:00
// 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
2017-09-15 02:15:14 +00:00
// 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 ) {
2018-09-18 19:50:17 +00:00
type NoMethod WriteLogEntriesRequest
raw := NoMethod ( * s )
2017-09-15 02:15:14 +00:00
return gensupport . MarshalJSON ( raw , s . ForceSendFields , s . NullFields )
}
// WriteLogEntriesResponse: Result returned from WriteLogEntries. empty
type WriteLogEntriesResponse struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi . ServerResponse ` json:"-" `
}
// 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 )
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 )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/exclusions" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
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 )
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 )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
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 )
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 )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
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 )
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 )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/exclusions" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Lists all the exclusions in a parent resource.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions",
// "httpMethod": "GET",
// "id": "logging.billingAccounts.exclusions.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent resource whose exclusions are to be listed.\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+parent}/exclusions",
// "response": {
// "$ref": "ListExclusionsResponse"
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * BillingAccountsExclusionsListCall ) Pages ( ctx context . Context , f func ( * ListExclusionsResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
// method id "logging.billingAccounts.exclusions.patch":
type BillingAccountsExclusionsPatchCall struct {
s * Service
name string
logexclusion * LogExclusion
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Patch: Changes one or more properties of an existing exclusion.
func ( r * BillingAccountsExclusionsService ) Patch ( name string , logexclusion * LogExclusion ) * BillingAccountsExclusionsPatchCall {
c := & BillingAccountsExclusionsPatchCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . name = name
c . logexclusion = logexclusion
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// nonempty list of fields to change in the existing exclusion. New
// values for the fields are taken from the corresponding fields in the
// LogExclusion included in this request. Fields not mentioned in
// update_mask are not changed and are ignored in the request.For
// example, to change the filter and description of an exclusion,
// specify an update_mask of "filter,description".
func ( c * BillingAccountsExclusionsPatchCall ) UpdateMask ( updateMask string ) * BillingAccountsExclusionsPatchCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func ( c * BillingAccountsExclusionsPatchCall ) Fields ( s ... googleapi . Field ) * BillingAccountsExclusionsPatchCall {
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 * BillingAccountsExclusionsPatchCall ) Context ( ctx context . Context ) * BillingAccountsExclusionsPatchCall {
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 * BillingAccountsExclusionsPatchCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * BillingAccountsExclusionsPatchCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logexclusion )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PATCH" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
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.patch" 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 * BillingAccountsExclusionsPatchCall ) 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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Changes one or more properties of an existing exclusion.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
// "httpMethod": "PATCH",
// "id": "logging.billingAccounts.exclusions.patch",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The resource name of the exclusion to update:\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"
// },
// "updateMask": {
// "description": "Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v2/{+name}",
// "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.logs.delete":
type BillingAccountsLogsDeleteCall struct {
s * Service
logName string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Delete: Deletes all the log entries in a log. The log reappears if it
// receives new entries. Log entries written shortly before the delete
// operation might not be deleted.
func ( r * BillingAccountsLogsService ) Delete ( logName string ) * BillingAccountsLogsDeleteCall {
c := & BillingAccountsLogsDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . logName = logName
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 * BillingAccountsLogsDeleteCall ) Fields ( s ... googleapi . Field ) * BillingAccountsLogsDeleteCall {
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 * BillingAccountsLogsDeleteCall ) Context ( ctx context . Context ) * BillingAccountsLogsDeleteCall {
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 * BillingAccountsLogsDeleteCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * BillingAccountsLogsDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+logName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"logName" : c . logName ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.billingAccounts.logs.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 * BillingAccountsLogsDeleteCall ) 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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}",
// "httpMethod": "DELETE",
// "id": "logging.billingAccounts.logs.delete",
// "parameterOrder": [
// "logName"
// ],
// "parameters": {
// "logName": {
// "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+/logs/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+logName}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.billingAccounts.logs.list":
type BillingAccountsLogsListCall struct {
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// List: Lists the logs in projects, organizations, folders, or billing
// accounts. Only logs that have entries are listed.
func ( r * BillingAccountsLogsService ) List ( parent string ) * BillingAccountsLogsListCall {
c := & BillingAccountsLogsListCall { 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 * BillingAccountsLogsListCall ) PageSize ( pageSize int64 ) * BillingAccountsLogsListCall {
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 * BillingAccountsLogsListCall ) PageToken ( pageToken string ) * BillingAccountsLogsListCall {
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 * BillingAccountsLogsListCall ) Fields ( s ... googleapi . Field ) * BillingAccountsLogsListCall {
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 * BillingAccountsLogsListCall ) IfNoneMatch ( entityTag string ) * BillingAccountsLogsListCall {
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 * BillingAccountsLogsListCall ) Context ( ctx context . Context ) * BillingAccountsLogsListCall {
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 * BillingAccountsLogsListCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * BillingAccountsLogsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/logs" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
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.logs.list" call.
// Exactly one of *ListLogsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListLogsResponse.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 * BillingAccountsLogsListCall ) Do ( opts ... googleapi . CallOption ) ( * ListLogsResponse , 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 := & ListLogsResponse {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/logs",
// "httpMethod": "GET",
// "id": "logging.billingAccounts.logs.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+parent}/logs",
// "response": {
// "$ref": "ListLogsResponse"
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * BillingAccountsLogsListCall ) Pages ( ctx context . Context , f func ( * ListLogsResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
// method id "logging.billingAccounts.sinks.create":
type BillingAccountsSinksCreateCall struct {
s * Service
parent string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Create: Creates a sink that exports specified log entries to a
// destination. The export of newly-ingested log entries begins
// immediately, unless the sink's writer_identity is not permitted to
// write to the destination. A sink can export log entries only from the
// resource owning the sink.
func ( r * BillingAccountsSinksService ) Create ( parent string , logsink * LogSink ) * BillingAccountsSinksCreateCall {
c := & BillingAccountsSinksCreateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . parent = parent
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": Determines the kind of IAM identity returned
// as writer_identity in the new sink. If this value is omitted or set
// to false, and if the sink's parent is a project, then the value
// returned as writer_identity is the same group or service account used
2018-09-18 19:50:17 +00:00
// by Logging before the addition of writer identities to this API. The
// sink's destination must be in the same project as the sink itself.If
// this field is set to true, or if the sink is owned by a non-project
// resource such as an organization, then the value of writer_identity
// will be a unique service account used only for exports from the new
// sink. For more information, see writer_identity in LogSink.
2017-09-15 02:15:14 +00:00
func ( c * BillingAccountsSinksCreateCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * BillingAccountsSinksCreateCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
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 * BillingAccountsSinksCreateCall ) Fields ( s ... googleapi . Field ) * BillingAccountsSinksCreateCall {
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 * BillingAccountsSinksCreateCall ) Context ( ctx context . Context ) * BillingAccountsSinksCreateCall {
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 * BillingAccountsSinksCreateCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * BillingAccountsSinksCreateCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/sinks" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
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.sinks.create" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * BillingAccountsSinksCreateCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , 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 := & LogSink {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks",
// "httpMethod": "POST",
// "id": "logging.billingAccounts.sinks.create",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The resource in which to create the sink:\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"
// },
// "uniqueWriterIdentity": {
2018-09-18 19:50:17 +00:00
// "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.",
2017-09-15 02:15:14 +00:00
// "location": "query",
// "type": "boolean"
// }
// },
// "path": "v2/{+parent}/sinks",
// "request": {
// "$ref": "LogSink"
// },
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.billingAccounts.sinks.delete":
type BillingAccountsSinksDeleteCall struct {
s * Service
sinkNameid string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Delete: Deletes a sink. If the sink has a unique writer_identity,
// then that service account is also deleted.
func ( r * BillingAccountsSinksService ) Delete ( sinkNameid string ) * BillingAccountsSinksDeleteCall {
c := & BillingAccountsSinksDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
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 * BillingAccountsSinksDeleteCall ) Fields ( s ... googleapi . Field ) * BillingAccountsSinksDeleteCall {
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 * BillingAccountsSinksDeleteCall ) Context ( ctx context . Context ) * BillingAccountsSinksDeleteCall {
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 * BillingAccountsSinksDeleteCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * BillingAccountsSinksDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkNameid ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.billingAccounts.sinks.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 * BillingAccountsSinksDeleteCall ) 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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
// "httpMethod": "DELETE",
// "id": "logging.billingAccounts.sinks.delete",
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.billingAccounts.sinks.get":
type BillingAccountsSinksGetCall struct {
s * Service
sinkName string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// Get: Gets a sink.
func ( r * BillingAccountsSinksService ) Get ( sinkName string ) * BillingAccountsSinksGetCall {
c := & BillingAccountsSinksGetCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkName = sinkName
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 * BillingAccountsSinksGetCall ) Fields ( s ... googleapi . Field ) * BillingAccountsSinksGetCall {
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 * BillingAccountsSinksGetCall ) IfNoneMatch ( entityTag string ) * BillingAccountsSinksGetCall {
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 * BillingAccountsSinksGetCall ) Context ( ctx context . Context ) * BillingAccountsSinksGetCall {
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 * BillingAccountsSinksGetCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * BillingAccountsSinksGetCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkName ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.billingAccounts.sinks.get" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * BillingAccountsSinksGetCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , 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 := & LogSink {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Gets a sink.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
// "httpMethod": "GET",
// "id": "logging.billingAccounts.sinks.get",
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "response": {
// "$ref": "LogSink"
// },
// "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.sinks.list":
type BillingAccountsSinksListCall struct {
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// List: Lists sinks.
func ( r * BillingAccountsSinksService ) List ( parent string ) * BillingAccountsSinksListCall {
c := & BillingAccountsSinksListCall { 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 * BillingAccountsSinksListCall ) PageSize ( pageSize int64 ) * BillingAccountsSinksListCall {
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 * BillingAccountsSinksListCall ) PageToken ( pageToken string ) * BillingAccountsSinksListCall {
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 * BillingAccountsSinksListCall ) Fields ( s ... googleapi . Field ) * BillingAccountsSinksListCall {
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 * BillingAccountsSinksListCall ) IfNoneMatch ( entityTag string ) * BillingAccountsSinksListCall {
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 * BillingAccountsSinksListCall ) Context ( ctx context . Context ) * BillingAccountsSinksListCall {
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 * BillingAccountsSinksListCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * BillingAccountsSinksListCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/sinks" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
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.sinks.list" call.
// Exactly one of *ListSinksResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListSinksResponse.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 * BillingAccountsSinksListCall ) Do ( opts ... googleapi . CallOption ) ( * ListSinksResponse , 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 := & ListSinksResponse {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Lists sinks.",
// "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks",
// "httpMethod": "GET",
// "id": "logging.billingAccounts.sinks.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+parent}/sinks",
// "response": {
// "$ref": "ListSinksResponse"
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * BillingAccountsSinksListCall ) Pages ( ctx context . Context , f func ( * ListSinksResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
// method id "logging.billingAccounts.sinks.patch":
type BillingAccountsSinksPatchCall struct {
s * Service
sinkNameid string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Patch: Updates a sink. This method replaces the following fields in
// the existing sink with values from the new sink: destination, and
2019-05-01 20:20:21 +00:00
// filter.The updated sink might also have a new writer_identity; see
2017-09-15 02:15:14 +00:00
// the unique_writer_identity field.
func ( r * BillingAccountsSinksService ) Patch ( sinkNameid string , logsink * LogSink ) * BillingAccountsSinksPatchCall {
c := & BillingAccountsSinksPatchCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": See sinks.create for a description of this
// field. When updating a sink, the effect of this field on the value of
// writer_identity in the updated sink depends on both the old and new
// values of this field:
// If the old and new values of this field are both false or both true,
// then there is no change to the sink's writer_identity.
// If the old value is false and the new value is true, then
// writer_identity is changed to a unique service account.
// It is an error if the old value is true and the new value is set to
// false or defaulted to false.
func ( c * BillingAccountsSinksPatchCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * BillingAccountsSinksPatchCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
return c
}
// UpdateMask sets the optional parameter "updateMask": Field mask that
// specifies the fields in sink that need an update. A sink field will
// be overwritten if, and only if, it is in the update mask. name and
// output only fields cannot be updated.An empty updateMask is
// temporarily treated as using the following mask for backwards
// compatibility purposes: destination,filter,includeChildren At some
// point in the future, behavior will be removed and specifying an empty
// updateMask will be an error.For a detailed FieldMask definition, see
2018-11-15 23:37:19 +00:00
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
2017-09-15 02:15:14 +00:00
// updateMask=filter.
func ( c * BillingAccountsSinksPatchCall ) UpdateMask ( updateMask string ) * BillingAccountsSinksPatchCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func ( c * BillingAccountsSinksPatchCall ) Fields ( s ... googleapi . Field ) * BillingAccountsSinksPatchCall {
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 * BillingAccountsSinksPatchCall ) Context ( ctx context . Context ) * BillingAccountsSinksPatchCall {
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 * BillingAccountsSinksPatchCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * BillingAccountsSinksPatchCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PATCH" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkNameid ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.billingAccounts.sinks.patch" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * BillingAccountsSinksPatchCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , 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 := & LogSink {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2019-05-01 20:20:21 +00:00
// "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
2017-09-15 02:15:14 +00:00
// "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
// "httpMethod": "PATCH",
// "id": "logging.billingAccounts.sinks.patch",
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
// "required": true,
// "type": "string"
// },
// "uniqueWriterIdentity": {
// "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
// "location": "query",
// "type": "boolean"
// },
// "updateMask": {
2018-11-15 23:37:19 +00:00
// "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
2017-09-15 02:15:14 +00:00
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "request": {
// "$ref": "LogSink"
// },
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.billingAccounts.sinks.update":
type BillingAccountsSinksUpdateCall struct {
s * Service
sinkNameid string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Update: Updates a sink. This method replaces the following fields in
// the existing sink with values from the new sink: destination, and
2019-05-01 20:20:21 +00:00
// filter.The updated sink might also have a new writer_identity; see
2017-09-15 02:15:14 +00:00
// the unique_writer_identity field.
func ( r * BillingAccountsSinksService ) Update ( sinkNameid string , logsink * LogSink ) * BillingAccountsSinksUpdateCall {
c := & BillingAccountsSinksUpdateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": See sinks.create for a description of this
// field. When updating a sink, the effect of this field on the value of
// writer_identity in the updated sink depends on both the old and new
// values of this field:
// If the old and new values of this field are both false or both true,
// then there is no change to the sink's writer_identity.
// If the old value is false and the new value is true, then
// writer_identity is changed to a unique service account.
// It is an error if the old value is true and the new value is set to
// false or defaulted to false.
func ( c * BillingAccountsSinksUpdateCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * BillingAccountsSinksUpdateCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
return c
}
// UpdateMask sets the optional parameter "updateMask": Field mask that
// specifies the fields in sink that need an update. A sink field will
// be overwritten if, and only if, it is in the update mask. name and
// output only fields cannot be updated.An empty updateMask is
// temporarily treated as using the following mask for backwards
// compatibility purposes: destination,filter,includeChildren At some
// point in the future, behavior will be removed and specifying an empty
// updateMask will be an error.For a detailed FieldMask definition, see
2018-11-15 23:37:19 +00:00
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
2017-09-15 02:15:14 +00:00
// updateMask=filter.
func ( c * BillingAccountsSinksUpdateCall ) UpdateMask ( updateMask string ) * BillingAccountsSinksUpdateCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func ( c * BillingAccountsSinksUpdateCall ) Fields ( s ... googleapi . Field ) * BillingAccountsSinksUpdateCall {
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 * BillingAccountsSinksUpdateCall ) Context ( ctx context . Context ) * BillingAccountsSinksUpdateCall {
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 * BillingAccountsSinksUpdateCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * BillingAccountsSinksUpdateCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PUT" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkNameid ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.billingAccounts.sinks.update" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * BillingAccountsSinksUpdateCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , 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 := & LogSink {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2019-05-01 20:20:21 +00:00
// "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
2017-09-15 02:15:14 +00:00
// "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
// "httpMethod": "PUT",
// "id": "logging.billingAccounts.sinks.update",
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
// "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
// "required": true,
// "type": "string"
// },
// "uniqueWriterIdentity": {
// "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
// "location": "query",
// "type": "boolean"
// },
// "updateMask": {
2018-11-15 23:37:19 +00:00
// "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
2017-09-15 02:15:14 +00:00
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "request": {
// "$ref": "LogSink"
// },
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.entries.list":
type EntriesListCall struct {
s * Service
listlogentriesrequest * ListLogEntriesRequest
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2019-04-15 20:39:47 +00:00
// List: Lists log entries. Use this method to retrieve log entries that
// originated from a project/folder/organization/billing account. For
// ways to export log entries, see Exporting Logs.
2017-09-15 02:15:14 +00:00
func ( r * EntriesService ) List ( listlogentriesrequest * ListLogEntriesRequest ) * EntriesListCall {
c := & EntriesListCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . listlogentriesrequest = listlogentriesrequest
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 * EntriesListCall ) Fields ( s ... googleapi . Field ) * EntriesListCall {
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 * EntriesListCall ) Context ( ctx context . Context ) * EntriesListCall {
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 * EntriesListCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * EntriesListCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . listlogentriesrequest )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/entries:list" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.entries.list" call.
// Exactly one of *ListLogEntriesResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListLogEntriesResponse.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 * EntriesListCall ) Do ( opts ... googleapi . CallOption ) ( * ListLogEntriesResponse , 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 := & ListLogEntriesResponse {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2019-04-15 20:39:47 +00:00
// "description": "Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs.",
2017-09-15 02:15:14 +00:00
// "flatPath": "v2/entries:list",
// "httpMethod": "POST",
// "id": "logging.entries.list",
// "parameterOrder": [],
// "parameters": {},
// "path": "v2/entries:list",
// "request": {
// "$ref": "ListLogEntriesRequest"
// },
// "response": {
// "$ref": "ListLogEntriesResponse"
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * EntriesListCall ) Pages ( ctx context . Context , f func ( * ListLogEntriesResponse ) error ) error {
c . ctx_ = ctx
defer func ( pt string ) { c . listlogentriesrequest . PageToken = pt } ( c . listlogentriesrequest . PageToken ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . listlogentriesrequest . PageToken = x . NextPageToken
}
}
// method id "logging.entries.write":
type EntriesWriteCall struct {
s * Service
writelogentriesrequest * WriteLogEntriesRequest
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Write: Writes log entries to Logging. This API method is the only way
// to send log entries to Logging. This method is used, directly or
// indirectly, by the Logging agent (fluentd) and all logging libraries
// configured to use Logging. A single request may contain log entries
// for a maximum of 1000 different resources (projects, organizations,
// billing accounts or folders)
2017-09-15 02:15:14 +00:00
func ( r * EntriesService ) Write ( writelogentriesrequest * WriteLogEntriesRequest ) * EntriesWriteCall {
c := & EntriesWriteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . writelogentriesrequest = writelogentriesrequest
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 * EntriesWriteCall ) Fields ( s ... googleapi . Field ) * EntriesWriteCall {
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 * EntriesWriteCall ) Context ( ctx context . Context ) * EntriesWriteCall {
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 * EntriesWriteCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * EntriesWriteCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . writelogentriesrequest )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/entries:write" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.entries.write" call.
// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *WriteLogEntriesResponse.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 * EntriesWriteCall ) Do ( opts ... googleapi . CallOption ) ( * WriteLogEntriesResponse , 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 := & WriteLogEntriesResponse {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)",
2017-09-15 02:15:14 +00:00
// "flatPath": "v2/entries:write",
// "httpMethod": "POST",
// "id": "logging.entries.write",
// "parameterOrder": [],
// "parameters": {},
// "path": "v2/entries:write",
// "request": {
// "$ref": "WriteLogEntriesRequest"
// },
// "response": {
// "$ref": "WriteLogEntriesResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.write"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.exclusions.create":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ExclusionsCreateCall struct {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( r * ExclusionsService ) Create ( parent string , logexclusion * LogExclusion ) * ExclusionsCreateCall {
c := & ExclusionsCreateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsCreateCall ) Fields ( s ... googleapi . Field ) * ExclusionsCreateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsCreateCall ) Context ( ctx context . Context ) * ExclusionsCreateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsCreateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsCreateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logexclusion )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/exclusions" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.exclusions.create" call.
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsCreateCall ) Do ( opts ... googleapi . CallOption ) ( * LogExclusion , error ) {
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
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.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/{v2Id}/{v2Id1}/exclusions",
2017-09-15 02:15:14 +00:00
// "httpMethod": "POST",
2018-09-18 19:50:17 +00:00
// "id": "logging.exclusions.create",
2017-09-15 02:15:14 +00:00
// "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",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+$",
2017-09-15 02:15:14 +00:00
// "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"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.exclusions.delete":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ExclusionsDeleteCall struct {
2017-09-15 02:15:14 +00:00
s * Service
name string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Delete: Deletes an exclusion.
2018-09-18 19:50:17 +00:00
func ( r * ExclusionsService ) Delete ( name string ) * ExclusionsDeleteCall {
c := & ExclusionsDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsDeleteCall ) Fields ( s ... googleapi . Field ) * ExclusionsDeleteCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsDeleteCall ) Context ( ctx context . Context ) * ExclusionsDeleteCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsDeleteCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"name" : c . name ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.exclusions.delete" call.
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsDeleteCall ) Do ( opts ... googleapi . CallOption ) ( * Empty , error ) {
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Deletes an exclusion.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "DELETE",
2018-09-18 19:50:17 +00:00
// "id": "logging.exclusions.delete",
2017-09-15 02:15:14 +00:00
// "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",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
2017-09-15 02:15:14 +00:00
// "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"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.exclusions.get":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ExclusionsGetCall struct {
2017-09-15 02:15:14 +00:00
s * Service
name string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// Get: Gets the description of an exclusion.
2018-09-18 19:50:17 +00:00
func ( r * ExclusionsService ) Get ( name string ) * ExclusionsGetCall {
c := & ExclusionsGetCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsGetCall ) Fields ( s ... googleapi . Field ) * ExclusionsGetCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsGetCall ) IfNoneMatch ( entityTag string ) * ExclusionsGetCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsGetCall ) Context ( ctx context . Context ) * ExclusionsGetCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsGetCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsGetCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"name" : c . name ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.exclusions.get" call.
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsGetCall ) Do ( opts ... googleapi . CallOption ) ( * LogExclusion , error ) {
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Gets the description of an exclusion.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.exclusions.get",
2017-09-15 02:15:14 +00:00
// "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",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
2017-09-15 02:15:14 +00:00
// "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"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.exclusions.list":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ExclusionsListCall struct {
2017-09-15 02:15:14 +00:00
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// List: Lists all the exclusions in a parent resource.
2018-09-18 19:50:17 +00:00
func ( r * ExclusionsService ) List ( parent string ) * ExclusionsListCall {
c := & ExclusionsListCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsListCall ) PageSize ( pageSize int64 ) * ExclusionsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsListCall ) PageToken ( pageToken string ) * ExclusionsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsListCall ) Fields ( s ... googleapi . Field ) * ExclusionsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsListCall ) IfNoneMatch ( entityTag string ) * ExclusionsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsListCall ) Context ( ctx context . Context ) * ExclusionsListCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsListCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/exclusions" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.exclusions.list" call.
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsListCall ) Do ( opts ... googleapi . CallOption ) ( * ListExclusionsResponse , error ) {
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Lists all the exclusions in a parent resource.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/{v2Id}/{v2Id1}/exclusions",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.exclusions.list",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent resource whose exclusions are to be listed.\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+parent}/exclusions",
// "response": {
// "$ref": "ListExclusionsResponse"
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsListCall ) Pages ( ctx context . Context , f func ( * ListExclusionsResponse ) error ) error {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2018-09-18 19:50:17 +00:00
// method id "logging.exclusions.patch":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ExclusionsPatchCall struct {
2017-09-15 02:15:14 +00:00
s * Service
name string
logexclusion * LogExclusion
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Patch: Changes one or more properties of an existing exclusion.
2018-09-18 19:50:17 +00:00
func ( r * ExclusionsService ) Patch ( name string , logexclusion * LogExclusion ) * ExclusionsPatchCall {
c := & ExclusionsPatchCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
c . name = name
c . logexclusion = logexclusion
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// nonempty list of fields to change in the existing exclusion. New
// values for the fields are taken from the corresponding fields in the
// LogExclusion included in this request. Fields not mentioned in
// update_mask are not changed and are ignored in the request.For
// example, to change the filter and description of an exclusion,
// specify an update_mask of "filter,description".
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsPatchCall ) UpdateMask ( updateMask string ) * ExclusionsPatchCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "updateMask" , updateMask )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsPatchCall ) Fields ( s ... googleapi . Field ) * ExclusionsPatchCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsPatchCall ) Context ( ctx context . Context ) * ExclusionsPatchCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsPatchCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsPatchCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logexclusion )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PATCH" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"name" : c . name ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.exclusions.patch" call.
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * ExclusionsPatchCall ) Do ( opts ... googleapi . CallOption ) ( * LogExclusion , error ) {
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Changes one or more properties of an existing exclusion.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "PATCH",
2018-09-18 19:50:17 +00:00
// "id": "logging.exclusions.patch",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The resource name of the exclusion to update:\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",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// },
// "updateMask": {
// "description": "Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v2/{+name}",
// "request": {
// "$ref": "LogExclusion"
// },
// "response": {
// "$ref": "LogExclusion"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.folders.exclusions.create":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type FoldersExclusionsCreateCall struct {
s * Service
parent string
logexclusion * LogExclusion
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// 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 * FoldersExclusionsService ) Create ( parent string , logexclusion * LogExclusion ) * FoldersExclusionsCreateCall {
c := & FoldersExclusionsCreateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . parent = parent
c . logexclusion = logexclusion
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsCreateCall ) Fields ( s ... googleapi . Field ) * FoldersExclusionsCreateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsCreateCall ) Context ( ctx context . Context ) * FoldersExclusionsCreateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsCreateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsCreateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logexclusion )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/exclusions" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"parent" : c . parent ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.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 * FoldersExclusionsCreateCall ) Do ( opts ... googleapi . CallOption ) ( * LogExclusion , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogExclusion {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "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/folders/{foldersId}/exclusions",
// "httpMethod": "POST",
// "id": "logging.folders.exclusions.create",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "parent"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "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\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^folders/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/exclusions",
// "request": {
// "$ref": "LogExclusion"
// },
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogExclusion"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.folders.exclusions.delete":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type FoldersExclusionsDeleteCall struct {
s * Service
name string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Delete: Deletes an exclusion.
func ( r * FoldersExclusionsService ) Delete ( name string ) * FoldersExclusionsDeleteCall {
c := & FoldersExclusionsDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . name = name
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsDeleteCall ) Fields ( s ... googleapi . Field ) * FoldersExclusionsDeleteCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsDeleteCall ) Context ( ctx context . Context ) * FoldersExclusionsDeleteCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsDeleteCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"name" : c . name ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.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 * FoldersExclusionsDeleteCall ) Do ( opts ... googleapi . CallOption ) ( * Empty , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & Empty {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Deletes an exclusion.",
// "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
// "httpMethod": "DELETE",
// "id": "logging.folders.exclusions.delete",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "name"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "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\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^folders/[^/]+/exclusions/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+name}",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "Empty"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.folders.exclusions.get":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type FoldersExclusionsGetCall struct {
s * Service
name string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Get: Gets the description of an exclusion.
func ( r * FoldersExclusionsService ) Get ( name string ) * FoldersExclusionsGetCall {
c := & FoldersExclusionsGetCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . name = name
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsGetCall ) Fields ( s ... googleapi . Field ) * FoldersExclusionsGetCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "fields" , googleapi . CombineFields ( s ) )
return c
}
2018-09-18 19:50:17 +00:00
// 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 * FoldersExclusionsGetCall ) IfNoneMatch ( entityTag string ) * FoldersExclusionsGetCall {
c . ifNoneMatch_ = entityTag
return c
}
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsGetCall ) Context ( ctx context . Context ) * FoldersExclusionsGetCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsGetCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsGetCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
2018-09-18 19:50:17 +00:00
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
var body io . Reader = nil
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"name" : c . name ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.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 * FoldersExclusionsGetCall ) Do ( opts ... googleapi . CallOption ) ( * LogExclusion , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogExclusion {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Gets the description of an exclusion.",
// "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
// "httpMethod": "GET",
// "id": "logging.folders.exclusions.get",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "name"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "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\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^folders/[^/]+/exclusions/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+name}",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogExclusion"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/cloud-platform.read-only",
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.read"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.folders.exclusions.list":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type FoldersExclusionsListCall struct {
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// List: Lists all the exclusions in a parent resource.
func ( r * FoldersExclusionsService ) List ( parent string ) * FoldersExclusionsListCall {
c := & FoldersExclusionsListCall { 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 * FoldersExclusionsListCall ) PageSize ( pageSize int64 ) * FoldersExclusionsListCall {
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 * FoldersExclusionsListCall ) PageToken ( pageToken string ) * FoldersExclusionsListCall {
c . urlParams_ . Set ( "pageToken" , pageToken )
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsListCall ) Fields ( s ... googleapi . Field ) * FoldersExclusionsListCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "fields" , googleapi . CombineFields ( s ) )
return c
}
2018-09-18 19:50:17 +00:00
// 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 * FoldersExclusionsListCall ) IfNoneMatch ( entityTag string ) * FoldersExclusionsListCall {
c . ifNoneMatch_ = entityTag
return c
}
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsListCall ) Context ( ctx context . Context ) * FoldersExclusionsListCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsListCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
2018-09-18 19:50:17 +00:00
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
2017-09-15 02:15:14 +00:00
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/exclusions" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"parent" : c . parent ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.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 * FoldersExclusionsListCall ) Do ( opts ... googleapi . CallOption ) ( * ListExclusionsResponse , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & ListExclusionsResponse {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Lists all the exclusions in a parent resource.",
// "flatPath": "v2/folders/{foldersId}/exclusions",
// "httpMethod": "GET",
// "id": "logging.folders.exclusions.list",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "parent"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent resource whose exclusions are to be listed.\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^folders/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/exclusions",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "ListExclusionsResponse"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/cloud-platform.read-only",
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.read"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * FoldersExclusionsListCall ) Pages ( ctx context . Context , f func ( * ListExclusionsResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
// method id "logging.folders.exclusions.patch":
type FoldersExclusionsPatchCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
name string
logexclusion * LogExclusion
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Patch: Changes one or more properties of an existing exclusion.
func ( r * FoldersExclusionsService ) Patch ( name string , logexclusion * LogExclusion ) * FoldersExclusionsPatchCall {
c := & FoldersExclusionsPatchCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . name = name
c . logexclusion = logexclusion
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// nonempty list of fields to change in the existing exclusion. New
// values for the fields are taken from the corresponding fields in the
// LogExclusion included in this request. Fields not mentioned in
// update_mask are not changed and are ignored in the request.For
// example, to change the filter and description of an exclusion,
// specify an update_mask of "filter,description".
func ( c * FoldersExclusionsPatchCall ) UpdateMask ( updateMask string ) * FoldersExclusionsPatchCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsPatchCall ) Fields ( s ... googleapi . Field ) * FoldersExclusionsPatchCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsPatchCall ) Context ( ctx context . Context ) * FoldersExclusionsPatchCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsPatchCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersExclusionsPatchCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logexclusion )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PATCH" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"name" : c . name ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.exclusions.patch" 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 * FoldersExclusionsPatchCall ) Do ( opts ... googleapi . CallOption ) ( * LogExclusion , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogExclusion {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Changes one or more properties of an existing exclusion.",
// "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
// "httpMethod": "PATCH",
// "id": "logging.folders.exclusions.patch",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "name"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "name": {
// "description": "Required. The resource name of the exclusion to update:\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\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^folders/[^/]+/exclusions/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
2018-09-18 19:50:17 +00:00
// },
// "updateMask": {
// "description": "Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
2017-09-15 02:15:14 +00:00
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+name}",
// "request": {
// "$ref": "LogExclusion"
// },
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogExclusion"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.folders.logs.delete":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type FoldersLogsDeleteCall struct {
s * Service
logName string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Delete: Deletes all the log entries in a log. The log reappears if it
// receives new entries. Log entries written shortly before the delete
// operation might not be deleted.
func ( r * FoldersLogsService ) Delete ( logName string ) * FoldersLogsDeleteCall {
c := & FoldersLogsDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . logName = logName
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 * FoldersLogsDeleteCall ) Fields ( s ... googleapi . Field ) * FoldersLogsDeleteCall {
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 * FoldersLogsDeleteCall ) Context ( ctx context . Context ) * FoldersLogsDeleteCall {
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 * FoldersLogsDeleteCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * FoldersLogsDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+logName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"logName" : c . logName ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.folders.logs.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 * FoldersLogsDeleteCall ) 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 all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.",
// "flatPath": "v2/folders/{foldersId}/logs/{logsId}",
// "httpMethod": "DELETE",
// "id": "logging.folders.logs.delete",
// "parameterOrder": [
// "logName"
// ],
// "parameters": {
// "logName": {
// "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.",
// "location": "path",
// "pattern": "^folders/[^/]+/logs/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+logName}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.folders.logs.list":
type FoldersLogsListCall struct {
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// List: Lists the logs in projects, organizations, folders, or billing
// accounts. Only logs that have entries are listed.
func ( r * FoldersLogsService ) List ( parent string ) * FoldersLogsListCall {
c := & FoldersLogsListCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersLogsListCall ) PageSize ( pageSize int64 ) * FoldersLogsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersLogsListCall ) PageToken ( pageToken string ) * FoldersLogsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersLogsListCall ) Fields ( s ... googleapi . Field ) * FoldersLogsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersLogsListCall ) IfNoneMatch ( entityTag string ) * FoldersLogsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersLogsListCall ) Context ( ctx context . Context ) * FoldersLogsListCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersLogsListCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersLogsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/logs" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.logs.list" call.
// Exactly one of *ListLogsResponse or error will be non-nil. Any
2017-09-15 02:15:14 +00:00
// non-2xx status code is an error. Response headers are in either
2018-09-18 19:50:17 +00:00
// *ListLogsResponse.ServerResponse.Header or (if a response was
2017-09-15 02:15:14 +00:00
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
2018-09-18 19:50:17 +00:00
func ( c * FoldersLogsListCall ) Do ( opts ... googleapi . CallOption ) ( * ListLogsResponse , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & ListLogsResponse {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
// "flatPath": "v2/folders/{foldersId}/logs",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.folders.logs.list",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
2018-09-18 19:50:17 +00:00
// "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
2017-09-15 02:15:14 +00:00
// "location": "path",
// "pattern": "^folders/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/logs",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "ListLogsResponse"
2017-09-15 02:15:14 +00:00
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
2018-09-18 19:50:17 +00:00
func ( c * FoldersLogsListCall ) Pages ( ctx context . Context , f func ( * ListLogsResponse ) error ) error {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2018-09-18 19:50:17 +00:00
// method id "logging.folders.sinks.create":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type FoldersSinksCreateCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
parent string
2017-09-15 02:15:14 +00:00
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Create: Creates a sink that exports specified log entries to a
// destination. The export of newly-ingested log entries begins
// immediately, unless the sink's writer_identity is not permitted to
// write to the destination. A sink can export log entries only from the
// resource owning the sink.
func ( r * FoldersSinksService ) Create ( parent string , logsink * LogSink ) * FoldersSinksCreateCall {
c := & FoldersSinksCreateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . parent = parent
2017-09-15 02:15:14 +00:00
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
2018-09-18 19:50:17 +00:00
// "uniqueWriterIdentity": Determines the kind of IAM identity returned
// as writer_identity in the new sink. If this value is omitted or set
// to false, and if the sink's parent is a project, then the value
// returned as writer_identity is the same group or service account used
// by Logging before the addition of writer identities to this API. The
// sink's destination must be in the same project as the sink itself.If
// this field is set to true, or if the sink is owned by a non-project
// resource such as an organization, then the value of writer_identity
// will be a unique service account used only for exports from the new
// sink. For more information, see writer_identity in LogSink.
func ( c * FoldersSinksCreateCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * FoldersSinksCreateCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksCreateCall ) Fields ( s ... googleapi . Field ) * FoldersSinksCreateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksCreateCall ) Context ( ctx context . Context ) * FoldersSinksCreateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksCreateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksCreateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/sinks" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"parent" : c . parent ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.sinks.create" call.
2017-09-15 02:15:14 +00:00
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksCreateCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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 := & LogSink {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.",
// "flatPath": "v2/folders/{foldersId}/sinks",
// "httpMethod": "POST",
// "id": "logging.folders.sinks.create",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "parent"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "parent": {
// "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^folders/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// },
// "uniqueWriterIdentity": {
2018-09-18 19:50:17 +00:00
// "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.",
2017-09-15 02:15:14 +00:00
// "location": "query",
// "type": "boolean"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/sinks",
2017-09-15 02:15:14 +00:00
// "request": {
// "$ref": "LogSink"
// },
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.folders.sinks.delete":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type FoldersSinksDeleteCall struct {
2017-09-15 02:15:14 +00:00
s * Service
sinkNameid string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Delete: Deletes a sink. If the sink has a unique writer_identity,
// then that service account is also deleted.
func ( r * FoldersSinksService ) Delete ( sinkNameid string ) * FoldersSinksDeleteCall {
c := & FoldersSinksDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
c . sinkNameid = sinkNameid
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksDeleteCall ) Fields ( s ... googleapi . Field ) * FoldersSinksDeleteCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksDeleteCall ) Context ( ctx context . Context ) * FoldersSinksDeleteCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksDeleteCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkNameid ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.sinks.delete" call.
// Exactly one of *Empty or error will be non-nil. Any non-2xx status
2017-09-15 02:15:14 +00:00
// code is an error. Response headers are in either
2018-09-18 19:50:17 +00:00
// *Empty.ServerResponse.Header or (if a response was returned at all)
2017-09-15 02:15:14 +00:00
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksDeleteCall ) Do ( opts ... googleapi . CallOption ) ( * Empty , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & Empty {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
2017-09-15 02:15:14 +00:00
// "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
2018-09-18 19:50:17 +00:00
// "httpMethod": "DELETE",
// "id": "logging.folders.sinks.delete",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
2018-09-18 19:50:17 +00:00
// "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
// "pattern": "^folders/[^/]+/sinks/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "Empty"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.folders.sinks.get":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type FoldersSinksGetCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
sinkName string
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Get: Gets a sink.
func ( r * FoldersSinksService ) Get ( sinkName string ) * FoldersSinksGetCall {
c := & FoldersSinksGetCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkName = sinkName
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksGetCall ) Fields ( s ... googleapi . Field ) * FoldersSinksGetCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksGetCall ) IfNoneMatch ( entityTag string ) * FoldersSinksGetCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksGetCall ) Context ( ctx context . Context ) * FoldersSinksGetCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksGetCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksGetCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
2018-09-18 19:50:17 +00:00
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkName ,
} )
2017-09-15 02:15:14 +00:00
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.sinks.get" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * FoldersSinksGetCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogSink {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Gets a sink.",
// "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.folders.sinks.get",
// "parameterOrder": [
// "sinkName"
// ],
2017-09-15 02:15:14 +00:00
// "parameters": {
2018-09-18 19:50:17 +00:00
// "sinkName": {
// "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
// "pattern": "^folders/[^/]+/sinks/[^/]+$",
// "required": true,
2017-09-15 02:15:14 +00:00
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+sinkName}",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogSink"
2017-09-15 02:15:14 +00:00
// },
// "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"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.folders.sinks.list":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type FoldersSinksListCall struct {
2017-09-15 02:15:14 +00:00
s * Service
parent string
urlParams_ gensupport . URLParams
2018-09-18 19:50:17 +00:00
ifNoneMatch_ string
2017-09-15 02:15:14 +00:00
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// List: Lists sinks.
func ( r * FoldersSinksService ) List ( parent string ) * FoldersSinksListCall {
c := & FoldersSinksListCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
c . parent = parent
return c
}
2018-09-18 19:50:17 +00:00
// 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 * FoldersSinksListCall ) PageSize ( pageSize int64 ) * FoldersSinksListCall {
c . urlParams_ . Set ( "pageSize" , fmt . Sprint ( pageSize ) )
2017-09-15 02:15:14 +00:00
return c
}
2018-09-18 19:50:17 +00:00
// 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 * FoldersSinksListCall ) PageToken ( pageToken string ) * FoldersSinksListCall {
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 * FoldersSinksListCall ) Fields ( s ... googleapi . Field ) * FoldersSinksListCall {
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 * FoldersSinksListCall ) IfNoneMatch ( entityTag string ) * FoldersSinksListCall {
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 * FoldersSinksListCall ) Context ( ctx context . Context ) * FoldersSinksListCall {
c . ctx_ = ctx
return c
2017-09-15 02:15:14 +00:00
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksListCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksListCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
2018-09-18 19:50:17 +00:00
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
var body io . Reader = nil
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/sinks" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.sinks.list" call.
// Exactly one of *ListSinksResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListSinksResponse.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 * FoldersSinksListCall ) Do ( opts ... googleapi . CallOption ) ( * ListSinksResponse , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & ListSinksResponse {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Lists sinks.",
// "flatPath": "v2/folders/{foldersId}/sinks",
// "httpMethod": "GET",
// "id": "logging.folders.sinks.list",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
2017-09-15 02:15:14 +00:00
// "parent": {
2018-09-18 19:50:17 +00:00
// "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^folders/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/sinks",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "ListSinksResponse"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/cloud-platform.read-only",
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.read"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * FoldersSinksListCall ) Pages ( ctx context . Context , f func ( * ListSinksResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
// method id "logging.folders.sinks.patch":
type FoldersSinksPatchCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
sinkNameid string
logsink * LogSink
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Patch: Updates a sink. This method replaces the following fields in
// the existing sink with values from the new sink: destination, and
2019-05-01 20:20:21 +00:00
// filter.The updated sink might also have a new writer_identity; see
2018-09-18 19:50:17 +00:00
// the unique_writer_identity field.
func ( r * FoldersSinksService ) Patch ( sinkNameid string , logsink * LogSink ) * FoldersSinksPatchCall {
c := & FoldersSinksPatchCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": See sinks.create for a description of this
// field. When updating a sink, the effect of this field on the value of
// writer_identity in the updated sink depends on both the old and new
// values of this field:
// If the old and new values of this field are both false or both true,
// then there is no change to the sink's writer_identity.
// If the old value is false and the new value is true, then
// writer_identity is changed to a unique service account.
// It is an error if the old value is true and the new value is set to
// false or defaulted to false.
func ( c * FoldersSinksPatchCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * FoldersSinksPatchCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
return c
}
// UpdateMask sets the optional parameter "updateMask": Field mask that
// specifies the fields in sink that need an update. A sink field will
// be overwritten if, and only if, it is in the update mask. name and
// output only fields cannot be updated.An empty updateMask is
// temporarily treated as using the following mask for backwards
// compatibility purposes: destination,filter,includeChildren At some
// point in the future, behavior will be removed and specifying an empty
// updateMask will be an error.For a detailed FieldMask definition, see
2018-11-15 23:37:19 +00:00
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
2018-09-18 19:50:17 +00:00
// updateMask=filter.
func ( c * FoldersSinksPatchCall ) UpdateMask ( updateMask string ) * FoldersSinksPatchCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksPatchCall ) Fields ( s ... googleapi . Field ) * FoldersSinksPatchCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksPatchCall ) Context ( ctx context . Context ) * FoldersSinksPatchCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksPatchCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksPatchCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PATCH" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"sinkName" : c . sinkNameid ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.sinks.patch" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
2017-09-15 02:15:14 +00:00
// code is an error. Response headers are in either
2018-09-18 19:50:17 +00:00
// *LogSink.ServerResponse.Header or (if a response was returned at all)
2017-09-15 02:15:14 +00:00
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksPatchCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogSink {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2019-05-01 20:20:21 +00:00
// "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
// "httpMethod": "PATCH",
// "id": "logging.folders.sinks.patch",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "sinkName"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "sinkName": {
// "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^folders/[^/]+/sinks/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
2018-09-18 19:50:17 +00:00
// },
// "uniqueWriterIdentity": {
// "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
// "location": "query",
// "type": "boolean"
// },
// "updateMask": {
2018-11-15 23:37:19 +00:00
// "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
2018-09-18 19:50:17 +00:00
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
2017-09-15 02:15:14 +00:00
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+sinkName}",
// "request": {
// "$ref": "LogSink"
// },
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogSink"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.folders.sinks.update":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type FoldersSinksUpdateCall struct {
s * Service
sinkNameid string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Update: Updates a sink. This method replaces the following fields in
// the existing sink with values from the new sink: destination, and
2019-05-01 20:20:21 +00:00
// filter.The updated sink might also have a new writer_identity; see
2018-09-18 19:50:17 +00:00
// the unique_writer_identity field.
func ( r * FoldersSinksService ) Update ( sinkNameid string , logsink * LogSink ) * FoldersSinksUpdateCall {
c := & FoldersSinksUpdateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": See sinks.create for a description of this
// field. When updating a sink, the effect of this field on the value of
// writer_identity in the updated sink depends on both the old and new
// values of this field:
// If the old and new values of this field are both false or both true,
// then there is no change to the sink's writer_identity.
// If the old value is false and the new value is true, then
// writer_identity is changed to a unique service account.
// It is an error if the old value is true and the new value is set to
// false or defaulted to false.
func ( c * FoldersSinksUpdateCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * FoldersSinksUpdateCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
return c
}
// UpdateMask sets the optional parameter "updateMask": Field mask that
// specifies the fields in sink that need an update. A sink field will
// be overwritten if, and only if, it is in the update mask. name and
// output only fields cannot be updated.An empty updateMask is
// temporarily treated as using the following mask for backwards
// compatibility purposes: destination,filter,includeChildren At some
// point in the future, behavior will be removed and specifying an empty
// updateMask will be an error.For a detailed FieldMask definition, see
2018-11-15 23:37:19 +00:00
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
2018-09-18 19:50:17 +00:00
// updateMask=filter.
func ( c * FoldersSinksUpdateCall ) UpdateMask ( updateMask string ) * FoldersSinksUpdateCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksUpdateCall ) Fields ( s ... googleapi . Field ) * FoldersSinksUpdateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksUpdateCall ) Context ( ctx context . Context ) * FoldersSinksUpdateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksUpdateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * FoldersSinksUpdateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PUT" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"sinkName" : c . sinkNameid ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.folders.sinks.update" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * FoldersSinksUpdateCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogSink {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2019-05-01 20:20:21 +00:00
// "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
// "httpMethod": "PUT",
// "id": "logging.folders.sinks.update",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "sinkName"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "sinkName": {
// "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^folders/[^/]+/sinks/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
2018-09-18 19:50:17 +00:00
// },
// "uniqueWriterIdentity": {
// "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
// "location": "query",
// "type": "boolean"
// },
// "updateMask": {
2018-11-15 23:37:19 +00:00
// "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
2018-09-18 19:50:17 +00:00
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
2017-09-15 02:15:14 +00:00
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+sinkName}",
// "request": {
// "$ref": "LogSink"
// },
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogSink"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.logs.delete":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type LogsDeleteCall struct {
s * Service
logName string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Delete: Deletes all the log entries in a log. The log reappears if it
// receives new entries. Log entries written shortly before the delete
// operation might not be deleted.
func ( r * LogsService ) Delete ( logName string ) * LogsDeleteCall {
c := & LogsDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . logName = logName
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * LogsDeleteCall ) Fields ( s ... googleapi . Field ) * LogsDeleteCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * LogsDeleteCall ) Context ( ctx context . Context ) * LogsDeleteCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * LogsDeleteCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * LogsDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+logName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"logName" : c . logName ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.logs.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 * LogsDeleteCall ) Do ( opts ... googleapi . CallOption ) ( * Empty , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & Empty {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.",
// "flatPath": "v2/{v2Id}/{v2Id1}/logs/{logsId}",
// "httpMethod": "DELETE",
// "id": "logging.logs.delete",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "logName"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "logName": {
// "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+/logs/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+logName}",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "Empty"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.logs.list":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type LogsListCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
parent string
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
2018-09-18 19:50:17 +00:00
ifNoneMatch_ string
2017-09-15 02:15:14 +00:00
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// List: Lists the logs in projects, organizations, folders, or billing
// accounts. Only logs that have entries are listed.
func ( r * LogsService ) List ( parent string ) * LogsListCall {
c := & LogsListCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . parent = parent
2017-09-15 02:15:14 +00:00
return c
}
2018-09-18 19:50:17 +00:00
// 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 * LogsListCall ) PageSize ( pageSize int64 ) * LogsListCall {
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 * LogsListCall ) PageToken ( pageToken string ) * LogsListCall {
c . urlParams_ . Set ( "pageToken" , pageToken )
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * LogsListCall ) Fields ( s ... googleapi . Field ) * LogsListCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "fields" , googleapi . CombineFields ( s ) )
return c
}
2018-09-18 19:50:17 +00:00
// 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 * LogsListCall ) IfNoneMatch ( entityTag string ) * LogsListCall {
c . ifNoneMatch_ = entityTag
return c
}
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * LogsListCall ) Context ( ctx context . Context ) * LogsListCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * LogsListCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * LogsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
2018-09-18 19:50:17 +00:00
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
var body io . Reader = nil
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/logs" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"parent" : c . parent ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.logs.list" call.
// Exactly one of *ListLogsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListLogsResponse.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 * LogsListCall ) Do ( opts ... googleapi . CallOption ) ( * ListLogsResponse , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & ListLogsResponse {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
// "flatPath": "v2/{v2Id}/{v2Id1}/logs",
// "httpMethod": "GET",
// "id": "logging.logs.list",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "parent"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
2017-09-15 02:15:14 +00:00
// },
2018-09-18 19:50:17 +00:00
// "pageToken": {
// "description": "Optional. 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.",
2017-09-15 02:15:14 +00:00
// "location": "query",
// "type": "string"
2018-09-18 19:50:17 +00:00
// },
// "parent": {
// "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
// "location": "path",
// "pattern": "^[^/]+/[^/]+$",
// "required": true,
// "type": "string"
2017-09-15 02:15:14 +00:00
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/logs",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "ListLogsResponse"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/cloud-platform.read-only",
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.read"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * LogsListCall ) Pages ( ctx context . Context , f func ( * ListLogsResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
// method id "logging.monitoredResourceDescriptors.list":
type MonitoredResourceDescriptorsListCall struct {
s * Service
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// List: Lists the descriptors for monitored resource types used by
// Logging.
func ( r * MonitoredResourceDescriptorsService ) List ( ) * MonitoredResourceDescriptorsListCall {
c := & MonitoredResourceDescriptorsListCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
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 * MonitoredResourceDescriptorsListCall ) PageSize ( pageSize int64 ) * MonitoredResourceDescriptorsListCall {
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 * MonitoredResourceDescriptorsListCall ) PageToken ( pageToken string ) * MonitoredResourceDescriptorsListCall {
c . urlParams_ . Set ( "pageToken" , pageToken )
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * MonitoredResourceDescriptorsListCall ) Fields ( s ... googleapi . Field ) * MonitoredResourceDescriptorsListCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "fields" , googleapi . CombineFields ( s ) )
return c
}
2018-09-18 19:50:17 +00:00
// 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 * MonitoredResourceDescriptorsListCall ) IfNoneMatch ( entityTag string ) * MonitoredResourceDescriptorsListCall {
c . ifNoneMatch_ = entityTag
return c
}
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * MonitoredResourceDescriptorsListCall ) Context ( ctx context . Context ) * MonitoredResourceDescriptorsListCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * MonitoredResourceDescriptorsListCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * MonitoredResourceDescriptorsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
2018-09-18 19:50:17 +00:00
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
2017-09-15 02:15:14 +00:00
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/monitoredResourceDescriptors" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.monitoredResourceDescriptors.list" call.
// Exactly one of *ListMonitoredResourceDescriptorsResponse or error
// will be non-nil. Any non-2xx status code is an error. Response
// headers are in either
// *ListMonitoredResourceDescriptorsResponse.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 * MonitoredResourceDescriptorsListCall ) Do ( opts ... googleapi . CallOption ) ( * ListMonitoredResourceDescriptorsResponse , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & ListMonitoredResourceDescriptorsResponse {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Lists the descriptors for monitored resource types used by Logging.",
// "flatPath": "v2/monitoredResourceDescriptors",
// "httpMethod": "GET",
// "id": "logging.monitoredResourceDescriptors.list",
// "parameterOrder": [],
2017-09-15 02:15:14 +00:00
// "parameters": {
2018-09-18 19:50:17 +00:00
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v2/monitoredResourceDescriptors",
// "response": {
// "$ref": "ListMonitoredResourceDescriptorsResponse"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/cloud-platform.read-only",
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.read"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * MonitoredResourceDescriptorsListCall ) Pages ( ctx context . Context , f func ( * ListMonitoredResourceDescriptorsResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
// method id "logging.organizations.exclusions.create":
type OrganizationsExclusionsCreateCall struct {
2017-09-15 02:15:14 +00:00
s * Service
parent string
2018-09-18 19:50:17 +00:00
logexclusion * LogExclusion
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// 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 * OrganizationsExclusionsService ) Create ( parent string , logexclusion * LogExclusion ) * OrganizationsExclusionsCreateCall {
c := & OrganizationsExclusionsCreateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
c . parent = parent
2018-09-18 19:50:17 +00:00
c . logexclusion = logexclusion
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsCreateCall ) Fields ( s ... googleapi . Field ) * OrganizationsExclusionsCreateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsCreateCall ) Context ( ctx context . Context ) * OrganizationsExclusionsCreateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsCreateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsCreateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logexclusion )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/exclusions" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.organizations.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 * OrganizationsExclusionsCreateCall ) Do ( opts ... googleapi . CallOption ) ( * LogExclusion , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogExclusion {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "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/organizations/{organizationsId}/exclusions",
// "httpMethod": "POST",
// "id": "logging.organizations.exclusions.create",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
2018-09-18 19:50:17 +00:00
// "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\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
// "pattern": "^organizations/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/exclusions",
// "request": {
// "$ref": "LogExclusion"
// },
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogExclusion"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.organizations.exclusions.delete":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type OrganizationsExclusionsDeleteCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
name string
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Delete: Deletes an exclusion.
func ( r * OrganizationsExclusionsService ) Delete ( name string ) * OrganizationsExclusionsDeleteCall {
c := & OrganizationsExclusionsDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . name = name
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsDeleteCall ) Fields ( s ... googleapi . Field ) * OrganizationsExclusionsDeleteCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsDeleteCall ) Context ( ctx context . Context ) * OrganizationsExclusionsDeleteCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsDeleteCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"name" : c . name ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.organizations.exclusions.delete" call.
// Exactly one of *Empty or error will be non-nil. Any non-2xx status
2017-09-15 02:15:14 +00:00
// code is an error. Response headers are in either
2018-09-18 19:50:17 +00:00
// *Empty.ServerResponse.Header or (if a response was returned at all)
2017-09-15 02:15:14 +00:00
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsDeleteCall ) Do ( opts ... googleapi . CallOption ) ( * Empty , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & Empty {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Deletes an exclusion.",
// "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
// "httpMethod": "DELETE",
// "id": "logging.organizations.exclusions.delete",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "name"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "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\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+name}",
2017-09-15 02:15:14 +00:00
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.organizations.exclusions.get":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type OrganizationsExclusionsGetCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
name string
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Get: Gets the description of an exclusion.
func ( r * OrganizationsExclusionsService ) Get ( name string ) * OrganizationsExclusionsGetCall {
c := & OrganizationsExclusionsGetCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . name = name
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsGetCall ) Fields ( s ... googleapi . Field ) * OrganizationsExclusionsGetCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsGetCall ) IfNoneMatch ( entityTag string ) * OrganizationsExclusionsGetCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsGetCall ) Context ( ctx context . Context ) * OrganizationsExclusionsGetCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsGetCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsGetCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"name" : c . name ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.organizations.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 * OrganizationsExclusionsGetCall ) Do ( opts ... googleapi . CallOption ) ( * LogExclusion , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogExclusion {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Gets the description of an exclusion.",
// "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.organizations.exclusions.get",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "name"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "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\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+name}",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogExclusion"
2017-09-15 02:15:14 +00:00
// },
// "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"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.organizations.exclusions.list":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type OrganizationsExclusionsListCall struct {
2017-09-15 02:15:14 +00:00
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// List: Lists all the exclusions in a parent resource.
func ( r * OrganizationsExclusionsService ) List ( parent string ) * OrganizationsExclusionsListCall {
c := & OrganizationsExclusionsListCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsListCall ) PageSize ( pageSize int64 ) * OrganizationsExclusionsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsListCall ) PageToken ( pageToken string ) * OrganizationsExclusionsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsListCall ) Fields ( s ... googleapi . Field ) * OrganizationsExclusionsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsListCall ) IfNoneMatch ( entityTag string ) * OrganizationsExclusionsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsListCall ) Context ( ctx context . Context ) * OrganizationsExclusionsListCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsListCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/exclusions" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.organizations.exclusions.list" call.
// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
2017-09-15 02:15:14 +00:00
// non-2xx status code is an error. Response headers are in either
2018-09-18 19:50:17 +00:00
// *ListExclusionsResponse.ServerResponse.Header or (if a response was
2017-09-15 02:15:14 +00:00
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsListCall ) Do ( opts ... googleapi . CallOption ) ( * ListExclusionsResponse , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & ListExclusionsResponse {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Lists all the exclusions in a parent resource.",
// "flatPath": "v2/organizations/{organizationsId}/exclusions",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.organizations.exclusions.list",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
2018-09-18 19:50:17 +00:00
// "description": "Required. The parent resource whose exclusions are to be listed.\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
2017-09-15 02:15:14 +00:00
// "location": "path",
// "pattern": "^organizations/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/exclusions",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "ListExclusionsResponse"
2017-09-15 02:15:14 +00:00
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsListCall ) Pages ( ctx context . Context , f func ( * ListExclusionsResponse ) error ) error {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2018-09-18 19:50:17 +00:00
// method id "logging.organizations.exclusions.patch":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type OrganizationsExclusionsPatchCall struct {
s * Service
name string
logexclusion * LogExclusion
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Patch: Changes one or more properties of an existing exclusion.
func ( r * OrganizationsExclusionsService ) Patch ( name string , logexclusion * LogExclusion ) * OrganizationsExclusionsPatchCall {
c := & OrganizationsExclusionsPatchCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . name = name
c . logexclusion = logexclusion
2017-09-15 02:15:14 +00:00
return c
}
2018-09-18 19:50:17 +00:00
// UpdateMask sets the optional parameter "updateMask": Required. A
// nonempty list of fields to change in the existing exclusion. New
// values for the fields are taken from the corresponding fields in the
// LogExclusion included in this request. Fields not mentioned in
// update_mask are not changed and are ignored in the request.For
// example, to change the filter and description of an exclusion,
// specify an update_mask of "filter,description".
func ( c * OrganizationsExclusionsPatchCall ) UpdateMask ( updateMask string ) * OrganizationsExclusionsPatchCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "updateMask" , updateMask )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsPatchCall ) Fields ( s ... googleapi . Field ) * OrganizationsExclusionsPatchCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsPatchCall ) Context ( ctx context . Context ) * OrganizationsExclusionsPatchCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsPatchCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsExclusionsPatchCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logexclusion )
2017-09-15 02:15:14 +00:00
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PATCH" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"name" : c . name ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.organizations.exclusions.patch" 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 * OrganizationsExclusionsPatchCall ) Do ( opts ... googleapi . CallOption ) ( * LogExclusion , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogExclusion {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Changes one or more properties of an existing exclusion.",
// "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "PATCH",
2018-09-18 19:50:17 +00:00
// "id": "logging.organizations.exclusions.patch",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "name"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "name": {
// "description": "Required. The resource name of the exclusion to update:\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\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// },
// "updateMask": {
2018-09-18 19:50:17 +00:00
// "description": "Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".",
2017-09-15 02:15:14 +00:00
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+name}",
2017-09-15 02:15:14 +00:00
// "request": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogExclusion"
2017-09-15 02:15:14 +00:00
// },
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogExclusion"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.organizations.logs.delete":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type OrganizationsLogsDeleteCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
logName string
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Delete: Deletes all the log entries in a log. The log reappears if it
// receives new entries. Log entries written shortly before the delete
// operation might not be deleted.
func ( r * OrganizationsLogsService ) Delete ( logName string ) * OrganizationsLogsDeleteCall {
c := & OrganizationsLogsDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . logName = logName
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsLogsDeleteCall ) Fields ( s ... googleapi . Field ) * OrganizationsLogsDeleteCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsLogsDeleteCall ) Context ( ctx context . Context ) * OrganizationsLogsDeleteCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsLogsDeleteCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * OrganizationsLogsDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+logName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"logName" : c . logName ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.organizations.logs.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 * OrganizationsLogsDeleteCall ) 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 ,
}
}
2017-09-15 02:15:14 +00:00
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
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 all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.",
// "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}",
// "httpMethod": "DELETE",
// "id": "logging.organizations.logs.delete",
// "parameterOrder": [
// "logName"
// ],
// "parameters": {
// "logName": {
// "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.",
// "location": "path",
// "pattern": "^organizations/[^/]+/logs/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+logName}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.organizations.logs.list":
type OrganizationsLogsListCall struct {
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// List: Lists the logs in projects, organizations, folders, or billing
// accounts. Only logs that have entries are listed.
func ( r * OrganizationsLogsService ) List ( parent string ) * OrganizationsLogsListCall {
c := & OrganizationsLogsListCall { 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 * OrganizationsLogsListCall ) PageSize ( pageSize int64 ) * OrganizationsLogsListCall {
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 * OrganizationsLogsListCall ) PageToken ( pageToken string ) * OrganizationsLogsListCall {
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 * OrganizationsLogsListCall ) Fields ( s ... googleapi . Field ) * OrganizationsLogsListCall {
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 * OrganizationsLogsListCall ) IfNoneMatch ( entityTag string ) * OrganizationsLogsListCall {
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 * OrganizationsLogsListCall ) Context ( ctx context . Context ) * OrganizationsLogsListCall {
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 * OrganizationsLogsListCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * OrganizationsLogsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/logs" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
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.organizations.logs.list" call.
// Exactly one of *ListLogsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListLogsResponse.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 * OrganizationsLogsListCall ) Do ( opts ... googleapi . CallOption ) ( * ListLogsResponse , 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 := & ListLogsResponse {
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 the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
// "flatPath": "v2/organizations/{organizationsId}/logs",
// "httpMethod": "GET",
// "id": "logging.organizations.logs.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
// "location": "path",
// "pattern": "^organizations/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+parent}/logs",
// "response": {
// "$ref": "ListLogsResponse"
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * OrganizationsLogsListCall ) Pages ( ctx context . Context , f func ( * ListLogsResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
// method id "logging.organizations.sinks.create":
type OrganizationsSinksCreateCall struct {
s * Service
parent string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Create: Creates a sink that exports specified log entries to a
// destination. The export of newly-ingested log entries begins
// immediately, unless the sink's writer_identity is not permitted to
// write to the destination. A sink can export log entries only from the
// resource owning the sink.
func ( r * OrganizationsSinksService ) Create ( parent string , logsink * LogSink ) * OrganizationsSinksCreateCall {
c := & OrganizationsSinksCreateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . parent = parent
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": Determines the kind of IAM identity returned
// as writer_identity in the new sink. If this value is omitted or set
// to false, and if the sink's parent is a project, then the value
// returned as writer_identity is the same group or service account used
// by Logging before the addition of writer identities to this API. The
// sink's destination must be in the same project as the sink itself.If
// this field is set to true, or if the sink is owned by a non-project
// resource such as an organization, then the value of writer_identity
// will be a unique service account used only for exports from the new
// sink. For more information, see writer_identity in LogSink.
func ( c * OrganizationsSinksCreateCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * OrganizationsSinksCreateCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
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 * OrganizationsSinksCreateCall ) Fields ( s ... googleapi . Field ) * OrganizationsSinksCreateCall {
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 * OrganizationsSinksCreateCall ) Context ( ctx context . Context ) * OrganizationsSinksCreateCall {
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 * OrganizationsSinksCreateCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * OrganizationsSinksCreateCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/sinks" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
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.organizations.sinks.create" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * OrganizationsSinksCreateCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , 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 := & LogSink {
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 sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.",
// "flatPath": "v2/organizations/{organizationsId}/sinks",
// "httpMethod": "POST",
// "id": "logging.organizations.sinks.create",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The resource in which to create the sink:\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": "^organizations/[^/]+$",
// "required": true,
// "type": "string"
// },
// "uniqueWriterIdentity": {
// "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.",
// "location": "query",
// "type": "boolean"
// }
// },
// "path": "v2/{+parent}/sinks",
// "request": {
// "$ref": "LogSink"
// },
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.organizations.sinks.delete":
type OrganizationsSinksDeleteCall struct {
s * Service
sinkNameid string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Delete: Deletes a sink. If the sink has a unique writer_identity,
// then that service account is also deleted.
func ( r * OrganizationsSinksService ) Delete ( sinkNameid string ) * OrganizationsSinksDeleteCall {
c := & OrganizationsSinksDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
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 * OrganizationsSinksDeleteCall ) Fields ( s ... googleapi . Field ) * OrganizationsSinksDeleteCall {
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 * OrganizationsSinksDeleteCall ) Context ( ctx context . Context ) * OrganizationsSinksDeleteCall {
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 * OrganizationsSinksDeleteCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * OrganizationsSinksDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkNameid ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.organizations.sinks.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 * OrganizationsSinksDeleteCall ) 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 a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
// "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
// "httpMethod": "DELETE",
// "id": "logging.organizations.sinks.delete",
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
// "pattern": "^organizations/[^/]+/sinks/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.organizations.sinks.get":
type OrganizationsSinksGetCall struct {
s * Service
sinkName string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// Get: Gets a sink.
func ( r * OrganizationsSinksService ) Get ( sinkName string ) * OrganizationsSinksGetCall {
c := & OrganizationsSinksGetCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkName = sinkName
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 * OrganizationsSinksGetCall ) Fields ( s ... googleapi . Field ) * OrganizationsSinksGetCall {
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 * OrganizationsSinksGetCall ) IfNoneMatch ( entityTag string ) * OrganizationsSinksGetCall {
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 * OrganizationsSinksGetCall ) Context ( ctx context . Context ) * OrganizationsSinksGetCall {
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 * OrganizationsSinksGetCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * OrganizationsSinksGetCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkName ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.organizations.sinks.get" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * OrganizationsSinksGetCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , 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 := & LogSink {
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 sink.",
// "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
// "httpMethod": "GET",
// "id": "logging.organizations.sinks.get",
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
// "pattern": "^organizations/[^/]+/sinks/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "response": {
// "$ref": "LogSink"
// },
// "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.organizations.sinks.list":
type OrganizationsSinksListCall struct {
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// List: Lists sinks.
func ( r * OrganizationsSinksService ) List ( parent string ) * OrganizationsSinksListCall {
c := & OrganizationsSinksListCall { 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 * OrganizationsSinksListCall ) PageSize ( pageSize int64 ) * OrganizationsSinksListCall {
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 * OrganizationsSinksListCall ) PageToken ( pageToken string ) * OrganizationsSinksListCall {
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 * OrganizationsSinksListCall ) Fields ( s ... googleapi . Field ) * OrganizationsSinksListCall {
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 * OrganizationsSinksListCall ) IfNoneMatch ( entityTag string ) * OrganizationsSinksListCall {
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 * OrganizationsSinksListCall ) Context ( ctx context . Context ) * OrganizationsSinksListCall {
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 * OrganizationsSinksListCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * OrganizationsSinksListCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/sinks" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
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.organizations.sinks.list" call.
// Exactly one of *ListSinksResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListSinksResponse.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 * OrganizationsSinksListCall ) Do ( opts ... googleapi . CallOption ) ( * ListSinksResponse , 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 := & ListSinksResponse {
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 sinks.",
// "flatPath": "v2/organizations/{organizationsId}/sinks",
// "httpMethod": "GET",
// "id": "logging.organizations.sinks.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
// "location": "path",
// "pattern": "^organizations/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+parent}/sinks",
// "response": {
// "$ref": "ListSinksResponse"
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * OrganizationsSinksListCall ) Pages ( ctx context . Context , f func ( * ListSinksResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
// method id "logging.organizations.sinks.patch":
type OrganizationsSinksPatchCall struct {
s * Service
sinkNameid string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Patch: Updates a sink. This method replaces the following fields in
// the existing sink with values from the new sink: destination, and
2019-05-01 20:20:21 +00:00
// filter.The updated sink might also have a new writer_identity; see
2018-09-18 19:50:17 +00:00
// the unique_writer_identity field.
func ( r * OrganizationsSinksService ) Patch ( sinkNameid string , logsink * LogSink ) * OrganizationsSinksPatchCall {
c := & OrganizationsSinksPatchCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": See sinks.create for a description of this
// field. When updating a sink, the effect of this field on the value of
// writer_identity in the updated sink depends on both the old and new
// values of this field:
// If the old and new values of this field are both false or both true,
// then there is no change to the sink's writer_identity.
// If the old value is false and the new value is true, then
// writer_identity is changed to a unique service account.
// It is an error if the old value is true and the new value is set to
// false or defaulted to false.
func ( c * OrganizationsSinksPatchCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * OrganizationsSinksPatchCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
return c
}
// UpdateMask sets the optional parameter "updateMask": Field mask that
// specifies the fields in sink that need an update. A sink field will
// be overwritten if, and only if, it is in the update mask. name and
// output only fields cannot be updated.An empty updateMask is
// temporarily treated as using the following mask for backwards
// compatibility purposes: destination,filter,includeChildren At some
// point in the future, behavior will be removed and specifying an empty
// updateMask will be an error.For a detailed FieldMask definition, see
2018-11-15 23:37:19 +00:00
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
2018-09-18 19:50:17 +00:00
// updateMask=filter.
func ( c * OrganizationsSinksPatchCall ) UpdateMask ( updateMask string ) * OrganizationsSinksPatchCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func ( c * OrganizationsSinksPatchCall ) Fields ( s ... googleapi . Field ) * OrganizationsSinksPatchCall {
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 * OrganizationsSinksPatchCall ) Context ( ctx context . Context ) * OrganizationsSinksPatchCall {
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 * OrganizationsSinksPatchCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * OrganizationsSinksPatchCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PATCH" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkNameid ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.organizations.sinks.patch" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * OrganizationsSinksPatchCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , 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 := & LogSink {
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
// {
2019-05-01 20:20:21 +00:00
// "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
// "httpMethod": "PATCH",
// "id": "logging.organizations.sinks.patch",
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
// "pattern": "^organizations/[^/]+/sinks/[^/]+$",
// "required": true,
// "type": "string"
// },
// "uniqueWriterIdentity": {
// "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
// "location": "query",
// "type": "boolean"
// },
// "updateMask": {
2018-11-15 23:37:19 +00:00
// "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
2018-09-18 19:50:17 +00:00
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "request": {
// "$ref": "LogSink"
// },
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.organizations.sinks.update":
type OrganizationsSinksUpdateCall struct {
s * Service
sinkNameid string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Update: Updates a sink. This method replaces the following fields in
// the existing sink with values from the new sink: destination, and
2019-05-01 20:20:21 +00:00
// filter.The updated sink might also have a new writer_identity; see
2018-09-18 19:50:17 +00:00
// the unique_writer_identity field.
func ( r * OrganizationsSinksService ) Update ( sinkNameid string , logsink * LogSink ) * OrganizationsSinksUpdateCall {
c := & OrganizationsSinksUpdateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": See sinks.create for a description of this
// field. When updating a sink, the effect of this field on the value of
// writer_identity in the updated sink depends on both the old and new
// values of this field:
// If the old and new values of this field are both false or both true,
// then there is no change to the sink's writer_identity.
// If the old value is false and the new value is true, then
// writer_identity is changed to a unique service account.
// It is an error if the old value is true and the new value is set to
// false or defaulted to false.
func ( c * OrganizationsSinksUpdateCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * OrganizationsSinksUpdateCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
return c
}
// UpdateMask sets the optional parameter "updateMask": Field mask that
// specifies the fields in sink that need an update. A sink field will
// be overwritten if, and only if, it is in the update mask. name and
// output only fields cannot be updated.An empty updateMask is
// temporarily treated as using the following mask for backwards
// compatibility purposes: destination,filter,includeChildren At some
// point in the future, behavior will be removed and specifying an empty
// updateMask will be an error.For a detailed FieldMask definition, see
2018-11-15 23:37:19 +00:00
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
2018-09-18 19:50:17 +00:00
// updateMask=filter.
func ( c * OrganizationsSinksUpdateCall ) UpdateMask ( updateMask string ) * OrganizationsSinksUpdateCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func ( c * OrganizationsSinksUpdateCall ) Fields ( s ... googleapi . Field ) * OrganizationsSinksUpdateCall {
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 * OrganizationsSinksUpdateCall ) Context ( ctx context . Context ) * OrganizationsSinksUpdateCall {
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 * OrganizationsSinksUpdateCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * OrganizationsSinksUpdateCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PUT" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkNameid ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.organizations.sinks.update" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * OrganizationsSinksUpdateCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , 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 := & LogSink {
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
// {
2019-05-01 20:20:21 +00:00
// "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
// "httpMethod": "PUT",
// "id": "logging.organizations.sinks.update",
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
// "pattern": "^organizations/[^/]+/sinks/[^/]+$",
// "required": true,
// "type": "string"
// },
// "uniqueWriterIdentity": {
// "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
// "location": "query",
// "type": "boolean"
// },
// "updateMask": {
2018-11-15 23:37:19 +00:00
// "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
2018-09-18 19:50:17 +00:00
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "request": {
// "$ref": "LogSink"
// },
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.projects.exclusions.create":
type ProjectsExclusionsCreateCall 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 * ProjectsExclusionsService ) Create ( parent string , logexclusion * LogExclusion ) * ProjectsExclusionsCreateCall {
c := & ProjectsExclusionsCreateCall { 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 * ProjectsExclusionsCreateCall ) Fields ( s ... googleapi . Field ) * ProjectsExclusionsCreateCall {
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 * ProjectsExclusionsCreateCall ) Context ( ctx context . Context ) * ProjectsExclusionsCreateCall {
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 * ProjectsExclusionsCreateCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * ProjectsExclusionsCreateCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logexclusion )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/exclusions" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
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.projects.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 * ProjectsExclusionsCreateCall ) 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/projects/{projectsId}/exclusions",
// "httpMethod": "POST",
// "id": "logging.projects.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": "^projects/[^/]+$",
// "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.projects.exclusions.delete":
type ProjectsExclusionsDeleteCall struct {
s * Service
name string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Delete: Deletes an exclusion.
func ( r * ProjectsExclusionsService ) Delete ( name string ) * ProjectsExclusionsDeleteCall {
c := & ProjectsExclusionsDeleteCall { 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 * ProjectsExclusionsDeleteCall ) Fields ( s ... googleapi . Field ) * ProjectsExclusionsDeleteCall {
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 * ProjectsExclusionsDeleteCall ) Context ( ctx context . Context ) * ProjectsExclusionsDeleteCall {
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 * ProjectsExclusionsDeleteCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * ProjectsExclusionsDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
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.projects.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 * ProjectsExclusionsDeleteCall ) 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/projects/{projectsId}/exclusions/{exclusionsId}",
// "httpMethod": "DELETE",
// "id": "logging.projects.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": "^projects/[^/]+/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.projects.exclusions.get":
type ProjectsExclusionsGetCall 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 * ProjectsExclusionsService ) Get ( name string ) * ProjectsExclusionsGetCall {
c := & ProjectsExclusionsGetCall { 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 * ProjectsExclusionsGetCall ) Fields ( s ... googleapi . Field ) * ProjectsExclusionsGetCall {
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 * ProjectsExclusionsGetCall ) IfNoneMatch ( entityTag string ) * ProjectsExclusionsGetCall {
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 * ProjectsExclusionsGetCall ) Context ( ctx context . Context ) * ProjectsExclusionsGetCall {
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 * ProjectsExclusionsGetCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * ProjectsExclusionsGetCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
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.projects.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 * ProjectsExclusionsGetCall ) 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/projects/{projectsId}/exclusions/{exclusionsId}",
// "httpMethod": "GET",
// "id": "logging.projects.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": "^projects/[^/]+/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.projects.exclusions.list":
type ProjectsExclusionsListCall 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 * ProjectsExclusionsService ) List ( parent string ) * ProjectsExclusionsListCall {
c := & ProjectsExclusionsListCall { 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 * ProjectsExclusionsListCall ) PageSize ( pageSize int64 ) * ProjectsExclusionsListCall {
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 * ProjectsExclusionsListCall ) PageToken ( pageToken string ) * ProjectsExclusionsListCall {
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 * ProjectsExclusionsListCall ) Fields ( s ... googleapi . Field ) * ProjectsExclusionsListCall {
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 * ProjectsExclusionsListCall ) IfNoneMatch ( entityTag string ) * ProjectsExclusionsListCall {
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 * ProjectsExclusionsListCall ) Context ( ctx context . Context ) * ProjectsExclusionsListCall {
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 * ProjectsExclusionsListCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * ProjectsExclusionsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/exclusions" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
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.projects.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 * ProjectsExclusionsListCall ) 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.",
// "flatPath": "v2/projects/{projectsId}/exclusions",
// "httpMethod": "GET",
// "id": "logging.projects.exclusions.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent resource whose exclusions are to be listed.\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+parent}/exclusions",
// "response": {
// "$ref": "ListExclusionsResponse"
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * ProjectsExclusionsListCall ) Pages ( ctx context . Context , f func ( * ListExclusionsResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
// method id "logging.projects.exclusions.patch":
type ProjectsExclusionsPatchCall struct {
s * Service
name string
logexclusion * LogExclusion
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Patch: Changes one or more properties of an existing exclusion.
func ( r * ProjectsExclusionsService ) Patch ( name string , logexclusion * LogExclusion ) * ProjectsExclusionsPatchCall {
c := & ProjectsExclusionsPatchCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . name = name
c . logexclusion = logexclusion
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. A
// nonempty list of fields to change in the existing exclusion. New
// values for the fields are taken from the corresponding fields in the
// LogExclusion included in this request. Fields not mentioned in
// update_mask are not changed and are ignored in the request.For
// example, to change the filter and description of an exclusion,
// specify an update_mask of "filter,description".
func ( c * ProjectsExclusionsPatchCall ) UpdateMask ( updateMask string ) * ProjectsExclusionsPatchCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func ( c * ProjectsExclusionsPatchCall ) Fields ( s ... googleapi . Field ) * ProjectsExclusionsPatchCall {
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 * ProjectsExclusionsPatchCall ) Context ( ctx context . Context ) * ProjectsExclusionsPatchCall {
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 * ProjectsExclusionsPatchCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * ProjectsExclusionsPatchCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logexclusion )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+name}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PATCH" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
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.projects.exclusions.patch" 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 * ProjectsExclusionsPatchCall ) 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": "Changes one or more properties of an existing exclusion.",
// "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}",
// "httpMethod": "PATCH",
// "id": "logging.projects.exclusions.patch",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The resource name of the exclusion to update:\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": "^projects/[^/]+/exclusions/[^/]+$",
// "required": true,
// "type": "string"
// },
// "updateMask": {
// "description": "Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of \"filter,description\".",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v2/{+name}",
// "request": {
// "$ref": "LogExclusion"
// },
// "response": {
// "$ref": "LogExclusion"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.projects.logs.delete":
type ProjectsLogsDeleteCall struct {
s * Service
logName string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Delete: Deletes all the log entries in a log. The log reappears if it
// receives new entries. Log entries written shortly before the delete
// operation might not be deleted.
func ( r * ProjectsLogsService ) Delete ( logName string ) * ProjectsLogsDeleteCall {
c := & ProjectsLogsDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . logName = logName
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 * ProjectsLogsDeleteCall ) Fields ( s ... googleapi . Field ) * ProjectsLogsDeleteCall {
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 * ProjectsLogsDeleteCall ) Context ( ctx context . Context ) * ProjectsLogsDeleteCall {
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 * ProjectsLogsDeleteCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * ProjectsLogsDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+logName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2018-09-18 19:50:17 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"logName" : c . logName ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
// Do executes the "logging.projects.logs.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 * ProjectsLogsDeleteCall ) 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 all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted.",
// "flatPath": "v2/projects/{projectsId}/logs/{logsId}",
// "httpMethod": "DELETE",
// "id": "logging.projects.logs.delete",
// "parameterOrder": [
// "logName"
// ],
// "parameters": {
// "logName": {
// "description": "Required. The resource name of the log to delete:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.",
// "location": "path",
// "pattern": "^projects/[^/]+/logs/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+logName}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
// method id "logging.projects.logs.list":
type ProjectsLogsListCall struct {
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// List: Lists the logs in projects, organizations, folders, or billing
// accounts. Only logs that have entries are listed.
func ( r * ProjectsLogsService ) List ( parent string ) * ProjectsLogsListCall {
c := & ProjectsLogsListCall { 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 * ProjectsLogsListCall ) PageSize ( pageSize int64 ) * ProjectsLogsListCall {
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 * ProjectsLogsListCall ) PageToken ( pageToken string ) * ProjectsLogsListCall {
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 * ProjectsLogsListCall ) Fields ( s ... googleapi . Field ) * ProjectsLogsListCall {
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 * ProjectsLogsListCall ) IfNoneMatch ( entityTag string ) * ProjectsLogsListCall {
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 * ProjectsLogsListCall ) Context ( ctx context . Context ) * ProjectsLogsListCall {
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 * ProjectsLogsListCall ) Header ( ) http . Header {
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
func ( c * ProjectsLogsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/logs" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"parent" : c . parent ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.logs.list" call.
// Exactly one of *ListLogsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListLogsResponse.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 * ProjectsLogsListCall ) Do ( opts ... googleapi . CallOption ) ( * ListLogsResponse , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & ListLogsResponse {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
// "flatPath": "v2/projects/{projectsId}/logs",
// "httpMethod": "GET",
// "id": "logging.projects.logs.list",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "parent"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
2017-09-15 02:15:14 +00:00
// "location": "query",
2018-09-18 19:50:17 +00:00
// "type": "integer"
2017-09-15 02:15:14 +00:00
// },
2018-09-18 19:50:17 +00:00
// "pageToken": {
// "description": "Optional. 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.",
2017-09-15 02:15:14 +00:00
// "location": "query",
// "type": "string"
2018-09-18 19:50:17 +00:00
// },
// "parent": {
// "description": "Required. The resource name that owns the logs:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
2017-09-15 02:15:14 +00:00
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/logs",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "ListLogsResponse"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/cloud-platform.read-only",
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.read"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * ProjectsLogsListCall ) Pages ( ctx context . Context , f func ( * ListLogsResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
// method id "logging.projects.metrics.create":
type ProjectsMetricsCreateCall struct {
s * Service
parent string
logmetric * LogMetric
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Create: Creates a logs-based metric.
func ( r * ProjectsMetricsService ) Create ( parent string , logmetric * LogMetric ) * ProjectsMetricsCreateCall {
c := & ProjectsMetricsCreateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
c . parent = parent
2018-09-18 19:50:17 +00:00
c . logmetric = logmetric
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsCreateCall ) Fields ( s ... googleapi . Field ) * ProjectsMetricsCreateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsCreateCall ) Context ( ctx context . Context ) * ProjectsMetricsCreateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsCreateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsCreateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logmetric )
2017-09-15 02:15:14 +00:00
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/metrics" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.metrics.create" call.
// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
2017-09-15 02:15:14 +00:00
// status code is an error. Response headers are in either
2018-09-18 19:50:17 +00:00
// *LogMetric.ServerResponse.Header or (if a response was returned at
2017-09-15 02:15:14 +00:00
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsCreateCall ) Do ( opts ... googleapi . CallOption ) ( * LogMetric , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogMetric {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Creates a logs-based metric.",
// "flatPath": "v2/projects/{projectsId}/metrics",
2017-09-15 02:15:14 +00:00
// "httpMethod": "POST",
2018-09-18 19:50:17 +00:00
// "id": "logging.projects.metrics.create",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
2018-09-18 19:50:17 +00:00
// "description": "The resource name of the project in which to create the metric:\n\"projects/[PROJECT_ID]\"\nThe new metric must be provided in the request.",
2017-09-15 02:15:14 +00:00
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/metrics",
2017-09-15 02:15:14 +00:00
// "request": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogMetric"
2017-09-15 02:15:14 +00:00
// },
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogMetric"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.write"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.projects.metrics.delete":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ProjectsMetricsDeleteCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
metricName string
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Delete: Deletes a logs-based metric.
func ( r * ProjectsMetricsService ) Delete ( metricName string ) * ProjectsMetricsDeleteCall {
c := & ProjectsMetricsDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . metricName = metricName
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsDeleteCall ) Fields ( s ... googleapi . Field ) * ProjectsMetricsDeleteCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsDeleteCall ) Context ( ctx context . Context ) * ProjectsMetricsDeleteCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsDeleteCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+metricName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"metricName" : c . metricName ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.metrics.delete" call.
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsDeleteCall ) Do ( opts ... googleapi . CallOption ) ( * Empty , error ) {
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Deletes a logs-based metric.",
// "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "DELETE",
2018-09-18 19:50:17 +00:00
// "id": "logging.projects.metrics.delete",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "metricName"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "metricName": {
// "description": "The resource name of the metric to delete:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^projects/[^/]+/metrics/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+metricName}",
2017-09-15 02:15:14 +00:00
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.write"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.projects.metrics.get":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ProjectsMetricsGetCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
metricName string
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Get: Gets a logs-based metric.
func ( r * ProjectsMetricsService ) Get ( metricName string ) * ProjectsMetricsGetCall {
c := & ProjectsMetricsGetCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . metricName = metricName
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsGetCall ) Fields ( s ... googleapi . Field ) * ProjectsMetricsGetCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsGetCall ) IfNoneMatch ( entityTag string ) * ProjectsMetricsGetCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsGetCall ) Context ( ctx context . Context ) * ProjectsMetricsGetCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsGetCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsGetCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+metricName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"metricName" : c . metricName ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.metrics.get" call.
// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
2017-09-15 02:15:14 +00:00
// status code is an error. Response headers are in either
2018-09-18 19:50:17 +00:00
// *LogMetric.ServerResponse.Header or (if a response was returned at
2017-09-15 02:15:14 +00:00
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsGetCall ) Do ( opts ... googleapi . CallOption ) ( * LogMetric , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogMetric {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Gets a logs-based metric.",
// "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.projects.metrics.get",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "metricName"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "metricName": {
// "description": "The resource name of the desired metric:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^projects/[^/]+/metrics/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+metricName}",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogMetric"
2017-09-15 02:15:14 +00:00
// },
// "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"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.projects.metrics.list":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ProjectsMetricsListCall struct {
2017-09-15 02:15:14 +00:00
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// List: Lists logs-based metrics.
func ( r * ProjectsMetricsService ) List ( parent string ) * ProjectsMetricsListCall {
c := & ProjectsMetricsListCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsListCall ) PageSize ( pageSize int64 ) * ProjectsMetricsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsListCall ) PageToken ( pageToken string ) * ProjectsMetricsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsListCall ) Fields ( s ... googleapi . Field ) * ProjectsMetricsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsListCall ) IfNoneMatch ( entityTag string ) * ProjectsMetricsListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsListCall ) Context ( ctx context . Context ) * ProjectsMetricsListCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsListCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsListCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/metrics" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.metrics.list" call.
// Exactly one of *ListLogMetricsResponse or error will be non-nil. Any
2017-09-15 02:15:14 +00:00
// non-2xx status code is an error. Response headers are in either
2018-09-18 19:50:17 +00:00
// *ListLogMetricsResponse.ServerResponse.Header or (if a response was
2017-09-15 02:15:14 +00:00
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsListCall ) Do ( opts ... googleapi . CallOption ) ( * ListLogMetricsResponse , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & ListLogMetricsResponse {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Lists logs-based metrics.",
// "flatPath": "v2/projects/{projectsId}/metrics",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.projects.metrics.list",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
2018-09-18 19:50:17 +00:00
// "description": "Required. The name of the project containing the metrics:\n\"projects/[PROJECT_ID]\"\n",
2017-09-15 02:15:14 +00:00
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/metrics",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "ListLogMetricsResponse"
2017-09-15 02:15:14 +00:00
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsListCall ) Pages ( ctx context . Context , f func ( * ListLogMetricsResponse ) error ) error {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2018-09-18 19:50:17 +00:00
// method id "logging.projects.metrics.update":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ProjectsMetricsUpdateCall struct {
s * Service
metricName string
logmetric * LogMetric
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Update: Creates or updates a logs-based metric.
func ( r * ProjectsMetricsService ) Update ( metricName string , logmetric * LogMetric ) * ProjectsMetricsUpdateCall {
c := & ProjectsMetricsUpdateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . metricName = metricName
c . logmetric = logmetric
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsUpdateCall ) Fields ( s ... googleapi . Field ) * ProjectsMetricsUpdateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsUpdateCall ) Context ( ctx context . Context ) * ProjectsMetricsUpdateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsUpdateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsMetricsUpdateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logmetric )
2017-09-15 02:15:14 +00:00
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+metricName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PUT" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"metricName" : c . metricName ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.metrics.update" call.
// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
2017-09-15 02:15:14 +00:00
// status code is an error. Response headers are in either
2018-09-18 19:50:17 +00:00
// *LogMetric.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 * ProjectsMetricsUpdateCall ) Do ( opts ... googleapi . CallOption ) ( * LogMetric , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogMetric {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Creates or updates a logs-based metric.",
// "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
// "httpMethod": "PUT",
// "id": "logging.projects.metrics.update",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "metricName"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "metricName": {
// "description": "The resource name of the metric to update:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\nThe updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created.",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^projects/[^/]+/metrics/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+metricName}",
// "request": {
// "$ref": "LogMetric"
// },
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogMetric"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin",
// "https://www.googleapis.com/auth/logging.write"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.projects.sinks.create":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ProjectsSinksCreateCall struct {
s * Service
parent string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Create: Creates a sink that exports specified log entries to a
// destination. The export of newly-ingested log entries begins
// immediately, unless the sink's writer_identity is not permitted to
// write to the destination. A sink can export log entries only from the
// resource owning the sink.
func ( r * ProjectsSinksService ) Create ( parent string , logsink * LogSink ) * ProjectsSinksCreateCall {
c := & ProjectsSinksCreateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
c . parent = parent
2018-09-18 19:50:17 +00:00
c . logsink = logsink
2017-09-15 02:15:14 +00:00
return c
}
2018-09-18 19:50:17 +00:00
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": Determines the kind of IAM identity returned
// as writer_identity in the new sink. If this value is omitted or set
// to false, and if the sink's parent is a project, then the value
// returned as writer_identity is the same group or service account used
// by Logging before the addition of writer identities to this API. The
// sink's destination must be in the same project as the sink itself.If
// this field is set to true, or if the sink is owned by a non-project
// resource such as an organization, then the value of writer_identity
// will be a unique service account used only for exports from the new
// sink. For more information, see writer_identity in LogSink.
func ( c * ProjectsSinksCreateCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * ProjectsSinksCreateCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksCreateCall ) Fields ( s ... googleapi . Field ) * ProjectsSinksCreateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksCreateCall ) Context ( ctx context . Context ) * ProjectsSinksCreateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksCreateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksCreateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/sinks" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.sinks.create" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * ProjectsSinksCreateCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogSink {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.",
// "flatPath": "v2/projects/{projectsId}/sinks",
// "httpMethod": "POST",
// "id": "logging.projects.sinks.create",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
2018-09-18 19:50:17 +00:00
// "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
2018-09-18 19:50:17 +00:00
// },
// "uniqueWriterIdentity": {
// "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.",
// "location": "query",
// "type": "boolean"
2017-09-15 02:15:14 +00:00
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/sinks",
// "request": {
// "$ref": "LogSink"
// },
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogSink"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.projects.sinks.delete":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ProjectsSinksDeleteCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
sinkNameid string
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Delete: Deletes a sink. If the sink has a unique writer_identity,
// then that service account is also deleted.
func ( r * ProjectsSinksService ) Delete ( sinkNameid string ) * ProjectsSinksDeleteCall {
c := & ProjectsSinksDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksDeleteCall ) Fields ( s ... googleapi . Field ) * ProjectsSinksDeleteCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksDeleteCall ) Context ( ctx context . Context ) * ProjectsSinksDeleteCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksDeleteCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"sinkName" : c . sinkNameid ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.sinks.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 * ProjectsSinksDeleteCall ) Do ( opts ... googleapi . CallOption ) ( * Empty , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & Empty {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
// "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
// "httpMethod": "DELETE",
// "id": "logging.projects.sinks.delete",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "sinkName"
2017-09-15 02:15:14 +00:00
// ],
2018-09-18 19:50:17 +00:00
// "parameters": {
// "sinkName": {
// "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^projects/[^/]+/sinks/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+sinkName}",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "Empty"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.projects.sinks.get":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ProjectsSinksGetCall struct {
s * Service
sinkName string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Get: Gets a sink.
func ( r * ProjectsSinksService ) Get ( sinkName string ) * ProjectsSinksGetCall {
c := & ProjectsSinksGetCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkName = sinkName
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksGetCall ) Fields ( s ... googleapi . Field ) * ProjectsSinksGetCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "fields" , googleapi . CombineFields ( s ) )
return c
}
2018-09-18 19:50:17 +00:00
// 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 * ProjectsSinksGetCall ) IfNoneMatch ( entityTag string ) * ProjectsSinksGetCall {
c . ifNoneMatch_ = entityTag
return c
}
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksGetCall ) Context ( ctx context . Context ) * ProjectsSinksGetCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksGetCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksGetCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
2018-09-18 19:50:17 +00:00
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
2017-09-15 02:15:14 +00:00
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"sinkName" : c . sinkName ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.sinks.get" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
2017-09-15 02:15:14 +00:00
// code is an error. Response headers are in either
2018-09-18 19:50:17 +00:00
// *LogSink.ServerResponse.Header or (if a response was returned at all)
2017-09-15 02:15:14 +00:00
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksGetCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogSink {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Gets a sink.",
// "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
// "httpMethod": "GET",
// "id": "logging.projects.sinks.get",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "sinkName"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "sinkName": {
// "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^projects/[^/]+/sinks/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+sinkName}",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogSink"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/cloud-platform.read-only",
2017-09-15 02:15:14 +00:00
// "https://www.googleapis.com/auth/logging.admin",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.read"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.projects.sinks.list":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ProjectsSinksListCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
parent string
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// List: Lists sinks.
func ( r * ProjectsSinksService ) List ( parent string ) * ProjectsSinksListCall {
c := & ProjectsSinksListCall { 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 * ProjectsSinksListCall ) PageSize ( pageSize int64 ) * ProjectsSinksListCall {
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 * ProjectsSinksListCall ) PageToken ( pageToken string ) * ProjectsSinksListCall {
c . urlParams_ . Set ( "pageToken" , pageToken )
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksListCall ) Fields ( s ... googleapi . Field ) * ProjectsSinksListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksListCall ) IfNoneMatch ( entityTag string ) * ProjectsSinksListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksListCall ) Context ( ctx context . Context ) * ProjectsSinksListCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksListCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksListCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/sinks" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"parent" : c . parent ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.sinks.list" call.
// Exactly one of *ListSinksResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListSinksResponse.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 * ProjectsSinksListCall ) Do ( opts ... googleapi . CallOption ) ( * ListSinksResponse , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & ListSinksResponse {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2018-09-18 19:50:17 +00:00
// "description": "Lists sinks.",
// "flatPath": "v2/projects/{projectsId}/sinks",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.projects.sinks.list",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "parent"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^projects/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+parent}/sinks",
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "ListSinksResponse"
2017-09-15 02:15:14 +00:00
// },
// "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"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func ( c * ProjectsSinksListCall ) Pages ( ctx context . Context , f func ( * ListSinksResponse ) error ) error {
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
// method id "logging.projects.sinks.patch":
type ProjectsSinksPatchCall struct {
s * Service
sinkNameid string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
2017-09-15 02:15:14 +00:00
}
2018-09-18 19:50:17 +00:00
// Patch: Updates a sink. This method replaces the following fields in
// the existing sink with values from the new sink: destination, and
2019-05-01 20:20:21 +00:00
// filter.The updated sink might also have a new writer_identity; see
2018-09-18 19:50:17 +00:00
// the unique_writer_identity field.
func ( r * ProjectsSinksService ) Patch ( sinkNameid string , logsink * LogSink ) * ProjectsSinksPatchCall {
c := & ProjectsSinksPatchCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
c . logsink = logsink
2017-09-15 02:15:14 +00:00
return c
}
2018-09-18 19:50:17 +00:00
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": See sinks.create for a description of this
// field. When updating a sink, the effect of this field on the value of
// writer_identity in the updated sink depends on both the old and new
// values of this field:
// If the old and new values of this field are both false or both true,
// then there is no change to the sink's writer_identity.
// If the old value is false and the new value is true, then
// writer_identity is changed to a unique service account.
// It is an error if the old value is true and the new value is set to
// false or defaulted to false.
func ( c * ProjectsSinksPatchCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * ProjectsSinksPatchCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
2017-09-15 02:15:14 +00:00
return c
}
2018-09-18 19:50:17 +00:00
// UpdateMask sets the optional parameter "updateMask": Field mask that
// specifies the fields in sink that need an update. A sink field will
// be overwritten if, and only if, it is in the update mask. name and
// output only fields cannot be updated.An empty updateMask is
// temporarily treated as using the following mask for backwards
// compatibility purposes: destination,filter,includeChildren At some
// point in the future, behavior will be removed and specifying an empty
// updateMask will be an error.For a detailed FieldMask definition, see
2018-11-15 23:37:19 +00:00
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
2018-09-18 19:50:17 +00:00
// updateMask=filter.
func ( c * ProjectsSinksPatchCall ) UpdateMask ( updateMask string ) * ProjectsSinksPatchCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksPatchCall ) Fields ( s ... googleapi . Field ) * ProjectsSinksPatchCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksPatchCall ) Context ( ctx context . Context ) * ProjectsSinksPatchCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksPatchCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksPatchCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PATCH" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"sinkName" : c . sinkNameid ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.sinks.patch" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * ProjectsSinksPatchCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogSink {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2019-05-01 20:20:21 +00:00
// "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
// "httpMethod": "PATCH",
// "id": "logging.projects.sinks.patch",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "sinkName"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "sinkName": {
// "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
// "pattern": "^projects/[^/]+/sinks/[^/]+$",
// "required": true,
// "type": "string"
2017-09-15 02:15:14 +00:00
// },
2018-09-18 19:50:17 +00:00
// "uniqueWriterIdentity": {
// "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
2017-09-15 02:15:14 +00:00
// "location": "query",
2018-09-18 19:50:17 +00:00
// "type": "boolean"
2017-09-15 02:15:14 +00:00
// },
2018-09-18 19:50:17 +00:00
// "updateMask": {
2018-11-15 23:37:19 +00:00
// "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
2018-09-18 19:50:17 +00:00
// "format": "google-fieldmask",
// "location": "query",
2017-09-15 02:15:14 +00:00
// "type": "string"
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+sinkName}",
// "request": {
// "$ref": "LogSink"
// },
2017-09-15 02:15:14 +00:00
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogSink"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.projects.sinks.update":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type ProjectsSinksUpdateCall struct {
2017-09-15 02:15:14 +00:00
s * Service
2018-09-18 19:50:17 +00:00
sinkNameid string
logsink * LogSink
2017-09-15 02:15:14 +00:00
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
2018-09-18 19:50:17 +00:00
// Update: Updates a sink. This method replaces the following fields in
// the existing sink with values from the new sink: destination, and
2019-05-01 20:20:21 +00:00
// filter.The updated sink might also have a new writer_identity; see
2018-09-18 19:50:17 +00:00
// the unique_writer_identity field.
func ( r * ProjectsSinksService ) Update ( sinkNameid string , logsink * LogSink ) * ProjectsSinksUpdateCall {
c := & ProjectsSinksUpdateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
c . sinkNameid = sinkNameid
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": See sinks.create for a description of this
// field. When updating a sink, the effect of this field on the value of
// writer_identity in the updated sink depends on both the old and new
// values of this field:
// If the old and new values of this field are both false or both true,
// then there is no change to the sink's writer_identity.
// If the old value is false and the new value is true, then
// writer_identity is changed to a unique service account.
// It is an error if the old value is true and the new value is set to
// false or defaulted to false.
func ( c * ProjectsSinksUpdateCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * ProjectsSinksUpdateCall {
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
return c
}
// UpdateMask sets the optional parameter "updateMask": Field mask that
// specifies the fields in sink that need an update. A sink field will
// be overwritten if, and only if, it is in the update mask. name and
// output only fields cannot be updated.An empty updateMask is
// temporarily treated as using the following mask for backwards
// compatibility purposes: destination,filter,includeChildren At some
// point in the future, behavior will be removed and specifying an empty
// updateMask will be an error.For a detailed FieldMask definition, see
2018-11-15 23:37:19 +00:00
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
2018-09-18 19:50:17 +00:00
// updateMask=filter.
func ( c * ProjectsSinksUpdateCall ) UpdateMask ( updateMask string ) * ProjectsSinksUpdateCall {
c . urlParams_ . Set ( "updateMask" , updateMask )
2017-09-15 02:15:14 +00:00
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksUpdateCall ) Fields ( s ... googleapi . Field ) * ProjectsSinksUpdateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksUpdateCall ) Context ( ctx context . Context ) * ProjectsSinksUpdateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksUpdateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * ProjectsSinksUpdateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
2018-09-18 19:50:17 +00:00
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
2017-09-15 02:15:14 +00:00
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2018-09-18 19:50:17 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
2017-09-15 02:15:14 +00:00
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PUT" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
2018-09-18 19:50:17 +00:00
"sinkName" : c . sinkNameid ,
2017-09-15 02:15:14 +00:00
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.projects.sinks.update" call.
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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 * ProjectsSinksUpdateCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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
}
2018-09-18 19:50:17 +00:00
ret := & LogSink {
2017-09-15 02:15:14 +00:00
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2019-05-01 20:20:21 +00:00
// "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "PUT",
2018-09-18 19:50:17 +00:00
// "id": "logging.projects.sinks.update",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
2018-09-18 19:50:17 +00:00
// "sinkName"
2017-09-15 02:15:14 +00:00
// ],
// "parameters": {
2018-09-18 19:50:17 +00:00
// "sinkName": {
// "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
2017-09-15 02:15:14 +00:00
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^projects/[^/]+/sinks/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
2018-09-18 19:50:17 +00:00
// },
// "uniqueWriterIdentity": {
// "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
// "location": "query",
// "type": "boolean"
// },
// "updateMask": {
2018-11-15 23:37:19 +00:00
// "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
2018-09-18 19:50:17 +00:00
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
2017-09-15 02:15:14 +00:00
// }
// },
2018-09-18 19:50:17 +00:00
// "path": "v2/{+sinkName}",
2017-09-15 02:15:14 +00:00
// "request": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogSink"
2017-09-15 02:15:14 +00:00
// },
// "response": {
2018-09-18 19:50:17 +00:00
// "$ref": "LogSink"
2017-09-15 02:15:14 +00:00
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
2018-09-18 19:50:17 +00:00
// "https://www.googleapis.com/auth/logging.admin"
2017-09-15 02:15:14 +00:00
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.sinks.create":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type SinksCreateCall struct {
2017-09-15 02:15:14 +00:00
s * Service
parent string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Create: Creates a sink that exports specified log entries to a
// destination. The export of newly-ingested log entries begins
// immediately, unless the sink's writer_identity is not permitted to
// write to the destination. A sink can export log entries only from the
// resource owning the sink.
2018-09-18 19:50:17 +00:00
func ( r * SinksService ) Create ( parent string , logsink * LogSink ) * SinksCreateCall {
c := & SinksCreateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
c . parent = parent
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": Determines the kind of IAM identity returned
// as writer_identity in the new sink. If this value is omitted or set
// to false, and if the sink's parent is a project, then the value
// returned as writer_identity is the same group or service account used
2018-09-18 19:50:17 +00:00
// by Logging before the addition of writer identities to this API. The
// sink's destination must be in the same project as the sink itself.If
// this field is set to true, or if the sink is owned by a non-project
// resource such as an organization, then the value of writer_identity
// will be a unique service account used only for exports from the new
// sink. For more information, see writer_identity in LogSink.
func ( c * SinksCreateCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * SinksCreateCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * SinksCreateCall ) Fields ( s ... googleapi . Field ) * SinksCreateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * SinksCreateCall ) Context ( ctx context . Context ) * SinksCreateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * SinksCreateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * SinksCreateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/sinks" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "POST" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.sinks.create" call.
2017-09-15 02:15:14 +00:00
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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.
2018-09-18 19:50:17 +00:00
func ( c * SinksCreateCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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 := & LogSink {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/{v2Id}/{v2Id1}/sinks",
2017-09-15 02:15:14 +00:00
// "httpMethod": "POST",
2018-09-18 19:50:17 +00:00
// "id": "logging.sinks.create",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The resource in which to create the sink:\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",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// },
// "uniqueWriterIdentity": {
2018-09-18 19:50:17 +00:00
// "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.",
2017-09-15 02:15:14 +00:00
// "location": "query",
// "type": "boolean"
// }
// },
// "path": "v2/{+parent}/sinks",
// "request": {
// "$ref": "LogSink"
// },
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.sinks.delete":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type SinksDeleteCall struct {
2017-09-15 02:15:14 +00:00
s * Service
sinkNameid string
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Delete: Deletes a sink. If the sink has a unique writer_identity,
// then that service account is also deleted.
2018-09-18 19:50:17 +00:00
func ( r * SinksService ) Delete ( sinkNameid string ) * SinksDeleteCall {
c := & SinksDeleteCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
c . sinkNameid = sinkNameid
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * SinksDeleteCall ) Fields ( s ... googleapi . Field ) * SinksDeleteCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * SinksDeleteCall ) Context ( ctx context . Context ) * SinksDeleteCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * SinksDeleteCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * SinksDeleteCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "DELETE" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkNameid ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.sinks.delete" call.
2017-09-15 02:15:14 +00:00
// 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.
2018-09-18 19:50:17 +00:00
func ( c * SinksDeleteCall ) Do ( opts ... googleapi . CallOption ) ( * Empty , error ) {
2017-09-15 02:15:14 +00:00
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
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "DELETE",
2018-09-18 19:50:17 +00:00
// "id": "logging.sinks.delete",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.sinks.get":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type SinksGetCall struct {
2017-09-15 02:15:14 +00:00
s * Service
sinkName string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// Get: Gets a sink.
2018-09-18 19:50:17 +00:00
func ( r * SinksService ) Get ( sinkName string ) * SinksGetCall {
c := & SinksGetCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
c . sinkName = sinkName
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * SinksGetCall ) Fields ( s ... googleapi . Field ) * SinksGetCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * SinksGetCall ) IfNoneMatch ( entityTag string ) * SinksGetCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * SinksGetCall ) Context ( ctx context . Context ) * SinksGetCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * SinksGetCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * SinksGetCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkName ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.sinks.get" call.
2017-09-15 02:15:14 +00:00
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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.
2018-09-18 19:50:17 +00:00
func ( c * SinksGetCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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 := & LogSink {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Gets a sink.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.sinks.get",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "response": {
// "$ref": "LogSink"
// },
// "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"
// ]
// }
}
2018-09-18 19:50:17 +00:00
// method id "logging.sinks.list":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type SinksListCall struct {
2017-09-15 02:15:14 +00:00
s * Service
parent string
urlParams_ gensupport . URLParams
ifNoneMatch_ string
ctx_ context . Context
header_ http . Header
}
// List: Lists sinks.
2018-09-18 19:50:17 +00:00
func ( r * SinksService ) List ( parent string ) * SinksListCall {
c := & SinksListCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * SinksListCall ) PageSize ( pageSize int64 ) * SinksListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * SinksListCall ) PageToken ( pageToken string ) * SinksListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * SinksListCall ) Fields ( s ... googleapi . Field ) * SinksListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * SinksListCall ) IfNoneMatch ( entityTag string ) * SinksListCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * SinksListCall ) Context ( ctx context . Context ) * SinksListCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * SinksListCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * SinksListCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
if c . ifNoneMatch_ != "" {
reqHeaders . Set ( "If-None-Match" , c . ifNoneMatch_ )
}
var body io . Reader = nil
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+parent}/sinks" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "GET" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"parent" : c . parent ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.sinks.list" call.
2017-09-15 02:15:14 +00:00
// Exactly one of *ListSinksResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListSinksResponse.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.
2018-09-18 19:50:17 +00:00
func ( c * SinksListCall ) Do ( opts ... googleapi . CallOption ) ( * ListSinksResponse , error ) {
2017-09-15 02:15:14 +00:00
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 := & ListSinksResponse {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
// "description": "Lists sinks.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/{v2Id}/{v2Id1}/sinks",
2017-09-15 02:15:14 +00:00
// "httpMethod": "GET",
2018-09-18 19:50:17 +00:00
// "id": "logging.sinks.list",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "Optional. 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.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. 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.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// }
// },
// "path": "v2/{+parent}/sinks",
// "response": {
// "$ref": "ListSinksResponse"
// },
// "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"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
2018-09-18 19:50:17 +00:00
func ( c * SinksListCall ) Pages ( ctx context . Context , f func ( * ListSinksResponse ) error ) error {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
defer c . PageToken ( c . urlParams_ . Get ( "pageToken" ) ) // reset paging to original point
for {
x , err := c . Do ( )
if err != nil {
return err
}
if err := f ( x ) ; err != nil {
return err
}
if x . NextPageToken == "" {
return nil
}
c . PageToken ( x . NextPageToken )
}
}
2018-09-18 19:50:17 +00:00
// method id "logging.sinks.update":
2017-09-15 02:15:14 +00:00
2018-09-18 19:50:17 +00:00
type SinksUpdateCall struct {
2017-09-15 02:15:14 +00:00
s * Service
sinkNameid string
logsink * LogSink
urlParams_ gensupport . URLParams
ctx_ context . Context
header_ http . Header
}
// Update: Updates a sink. This method replaces the following fields in
// the existing sink with values from the new sink: destination, and
2019-05-01 20:20:21 +00:00
// filter.The updated sink might also have a new writer_identity; see
2017-09-15 02:15:14 +00:00
// the unique_writer_identity field.
2018-09-18 19:50:17 +00:00
func ( r * SinksService ) Update ( sinkNameid string , logsink * LogSink ) * SinksUpdateCall {
c := & SinksUpdateCall { s : r . s , urlParams_ : make ( gensupport . URLParams ) }
2017-09-15 02:15:14 +00:00
c . sinkNameid = sinkNameid
c . logsink = logsink
return c
}
// UniqueWriterIdentity sets the optional parameter
// "uniqueWriterIdentity": See sinks.create for a description of this
// field. When updating a sink, the effect of this field on the value of
// writer_identity in the updated sink depends on both the old and new
// values of this field:
// If the old and new values of this field are both false or both true,
// then there is no change to the sink's writer_identity.
// If the old value is false and the new value is true, then
// writer_identity is changed to a unique service account.
// It is an error if the old value is true and the new value is set to
// false or defaulted to false.
2018-09-18 19:50:17 +00:00
func ( c * SinksUpdateCall ) UniqueWriterIdentity ( uniqueWriterIdentity bool ) * SinksUpdateCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "uniqueWriterIdentity" , fmt . Sprint ( uniqueWriterIdentity ) )
return c
}
// UpdateMask sets the optional parameter "updateMask": Field mask that
// specifies the fields in sink that need an update. A sink field will
// be overwritten if, and only if, it is in the update mask. name and
// output only fields cannot be updated.An empty updateMask is
// temporarily treated as using the following mask for backwards
// compatibility purposes: destination,filter,includeChildren At some
// point in the future, behavior will be removed and specifying an empty
// updateMask will be an error.For a detailed FieldMask definition, see
2018-11-15 23:37:19 +00:00
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
2017-09-15 02:15:14 +00:00
// updateMask=filter.
2018-09-18 19:50:17 +00:00
func ( c * SinksUpdateCall ) UpdateMask ( updateMask string ) * SinksUpdateCall {
2017-09-15 02:15:14 +00:00
c . urlParams_ . Set ( "updateMask" , updateMask )
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
2018-09-18 19:50:17 +00:00
func ( c * SinksUpdateCall ) Fields ( s ... googleapi . Field ) * SinksUpdateCall {
2017-09-15 02:15:14 +00:00
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.
2018-09-18 19:50:17 +00:00
func ( c * SinksUpdateCall ) Context ( ctx context . Context ) * SinksUpdateCall {
2017-09-15 02:15:14 +00:00
c . ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
2018-09-18 19:50:17 +00:00
func ( c * SinksUpdateCall ) Header ( ) http . Header {
2017-09-15 02:15:14 +00:00
if c . header_ == nil {
c . header_ = make ( http . Header )
}
return c . header_
}
2018-09-18 19:50:17 +00:00
func ( c * SinksUpdateCall ) doRequest ( alt string ) ( * http . Response , error ) {
2017-09-15 02:15:14 +00:00
reqHeaders := make ( http . Header )
for k , v := range c . header_ {
reqHeaders [ k ] = v
}
reqHeaders . Set ( "User-Agent" , c . s . userAgent ( ) )
var body io . Reader = nil
body , err := googleapi . WithoutDataWrapper . JSONReader ( c . logsink )
if err != nil {
return nil , err
}
reqHeaders . Set ( "Content-Type" , "application/json" )
c . urlParams_ . Set ( "alt" , alt )
2018-11-15 23:37:19 +00:00
c . urlParams_ . Set ( "prettyPrint" , "false" )
2017-09-15 02:15:14 +00:00
urls := googleapi . ResolveRelative ( c . s . BasePath , "v2/{+sinkName}" )
urls += "?" + c . urlParams_ . Encode ( )
2018-11-15 23:37:19 +00:00
req , err := http . NewRequest ( "PUT" , urls , body )
if err != nil {
return nil , err
}
2017-09-15 02:15:14 +00:00
req . Header = reqHeaders
googleapi . Expand ( req . URL , map [ string ] string {
"sinkName" : c . sinkNameid ,
} )
return gensupport . SendRequest ( c . ctx_ , c . s . client , req )
}
2018-09-18 19:50:17 +00:00
// Do executes the "logging.sinks.update" call.
2017-09-15 02:15:14 +00:00
// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *LogSink.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.
2018-09-18 19:50:17 +00:00
func ( c * SinksUpdateCall ) Do ( opts ... googleapi . CallOption ) ( * LogSink , error ) {
2017-09-15 02:15:14 +00:00
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 := & LogSink {
ServerResponse : googleapi . ServerResponse {
Header : res . Header ,
HTTPStatusCode : res . StatusCode ,
} ,
}
target := & ret
2018-09-18 19:50:17 +00:00
if err := gensupport . DecodeResponse ( target , res ) ; err != nil {
2017-09-15 02:15:14 +00:00
return nil , err
}
return ret , nil
// {
2019-05-01 20:20:21 +00:00
// "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
2018-09-18 19:50:17 +00:00
// "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
2017-09-15 02:15:14 +00:00
// "httpMethod": "PUT",
2018-09-18 19:50:17 +00:00
// "id": "logging.sinks.update",
2017-09-15 02:15:14 +00:00
// "parameterOrder": [
// "sinkName"
// ],
// "parameters": {
// "sinkName": {
// "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
// "location": "path",
2018-09-18 19:50:17 +00:00
// "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
2017-09-15 02:15:14 +00:00
// "required": true,
// "type": "string"
// },
// "uniqueWriterIdentity": {
// "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
// "location": "query",
// "type": "boolean"
// },
// "updateMask": {
2018-11-15 23:37:19 +00:00
// "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
2017-09-15 02:15:14 +00:00
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v2/{+sinkName}",
// "request": {
// "$ref": "LogSink"
// },
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/logging.admin"
// ]
// }
}