1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Code generated file. DO NOT EDIT.
6
7// Package logging provides access to the Cloud Logging API.
8//
9// This package is DEPRECATED. Use package cloud.google.com/go/logging instead.
10//
11// For product documentation, see: https://cloud.google.com/logging/docs/
12//
13// Creating a client
14//
15// Usage example:
16//
17//   import "google.golang.org/api/logging/v2"
18//   ...
19//   ctx := context.Background()
20//   loggingService, err := logging.NewService(ctx)
21//
22// In this example, Google Application Default Credentials are used for authentication.
23//
24// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
25//
26// Other authentication options
27//
28// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
29//
30//   loggingService, err := logging.NewService(ctx, option.WithScopes(logging.LoggingWriteScope))
31//
32// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
33//
34//   loggingService, err := logging.NewService(ctx, option.WithAPIKey("AIza..."))
35//
36// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
37//
38//   config := &oauth2.Config{...}
39//   // ...
40//   token, err := config.Exchange(ctx, ...)
41//   loggingService, err := logging.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
42//
43// See https://godoc.org/google.golang.org/api/option/ for details on options.
44package logging // import "google.golang.org/api/logging/v2"
45
46import (
47	"bytes"
48	"context"
49	"encoding/json"
50	"errors"
51	"fmt"
52	"io"
53	"net/http"
54	"net/url"
55	"strconv"
56	"strings"
57
58	googleapi "google.golang.org/api/googleapi"
59	gensupport "google.golang.org/api/internal/gensupport"
60	option "google.golang.org/api/option"
61	internaloption "google.golang.org/api/option/internaloption"
62	htransport "google.golang.org/api/transport/http"
63)
64
65// Always reference these packages, just in case the auto-generated code
66// below doesn't.
67var _ = bytes.NewBuffer
68var _ = strconv.Itoa
69var _ = fmt.Sprintf
70var _ = json.NewDecoder
71var _ = io.Copy
72var _ = url.Parse
73var _ = gensupport.MarshalJSON
74var _ = googleapi.Version
75var _ = errors.New
76var _ = strings.Replace
77var _ = context.Canceled
78var _ = internaloption.WithDefaultEndpoint
79
80const apiId = "logging:v2"
81const apiName = "logging"
82const apiVersion = "v2"
83const basePath = "https://logging.googleapis.com/"
84const mtlsBasePath = "https://logging.mtls.googleapis.com/"
85
86// OAuth2 scopes used by this API.
87const (
88	// View and manage your data across Google Cloud Platform services
89	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
90
91	// View your data across Google Cloud Platform services
92	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
93
94	// Administrate log data for your projects
95	LoggingAdminScope = "https://www.googleapis.com/auth/logging.admin"
96
97	// View log data for your projects
98	LoggingReadScope = "https://www.googleapis.com/auth/logging.read"
99
100	// Submit log data for your projects
101	LoggingWriteScope = "https://www.googleapis.com/auth/logging.write"
102)
103
104// NewService creates a new Service.
105func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
106	scopesOption := option.WithScopes(
107		"https://www.googleapis.com/auth/cloud-platform",
108		"https://www.googleapis.com/auth/cloud-platform.read-only",
109		"https://www.googleapis.com/auth/logging.admin",
110		"https://www.googleapis.com/auth/logging.read",
111		"https://www.googleapis.com/auth/logging.write",
112	)
113	// NOTE: prepend, so we don't override user-specified scopes.
114	opts = append([]option.ClientOption{scopesOption}, opts...)
115	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
116	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
117	client, endpoint, err := htransport.NewClient(ctx, opts...)
118	if err != nil {
119		return nil, err
120	}
121	s, err := New(client)
122	if err != nil {
123		return nil, err
124	}
125	if endpoint != "" {
126		s.BasePath = endpoint
127	}
128	return s, nil
129}
130
131// New creates a new Service. It uses the provided http.Client for requests.
132//
133// Deprecated: please use NewService instead.
134// To provide a custom HTTP client, use option.WithHTTPClient.
135// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
136func New(client *http.Client) (*Service, error) {
137	if client == nil {
138		return nil, errors.New("client is nil")
139	}
140	s := &Service{client: client, BasePath: basePath}
141	s.BillingAccounts = NewBillingAccountsService(s)
142	s.Entries = NewEntriesService(s)
143	s.Exclusions = NewExclusionsService(s)
144	s.Folders = NewFoldersService(s)
145	s.Locations = NewLocationsService(s)
146	s.Logs = NewLogsService(s)
147	s.MonitoredResourceDescriptors = NewMonitoredResourceDescriptorsService(s)
148	s.Organizations = NewOrganizationsService(s)
149	s.Projects = NewProjectsService(s)
150	s.Sinks = NewSinksService(s)
151	s.V2 = NewV2Service(s)
152	return s, nil
153}
154
155type Service struct {
156	client    *http.Client
157	BasePath  string // API endpoint base URL
158	UserAgent string // optional additional User-Agent fragment
159
160	BillingAccounts *BillingAccountsService
161
162	Entries *EntriesService
163
164	Exclusions *ExclusionsService
165
166	Folders *FoldersService
167
168	Locations *LocationsService
169
170	Logs *LogsService
171
172	MonitoredResourceDescriptors *MonitoredResourceDescriptorsService
173
174	Organizations *OrganizationsService
175
176	Projects *ProjectsService
177
178	Sinks *SinksService
179
180	V2 *V2Service
181}
182
183func (s *Service) userAgent() string {
184	if s.UserAgent == "" {
185		return googleapi.UserAgent
186	}
187	return googleapi.UserAgent + " " + s.UserAgent
188}
189
190func NewBillingAccountsService(s *Service) *BillingAccountsService {
191	rs := &BillingAccountsService{s: s}
192	rs.Buckets = NewBillingAccountsBucketsService(s)
193	rs.Exclusions = NewBillingAccountsExclusionsService(s)
194	rs.Locations = NewBillingAccountsLocationsService(s)
195	rs.Logs = NewBillingAccountsLogsService(s)
196	rs.Sinks = NewBillingAccountsSinksService(s)
197	return rs
198}
199
200type BillingAccountsService struct {
201	s *Service
202
203	Buckets *BillingAccountsBucketsService
204
205	Exclusions *BillingAccountsExclusionsService
206
207	Locations *BillingAccountsLocationsService
208
209	Logs *BillingAccountsLogsService
210
211	Sinks *BillingAccountsSinksService
212}
213
214func NewBillingAccountsBucketsService(s *Service) *BillingAccountsBucketsService {
215	rs := &BillingAccountsBucketsService{s: s}
216	rs.Views = NewBillingAccountsBucketsViewsService(s)
217	return rs
218}
219
220type BillingAccountsBucketsService struct {
221	s *Service
222
223	Views *BillingAccountsBucketsViewsService
224}
225
226func NewBillingAccountsBucketsViewsService(s *Service) *BillingAccountsBucketsViewsService {
227	rs := &BillingAccountsBucketsViewsService{s: s}
228	return rs
229}
230
231type BillingAccountsBucketsViewsService struct {
232	s *Service
233}
234
235func NewBillingAccountsExclusionsService(s *Service) *BillingAccountsExclusionsService {
236	rs := &BillingAccountsExclusionsService{s: s}
237	return rs
238}
239
240type BillingAccountsExclusionsService struct {
241	s *Service
242}
243
244func NewBillingAccountsLocationsService(s *Service) *BillingAccountsLocationsService {
245	rs := &BillingAccountsLocationsService{s: s}
246	rs.Buckets = NewBillingAccountsLocationsBucketsService(s)
247	return rs
248}
249
250type BillingAccountsLocationsService struct {
251	s *Service
252
253	Buckets *BillingAccountsLocationsBucketsService
254}
255
256func NewBillingAccountsLocationsBucketsService(s *Service) *BillingAccountsLocationsBucketsService {
257	rs := &BillingAccountsLocationsBucketsService{s: s}
258	rs.Views = NewBillingAccountsLocationsBucketsViewsService(s)
259	return rs
260}
261
262type BillingAccountsLocationsBucketsService struct {
263	s *Service
264
265	Views *BillingAccountsLocationsBucketsViewsService
266}
267
268func NewBillingAccountsLocationsBucketsViewsService(s *Service) *BillingAccountsLocationsBucketsViewsService {
269	rs := &BillingAccountsLocationsBucketsViewsService{s: s}
270	return rs
271}
272
273type BillingAccountsLocationsBucketsViewsService struct {
274	s *Service
275}
276
277func NewBillingAccountsLogsService(s *Service) *BillingAccountsLogsService {
278	rs := &BillingAccountsLogsService{s: s}
279	return rs
280}
281
282type BillingAccountsLogsService struct {
283	s *Service
284}
285
286func NewBillingAccountsSinksService(s *Service) *BillingAccountsSinksService {
287	rs := &BillingAccountsSinksService{s: s}
288	return rs
289}
290
291type BillingAccountsSinksService struct {
292	s *Service
293}
294
295func NewEntriesService(s *Service) *EntriesService {
296	rs := &EntriesService{s: s}
297	return rs
298}
299
300type EntriesService struct {
301	s *Service
302}
303
304func NewExclusionsService(s *Service) *ExclusionsService {
305	rs := &ExclusionsService{s: s}
306	return rs
307}
308
309type ExclusionsService struct {
310	s *Service
311}
312
313func NewFoldersService(s *Service) *FoldersService {
314	rs := &FoldersService{s: s}
315	rs.Exclusions = NewFoldersExclusionsService(s)
316	rs.Locations = NewFoldersLocationsService(s)
317	rs.Logs = NewFoldersLogsService(s)
318	rs.Sinks = NewFoldersSinksService(s)
319	return rs
320}
321
322type FoldersService struct {
323	s *Service
324
325	Exclusions *FoldersExclusionsService
326
327	Locations *FoldersLocationsService
328
329	Logs *FoldersLogsService
330
331	Sinks *FoldersSinksService
332}
333
334func NewFoldersExclusionsService(s *Service) *FoldersExclusionsService {
335	rs := &FoldersExclusionsService{s: s}
336	return rs
337}
338
339type FoldersExclusionsService struct {
340	s *Service
341}
342
343func NewFoldersLocationsService(s *Service) *FoldersLocationsService {
344	rs := &FoldersLocationsService{s: s}
345	rs.Buckets = NewFoldersLocationsBucketsService(s)
346	return rs
347}
348
349type FoldersLocationsService struct {
350	s *Service
351
352	Buckets *FoldersLocationsBucketsService
353}
354
355func NewFoldersLocationsBucketsService(s *Service) *FoldersLocationsBucketsService {
356	rs := &FoldersLocationsBucketsService{s: s}
357	rs.Views = NewFoldersLocationsBucketsViewsService(s)
358	return rs
359}
360
361type FoldersLocationsBucketsService struct {
362	s *Service
363
364	Views *FoldersLocationsBucketsViewsService
365}
366
367func NewFoldersLocationsBucketsViewsService(s *Service) *FoldersLocationsBucketsViewsService {
368	rs := &FoldersLocationsBucketsViewsService{s: s}
369	return rs
370}
371
372type FoldersLocationsBucketsViewsService struct {
373	s *Service
374}
375
376func NewFoldersLogsService(s *Service) *FoldersLogsService {
377	rs := &FoldersLogsService{s: s}
378	return rs
379}
380
381type FoldersLogsService struct {
382	s *Service
383}
384
385func NewFoldersSinksService(s *Service) *FoldersSinksService {
386	rs := &FoldersSinksService{s: s}
387	return rs
388}
389
390type FoldersSinksService struct {
391	s *Service
392}
393
394func NewLocationsService(s *Service) *LocationsService {
395	rs := &LocationsService{s: s}
396	rs.Buckets = NewLocationsBucketsService(s)
397	return rs
398}
399
400type LocationsService struct {
401	s *Service
402
403	Buckets *LocationsBucketsService
404}
405
406func NewLocationsBucketsService(s *Service) *LocationsBucketsService {
407	rs := &LocationsBucketsService{s: s}
408	rs.Views = NewLocationsBucketsViewsService(s)
409	return rs
410}
411
412type LocationsBucketsService struct {
413	s *Service
414
415	Views *LocationsBucketsViewsService
416}
417
418func NewLocationsBucketsViewsService(s *Service) *LocationsBucketsViewsService {
419	rs := &LocationsBucketsViewsService{s: s}
420	return rs
421}
422
423type LocationsBucketsViewsService struct {
424	s *Service
425}
426
427func NewLogsService(s *Service) *LogsService {
428	rs := &LogsService{s: s}
429	return rs
430}
431
432type LogsService struct {
433	s *Service
434}
435
436func NewMonitoredResourceDescriptorsService(s *Service) *MonitoredResourceDescriptorsService {
437	rs := &MonitoredResourceDescriptorsService{s: s}
438	return rs
439}
440
441type MonitoredResourceDescriptorsService struct {
442	s *Service
443}
444
445func NewOrganizationsService(s *Service) *OrganizationsService {
446	rs := &OrganizationsService{s: s}
447	rs.Exclusions = NewOrganizationsExclusionsService(s)
448	rs.Locations = NewOrganizationsLocationsService(s)
449	rs.Logs = NewOrganizationsLogsService(s)
450	rs.Sinks = NewOrganizationsSinksService(s)
451	return rs
452}
453
454type OrganizationsService struct {
455	s *Service
456
457	Exclusions *OrganizationsExclusionsService
458
459	Locations *OrganizationsLocationsService
460
461	Logs *OrganizationsLogsService
462
463	Sinks *OrganizationsSinksService
464}
465
466func NewOrganizationsExclusionsService(s *Service) *OrganizationsExclusionsService {
467	rs := &OrganizationsExclusionsService{s: s}
468	return rs
469}
470
471type OrganizationsExclusionsService struct {
472	s *Service
473}
474
475func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService {
476	rs := &OrganizationsLocationsService{s: s}
477	rs.Buckets = NewOrganizationsLocationsBucketsService(s)
478	return rs
479}
480
481type OrganizationsLocationsService struct {
482	s *Service
483
484	Buckets *OrganizationsLocationsBucketsService
485}
486
487func NewOrganizationsLocationsBucketsService(s *Service) *OrganizationsLocationsBucketsService {
488	rs := &OrganizationsLocationsBucketsService{s: s}
489	rs.Views = NewOrganizationsLocationsBucketsViewsService(s)
490	return rs
491}
492
493type OrganizationsLocationsBucketsService struct {
494	s *Service
495
496	Views *OrganizationsLocationsBucketsViewsService
497}
498
499func NewOrganizationsLocationsBucketsViewsService(s *Service) *OrganizationsLocationsBucketsViewsService {
500	rs := &OrganizationsLocationsBucketsViewsService{s: s}
501	return rs
502}
503
504type OrganizationsLocationsBucketsViewsService struct {
505	s *Service
506}
507
508func NewOrganizationsLogsService(s *Service) *OrganizationsLogsService {
509	rs := &OrganizationsLogsService{s: s}
510	return rs
511}
512
513type OrganizationsLogsService struct {
514	s *Service
515}
516
517func NewOrganizationsSinksService(s *Service) *OrganizationsSinksService {
518	rs := &OrganizationsSinksService{s: s}
519	return rs
520}
521
522type OrganizationsSinksService struct {
523	s *Service
524}
525
526func NewProjectsService(s *Service) *ProjectsService {
527	rs := &ProjectsService{s: s}
528	rs.Exclusions = NewProjectsExclusionsService(s)
529	rs.Locations = NewProjectsLocationsService(s)
530	rs.Logs = NewProjectsLogsService(s)
531	rs.Metrics = NewProjectsMetricsService(s)
532	rs.Sinks = NewProjectsSinksService(s)
533	return rs
534}
535
536type ProjectsService struct {
537	s *Service
538
539	Exclusions *ProjectsExclusionsService
540
541	Locations *ProjectsLocationsService
542
543	Logs *ProjectsLogsService
544
545	Metrics *ProjectsMetricsService
546
547	Sinks *ProjectsSinksService
548}
549
550func NewProjectsExclusionsService(s *Service) *ProjectsExclusionsService {
551	rs := &ProjectsExclusionsService{s: s}
552	return rs
553}
554
555type ProjectsExclusionsService struct {
556	s *Service
557}
558
559func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
560	rs := &ProjectsLocationsService{s: s}
561	rs.Buckets = NewProjectsLocationsBucketsService(s)
562	return rs
563}
564
565type ProjectsLocationsService struct {
566	s *Service
567
568	Buckets *ProjectsLocationsBucketsService
569}
570
571func NewProjectsLocationsBucketsService(s *Service) *ProjectsLocationsBucketsService {
572	rs := &ProjectsLocationsBucketsService{s: s}
573	rs.Views = NewProjectsLocationsBucketsViewsService(s)
574	return rs
575}
576
577type ProjectsLocationsBucketsService struct {
578	s *Service
579
580	Views *ProjectsLocationsBucketsViewsService
581}
582
583func NewProjectsLocationsBucketsViewsService(s *Service) *ProjectsLocationsBucketsViewsService {
584	rs := &ProjectsLocationsBucketsViewsService{s: s}
585	return rs
586}
587
588type ProjectsLocationsBucketsViewsService struct {
589	s *Service
590}
591
592func NewProjectsLogsService(s *Service) *ProjectsLogsService {
593	rs := &ProjectsLogsService{s: s}
594	return rs
595}
596
597type ProjectsLogsService struct {
598	s *Service
599}
600
601func NewProjectsMetricsService(s *Service) *ProjectsMetricsService {
602	rs := &ProjectsMetricsService{s: s}
603	return rs
604}
605
606type ProjectsMetricsService struct {
607	s *Service
608}
609
610func NewProjectsSinksService(s *Service) *ProjectsSinksService {
611	rs := &ProjectsSinksService{s: s}
612	return rs
613}
614
615type ProjectsSinksService struct {
616	s *Service
617}
618
619func NewSinksService(s *Service) *SinksService {
620	rs := &SinksService{s: s}
621	return rs
622}
623
624type SinksService struct {
625	s *Service
626}
627
628func NewV2Service(s *Service) *V2Service {
629	rs := &V2Service{s: s}
630	return rs
631}
632
633type V2Service struct {
634	s *Service
635}
636
637// BigQueryOptions: Options that change functionality of a sink
638// exporting data to BigQuery.
639type BigQueryOptions struct {
640	// UsePartitionedTables: Optional. Whether to use BigQuery's partition
641	// tables (https://cloud.google.com/bigquery/docs/partitioned-tables).
642	// By default, Logging creates dated tables based on the log entries'
643	// timestamps, e.g. syslog_20170523. With partitioned tables the date
644	// suffix is no longer present and special query syntax
645	// (https://cloud.google.com/bigquery/docs/querying-partitioned-tables)
646	// has to be used instead. In both cases, tables are sharded based on
647	// UTC timezone.
648	UsePartitionedTables bool `json:"usePartitionedTables,omitempty"`
649
650	// UsesTimestampColumnPartitioning: Output only. True if new timestamp
651	// column based partitioning is in use, false if legacy ingestion-time
652	// partitioning is in use. All new sinks will have this field set true
653	// and will use timestamp column based partitioning. If
654	// use_partitioned_tables is false, this value has no meaning and will
655	// be false. Legacy sinks using partitioned tables will have this field
656	// set to false.
657	UsesTimestampColumnPartitioning bool `json:"usesTimestampColumnPartitioning,omitempty"`
658
659	// ForceSendFields is a list of field names (e.g.
660	// "UsePartitionedTables") to unconditionally include in API requests.
661	// By default, fields with empty values are omitted from API requests.
662	// However, any non-pointer, non-interface field appearing in
663	// ForceSendFields will be sent to the server regardless of whether the
664	// field is empty or not. This may be used to include empty fields in
665	// Patch requests.
666	ForceSendFields []string `json:"-"`
667
668	// NullFields is a list of field names (e.g. "UsePartitionedTables") to
669	// include in API requests with the JSON null value. By default, fields
670	// with empty values are omitted from API requests. However, any field
671	// with an empty value appearing in NullFields will be sent to the
672	// server as null. It is an error if a field in this list has a
673	// non-empty value. This may be used to include null fields in Patch
674	// requests.
675	NullFields []string `json:"-"`
676}
677
678func (s *BigQueryOptions) MarshalJSON() ([]byte, error) {
679	type NoMethod BigQueryOptions
680	raw := NoMethod(*s)
681	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
682}
683
684// BucketOptions: BucketOptions describes the bucket boundaries used to
685// create a histogram for the distribution. The buckets can be in a
686// linear sequence, an exponential sequence, or each bucket can be
687// specified explicitly. BucketOptions does not include the number of
688// values in each bucket.A bucket has an inclusive lower bound and
689// exclusive upper bound for the values that are counted for that
690// bucket. The upper bound of a bucket must be strictly greater than the
691// lower bound. The sequence of N buckets for a distribution consists of
692// an underflow bucket (number 0), zero or more finite buckets (number 1
693// through N - 2) and an overflow bucket (number N - 1). The buckets are
694// contiguous: the lower bound of bucket i (i > 0) is the same as the
695// upper bound of bucket i - 1. The buckets span the whole range of
696// finite values: lower bound of the underflow bucket is -infinity and
697// the upper bound of the overflow bucket is +infinity. The finite
698// buckets are so-called because both bounds are finite.
699type BucketOptions struct {
700	// ExplicitBuckets: The explicit buckets.
701	ExplicitBuckets *Explicit `json:"explicitBuckets,omitempty"`
702
703	// ExponentialBuckets: The exponential buckets.
704	ExponentialBuckets *Exponential `json:"exponentialBuckets,omitempty"`
705
706	// LinearBuckets: The linear bucket.
707	LinearBuckets *Linear `json:"linearBuckets,omitempty"`
708
709	// ForceSendFields is a list of field names (e.g. "ExplicitBuckets") to
710	// unconditionally include in API requests. By default, fields with
711	// empty values are omitted from API requests. However, any non-pointer,
712	// non-interface field appearing in ForceSendFields will be sent to the
713	// server regardless of whether the field is empty or not. This may be
714	// used to include empty fields in Patch requests.
715	ForceSendFields []string `json:"-"`
716
717	// NullFields is a list of field names (e.g. "ExplicitBuckets") to
718	// include in API requests with the JSON null value. By default, fields
719	// with empty values are omitted from API requests. However, any field
720	// with an empty value appearing in NullFields will be sent to the
721	// server as null. It is an error if a field in this list has a
722	// non-empty value. This may be used to include null fields in Patch
723	// requests.
724	NullFields []string `json:"-"`
725}
726
727func (s *BucketOptions) MarshalJSON() ([]byte, error) {
728	type NoMethod BucketOptions
729	raw := NoMethod(*s)
730	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
731}
732
733// CmekSettings: Describes the customer-managed encryption key (CMEK)
734// settings associated with a project, folder, organization, billing
735// account, or flexible resource.Note: CMEK for the Logs Router can
736// currently only be configured for GCP organizations. Once configured,
737// it applies to all projects and folders in the GCP organization.See
738// Enabling CMEK for Logs Router
739// (https://cloud.google.com/logging/docs/routing/managed-encryption)
740// for more information.
741type CmekSettings struct {
742	// KmsKeyName: The resource name for the configured Cloud KMS key.KMS
743	// key name format:
744	// "projects/PROJECT_ID/locations/LOCATION/keyRings/KEYRING/cryptoKeys/KE
745	// Y"For example:
746	// "projects/my-project-id/locations/my-region/keyRings/key-ring-name/cry
747	// ptoKeys/key-name"To enable CMEK for the Logs Router, set this field
748	// to a valid kms_key_name for which the associated service account has
749	// the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned
750	// for the key.The Cloud KMS key used by the Log Router can be updated
751	// by changing the kms_key_name to a new valid key name. Encryption
752	// operations that are in progress will be completed with the key that
753	// was in use when they started. Decryption operations will be completed
754	// using the key that was used at the time of encryption unless access
755	// to that key has been revoked.To disable CMEK for the Logs Router, set
756	// this field to an empty string.See Enabling CMEK for Logs Router
757	// (https://cloud.google.com/logging/docs/routing/managed-encryption)
758	// for more information.
759	KmsKeyName string `json:"kmsKeyName,omitempty"`
760
761	// Name: Output only. The resource name of the CMEK settings.
762	Name string `json:"name,omitempty"`
763
764	// ServiceAccountId: Output only. The service account that will be used
765	// by the Logs Router to access your Cloud KMS key.Before enabling CMEK
766	// for Logs Router, you must first assign the role
767	// roles/cloudkms.cryptoKeyEncrypterDecrypter to the service account
768	// that the Logs Router will use to access your Cloud KMS key. Use
769	// GetCmekSettings to obtain the service account ID.See Enabling CMEK
770	// for Logs Router
771	// (https://cloud.google.com/logging/docs/routing/managed-encryption)
772	// for more information.
773	ServiceAccountId string `json:"serviceAccountId,omitempty"`
774
775	// ServerResponse contains the HTTP response code and headers from the
776	// server.
777	googleapi.ServerResponse `json:"-"`
778
779	// ForceSendFields is a list of field names (e.g. "KmsKeyName") to
780	// unconditionally include in API requests. By default, fields with
781	// empty values are omitted from API requests. However, any non-pointer,
782	// non-interface field appearing in ForceSendFields will be sent to the
783	// server regardless of whether the field is empty or not. This may be
784	// used to include empty fields in Patch requests.
785	ForceSendFields []string `json:"-"`
786
787	// NullFields is a list of field names (e.g. "KmsKeyName") to include in
788	// API requests with the JSON null value. By default, fields with empty
789	// values are omitted from API requests. However, any field with an
790	// empty value appearing in NullFields will be sent to the server as
791	// null. It is an error if a field in this list has a non-empty value.
792	// This may be used to include null fields in Patch requests.
793	NullFields []string `json:"-"`
794}
795
796func (s *CmekSettings) MarshalJSON() ([]byte, error) {
797	type NoMethod CmekSettings
798	raw := NoMethod(*s)
799	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
800}
801
802// Empty: A generic empty message that you can re-use to avoid defining
803// duplicated empty messages in your APIs. A typical example is to use
804// it as the request or the response type of an API method. For
805// instance: service Foo { rpc Bar(google.protobuf.Empty) returns
806// (google.protobuf.Empty); } The JSON representation for Empty is empty
807// JSON object {}.
808type Empty struct {
809	// ServerResponse contains the HTTP response code and headers from the
810	// server.
811	googleapi.ServerResponse `json:"-"`
812}
813
814// Explicit: Specifies a set of buckets with arbitrary widths.There are
815// size(bounds) + 1 (= N) buckets. Bucket i has the following
816// boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i <
817// N); boundsi - 1The bounds field must contain at least one element. If
818// bounds has only one element, then there are no finite buckets, and
819// that single element is the common boundary of the overflow and
820// underflow buckets.
821type Explicit struct {
822	// Bounds: The values must be monotonically increasing.
823	Bounds []float64 `json:"bounds,omitempty"`
824
825	// ForceSendFields is a list of field names (e.g. "Bounds") to
826	// unconditionally include in API requests. By default, fields with
827	// empty values are omitted from API requests. However, any non-pointer,
828	// non-interface field appearing in ForceSendFields will be sent to the
829	// server regardless of whether the field is empty or not. This may be
830	// used to include empty fields in Patch requests.
831	ForceSendFields []string `json:"-"`
832
833	// NullFields is a list of field names (e.g. "Bounds") to include in API
834	// requests with the JSON null value. By default, fields with empty
835	// values are omitted from API requests. However, any field with an
836	// empty value appearing in NullFields will be sent to the server as
837	// null. It is an error if a field in this list has a non-empty value.
838	// This may be used to include null fields in Patch requests.
839	NullFields []string `json:"-"`
840}
841
842func (s *Explicit) MarshalJSON() ([]byte, error) {
843	type NoMethod Explicit
844	raw := NoMethod(*s)
845	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
846}
847
848// Exponential: Specifies an exponential sequence of buckets that have a
849// width that is proportional to the value of the lower bound. Each
850// bucket represents a constant relative uncertainty on a specific value
851// in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket
852// i has the following boundaries:Upper bound (0 <= i < N-1): scale *
853// (growth_factor ^ i). Lower bound (1 <= i < N): scale * (growth_factor
854// ^ (i - 1)).
855type Exponential struct {
856	// GrowthFactor: Must be greater than 1.
857	GrowthFactor float64 `json:"growthFactor,omitempty"`
858
859	// NumFiniteBuckets: Must be greater than 0.
860	NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
861
862	// Scale: Must be greater than 0.
863	Scale float64 `json:"scale,omitempty"`
864
865	// ForceSendFields is a list of field names (e.g. "GrowthFactor") to
866	// unconditionally include in API requests. By default, fields with
867	// empty values are omitted from API requests. However, any non-pointer,
868	// non-interface field appearing in ForceSendFields will be sent to the
869	// server regardless of whether the field is empty or not. This may be
870	// used to include empty fields in Patch requests.
871	ForceSendFields []string `json:"-"`
872
873	// NullFields is a list of field names (e.g. "GrowthFactor") to include
874	// in API requests with the JSON null value. By default, fields with
875	// empty values are omitted from API requests. However, any field with
876	// an empty value appearing in NullFields will be sent to the server as
877	// null. It is an error if a field in this list has a non-empty value.
878	// This may be used to include null fields in Patch requests.
879	NullFields []string `json:"-"`
880}
881
882func (s *Exponential) MarshalJSON() ([]byte, error) {
883	type NoMethod Exponential
884	raw := NoMethod(*s)
885	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
886}
887
888func (s *Exponential) UnmarshalJSON(data []byte) error {
889	type NoMethod Exponential
890	var s1 struct {
891		GrowthFactor gensupport.JSONFloat64 `json:"growthFactor"`
892		Scale        gensupport.JSONFloat64 `json:"scale"`
893		*NoMethod
894	}
895	s1.NoMethod = (*NoMethod)(s)
896	if err := json.Unmarshal(data, &s1); err != nil {
897		return err
898	}
899	s.GrowthFactor = float64(s1.GrowthFactor)
900	s.Scale = float64(s1.Scale)
901	return nil
902}
903
904// HttpRequest: A common proto for logging HTTP requests. Only contains
905// semantics defined by the HTTP specification. Product-specific logging
906// information MUST be defined in a separate message.
907type HttpRequest struct {
908	// CacheFillBytes: The number of HTTP response bytes inserted into
909	// cache. Set only when a cache fill was attempted.
910	CacheFillBytes int64 `json:"cacheFillBytes,omitempty,string"`
911
912	// CacheHit: Whether or not an entity was served from cache (with or
913	// without validation).
914	CacheHit bool `json:"cacheHit,omitempty"`
915
916	// CacheLookup: Whether or not a cache lookup was attempted.
917	CacheLookup bool `json:"cacheLookup,omitempty"`
918
919	// CacheValidatedWithOriginServer: Whether or not the response was
920	// validated with the origin server before being served from cache. This
921	// field is only meaningful if cache_hit is True.
922	CacheValidatedWithOriginServer bool `json:"cacheValidatedWithOriginServer,omitempty"`
923
924	// Latency: The request processing latency on the server, from the time
925	// the request was received until the response was sent.
926	Latency string `json:"latency,omitempty"`
927
928	// Protocol: Protocol used for the request. Examples: "HTTP/1.1",
929	// "HTTP/2", "websocket"
930	Protocol string `json:"protocol,omitempty"`
931
932	// Referer: The referer URL of the request, as defined in HTTP/1.1
933	// Header Field Definitions
934	// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
935	Referer string `json:"referer,omitempty"`
936
937	// RemoteIp: The IP address (IPv4 or IPv6) of the client that issued the
938	// HTTP request. This field can include port information. Examples:
939	// "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".
940	RemoteIp string `json:"remoteIp,omitempty"`
941
942	// RequestMethod: The request method. Examples: "GET", "HEAD", "PUT",
943	// "POST".
944	RequestMethod string `json:"requestMethod,omitempty"`
945
946	// RequestSize: The size of the HTTP request message in bytes, including
947	// the request headers and the request body.
948	RequestSize int64 `json:"requestSize,omitempty,string"`
949
950	// RequestUrl: The scheme (http, https), the host name, the path and the
951	// query portion of the URL that was requested. Example:
952	// "http://example.com/some/info?color=red".
953	RequestUrl string `json:"requestUrl,omitempty"`
954
955	// ResponseSize: The size of the HTTP response message sent back to the
956	// client, in bytes, including the response headers and the response
957	// body.
958	ResponseSize int64 `json:"responseSize,omitempty,string"`
959
960	// ServerIp: The IP address (IPv4 or IPv6) of the origin server that the
961	// request was sent to. This field can include port information.
962	// Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".
963	ServerIp string `json:"serverIp,omitempty"`
964
965	// Status: The response code indicating the status of response.
966	// Examples: 200, 404.
967	Status int64 `json:"status,omitempty"`
968
969	// UserAgent: The user agent sent by the client. Example: "Mozilla/4.0
970	// (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".
971	UserAgent string `json:"userAgent,omitempty"`
972
973	// ForceSendFields is a list of field names (e.g. "CacheFillBytes") to
974	// unconditionally include in API requests. By default, fields with
975	// empty values are omitted from API requests. However, any non-pointer,
976	// non-interface field appearing in ForceSendFields will be sent to the
977	// server regardless of whether the field is empty or not. This may be
978	// used to include empty fields in Patch requests.
979	ForceSendFields []string `json:"-"`
980
981	// NullFields is a list of field names (e.g. "CacheFillBytes") to
982	// include in API requests with the JSON null value. By default, fields
983	// with empty values are omitted from API requests. However, any field
984	// with an empty value appearing in NullFields will be sent to the
985	// server as null. It is an error if a field in this list has a
986	// non-empty value. This may be used to include null fields in Patch
987	// requests.
988	NullFields []string `json:"-"`
989}
990
991func (s *HttpRequest) MarshalJSON() ([]byte, error) {
992	type NoMethod HttpRequest
993	raw := NoMethod(*s)
994	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
995}
996
997// LabelDescriptor: A description of a label.
998type LabelDescriptor struct {
999	// Description: A human-readable description for the label.
1000	Description string `json:"description,omitempty"`
1001
1002	// Key: The label key.
1003	Key string `json:"key,omitempty"`
1004
1005	// ValueType: The type of data that can be assigned to the label.
1006	//
1007	// Possible values:
1008	//   "STRING" - A variable-length string. This is the default.
1009	//   "BOOL" - Boolean; true or false.
1010	//   "INT64" - A 64-bit signed integer.
1011	ValueType string `json:"valueType,omitempty"`
1012
1013	// ForceSendFields is a list of field names (e.g. "Description") to
1014	// unconditionally include in API requests. By default, fields with
1015	// empty values are omitted from API requests. However, any non-pointer,
1016	// non-interface field appearing in ForceSendFields will be sent to the
1017	// server regardless of whether the field is empty or not. This may be
1018	// used to include empty fields in Patch requests.
1019	ForceSendFields []string `json:"-"`
1020
1021	// NullFields is a list of field names (e.g. "Description") to include
1022	// in API requests with the JSON null value. By default, fields with
1023	// empty values are omitted from API requests. However, any field with
1024	// an empty value appearing in NullFields will be sent to the server as
1025	// null. It is an error if a field in this list has a non-empty value.
1026	// This may be used to include null fields in Patch requests.
1027	NullFields []string `json:"-"`
1028}
1029
1030func (s *LabelDescriptor) MarshalJSON() ([]byte, error) {
1031	type NoMethod LabelDescriptor
1032	raw := NoMethod(*s)
1033	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1034}
1035
1036// Linear: Specifies a linear sequence of buckets that all have the same
1037// width (except overflow and underflow). Each bucket represents a
1038// constant absolute uncertainty on the specific value in the
1039// bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has
1040// the following boundaries:Upper bound (0 <= i < N-1): offset + (width
1041// * i). Lower bound (1 <= i < N): offset + (width * (i - 1)).
1042type Linear struct {
1043	// NumFiniteBuckets: Must be greater than 0.
1044	NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
1045
1046	// Offset: Lower bound of the first bucket.
1047	Offset float64 `json:"offset,omitempty"`
1048
1049	// Width: Must be greater than 0.
1050	Width float64 `json:"width,omitempty"`
1051
1052	// ForceSendFields is a list of field names (e.g. "NumFiniteBuckets") to
1053	// unconditionally include in API requests. By default, fields with
1054	// empty values are omitted from API requests. However, any non-pointer,
1055	// non-interface field appearing in ForceSendFields will be sent to the
1056	// server regardless of whether the field is empty or not. This may be
1057	// used to include empty fields in Patch requests.
1058	ForceSendFields []string `json:"-"`
1059
1060	// NullFields is a list of field names (e.g. "NumFiniteBuckets") to
1061	// include in API requests with the JSON null value. By default, fields
1062	// with empty values are omitted from API requests. However, any field
1063	// with an empty value appearing in NullFields will be sent to the
1064	// server as null. It is an error if a field in this list has a
1065	// non-empty value. This may be used to include null fields in Patch
1066	// requests.
1067	NullFields []string `json:"-"`
1068}
1069
1070func (s *Linear) MarshalJSON() ([]byte, error) {
1071	type NoMethod Linear
1072	raw := NoMethod(*s)
1073	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1074}
1075
1076func (s *Linear) UnmarshalJSON(data []byte) error {
1077	type NoMethod Linear
1078	var s1 struct {
1079		Offset gensupport.JSONFloat64 `json:"offset"`
1080		Width  gensupport.JSONFloat64 `json:"width"`
1081		*NoMethod
1082	}
1083	s1.NoMethod = (*NoMethod)(s)
1084	if err := json.Unmarshal(data, &s1); err != nil {
1085		return err
1086	}
1087	s.Offset = float64(s1.Offset)
1088	s.Width = float64(s1.Width)
1089	return nil
1090}
1091
1092// ListBucketsResponse: The response from ListBuckets.
1093type ListBucketsResponse struct {
1094	// Buckets: A list of buckets.
1095	Buckets []*LogBucket `json:"buckets,omitempty"`
1096
1097	// NextPageToken: If there might be more results than appear in this
1098	// response, then nextPageToken is included. To get the next set of
1099	// results, call the same method again using the value of nextPageToken
1100	// as pageToken.
1101	NextPageToken string `json:"nextPageToken,omitempty"`
1102
1103	// ServerResponse contains the HTTP response code and headers from the
1104	// server.
1105	googleapi.ServerResponse `json:"-"`
1106
1107	// ForceSendFields is a list of field names (e.g. "Buckets") to
1108	// unconditionally include in API requests. By default, fields with
1109	// empty values are omitted from API requests. However, any non-pointer,
1110	// non-interface field appearing in ForceSendFields will be sent to the
1111	// server regardless of whether the field is empty or not. This may be
1112	// used to include empty fields in Patch requests.
1113	ForceSendFields []string `json:"-"`
1114
1115	// NullFields is a list of field names (e.g. "Buckets") to include in
1116	// API requests with the JSON null value. By default, fields with empty
1117	// values are omitted from API requests. However, any field with an
1118	// empty value appearing in NullFields will be sent to the server as
1119	// null. It is an error if a field in this list has a non-empty value.
1120	// This may be used to include null fields in Patch requests.
1121	NullFields []string `json:"-"`
1122}
1123
1124func (s *ListBucketsResponse) MarshalJSON() ([]byte, error) {
1125	type NoMethod ListBucketsResponse
1126	raw := NoMethod(*s)
1127	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1128}
1129
1130// ListExclusionsResponse: Result returned from ListExclusions.
1131type ListExclusionsResponse struct {
1132	// Exclusions: A list of exclusions.
1133	Exclusions []*LogExclusion `json:"exclusions,omitempty"`
1134
1135	// NextPageToken: If there might be more results than appear in this
1136	// response, then nextPageToken is included. To get the next set of
1137	// results, call the same method again using the value of nextPageToken
1138	// as pageToken.
1139	NextPageToken string `json:"nextPageToken,omitempty"`
1140
1141	// ServerResponse contains the HTTP response code and headers from the
1142	// server.
1143	googleapi.ServerResponse `json:"-"`
1144
1145	// ForceSendFields is a list of field names (e.g. "Exclusions") to
1146	// unconditionally include in API requests. By default, fields with
1147	// empty values are omitted from API requests. However, any non-pointer,
1148	// non-interface field appearing in ForceSendFields will be sent to the
1149	// server regardless of whether the field is empty or not. This may be
1150	// used to include empty fields in Patch requests.
1151	ForceSendFields []string `json:"-"`
1152
1153	// NullFields is a list of field names (e.g. "Exclusions") to include in
1154	// API requests with the JSON null value. By default, fields with empty
1155	// values are omitted from API requests. However, any field with an
1156	// empty value appearing in NullFields will be sent to the server as
1157	// null. It is an error if a field in this list has a non-empty value.
1158	// This may be used to include null fields in Patch requests.
1159	NullFields []string `json:"-"`
1160}
1161
1162func (s *ListExclusionsResponse) MarshalJSON() ([]byte, error) {
1163	type NoMethod ListExclusionsResponse
1164	raw := NoMethod(*s)
1165	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1166}
1167
1168// ListLocationsResponse: The response message for
1169// Locations.ListLocations.
1170type ListLocationsResponse struct {
1171	// Locations: A list of locations that matches the specified filter in
1172	// the request.
1173	Locations []*Location `json:"locations,omitempty"`
1174
1175	// NextPageToken: The standard List next-page token.
1176	NextPageToken string `json:"nextPageToken,omitempty"`
1177
1178	// ServerResponse contains the HTTP response code and headers from the
1179	// server.
1180	googleapi.ServerResponse `json:"-"`
1181
1182	// ForceSendFields is a list of field names (e.g. "Locations") to
1183	// unconditionally include in API requests. By default, fields with
1184	// empty values are omitted from API requests. However, any non-pointer,
1185	// non-interface field appearing in ForceSendFields will be sent to the
1186	// server regardless of whether the field is empty or not. This may be
1187	// used to include empty fields in Patch requests.
1188	ForceSendFields []string `json:"-"`
1189
1190	// NullFields is a list of field names (e.g. "Locations") to include in
1191	// API requests with the JSON null value. By default, fields with empty
1192	// values are omitted from API requests. However, any field with an
1193	// empty value appearing in NullFields will be sent to the server as
1194	// null. It is an error if a field in this list has a non-empty value.
1195	// This may be used to include null fields in Patch requests.
1196	NullFields []string `json:"-"`
1197}
1198
1199func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
1200	type NoMethod ListLocationsResponse
1201	raw := NoMethod(*s)
1202	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1203}
1204
1205// ListLogEntriesRequest: The parameters to ListLogEntries.
1206type ListLogEntriesRequest struct {
1207	// Filter: Optional. A filter that chooses which log entries to return.
1208	// See Advanced Logs Queries
1209	// (https://cloud.google.com/logging/docs/view/advanced-queries). Only
1210	// log entries that match the filter are returned. An empty filter
1211	// matches all log entries in the resources listed in resource_names.
1212	// Referencing a parent resource that is not listed in resource_names
1213	// will cause the filter to return no results. The maximum length of the
1214	// filter is 20000 characters.
1215	Filter string `json:"filter,omitempty"`
1216
1217	// OrderBy: Optional. How the results should be sorted. Presently, the
1218	// only permitted values are "timestamp asc" (default) and "timestamp
1219	// desc". The first option returns entries in order of increasing values
1220	// of LogEntry.timestamp (oldest first), and the second option returns
1221	// entries in order of decreasing timestamps (newest first). Entries
1222	// with equal timestamps are returned in order of their insert_id
1223	// values.
1224	OrderBy string `json:"orderBy,omitempty"`
1225
1226	// PageSize: Optional. The maximum number of results to return from this
1227	// request. Default is 50. If the value is negative or exceeds 1000, the
1228	// request is rejected. The presence of next_page_token in the response
1229	// indicates that more results might be available.
1230	PageSize int64 `json:"pageSize,omitempty"`
1231
1232	// PageToken: Optional. If present, then retrieve the next batch of
1233	// results from the preceding call to this method. page_token must be
1234	// the value of next_page_token from the previous response. The values
1235	// of other method parameters should be identical to those in the
1236	// previous call.
1237	PageToken string `json:"pageToken,omitempty"`
1238
1239	// ProjectIds: Optional. Deprecated. Use resource_names instead. One or
1240	// more project identifiers or project numbers from which to retrieve
1241	// log entries. Example: "my-project-1A".
1242	ProjectIds []string `json:"projectIds,omitempty"`
1243
1244	// ResourceNames: Required. Names of one or more parent resources from
1245	// which to retrieve log entries: "projects/[PROJECT_ID]"
1246	// "organizations/[ORGANIZATION_ID]"
1247	// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" May
1248	// alternatively be one or more views
1249	// projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW
1250	// _ID
1251	// organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/v
1252	// iews/VIEW_ID
1253	// billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKE
1254	// T_ID/views/VIEW_ID
1255	// folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_I
1256	// DProjects listed in the project_ids field are added to this list.
1257	ResourceNames []string `json:"resourceNames,omitempty"`
1258
1259	// ForceSendFields is a list of field names (e.g. "Filter") to
1260	// unconditionally include in API requests. By default, fields with
1261	// empty values are omitted from API requests. However, any non-pointer,
1262	// non-interface field appearing in ForceSendFields will be sent to the
1263	// server regardless of whether the field is empty or not. This may be
1264	// used to include empty fields in Patch requests.
1265	ForceSendFields []string `json:"-"`
1266
1267	// NullFields is a list of field names (e.g. "Filter") to include in API
1268	// requests with the JSON null value. By default, fields with empty
1269	// values are omitted from API requests. However, any field with an
1270	// empty value appearing in NullFields will be sent to the server as
1271	// null. It is an error if a field in this list has a non-empty value.
1272	// This may be used to include null fields in Patch requests.
1273	NullFields []string `json:"-"`
1274}
1275
1276func (s *ListLogEntriesRequest) MarshalJSON() ([]byte, error) {
1277	type NoMethod ListLogEntriesRequest
1278	raw := NoMethod(*s)
1279	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1280}
1281
1282// ListLogEntriesResponse: Result returned from ListLogEntries.
1283type ListLogEntriesResponse struct {
1284	// Entries: A list of log entries. If entries is empty, nextPageToken
1285	// may still be returned, indicating that more entries may exist. See
1286	// nextPageToken for more information.
1287	Entries []*LogEntry `json:"entries,omitempty"`
1288
1289	// NextPageToken: If there might be more results than those appearing in
1290	// this response, then nextPageToken is included. To get the next set of
1291	// results, call this method again using the value of nextPageToken as
1292	// pageToken.If a value for next_page_token appears and the entries
1293	// field is empty, it means that the search found no log entries so far
1294	// but it did not have time to search all the possible log entries.
1295	// Retry the method with this value for page_token to continue the
1296	// search. Alternatively, consider speeding up the search by changing
1297	// your filter to specify a single log name or resource type, or to
1298	// narrow the time range of the search.
1299	NextPageToken string `json:"nextPageToken,omitempty"`
1300
1301	// ServerResponse contains the HTTP response code and headers from the
1302	// server.
1303	googleapi.ServerResponse `json:"-"`
1304
1305	// ForceSendFields is a list of field names (e.g. "Entries") to
1306	// unconditionally include in API requests. By default, fields with
1307	// empty values are omitted from API requests. However, any non-pointer,
1308	// non-interface field appearing in ForceSendFields will be sent to the
1309	// server regardless of whether the field is empty or not. This may be
1310	// used to include empty fields in Patch requests.
1311	ForceSendFields []string `json:"-"`
1312
1313	// NullFields is a list of field names (e.g. "Entries") to include in
1314	// API requests with the JSON null value. By default, fields with empty
1315	// values are omitted from API requests. However, any field with an
1316	// empty value appearing in NullFields will be sent to the server as
1317	// null. It is an error if a field in this list has a non-empty value.
1318	// This may be used to include null fields in Patch requests.
1319	NullFields []string `json:"-"`
1320}
1321
1322func (s *ListLogEntriesResponse) MarshalJSON() ([]byte, error) {
1323	type NoMethod ListLogEntriesResponse
1324	raw := NoMethod(*s)
1325	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1326}
1327
1328// ListLogMetricsResponse: Result returned from ListLogMetrics.
1329type ListLogMetricsResponse struct {
1330	// Metrics: A list of logs-based metrics.
1331	Metrics []*LogMetric `json:"metrics,omitempty"`
1332
1333	// NextPageToken: If there might be more results than appear in this
1334	// response, then nextPageToken is included. To get the next set of
1335	// results, call this method again using the value of nextPageToken as
1336	// pageToken.
1337	NextPageToken string `json:"nextPageToken,omitempty"`
1338
1339	// ServerResponse contains the HTTP response code and headers from the
1340	// server.
1341	googleapi.ServerResponse `json:"-"`
1342
1343	// ForceSendFields is a list of field names (e.g. "Metrics") to
1344	// unconditionally include in API requests. By default, fields with
1345	// empty values are omitted from API requests. However, any non-pointer,
1346	// non-interface field appearing in ForceSendFields will be sent to the
1347	// server regardless of whether the field is empty or not. This may be
1348	// used to include empty fields in Patch requests.
1349	ForceSendFields []string `json:"-"`
1350
1351	// NullFields is a list of field names (e.g. "Metrics") to include in
1352	// API requests with the JSON null value. By default, fields with empty
1353	// values are omitted from API requests. However, any field with an
1354	// empty value appearing in NullFields will be sent to the server as
1355	// null. It is an error if a field in this list has a non-empty value.
1356	// This may be used to include null fields in Patch requests.
1357	NullFields []string `json:"-"`
1358}
1359
1360func (s *ListLogMetricsResponse) MarshalJSON() ([]byte, error) {
1361	type NoMethod ListLogMetricsResponse
1362	raw := NoMethod(*s)
1363	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1364}
1365
1366// ListLogsResponse: Result returned from ListLogs.
1367type ListLogsResponse struct {
1368	// LogNames: A list of log names. For example,
1369	// "projects/my-project/logs/syslog" or
1370	// "organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity
1371	// ".
1372	LogNames []string `json:"logNames,omitempty"`
1373
1374	// NextPageToken: If there might be more results than those appearing in
1375	// this response, then nextPageToken is included. To get the next set of
1376	// results, call this method again using the value of nextPageToken as
1377	// pageToken.
1378	NextPageToken string `json:"nextPageToken,omitempty"`
1379
1380	// ServerResponse contains the HTTP response code and headers from the
1381	// server.
1382	googleapi.ServerResponse `json:"-"`
1383
1384	// ForceSendFields is a list of field names (e.g. "LogNames") to
1385	// unconditionally include in API requests. By default, fields with
1386	// empty values are omitted from API requests. However, any non-pointer,
1387	// non-interface field appearing in ForceSendFields will be sent to the
1388	// server regardless of whether the field is empty or not. This may be
1389	// used to include empty fields in Patch requests.
1390	ForceSendFields []string `json:"-"`
1391
1392	// NullFields is a list of field names (e.g. "LogNames") to include in
1393	// API requests with the JSON null value. By default, fields with empty
1394	// values are omitted from API requests. However, any field with an
1395	// empty value appearing in NullFields will be sent to the server as
1396	// null. It is an error if a field in this list has a non-empty value.
1397	// This may be used to include null fields in Patch requests.
1398	NullFields []string `json:"-"`
1399}
1400
1401func (s *ListLogsResponse) MarshalJSON() ([]byte, error) {
1402	type NoMethod ListLogsResponse
1403	raw := NoMethod(*s)
1404	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1405}
1406
1407// ListMonitoredResourceDescriptorsResponse: Result returned from
1408// ListMonitoredResourceDescriptors.
1409type ListMonitoredResourceDescriptorsResponse struct {
1410	// NextPageToken: If there might be more results than those appearing in
1411	// this response, then nextPageToken is included. To get the next set of
1412	// results, call this method again using the value of nextPageToken as
1413	// pageToken.
1414	NextPageToken string `json:"nextPageToken,omitempty"`
1415
1416	// ResourceDescriptors: A list of resource descriptors.
1417	ResourceDescriptors []*MonitoredResourceDescriptor `json:"resourceDescriptors,omitempty"`
1418
1419	// ServerResponse contains the HTTP response code and headers from the
1420	// server.
1421	googleapi.ServerResponse `json:"-"`
1422
1423	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
1424	// unconditionally include in API requests. By default, fields with
1425	// empty values are omitted from API requests. However, any non-pointer,
1426	// non-interface field appearing in ForceSendFields will be sent to the
1427	// server regardless of whether the field is empty or not. This may be
1428	// used to include empty fields in Patch requests.
1429	ForceSendFields []string `json:"-"`
1430
1431	// NullFields is a list of field names (e.g. "NextPageToken") to include
1432	// in API requests with the JSON null value. By default, fields with
1433	// empty values are omitted from API requests. However, any field with
1434	// an empty value appearing in NullFields will be sent to the server as
1435	// null. It is an error if a field in this list has a non-empty value.
1436	// This may be used to include null fields in Patch requests.
1437	NullFields []string `json:"-"`
1438}
1439
1440func (s *ListMonitoredResourceDescriptorsResponse) MarshalJSON() ([]byte, error) {
1441	type NoMethod ListMonitoredResourceDescriptorsResponse
1442	raw := NoMethod(*s)
1443	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1444}
1445
1446// ListSinksResponse: Result returned from ListSinks.
1447type ListSinksResponse struct {
1448	// NextPageToken: If there might be more results than appear in this
1449	// response, then nextPageToken is included. To get the next set of
1450	// results, call the same method again using the value of nextPageToken
1451	// as pageToken.
1452	NextPageToken string `json:"nextPageToken,omitempty"`
1453
1454	// Sinks: A list of sinks.
1455	Sinks []*LogSink `json:"sinks,omitempty"`
1456
1457	// ServerResponse contains the HTTP response code and headers from the
1458	// server.
1459	googleapi.ServerResponse `json:"-"`
1460
1461	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
1462	// unconditionally include in API requests. By default, fields with
1463	// empty values are omitted from API requests. However, any non-pointer,
1464	// non-interface field appearing in ForceSendFields will be sent to the
1465	// server regardless of whether the field is empty or not. This may be
1466	// used to include empty fields in Patch requests.
1467	ForceSendFields []string `json:"-"`
1468
1469	// NullFields is a list of field names (e.g. "NextPageToken") to include
1470	// in API requests with the JSON null value. By default, fields with
1471	// empty values are omitted from API requests. However, any field with
1472	// an empty value appearing in NullFields will be sent to the server as
1473	// null. It is an error if a field in this list has a non-empty value.
1474	// This may be used to include null fields in Patch requests.
1475	NullFields []string `json:"-"`
1476}
1477
1478func (s *ListSinksResponse) MarshalJSON() ([]byte, error) {
1479	type NoMethod ListSinksResponse
1480	raw := NoMethod(*s)
1481	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1482}
1483
1484// ListViewsResponse: The response from ListViews.
1485type ListViewsResponse struct {
1486	// NextPageToken: If there might be more results than appear in this
1487	// response, then nextPageToken is included. To get the next set of
1488	// results, call the same method again using the value of nextPageToken
1489	// as pageToken.
1490	NextPageToken string `json:"nextPageToken,omitempty"`
1491
1492	// Views: A list of views.
1493	Views []*LogView `json:"views,omitempty"`
1494
1495	// ServerResponse contains the HTTP response code and headers from the
1496	// server.
1497	googleapi.ServerResponse `json:"-"`
1498
1499	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
1500	// unconditionally include in API requests. By default, fields with
1501	// empty values are omitted from API requests. However, any non-pointer,
1502	// non-interface field appearing in ForceSendFields will be sent to the
1503	// server regardless of whether the field is empty or not. This may be
1504	// used to include empty fields in Patch requests.
1505	ForceSendFields []string `json:"-"`
1506
1507	// NullFields is a list of field names (e.g. "NextPageToken") to include
1508	// in API requests with the JSON null value. By default, fields with
1509	// empty values are omitted from API requests. However, any field with
1510	// an empty value appearing in NullFields will be sent to the server as
1511	// null. It is an error if a field in this list has a non-empty value.
1512	// This may be used to include null fields in Patch requests.
1513	NullFields []string `json:"-"`
1514}
1515
1516func (s *ListViewsResponse) MarshalJSON() ([]byte, error) {
1517	type NoMethod ListViewsResponse
1518	raw := NoMethod(*s)
1519	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1520}
1521
1522// Location: A resource that represents Google Cloud Platform location.
1523type Location struct {
1524	// DisplayName: The friendly name for this location, typically a nearby
1525	// city name. For example, "Tokyo".
1526	DisplayName string `json:"displayName,omitempty"`
1527
1528	// Labels: Cross-service attributes for the location. For example
1529	// {"cloud.googleapis.com/region": "us-east1"}
1530	Labels map[string]string `json:"labels,omitempty"`
1531
1532	// LocationId: The canonical id for this location. For example:
1533	// "us-east1".
1534	LocationId string `json:"locationId,omitempty"`
1535
1536	// Metadata: Service-specific metadata. For example the available
1537	// capacity at the given location.
1538	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1539
1540	// Name: Resource name for the location, which may vary between
1541	// implementations. For example:
1542	// "projects/example-project/locations/us-east1"
1543	Name string `json:"name,omitempty"`
1544
1545	// ServerResponse contains the HTTP response code and headers from the
1546	// server.
1547	googleapi.ServerResponse `json:"-"`
1548
1549	// ForceSendFields is a list of field names (e.g. "DisplayName") to
1550	// unconditionally include in API requests. By default, fields with
1551	// empty values are omitted from API requests. However, any non-pointer,
1552	// non-interface field appearing in ForceSendFields will be sent to the
1553	// server regardless of whether the field is empty or not. This may be
1554	// used to include empty fields in Patch requests.
1555	ForceSendFields []string `json:"-"`
1556
1557	// NullFields is a list of field names (e.g. "DisplayName") to include
1558	// in API requests with the JSON null value. By default, fields with
1559	// empty values are omitted from API requests. However, any field with
1560	// an empty value appearing in NullFields will be sent to the server as
1561	// null. It is an error if a field in this list has a non-empty value.
1562	// This may be used to include null fields in Patch requests.
1563	NullFields []string `json:"-"`
1564}
1565
1566func (s *Location) MarshalJSON() ([]byte, error) {
1567	type NoMethod Location
1568	raw := NoMethod(*s)
1569	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1570}
1571
1572// LogBucket: Describes a repository of logs.
1573type LogBucket struct {
1574	// CreateTime: Output only. The creation timestamp of the bucket. This
1575	// is not set for any of the default buckets.
1576	CreateTime string `json:"createTime,omitempty"`
1577
1578	// Description: Describes this bucket.
1579	Description string `json:"description,omitempty"`
1580
1581	// LifecycleState: Output only. The bucket lifecycle state.
1582	//
1583	// Possible values:
1584	//   "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. This is only
1585	// used/useful for distinguishing unset values.
1586	//   "ACTIVE" - The normal and active state.
1587	//   "DELETE_REQUESTED" - The bucket has been marked for deletion by the
1588	// user.
1589	LifecycleState string `json:"lifecycleState,omitempty"`
1590
1591	// Locked: Whether the bucket has been locked. The retention period on a
1592	// locked bucket may not be changed. Locked buckets may only be deleted
1593	// if they are empty.
1594	Locked bool `json:"locked,omitempty"`
1595
1596	// Name: Output only. The resource name of the bucket. For example:
1597	// "projects/my-project-id/locations/my-location/buckets/my-bucket-id
1598	// The supported locations are: "global"For the location of global it is
1599	// unspecified where logs are actually stored. Once a bucket has been
1600	// created, the location can not be changed.
1601	Name string `json:"name,omitempty"`
1602
1603	// RetentionDays: Logs will be retained by default for this amount of
1604	// time, after which they will automatically be deleted. The minimum
1605	// retention period is 1 day. If this value is set to zero at bucket
1606	// creation time, the default time of 30 days will be used.
1607	RetentionDays int64 `json:"retentionDays,omitempty"`
1608
1609	// UpdateTime: Output only. The last update timestamp of the bucket.
1610	UpdateTime string `json:"updateTime,omitempty"`
1611
1612	// ServerResponse contains the HTTP response code and headers from the
1613	// server.
1614	googleapi.ServerResponse `json:"-"`
1615
1616	// ForceSendFields is a list of field names (e.g. "CreateTime") to
1617	// unconditionally include in API requests. By default, fields with
1618	// empty values are omitted from API requests. However, any non-pointer,
1619	// non-interface field appearing in ForceSendFields will be sent to the
1620	// server regardless of whether the field is empty or not. This may be
1621	// used to include empty fields in Patch requests.
1622	ForceSendFields []string `json:"-"`
1623
1624	// NullFields is a list of field names (e.g. "CreateTime") to include in
1625	// API requests with the JSON null value. By default, fields with empty
1626	// values are omitted from API requests. However, any field with an
1627	// empty value appearing in NullFields will be sent to the server as
1628	// null. It is an error if a field in this list has a non-empty value.
1629	// This may be used to include null fields in Patch requests.
1630	NullFields []string `json:"-"`
1631}
1632
1633func (s *LogBucket) MarshalJSON() ([]byte, error) {
1634	type NoMethod LogBucket
1635	raw := NoMethod(*s)
1636	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1637}
1638
1639// LogEntry: An individual entry in a log.
1640type LogEntry struct {
1641	// HttpRequest: Optional. Information about the HTTP request associated
1642	// with this log entry, if applicable.
1643	HttpRequest *HttpRequest `json:"httpRequest,omitempty"`
1644
1645	// InsertId: Optional. A unique identifier for the log entry. If you
1646	// provide a value, then Logging considers other log entries in the same
1647	// project, with the same timestamp, and with the same insert_id to be
1648	// duplicates which are removed in a single query result. However, there
1649	// are no guarantees of de-duplication in the export of logs.If the
1650	// insert_id is omitted when writing a log entry, the Logging API
1651	// assigns its own unique identifier in this field.In queries, the
1652	// insert_id is also used to order log entries that have the same
1653	// log_name and timestamp values.
1654	InsertId string `json:"insertId,omitempty"`
1655
1656	// JsonPayload: The log entry payload, represented as a structure that
1657	// is expressed as a JSON object.
1658	JsonPayload googleapi.RawMessage `json:"jsonPayload,omitempty"`
1659
1660	// Labels: Optional. A set of user-defined (key, value) data that
1661	// provides additional information about the log entry.
1662	Labels map[string]string `json:"labels,omitempty"`
1663
1664	// LogName: Required. The resource name of the log to which this log
1665	// entry belongs: "projects/[PROJECT_ID]/logs/[LOG_ID]"
1666	// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
1667	// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
1668	// "folders/[FOLDER_ID]/logs/[LOG_ID]" A project number may be used in
1669	// place of PROJECT_ID. The project number is translated to its
1670	// corresponding PROJECT_ID internally and the log_name field will
1671	// contain PROJECT_ID in queries and exports.[LOG_ID] must be
1672	// URL-encoded within log_name. Example:
1673	// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Fa
1674	// ctivity". [LOG_ID] must be less than 512 characters long and can only
1675	// include the following characters: upper and lower case alphanumeric
1676	// characters, forward-slash, underscore, hyphen, and period.For
1677	// backward compatibility, if log_name begins with a forward-slash, such
1678	// as /projects/..., then the log entry is ingested as usual but the
1679	// forward-slash is removed. Listing the log entry will not show the
1680	// leading slash and filtering for a log name with a leading slash will
1681	// never return any results.
1682	LogName string `json:"logName,omitempty"`
1683
1684	// Metadata: Output only. Deprecated. Additional metadata about the
1685	// monitored resource.Only k8s_container, k8s_pod, and k8s_node
1686	// MonitoredResources have this field populated for GKE versions older
1687	// than 1.12.6. For GKE versions 1.12.6 and above, the metadata field
1688	// has been deprecated. The Kubernetes pod labels that used to be in
1689	// metadata.userLabels will now be present in the labels field with a
1690	// key prefix of k8s-pod/. The system labels that were present in the
1691	// metadata.systemLabels field will no longer be available in the
1692	// LogEntry.
1693	Metadata *MonitoredResourceMetadata `json:"metadata,omitempty"`
1694
1695	// Operation: Optional. Information about an operation associated with
1696	// the log entry, if applicable.
1697	Operation *LogEntryOperation `json:"operation,omitempty"`
1698
1699	// ProtoPayload: The log entry payload, represented as a protocol
1700	// buffer. Some Google Cloud Platform services use this field for their
1701	// log entry payloads.The following protocol buffer types are supported;
1702	// user-defined types are not
1703	// supported:"type.googleapis.com/google.cloud.audit.AuditLog"
1704	// "type.googleapis.com/google.appengine.logging.v1.RequestLog"
1705	ProtoPayload googleapi.RawMessage `json:"protoPayload,omitempty"`
1706
1707	// ReceiveTimestamp: Output only. The time the log entry was received by
1708	// Logging.
1709	ReceiveTimestamp string `json:"receiveTimestamp,omitempty"`
1710
1711	// Resource: Required. The monitored resource that produced this log
1712	// entry.Example: a log entry that reports a database error would be
1713	// associated with the monitored resource designating the particular
1714	// database that reported the error.
1715	Resource *MonitoredResource `json:"resource,omitempty"`
1716
1717	// Severity: Optional. The severity of the log entry. The default value
1718	// is LogSeverity.DEFAULT.
1719	//
1720	// Possible values:
1721	//   "DEFAULT" - (0) The log entry has no assigned severity level.
1722	//   "DEBUG" - (100) Debug or trace information.
1723	//   "INFO" - (200) Routine information, such as ongoing status or
1724	// performance.
1725	//   "NOTICE" - (300) Normal but significant events, such as start up,
1726	// shut down, or a configuration change.
1727	//   "WARNING" - (400) Warning events might cause problems.
1728	//   "ERROR" - (500) Error events are likely to cause problems.
1729	//   "CRITICAL" - (600) Critical events cause more severe problems or
1730	// outages.
1731	//   "ALERT" - (700) A person must take an action immediately.
1732	//   "EMERGENCY" - (800) One or more systems are unusable.
1733	Severity string `json:"severity,omitempty"`
1734
1735	// SourceLocation: Optional. Source code location information associated
1736	// with the log entry, if any.
1737	SourceLocation *LogEntrySourceLocation `json:"sourceLocation,omitempty"`
1738
1739	// SpanId: Optional. The span ID within the trace associated with the
1740	// log entry.For Trace spans, this is the same format that the Trace API
1741	// v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such
1742	// as 000000000000004a.
1743	SpanId string `json:"spanId,omitempty"`
1744
1745	// TextPayload: The log entry payload, represented as a Unicode string
1746	// (UTF-8).
1747	TextPayload string `json:"textPayload,omitempty"`
1748
1749	// Timestamp: Optional. The time the event described by the log entry
1750	// occurred. This time is used to compute the log entry's age and to
1751	// enforce the logs retention period. If this field is omitted in a new
1752	// log entry, then Logging assigns it the current time. Timestamps have
1753	// nanosecond accuracy, but trailing zeros in the fractional seconds
1754	// might be omitted when the timestamp is displayed.Incoming log entries
1755	// must have timestamps that don't exceed the logs retention period
1756	// (https://cloud.google.com/logging/quotas#logs_retention_periods) in
1757	// the past, and that don't exceed 24 hours in the future. Log entries
1758	// outside those time boundaries aren't ingested by Logging.
1759	Timestamp string `json:"timestamp,omitempty"`
1760
1761	// Trace: Optional. Resource name of the trace associated with the log
1762	// entry, if any. If it contains a relative resource name, the name is
1763	// assumed to be relative to //tracing.googleapis.com. Example:
1764	// projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824
1765	Trace string `json:"trace,omitempty"`
1766
1767	// TraceSampled: Optional. The sampling decision of the trace associated
1768	// with the log entry.True means that the trace resource name in the
1769	// trace field was sampled for storage in a trace backend. False means
1770	// that the trace was not sampled for storage when this log entry was
1771	// written, or the sampling decision was unknown at the time. A
1772	// non-sampled trace value is still useful as a request correlation
1773	// identifier. The default is False.
1774	TraceSampled bool `json:"traceSampled,omitempty"`
1775
1776	// ForceSendFields is a list of field names (e.g. "HttpRequest") to
1777	// unconditionally include in API requests. By default, fields with
1778	// empty values are omitted from API requests. However, any non-pointer,
1779	// non-interface field appearing in ForceSendFields will be sent to the
1780	// server regardless of whether the field is empty or not. This may be
1781	// used to include empty fields in Patch requests.
1782	ForceSendFields []string `json:"-"`
1783
1784	// NullFields is a list of field names (e.g. "HttpRequest") to include
1785	// in API requests with the JSON null value. By default, fields with
1786	// empty values are omitted from API requests. However, any field with
1787	// an empty value appearing in NullFields will be sent to the server as
1788	// null. It is an error if a field in this list has a non-empty value.
1789	// This may be used to include null fields in Patch requests.
1790	NullFields []string `json:"-"`
1791}
1792
1793func (s *LogEntry) MarshalJSON() ([]byte, error) {
1794	type NoMethod LogEntry
1795	raw := NoMethod(*s)
1796	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1797}
1798
1799// LogEntryOperation: Additional information about a potentially
1800// long-running operation with which a log entry is associated.
1801type LogEntryOperation struct {
1802	// First: Optional. Set this to True if this is the first log entry in
1803	// the operation.
1804	First bool `json:"first,omitempty"`
1805
1806	// Id: Optional. An arbitrary operation identifier. Log entries with the
1807	// same identifier are assumed to be part of the same operation.
1808	Id string `json:"id,omitempty"`
1809
1810	// Last: Optional. Set this to True if this is the last log entry in the
1811	// operation.
1812	Last bool `json:"last,omitempty"`
1813
1814	// Producer: Optional. An arbitrary producer identifier. The combination
1815	// of id and producer must be globally unique. Examples for producer:
1816	// "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication".
1817	Producer string `json:"producer,omitempty"`
1818
1819	// ForceSendFields is a list of field names (e.g. "First") to
1820	// unconditionally include in API requests. By default, fields with
1821	// empty values are omitted from API requests. However, any non-pointer,
1822	// non-interface field appearing in ForceSendFields will be sent to the
1823	// server regardless of whether the field is empty or not. This may be
1824	// used to include empty fields in Patch requests.
1825	ForceSendFields []string `json:"-"`
1826
1827	// NullFields is a list of field names (e.g. "First") to include in API
1828	// requests with the JSON null value. By default, fields with empty
1829	// values are omitted from API requests. However, any field with an
1830	// empty value appearing in NullFields will be sent to the server as
1831	// null. It is an error if a field in this list has a non-empty value.
1832	// This may be used to include null fields in Patch requests.
1833	NullFields []string `json:"-"`
1834}
1835
1836func (s *LogEntryOperation) MarshalJSON() ([]byte, error) {
1837	type NoMethod LogEntryOperation
1838	raw := NoMethod(*s)
1839	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1840}
1841
1842// LogEntrySourceLocation: Additional information about the source code
1843// location that produced the log entry.
1844type LogEntrySourceLocation struct {
1845	// File: Optional. Source file name. Depending on the runtime
1846	// environment, this might be a simple name or a fully-qualified name.
1847	File string `json:"file,omitempty"`
1848
1849	// Function: Optional. Human-readable name of the function or method
1850	// being invoked, with optional context such as the class or package
1851	// name. This information may be used in contexts such as the logs
1852	// viewer, where a file and line number are less meaningful. The format
1853	// can vary by language. For example: qual.if.ied.Class.method (Java),
1854	// dir/package.func (Go), function (Python).
1855	Function string `json:"function,omitempty"`
1856
1857	// Line: Optional. Line within the source file. 1-based; 0 indicates no
1858	// line number available.
1859	Line int64 `json:"line,omitempty,string"`
1860
1861	// ForceSendFields is a list of field names (e.g. "File") to
1862	// unconditionally include in API requests. By default, fields with
1863	// empty values are omitted from API requests. However, any non-pointer,
1864	// non-interface field appearing in ForceSendFields will be sent to the
1865	// server regardless of whether the field is empty or not. This may be
1866	// used to include empty fields in Patch requests.
1867	ForceSendFields []string `json:"-"`
1868
1869	// NullFields is a list of field names (e.g. "File") to include in API
1870	// requests with the JSON null value. By default, fields with empty
1871	// values are omitted from API requests. However, any field with an
1872	// empty value appearing in NullFields will be sent to the server as
1873	// null. It is an error if a field in this list has a non-empty value.
1874	// This may be used to include null fields in Patch requests.
1875	NullFields []string `json:"-"`
1876}
1877
1878func (s *LogEntrySourceLocation) MarshalJSON() ([]byte, error) {
1879	type NoMethod LogEntrySourceLocation
1880	raw := NoMethod(*s)
1881	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1882}
1883
1884// LogExclusion: Specifies a set of log entries that are not to be
1885// stored in Logging. If your GCP resource receives a large volume of
1886// logs, you can use exclusions to reduce your chargeable logs.
1887// Exclusions are processed after log sinks, so you can export log
1888// entries before they are excluded. Note that organization-level and
1889// folder-level exclusions don't apply to child resources, and that you
1890// can't exclude audit log entries.
1891type LogExclusion struct {
1892	// CreateTime: Output only. The creation timestamp of the exclusion.This
1893	// field may not be present for older exclusions.
1894	CreateTime string `json:"createTime,omitempty"`
1895
1896	// Description: Optional. A description of this exclusion.
1897	Description string `json:"description,omitempty"`
1898
1899	// Disabled: Optional. If set to True, then this exclusion is disabled
1900	// and it does not exclude any log entries. You can update an exclusion
1901	// to change the value of this field.
1902	Disabled bool `json:"disabled,omitempty"`
1903
1904	// Filter: Required. An advanced logs filter
1905	// (https://cloud.google.com/logging/docs/view/advanced-queries) that
1906	// matches the log entries to be excluded. By using the sample function
1907	// (https://cloud.google.com/logging/docs/view/advanced-queries#sample),
1908	// you can exclude less than 100% of the matching log entries. For
1909	// example, the following query matches 99% of low-severity log entries
1910	// from Google Cloud Storage buckets:"resource.type=gcs_bucket
1911	// severity<ERROR sample(insertId, 0.99)"
1912	Filter string `json:"filter,omitempty"`
1913
1914	// Name: Required. A client-assigned identifier, such as
1915	// "load-balancer-exclusion". Identifiers are limited to 100 characters
1916	// and can include only letters, digits, underscores, hyphens, and
1917	// periods. First character has to be alphanumeric.
1918	Name string `json:"name,omitempty"`
1919
1920	// UpdateTime: Output only. The last update timestamp of the
1921	// exclusion.This field may not be present for older exclusions.
1922	UpdateTime string `json:"updateTime,omitempty"`
1923
1924	// ServerResponse contains the HTTP response code and headers from the
1925	// server.
1926	googleapi.ServerResponse `json:"-"`
1927
1928	// ForceSendFields is a list of field names (e.g. "CreateTime") to
1929	// unconditionally include in API requests. By default, fields with
1930	// empty values are omitted from API requests. However, any non-pointer,
1931	// non-interface field appearing in ForceSendFields will be sent to the
1932	// server regardless of whether the field is empty or not. This may be
1933	// used to include empty fields in Patch requests.
1934	ForceSendFields []string `json:"-"`
1935
1936	// NullFields is a list of field names (e.g. "CreateTime") to include in
1937	// API requests with the JSON null value. By default, fields with empty
1938	// values are omitted from API requests. However, any field with an
1939	// empty value appearing in NullFields will be sent to the server as
1940	// null. It is an error if a field in this list has a non-empty value.
1941	// This may be used to include null fields in Patch requests.
1942	NullFields []string `json:"-"`
1943}
1944
1945func (s *LogExclusion) MarshalJSON() ([]byte, error) {
1946	type NoMethod LogExclusion
1947	raw := NoMethod(*s)
1948	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1949}
1950
1951// LogLine: Application log line emitted while processing a request.
1952type LogLine struct {
1953	// LogMessage: App-provided log message.
1954	LogMessage string `json:"logMessage,omitempty"`
1955
1956	// Severity: Severity of this log entry.
1957	//
1958	// Possible values:
1959	//   "DEFAULT" - (0) The log entry has no assigned severity level.
1960	//   "DEBUG" - (100) Debug or trace information.
1961	//   "INFO" - (200) Routine information, such as ongoing status or
1962	// performance.
1963	//   "NOTICE" - (300) Normal but significant events, such as start up,
1964	// shut down, or a configuration change.
1965	//   "WARNING" - (400) Warning events might cause problems.
1966	//   "ERROR" - (500) Error events are likely to cause problems.
1967	//   "CRITICAL" - (600) Critical events cause more severe problems or
1968	// outages.
1969	//   "ALERT" - (700) A person must take an action immediately.
1970	//   "EMERGENCY" - (800) One or more systems are unusable.
1971	Severity string `json:"severity,omitempty"`
1972
1973	// SourceLocation: Where in the source code this log message was
1974	// written.
1975	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
1976
1977	// Time: Approximate time when this log entry was made.
1978	Time string `json:"time,omitempty"`
1979
1980	// ForceSendFields is a list of field names (e.g. "LogMessage") to
1981	// unconditionally include in API requests. By default, fields with
1982	// empty values are omitted from API requests. However, any non-pointer,
1983	// non-interface field appearing in ForceSendFields will be sent to the
1984	// server regardless of whether the field is empty or not. This may be
1985	// used to include empty fields in Patch requests.
1986	ForceSendFields []string `json:"-"`
1987
1988	// NullFields is a list of field names (e.g. "LogMessage") to include in
1989	// API requests with the JSON null value. By default, fields with empty
1990	// values are omitted from API requests. However, any field with an
1991	// empty value appearing in NullFields will be sent to the server as
1992	// null. It is an error if a field in this list has a non-empty value.
1993	// This may be used to include null fields in Patch requests.
1994	NullFields []string `json:"-"`
1995}
1996
1997func (s *LogLine) MarshalJSON() ([]byte, error) {
1998	type NoMethod LogLine
1999	raw := NoMethod(*s)
2000	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2001}
2002
2003// LogMetric: Describes a logs-based metric. The value of the metric is
2004// the number of log entries that match a logs filter in a given time
2005// interval.Logs-based metrics can also be used to extract values from
2006// logs and create a distribution of the values. The distribution
2007// records the statistics of the extracted values along with an optional
2008// histogram of the values as specified by the bucket options.
2009type LogMetric struct {
2010	// BucketOptions: Optional. The bucket_options are required when the
2011	// logs-based metric is using a DISTRIBUTION value type and it describes
2012	// the bucket boundaries used to create a histogram of the extracted
2013	// values.
2014	BucketOptions *BucketOptions `json:"bucketOptions,omitempty"`
2015
2016	// CreateTime: Output only. The creation timestamp of the metric.This
2017	// field may not be present for older metrics.
2018	CreateTime string `json:"createTime,omitempty"`
2019
2020	// Description: Optional. A description of this metric, which is used in
2021	// documentation. The maximum length of the description is 8000
2022	// characters.
2023	Description string `json:"description,omitempty"`
2024
2025	// Filter: Required. An advanced logs filter
2026	// (https://cloud.google.com/logging/docs/view/advanced_filters) which
2027	// is used to match log entries. Example: "resource.type=gae_app AND
2028	// severity>=ERROR" The maximum length of the filter is 20000
2029	// characters.
2030	Filter string `json:"filter,omitempty"`
2031
2032	// LabelExtractors: Optional. A map from a label key string to an
2033	// extractor expression which is used to extract data from a log entry
2034	// field and assign as the label value. Each label key specified in the
2035	// LabelDescriptor must have an associated extractor expression in this
2036	// map. The syntax of the extractor expression is the same as for the
2037	// value_extractor field.The extracted value is converted to the type
2038	// defined in the label descriptor. If the either the extraction or the
2039	// type conversion fails, the label will have a default value. The
2040	// default value for a string label is an empty string, for an integer
2041	// label its 0, and for a boolean label its false.Note that there are
2042	// upper bounds on the maximum number of labels and the number of active
2043	// time series that are allowed in a project.
2044	LabelExtractors map[string]string `json:"labelExtractors,omitempty"`
2045
2046	// MetricDescriptor: Optional. The metric descriptor associated with the
2047	// logs-based metric. If unspecified, it uses a default metric
2048	// descriptor with a DELTA metric kind, INT64 value type, with no labels
2049	// and a unit of "1". Such a metric counts the number of log entries
2050	// matching the filter expression.The name, type, and description fields
2051	// in the metric_descriptor are output only, and is constructed using
2052	// the name and description field in the LogMetric.To create a
2053	// logs-based metric that records a distribution of log values, a DELTA
2054	// metric kind with a DISTRIBUTION value type must be used along with a
2055	// value_extractor expression in the LogMetric.Each label in the metric
2056	// descriptor must have a matching label name as the key and an
2057	// extractor expression as the value in the label_extractors map.The
2058	// metric_kind and value_type fields in the metric_descriptor cannot be
2059	// updated once initially configured. New labels can be added in the
2060	// metric_descriptor, but existing labels cannot be modified except for
2061	// their description.
2062	MetricDescriptor *MetricDescriptor `json:"metricDescriptor,omitempty"`
2063
2064	// Name: Required. The client-assigned metric identifier. Examples:
2065	// "error_count", "nginx/requests".Metric identifiers are limited to 100
2066	// characters and can include only the following characters: A-Z, a-z,
2067	// 0-9, and the special characters _-.,+!*',()%/. The forward-slash
2068	// character (/) denotes a hierarchy of name pieces, and it cannot be
2069	// the first character of the name.The metric identifier in this field
2070	// must not be URL-encoded
2071	// (https://en.wikipedia.org/wiki/Percent-encoding). However, when the
2072	// metric identifier appears as the [METRIC_ID] part of a metric_name
2073	// API parameter, then the metric identifier must be URL-encoded.
2074	// Example: "projects/my-project/metrics/nginx%2Frequests".
2075	Name string `json:"name,omitempty"`
2076
2077	// UpdateTime: Output only. The last update timestamp of the metric.This
2078	// field may not be present for older metrics.
2079	UpdateTime string `json:"updateTime,omitempty"`
2080
2081	// ValueExtractor: Optional. A value_extractor is required when using a
2082	// distribution logs-based metric to extract the values to record from a
2083	// log entry. Two functions are supported for value extraction:
2084	// EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1.
2085	// field: The name of the log entry field from which the value is to be
2086	// extracted. 2. regex: A regular expression using the Google RE2 syntax
2087	// (https://github.com/google/re2/wiki/Syntax) with a single capture
2088	// group to extract data from the specified log entry field. The value
2089	// of the field is converted to a string before applying the regex. It
2090	// is an error to specify a regex that does not include exactly one
2091	// capture group.The result of the extraction must be convertible to a
2092	// double type, as the distribution always records double values. If
2093	// either the extraction or the conversion to double fails, then those
2094	// values are not recorded in the distribution.Example:
2095	// REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")
2096	ValueExtractor string `json:"valueExtractor,omitempty"`
2097
2098	// Version: Deprecated. The API version that created or updated this
2099	// metric. The v2 format is used by default and cannot be changed.
2100	//
2101	// Possible values:
2102	//   "V2" - Logging API v2.
2103	//   "V1" - Logging API v1.
2104	Version string `json:"version,omitempty"`
2105
2106	// ServerResponse contains the HTTP response code and headers from the
2107	// server.
2108	googleapi.ServerResponse `json:"-"`
2109
2110	// ForceSendFields is a list of field names (e.g. "BucketOptions") to
2111	// unconditionally include in API requests. By default, fields with
2112	// empty values are omitted from API requests. However, any non-pointer,
2113	// non-interface field appearing in ForceSendFields will be sent to the
2114	// server regardless of whether the field is empty or not. This may be
2115	// used to include empty fields in Patch requests.
2116	ForceSendFields []string `json:"-"`
2117
2118	// NullFields is a list of field names (e.g. "BucketOptions") to include
2119	// in API requests with the JSON null value. By default, fields with
2120	// empty values are omitted from API requests. However, any field with
2121	// an empty value appearing in NullFields will be sent to the server as
2122	// null. It is an error if a field in this list has a non-empty value.
2123	// This may be used to include null fields in Patch requests.
2124	NullFields []string `json:"-"`
2125}
2126
2127func (s *LogMetric) MarshalJSON() ([]byte, error) {
2128	type NoMethod LogMetric
2129	raw := NoMethod(*s)
2130	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2131}
2132
2133// LogSink: Describes a sink used to export log entries to one of the
2134// following destinations in any project: a Cloud Storage bucket, a
2135// BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls
2136// which log entries are exported. The sink must be created within a
2137// project, organization, billing account, or folder.
2138type LogSink struct {
2139	// BigqueryOptions: Optional. Options that affect sinks exporting data
2140	// to BigQuery.
2141	BigqueryOptions *BigQueryOptions `json:"bigqueryOptions,omitempty"`
2142
2143	// CreateTime: Output only. The creation timestamp of the sink.This
2144	// field may not be present for older sinks.
2145	CreateTime string `json:"createTime,omitempty"`
2146
2147	// Description: Optional. A description of this sink. The maximum length
2148	// of the description is 8000 characters.
2149	Description string `json:"description,omitempty"`
2150
2151	// Destination: Required. The export destination:
2152	// "storage.googleapis.com/[GCS_BUCKET]"
2153	// "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
2154	// "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" The
2155	// sink's writer_identity, set when the sink is created, must have
2156	// permission to write to the destination or else the log entries are
2157	// not exported. For more information, see Exporting Logs with Sinks
2158	// (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
2159	Destination string `json:"destination,omitempty"`
2160
2161	// Disabled: Optional. If set to True, then this sink is disabled and it
2162	// does not export any log entries.
2163	Disabled bool `json:"disabled,omitempty"`
2164
2165	// Exclusions: Optional. Log entries that match any of the exclusion
2166	// filters will not be exported. If a log entry is matched by both
2167	// filter and one of exclusion_filters it will not be exported.
2168	Exclusions []*LogExclusion `json:"exclusions,omitempty"`
2169
2170	// Filter: Optional. An advanced logs filter
2171	// (https://cloud.google.com/logging/docs/view/advanced-queries). The
2172	// only exported log entries are those that are in the resource owning
2173	// the sink and that match the filter. For example:
2174	// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
2175	Filter string `json:"filter,omitempty"`
2176
2177	// IncludeChildren: Optional. This field applies only to sinks owned by
2178	// organizations and folders. If the field is false, the default, only
2179	// the logs owned by the sink's parent resource are available for
2180	// export. If the field is true, then logs from all the projects,
2181	// folders, and billing accounts contained in the sink's parent resource
2182	// are also available for export. Whether a particular log entry from
2183	// the children is exported depends on the sink's filter expression. For
2184	// example, if this field is true, then the filter
2185	// resource.type=gce_instance would export all Compute Engine VM
2186	// instance log entries from all projects in the sink's parent. To only
2187	// export entries from certain child projects, filter on the project
2188	// part of the log name: logName:("projects/test-project1/" OR
2189	// "projects/test-project2/") AND resource.type=gce_instance
2190	IncludeChildren bool `json:"includeChildren,omitempty"`
2191
2192	// Name: Required. The client-assigned sink identifier, unique within
2193	// the project. Example: "my-syslog-errors-to-pubsub". Sink identifiers
2194	// are limited to 100 characters and can include only the following
2195	// characters: upper and lower-case alphanumeric characters,
2196	// underscores, hyphens, and periods. First character has to be
2197	// alphanumeric.
2198	Name string `json:"name,omitempty"`
2199
2200	// OutputVersionFormat: Deprecated. This field is unused.
2201	//
2202	// Possible values:
2203	//   "VERSION_FORMAT_UNSPECIFIED" - An unspecified format version that
2204	// will default to V2.
2205	//   "V2" - LogEntry version 2 format.
2206	//   "V1" - LogEntry version 1 format.
2207	OutputVersionFormat string `json:"outputVersionFormat,omitempty"`
2208
2209	// UpdateTime: Output only. The last update timestamp of the sink.This
2210	// field may not be present for older sinks.
2211	UpdateTime string `json:"updateTime,omitempty"`
2212
2213	// WriterIdentity: Output only. An IAM identity—a service account or
2214	// group—under which Logging writes the exported log entries to the
2215	// sink's destination. This field is set by sinks.create and
2216	// sinks.update based on the value of unique_writer_identity in those
2217	// methods.Until you grant this identity write-access to the
2218	// destination, log entry exports from this sink will fail. For more
2219	// information, see Granting Access for a Resource
2220	// (https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#
2221	// granting_access_to_a_service_account_for_a_resource). Consult the
2222	// destination service's documentation to determine the appropriate IAM
2223	// roles to assign to the identity.
2224	WriterIdentity string `json:"writerIdentity,omitempty"`
2225
2226	// ServerResponse contains the HTTP response code and headers from the
2227	// server.
2228	googleapi.ServerResponse `json:"-"`
2229
2230	// ForceSendFields is a list of field names (e.g. "BigqueryOptions") to
2231	// unconditionally include in API requests. By default, fields with
2232	// empty values are omitted from API requests. However, any non-pointer,
2233	// non-interface field appearing in ForceSendFields will be sent to the
2234	// server regardless of whether the field is empty or not. This may be
2235	// used to include empty fields in Patch requests.
2236	ForceSendFields []string `json:"-"`
2237
2238	// NullFields is a list of field names (e.g. "BigqueryOptions") to
2239	// include in API requests with the JSON null value. By default, fields
2240	// with empty values are omitted from API requests. However, any field
2241	// with an empty value appearing in NullFields will be sent to the
2242	// server as null. It is an error if a field in this list has a
2243	// non-empty value. This may be used to include null fields in Patch
2244	// requests.
2245	NullFields []string `json:"-"`
2246}
2247
2248func (s *LogSink) MarshalJSON() ([]byte, error) {
2249	type NoMethod LogSink
2250	raw := NoMethod(*s)
2251	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2252}
2253
2254// LogView: Describes a view over logs in a bucket.
2255type LogView struct {
2256	// CreateTime: Output only. The creation timestamp of the view.
2257	CreateTime string `json:"createTime,omitempty"`
2258
2259	// Description: Describes this view.
2260	Description string `json:"description,omitempty"`
2261
2262	// Filter: Filter that restricts which log entries in a bucket are
2263	// visible in this view. Filters are restricted to be a logical AND of
2264	// ==/!= of any of the following: originating
2265	// project/folder/organization/billing account. resource type log id
2266	// Example: SOURCE("projects/myproject") AND resource.type =
2267	// "gce_instance" AND LOG_ID("stdout")
2268	Filter string `json:"filter,omitempty"`
2269
2270	// Name: The resource name of the view. For example
2271	// "projects/my-project-id/locations/my-location/buckets/my-bucket-id/vie
2272	// ws/my-view
2273	Name string `json:"name,omitempty"`
2274
2275	// UpdateTime: Output only. The last update timestamp of the view.
2276	UpdateTime string `json:"updateTime,omitempty"`
2277
2278	// ServerResponse contains the HTTP response code and headers from the
2279	// server.
2280	googleapi.ServerResponse `json:"-"`
2281
2282	// ForceSendFields is a list of field names (e.g. "CreateTime") to
2283	// unconditionally include in API requests. By default, fields with
2284	// empty values are omitted from API requests. However, any non-pointer,
2285	// non-interface field appearing in ForceSendFields will be sent to the
2286	// server regardless of whether the field is empty or not. This may be
2287	// used to include empty fields in Patch requests.
2288	ForceSendFields []string `json:"-"`
2289
2290	// NullFields is a list of field names (e.g. "CreateTime") to include in
2291	// API requests with the JSON null value. By default, fields with empty
2292	// values are omitted from API requests. However, any field with an
2293	// empty value appearing in NullFields will be sent to the server as
2294	// null. It is an error if a field in this list has a non-empty value.
2295	// This may be used to include null fields in Patch requests.
2296	NullFields []string `json:"-"`
2297}
2298
2299func (s *LogView) MarshalJSON() ([]byte, error) {
2300	type NoMethod LogView
2301	raw := NoMethod(*s)
2302	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2303}
2304
2305// MetricDescriptor: Defines a metric type and its schema. Once a metric
2306// descriptor is created, deleting or altering it stops data collection
2307// and makes the metric type's existing data unusable.
2308type MetricDescriptor struct {
2309	// Description: A detailed description of the metric, which can be used
2310	// in documentation.
2311	Description string `json:"description,omitempty"`
2312
2313	// DisplayName: A concise name for the metric, which can be displayed in
2314	// user interfaces. Use sentence case without an ending period, for
2315	// example "Request count". This field is optional but it is recommended
2316	// to be set for any metrics associated with user-visible concepts, such
2317	// as Quota.
2318	DisplayName string `json:"displayName,omitempty"`
2319
2320	// Labels: The set of labels that can be used to describe a specific
2321	// instance of this metric type. For example, the
2322	// appengine.googleapis.com/http/server/response_latencies metric type
2323	// has a label for the HTTP response code, response_code, so you can
2324	// look at latencies for successful responses or just for responses that
2325	// failed.
2326	Labels []*LabelDescriptor `json:"labels,omitempty"`
2327
2328	// LaunchStage: Optional. The launch stage of the metric definition.
2329	//
2330	// Possible values:
2331	//   "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
2332	//   "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
2333	// use it.
2334	//   "PRELAUNCH" - Prelaunch features are hidden from users and are only
2335	// visible internally.
2336	//   "EARLY_ACCESS" - Early Access features are limited to a closed
2337	// group of testers. To use these features, you must sign up in advance
2338	// and sign a Trusted Tester agreement (which includes confidentiality
2339	// provisions). These features may be unstable, changed in
2340	// backward-incompatible ways, and are not guaranteed to be released.
2341	//   "ALPHA" - Alpha is a limited availability test for releases before
2342	// they are cleared for widespread use. By Alpha, all significant design
2343	// issues are resolved and we are in the process of verifying
2344	// functionality. Alpha customers need to apply for access, agree to
2345	// applicable terms, and have their projects allowlisted. Alpha releases
2346	// don’t have to be feature complete, no SLAs are provided, and there
2347	// are no technical support obligations, but they will be far enough
2348	// along that customers can actually use them in test environments or
2349	// for limited-use tests -- just like they would in normal production
2350	// cases.
2351	//   "BETA" - Beta is the point at which we are ready to open a release
2352	// for any customer to use. There are no SLA or technical support
2353	// obligations in a Beta release. Products will be complete from a
2354	// feature perspective, but may have some open outstanding issues. Beta
2355	// releases are suitable for limited production use cases.
2356	//   "GA" - GA features are open to all developers and are considered
2357	// stable and fully qualified for production use.
2358	//   "DEPRECATED" - Deprecated features are scheduled to be shut down
2359	// and removed. For more information, see the “Deprecation Policy”
2360	// section of our Terms of Service (https://cloud.google.com/terms/) and
2361	// the Google Cloud Platform Subject to the Deprecation Policy
2362	// (https://cloud.google.com/terms/deprecation) documentation.
2363	LaunchStage string `json:"launchStage,omitempty"`
2364
2365	// Metadata: Optional. Metadata which can be used to guide usage of the
2366	// metric.
2367	Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"`
2368
2369	// MetricKind: Whether the metric records instantaneous values, changes
2370	// to a value, etc. Some combinations of metric_kind and value_type
2371	// might not be supported.
2372	//
2373	// Possible values:
2374	//   "METRIC_KIND_UNSPECIFIED" - Do not use this default value.
2375	//   "GAUGE" - An instantaneous measurement of a value.
2376	//   "DELTA" - The change in a value during a time interval.
2377	//   "CUMULATIVE" - A value accumulated over a time interval. Cumulative
2378	// measurements in a time series should have the same start time and
2379	// increasing end times, until an event resets the cumulative value to
2380	// zero and sets a new start time for the following points.
2381	MetricKind string `json:"metricKind,omitempty"`
2382
2383	// MonitoredResourceTypes: Read-only. If present, then a time series,
2384	// which is identified partially by a metric type and a
2385	// MonitoredResourceDescriptor, that is associated with this metric type
2386	// can only be associated with one of the monitored resource types
2387	// listed here.
2388	MonitoredResourceTypes []string `json:"monitoredResourceTypes,omitempty"`
2389
2390	// Name: The resource name of the metric descriptor.
2391	Name string `json:"name,omitempty"`
2392
2393	// Type: The metric type, including its DNS name prefix. The type is not
2394	// URL-encoded. All user-defined metric types have the DNS name
2395	// custom.googleapis.com or external.googleapis.com. Metric types should
2396	// use a natural hierarchical grouping. For example:
2397	// "custom.googleapis.com/invoice/paid/amount"
2398	// "external.googleapis.com/prometheus/up"
2399	// "appengine.googleapis.com/http/server/response_latencies"
2400	Type string `json:"type,omitempty"`
2401
2402	// Unit: The units in which the metric value is reported. It is only
2403	// applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The
2404	// unit defines the representation of the stored metric values.Different
2405	// systems may scale the values to be more easily displayed (so a value
2406	// of 0.02KBy might be displayed as 20By, and a value of 3523KBy might
2407	// be displayed as 3.5MBy). However, if the unit is KBy, then the value
2408	// of the metric is always in thousands of bytes, no matter how it may
2409	// be displayed..If you want a custom metric to record the exact number
2410	// of CPU-seconds used by a job, you can create an INT64 CUMULATIVE
2411	// metric whose unit is s{CPU} (or equivalently 1s{CPU} or just s). If
2412	// the job uses 12,005 CPU-seconds, then the value is written as
2413	// 12005.Alternatively, if you want a custom metric to record data in a
2414	// more granular way, you can create a DOUBLE CUMULATIVE metric whose
2415	// unit is ks{CPU}, and then write the value 12.005 (which is
2416	// 12005/1000), or use Kis{CPU} and write 11.723 (which is
2417	// 12005/1024).The supported units are a subset of The Unified Code for
2418	// Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic
2419	// units (UNIT) bit bit By byte s second min minute h hour d day 1
2420	// dimensionlessPrefixes (PREFIX) k kilo (10^3) M mega (10^6) G giga
2421	// (10^9) T tera (10^12) P peta (10^15) E exa (10^18) Z zetta (10^21) Y
2422	// yotta (10^24) m milli (10^-3) u micro (10^-6) n nano (10^-9) p pico
2423	// (10^-12) f femto (10^-15) a atto (10^-18) z zepto (10^-21) y yocto
2424	// (10^-24) Ki kibi (2^10) Mi mebi (2^20) Gi gibi (2^30) Ti tebi (2^40)
2425	// Pi pebi (2^50)GrammarThe grammar also includes these connectors: /
2426	// division or ratio (as an infix operator). For examples, kBy/{email}
2427	// or MiBy/10ms (although you should almost never have /s in a metric
2428	// unit; rates should always be computed at query time from the
2429	// underlying cumulative or delta value). . multiplication or
2430	// composition (as an infix operator). For examples, GBy.d or
2431	// k{watt}.h.The grammar for a unit is as follows: Expression =
2432	// Component { "." Component } { "/" Component } ; Component = ( [
2433	// PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation | "1" ; Annotation
2434	// = "{" NAME "}" ; Notes: Annotation is just a comment if it follows a
2435	// UNIT. If the annotation is used alone, then the unit is equivalent to
2436	// 1. For examples, {request}/s == 1/s, By{transmitted}/s == By/s. NAME
2437	// is a sequence of non-blank printable ASCII characters not containing
2438	// { or }. 1 represents a unitary dimensionless unit
2439	// (https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such as
2440	// in 1/s. It is typically used when none of the basic units are
2441	// appropriate. For example, "new users per day" can be represented as
2442	// 1/d or {new-users}/d (and a metric value 5 would mean "5 new users).
2443	// Alternatively, "thousands of page views per day" would be represented
2444	// as 1000/d or k1/d or k{page_views}/d (and a metric value of 5.3 would
2445	// mean "5300 page views per day"). % represents dimensionless value of
2446	// 1/100, and annotates values giving a percentage (so the metric values
2447	// are typically in the range of 0..100, and a metric value 3 means "3
2448	// percent"). 10^2.% indicates a metric contains a ratio, typically in
2449	// the range 0..1, that will be multiplied by 100 and displayed as a
2450	// percentage (so a metric value 0.03 means "3 percent").
2451	Unit string `json:"unit,omitempty"`
2452
2453	// ValueType: Whether the measurement is an integer, a floating-point
2454	// number, etc. Some combinations of metric_kind and value_type might
2455	// not be supported.
2456	//
2457	// Possible values:
2458	//   "VALUE_TYPE_UNSPECIFIED" - Do not use this default value.
2459	//   "BOOL" - The value is a boolean. This value type can be used only
2460	// if the metric kind is GAUGE.
2461	//   "INT64" - The value is a signed 64-bit integer.
2462	//   "DOUBLE" - The value is a double precision floating point number.
2463	//   "STRING" - The value is a text string. This value type can be used
2464	// only if the metric kind is GAUGE.
2465	//   "DISTRIBUTION" - The value is a Distribution.
2466	//   "MONEY" - The value is money.
2467	ValueType string `json:"valueType,omitempty"`
2468
2469	// ForceSendFields is a list of field names (e.g. "Description") to
2470	// unconditionally include in API requests. By default, fields with
2471	// empty values are omitted from API requests. However, any non-pointer,
2472	// non-interface field appearing in ForceSendFields will be sent to the
2473	// server regardless of whether the field is empty or not. This may be
2474	// used to include empty fields in Patch requests.
2475	ForceSendFields []string `json:"-"`
2476
2477	// NullFields is a list of field names (e.g. "Description") to include
2478	// in API requests with the JSON null value. By default, fields with
2479	// empty values are omitted from API requests. However, any field with
2480	// an empty value appearing in NullFields will be sent to the server as
2481	// null. It is an error if a field in this list has a non-empty value.
2482	// This may be used to include null fields in Patch requests.
2483	NullFields []string `json:"-"`
2484}
2485
2486func (s *MetricDescriptor) MarshalJSON() ([]byte, error) {
2487	type NoMethod MetricDescriptor
2488	raw := NoMethod(*s)
2489	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2490}
2491
2492// MetricDescriptorMetadata: Additional annotations that can be used to
2493// guide the usage of a metric.
2494type MetricDescriptorMetadata struct {
2495	// IngestDelay: The delay of data points caused by ingestion. Data
2496	// points older than this age are guaranteed to be ingested and
2497	// available to be read, excluding data loss due to errors.
2498	IngestDelay string `json:"ingestDelay,omitempty"`
2499
2500	// LaunchStage: Deprecated. Must use the MetricDescriptor.launch_stage
2501	// instead.
2502	//
2503	// Possible values:
2504	//   "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
2505	//   "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
2506	// use it.
2507	//   "PRELAUNCH" - Prelaunch features are hidden from users and are only
2508	// visible internally.
2509	//   "EARLY_ACCESS" - Early Access features are limited to a closed
2510	// group of testers. To use these features, you must sign up in advance
2511	// and sign a Trusted Tester agreement (which includes confidentiality
2512	// provisions). These features may be unstable, changed in
2513	// backward-incompatible ways, and are not guaranteed to be released.
2514	//   "ALPHA" - Alpha is a limited availability test for releases before
2515	// they are cleared for widespread use. By Alpha, all significant design
2516	// issues are resolved and we are in the process of verifying
2517	// functionality. Alpha customers need to apply for access, agree to
2518	// applicable terms, and have their projects allowlisted. Alpha releases
2519	// don’t have to be feature complete, no SLAs are provided, and there
2520	// are no technical support obligations, but they will be far enough
2521	// along that customers can actually use them in test environments or
2522	// for limited-use tests -- just like they would in normal production
2523	// cases.
2524	//   "BETA" - Beta is the point at which we are ready to open a release
2525	// for any customer to use. There are no SLA or technical support
2526	// obligations in a Beta release. Products will be complete from a
2527	// feature perspective, but may have some open outstanding issues. Beta
2528	// releases are suitable for limited production use cases.
2529	//   "GA" - GA features are open to all developers and are considered
2530	// stable and fully qualified for production use.
2531	//   "DEPRECATED" - Deprecated features are scheduled to be shut down
2532	// and removed. For more information, see the “Deprecation Policy”
2533	// section of our Terms of Service (https://cloud.google.com/terms/) and
2534	// the Google Cloud Platform Subject to the Deprecation Policy
2535	// (https://cloud.google.com/terms/deprecation) documentation.
2536	LaunchStage string `json:"launchStage,omitempty"`
2537
2538	// SamplePeriod: The sampling period of metric data points. For metrics
2539	// which are written periodically, consecutive data points are stored at
2540	// this time interval, excluding data loss due to errors. Metrics with a
2541	// higher granularity have a smaller sampling period.
2542	SamplePeriod string `json:"samplePeriod,omitempty"`
2543
2544	// ForceSendFields is a list of field names (e.g. "IngestDelay") to
2545	// unconditionally include in API requests. By default, fields with
2546	// empty values are omitted from API requests. However, any non-pointer,
2547	// non-interface field appearing in ForceSendFields will be sent to the
2548	// server regardless of whether the field is empty or not. This may be
2549	// used to include empty fields in Patch requests.
2550	ForceSendFields []string `json:"-"`
2551
2552	// NullFields is a list of field names (e.g. "IngestDelay") to include
2553	// in API requests with the JSON null value. By default, fields with
2554	// empty values are omitted from API requests. However, any field with
2555	// an empty value appearing in NullFields will be sent to the server as
2556	// null. It is an error if a field in this list has a non-empty value.
2557	// This may be used to include null fields in Patch requests.
2558	NullFields []string `json:"-"`
2559}
2560
2561func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) {
2562	type NoMethod MetricDescriptorMetadata
2563	raw := NoMethod(*s)
2564	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2565}
2566
2567// MonitoredResource: An object representing a resource that can be used
2568// for monitoring, logging, billing, or other purposes. Examples include
2569// virtual machine instances, databases, and storage devices such as
2570// disks. The type field identifies a MonitoredResourceDescriptor object
2571// that describes the resource's schema. Information in the labels field
2572// identifies the actual resource and its attributes according to the
2573// schema. For example, a particular Compute Engine VM instance could be
2574// represented by the following object, because the
2575// MonitoredResourceDescriptor for "gce_instance" has labels
2576// "instance_id" and "zone": { "type": "gce_instance", "labels": {
2577// "instance_id": "12345678901234", "zone": "us-central1-a" }}
2578type MonitoredResource struct {
2579	// Labels: Required. Values for all of the labels listed in the
2580	// associated monitored resource descriptor. For example, Compute Engine
2581	// VM instances use the labels "project_id", "instance_id", and "zone".
2582	Labels map[string]string `json:"labels,omitempty"`
2583
2584	// Type: Required. The monitored resource type. This field must match
2585	// the type field of a MonitoredResourceDescriptor object. For example,
2586	// the type of a Compute Engine VM instance is gce_instance.
2587	Type string `json:"type,omitempty"`
2588
2589	// ForceSendFields is a list of field names (e.g. "Labels") to
2590	// unconditionally include in API requests. By default, fields with
2591	// empty values are omitted from API requests. However, any non-pointer,
2592	// non-interface field appearing in ForceSendFields will be sent to the
2593	// server regardless of whether the field is empty or not. This may be
2594	// used to include empty fields in Patch requests.
2595	ForceSendFields []string `json:"-"`
2596
2597	// NullFields is a list of field names (e.g. "Labels") to include in API
2598	// requests with the JSON null value. By default, fields with empty
2599	// values are omitted from API requests. However, any field with an
2600	// empty value appearing in NullFields will be sent to the server as
2601	// null. It is an error if a field in this list has a non-empty value.
2602	// This may be used to include null fields in Patch requests.
2603	NullFields []string `json:"-"`
2604}
2605
2606func (s *MonitoredResource) MarshalJSON() ([]byte, error) {
2607	type NoMethod MonitoredResource
2608	raw := NoMethod(*s)
2609	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2610}
2611
2612// MonitoredResourceDescriptor: An object that describes the schema of a
2613// MonitoredResource object using a type name and a set of labels. For
2614// example, the monitored resource descriptor for Google Compute Engine
2615// VM instances has a type of "gce_instance" and specifies the use of
2616// the labels "instance_id" and "zone" to identify particular VM
2617// instances.Different APIs can support different monitored resource
2618// types. APIs generally provide a list method that returns the
2619// monitored resource descriptors used by the API.
2620type MonitoredResourceDescriptor struct {
2621	// Description: Optional. A detailed description of the monitored
2622	// resource type that might be used in documentation.
2623	Description string `json:"description,omitempty"`
2624
2625	// DisplayName: Optional. A concise name for the monitored resource type
2626	// that might be displayed in user interfaces. It should be a Title
2627	// Cased Noun Phrase, without any article or other determiners. For
2628	// example, "Google Cloud SQL Database".
2629	DisplayName string `json:"displayName,omitempty"`
2630
2631	// Labels: Required. A set of labels used to describe instances of this
2632	// monitored resource type. For example, an individual Google Cloud SQL
2633	// database is identified by values for the labels "database_id" and
2634	// "zone".
2635	Labels []*LabelDescriptor `json:"labels,omitempty"`
2636
2637	// LaunchStage: Optional. The launch stage of the monitored resource
2638	// definition.
2639	//
2640	// Possible values:
2641	//   "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
2642	//   "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
2643	// use it.
2644	//   "PRELAUNCH" - Prelaunch features are hidden from users and are only
2645	// visible internally.
2646	//   "EARLY_ACCESS" - Early Access features are limited to a closed
2647	// group of testers. To use these features, you must sign up in advance
2648	// and sign a Trusted Tester agreement (which includes confidentiality
2649	// provisions). These features may be unstable, changed in
2650	// backward-incompatible ways, and are not guaranteed to be released.
2651	//   "ALPHA" - Alpha is a limited availability test for releases before
2652	// they are cleared for widespread use. By Alpha, all significant design
2653	// issues are resolved and we are in the process of verifying
2654	// functionality. Alpha customers need to apply for access, agree to
2655	// applicable terms, and have their projects allowlisted. Alpha releases
2656	// don’t have to be feature complete, no SLAs are provided, and there
2657	// are no technical support obligations, but they will be far enough
2658	// along that customers can actually use them in test environments or
2659	// for limited-use tests -- just like they would in normal production
2660	// cases.
2661	//   "BETA" - Beta is the point at which we are ready to open a release
2662	// for any customer to use. There are no SLA or technical support
2663	// obligations in a Beta release. Products will be complete from a
2664	// feature perspective, but may have some open outstanding issues. Beta
2665	// releases are suitable for limited production use cases.
2666	//   "GA" - GA features are open to all developers and are considered
2667	// stable and fully qualified for production use.
2668	//   "DEPRECATED" - Deprecated features are scheduled to be shut down
2669	// and removed. For more information, see the “Deprecation Policy”
2670	// section of our Terms of Service (https://cloud.google.com/terms/) and
2671	// the Google Cloud Platform Subject to the Deprecation Policy
2672	// (https://cloud.google.com/terms/deprecation) documentation.
2673	LaunchStage string `json:"launchStage,omitempty"`
2674
2675	// Name: Optional. The resource name of the monitored resource
2676	// descriptor:
2677	// "projects/{project_id}/monitoredResourceDescriptors/{type}" where
2678	// {type} is the value of the type field in this object and {project_id}
2679	// is a project ID that provides API-specific context for accessing the
2680	// type. APIs that do not use project information can use the resource
2681	// name format "monitoredResourceDescriptors/{type}".
2682	Name string `json:"name,omitempty"`
2683
2684	// Type: Required. The monitored resource type. For example, the type
2685	// "cloudsql_database" represents databases in Google Cloud SQL.
2686	Type string `json:"type,omitempty"`
2687
2688	// ForceSendFields is a list of field names (e.g. "Description") to
2689	// unconditionally include in API requests. By default, fields with
2690	// empty values are omitted from API requests. However, any non-pointer,
2691	// non-interface field appearing in ForceSendFields will be sent to the
2692	// server regardless of whether the field is empty or not. This may be
2693	// used to include empty fields in Patch requests.
2694	ForceSendFields []string `json:"-"`
2695
2696	// NullFields is a list of field names (e.g. "Description") to include
2697	// in API requests with the JSON null value. By default, fields with
2698	// empty values are omitted from API requests. However, any field with
2699	// an empty value appearing in NullFields will be sent to the server as
2700	// null. It is an error if a field in this list has a non-empty value.
2701	// This may be used to include null fields in Patch requests.
2702	NullFields []string `json:"-"`
2703}
2704
2705func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) {
2706	type NoMethod MonitoredResourceDescriptor
2707	raw := NoMethod(*s)
2708	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2709}
2710
2711// MonitoredResourceMetadata: Auxiliary metadata for a MonitoredResource
2712// object. MonitoredResource objects contain the minimum set of
2713// information to uniquely identify a monitored resource instance. There
2714// is some other useful auxiliary metadata. Monitoring and Logging use
2715// an ingestion pipeline to extract metadata for cloud resources of all
2716// types, and store the metadata in this message.
2717type MonitoredResourceMetadata struct {
2718	// SystemLabels: Output only. Values for predefined system metadata
2719	// labels. System labels are a kind of metadata extracted by Google,
2720	// including "machine_image", "vpc", "subnet_id", "security_group",
2721	// "name", etc. System label values can be only strings, Boolean values,
2722	// or a list of strings. For example: { "name": "my-test-instance",
2723	// "security_group": ["a", "b", "c"], "spot_instance": false }
2724	SystemLabels googleapi.RawMessage `json:"systemLabels,omitempty"`
2725
2726	// UserLabels: Output only. A map of user-defined metadata labels.
2727	UserLabels map[string]string `json:"userLabels,omitempty"`
2728
2729	// ForceSendFields is a list of field names (e.g. "SystemLabels") to
2730	// unconditionally include in API requests. By default, fields with
2731	// empty values are omitted from API requests. However, any non-pointer,
2732	// non-interface field appearing in ForceSendFields will be sent to the
2733	// server regardless of whether the field is empty or not. This may be
2734	// used to include empty fields in Patch requests.
2735	ForceSendFields []string `json:"-"`
2736
2737	// NullFields is a list of field names (e.g. "SystemLabels") to include
2738	// in API requests with the JSON null value. By default, fields with
2739	// empty values are omitted from API requests. However, any field with
2740	// an empty value appearing in NullFields will be sent to the server as
2741	// null. It is an error if a field in this list has a non-empty value.
2742	// This may be used to include null fields in Patch requests.
2743	NullFields []string `json:"-"`
2744}
2745
2746func (s *MonitoredResourceMetadata) MarshalJSON() ([]byte, error) {
2747	type NoMethod MonitoredResourceMetadata
2748	raw := NoMethod(*s)
2749	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2750}
2751
2752// RequestLog: Complete log information about a single HTTP request to
2753// an App Engine application.
2754type RequestLog struct {
2755	// AppEngineRelease: App Engine release version.
2756	AppEngineRelease string `json:"appEngineRelease,omitempty"`
2757
2758	// AppId: Application that handled this request.
2759	AppId string `json:"appId,omitempty"`
2760
2761	// Cost: An indication of the relative cost of serving this request.
2762	Cost float64 `json:"cost,omitempty"`
2763
2764	// EndTime: Time when the request finished.
2765	EndTime string `json:"endTime,omitempty"`
2766
2767	// Finished: Whether this request is finished or active.
2768	Finished bool `json:"finished,omitempty"`
2769
2770	// First: Whether this is the first RequestLog entry for this request.
2771	// If an active request has several RequestLog entries written to
2772	// Stackdriver Logging, then this field will be set for one of them.
2773	First bool `json:"first,omitempty"`
2774
2775	// Host: Internet host and port number of the resource being requested.
2776	Host string `json:"host,omitempty"`
2777
2778	// HttpVersion: HTTP version of request. Example: "HTTP/1.1".
2779	HttpVersion string `json:"httpVersion,omitempty"`
2780
2781	// InstanceId: An identifier for the instance that handled the request.
2782	InstanceId string `json:"instanceId,omitempty"`
2783
2784	// InstanceIndex: If the instance processing this request belongs to a
2785	// manually scaled module, then this is the 0-based index of the
2786	// instance. Otherwise, this value is -1.
2787	InstanceIndex int64 `json:"instanceIndex,omitempty"`
2788
2789	// Ip: Origin IP address.
2790	Ip string `json:"ip,omitempty"`
2791
2792	// Latency: Latency of the request.
2793	Latency string `json:"latency,omitempty"`
2794
2795	// Line: A list of log lines emitted by the application while serving
2796	// this request.
2797	Line []*LogLine `json:"line,omitempty"`
2798
2799	// MegaCycles: Number of CPU megacycles used to process request.
2800	MegaCycles int64 `json:"megaCycles,omitempty,string"`
2801
2802	// Method: Request method. Example: "GET", "HEAD", "PUT", "POST",
2803	// "DELETE".
2804	Method string `json:"method,omitempty"`
2805
2806	// ModuleId: Module of the application that handled this request.
2807	ModuleId string `json:"moduleId,omitempty"`
2808
2809	// Nickname: The logged-in user who made the request.Most likely, this
2810	// is the part of the user's email before the @ sign. The field value is
2811	// the same for different requests from the same user, but different
2812	// users can have similar names. This information is also available to
2813	// the application via the App Engine Users API.This field will be
2814	// populated starting with App Engine 1.9.21.
2815	Nickname string `json:"nickname,omitempty"`
2816
2817	// PendingTime: Time this request spent in the pending request queue.
2818	PendingTime string `json:"pendingTime,omitempty"`
2819
2820	// Referrer: Referrer URL of request.
2821	Referrer string `json:"referrer,omitempty"`
2822
2823	// RequestId: Globally unique identifier for a request, which is based
2824	// on the request start time. Request IDs for requests which started
2825	// later will compare greater as strings than those for requests which
2826	// started earlier.
2827	RequestId string `json:"requestId,omitempty"`
2828
2829	// Resource: Contains the path and query portion of the URL that was
2830	// requested. For example, if the URL was
2831	// "http://example.com/app?name=val", the resource would be
2832	// "/app?name=val". The fragment identifier, which is identified by the
2833	// # character, is not included.
2834	Resource string `json:"resource,omitempty"`
2835
2836	// ResponseSize: Size in bytes sent back to client by request.
2837	ResponseSize int64 `json:"responseSize,omitempty,string"`
2838
2839	// SourceReference: Source code for the application that handled this
2840	// request. There can be more than one source reference per deployed
2841	// application if source code is distributed among multiple
2842	// repositories.
2843	SourceReference []*SourceReference `json:"sourceReference,omitempty"`
2844
2845	// StartTime: Time when the request started.
2846	StartTime string `json:"startTime,omitempty"`
2847
2848	// Status: HTTP response status code. Example: 200, 404.
2849	Status int64 `json:"status,omitempty"`
2850
2851	// TaskName: Task name of the request, in the case of an offline
2852	// request.
2853	TaskName string `json:"taskName,omitempty"`
2854
2855	// TaskQueueName: Queue name of the request, in the case of an offline
2856	// request.
2857	TaskQueueName string `json:"taskQueueName,omitempty"`
2858
2859	// TraceId: Stackdriver Trace identifier for this request.
2860	TraceId string `json:"traceId,omitempty"`
2861
2862	// TraceSampled: If true, the value in the 'trace_id' field was sampled
2863	// for storage in a trace backend.
2864	TraceSampled bool `json:"traceSampled,omitempty"`
2865
2866	// UrlMapEntry: File or class that handled the request.
2867	UrlMapEntry string `json:"urlMapEntry,omitempty"`
2868
2869	// UserAgent: User agent that made the request.
2870	UserAgent string `json:"userAgent,omitempty"`
2871
2872	// VersionId: Version of the application that handled this request.
2873	VersionId string `json:"versionId,omitempty"`
2874
2875	// WasLoadingRequest: Whether this was a loading request for the
2876	// instance.
2877	WasLoadingRequest bool `json:"wasLoadingRequest,omitempty"`
2878
2879	// ForceSendFields is a list of field names (e.g. "AppEngineRelease") to
2880	// unconditionally include in API requests. By default, fields with
2881	// empty values are omitted from API requests. However, any non-pointer,
2882	// non-interface field appearing in ForceSendFields will be sent to the
2883	// server regardless of whether the field is empty or not. This may be
2884	// used to include empty fields in Patch requests.
2885	ForceSendFields []string `json:"-"`
2886
2887	// NullFields is a list of field names (e.g. "AppEngineRelease") to
2888	// include in API requests with the JSON null value. By default, fields
2889	// with empty values are omitted from API requests. However, any field
2890	// with an empty value appearing in NullFields will be sent to the
2891	// server as null. It is an error if a field in this list has a
2892	// non-empty value. This may be used to include null fields in Patch
2893	// requests.
2894	NullFields []string `json:"-"`
2895}
2896
2897func (s *RequestLog) MarshalJSON() ([]byte, error) {
2898	type NoMethod RequestLog
2899	raw := NoMethod(*s)
2900	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2901}
2902
2903func (s *RequestLog) UnmarshalJSON(data []byte) error {
2904	type NoMethod RequestLog
2905	var s1 struct {
2906		Cost gensupport.JSONFloat64 `json:"cost"`
2907		*NoMethod
2908	}
2909	s1.NoMethod = (*NoMethod)(s)
2910	if err := json.Unmarshal(data, &s1); err != nil {
2911		return err
2912	}
2913	s.Cost = float64(s1.Cost)
2914	return nil
2915}
2916
2917// SourceLocation: Specifies a location in a source code file.
2918type SourceLocation struct {
2919	// File: Source file name. Depending on the runtime environment, this
2920	// might be a simple name or a fully-qualified name.
2921	File string `json:"file,omitempty"`
2922
2923	// FunctionName: Human-readable name of the function or method being
2924	// invoked, with optional context such as the class or package name.
2925	// This information is used in contexts such as the logs viewer, where a
2926	// file and line number are less meaningful. The format can vary by
2927	// language. For example: qual.if.ied.Class.method (Java),
2928	// dir/package.func (Go), function (Python).
2929	FunctionName string `json:"functionName,omitempty"`
2930
2931	// Line: Line within the source file.
2932	Line int64 `json:"line,omitempty,string"`
2933
2934	// ForceSendFields is a list of field names (e.g. "File") to
2935	// unconditionally include in API requests. By default, fields with
2936	// empty values are omitted from API requests. However, any non-pointer,
2937	// non-interface field appearing in ForceSendFields will be sent to the
2938	// server regardless of whether the field is empty or not. This may be
2939	// used to include empty fields in Patch requests.
2940	ForceSendFields []string `json:"-"`
2941
2942	// NullFields is a list of field names (e.g. "File") to include in API
2943	// requests with the JSON null value. By default, fields with empty
2944	// values are omitted from API requests. However, any field with an
2945	// empty value appearing in NullFields will be sent to the server as
2946	// null. It is an error if a field in this list has a non-empty value.
2947	// This may be used to include null fields in Patch requests.
2948	NullFields []string `json:"-"`
2949}
2950
2951func (s *SourceLocation) MarshalJSON() ([]byte, error) {
2952	type NoMethod SourceLocation
2953	raw := NoMethod(*s)
2954	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2955}
2956
2957// SourceReference: A reference to a particular snapshot of the source
2958// tree used to build and deploy an application.
2959type SourceReference struct {
2960	// Repository: Optional. A URI string identifying the repository.
2961	// Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
2962	Repository string `json:"repository,omitempty"`
2963
2964	// RevisionId: The canonical and persistent identifier of the deployed
2965	// revision. Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
2966	RevisionId string `json:"revisionId,omitempty"`
2967
2968	// ForceSendFields is a list of field names (e.g. "Repository") to
2969	// unconditionally include in API requests. By default, fields with
2970	// empty values are omitted from API requests. However, any non-pointer,
2971	// non-interface field appearing in ForceSendFields will be sent to the
2972	// server regardless of whether the field is empty or not. This may be
2973	// used to include empty fields in Patch requests.
2974	ForceSendFields []string `json:"-"`
2975
2976	// NullFields is a list of field names (e.g. "Repository") to include in
2977	// API requests with the JSON null value. By default, fields with empty
2978	// values are omitted from API requests. However, any field with an
2979	// empty value appearing in NullFields will be sent to the server as
2980	// null. It is an error if a field in this list has a non-empty value.
2981	// This may be used to include null fields in Patch requests.
2982	NullFields []string `json:"-"`
2983}
2984
2985func (s *SourceReference) MarshalJSON() ([]byte, error) {
2986	type NoMethod SourceReference
2987	raw := NoMethod(*s)
2988	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2989}
2990
2991// SuppressionInfo: Information about entries that were omitted from the
2992// session.
2993type SuppressionInfo struct {
2994	// Reason: The reason that entries were omitted from the session.
2995	//
2996	// Possible values:
2997	//   "REASON_UNSPECIFIED" - Unexpected default.
2998	//   "RATE_LIMIT" - Indicates suppression occurred due to relevant
2999	// entries being received in excess of rate limits. For quotas and
3000	// limits, see Logging API quotas and limits
3001	// (https://cloud.google.com/logging/quotas#api-limits).
3002	//   "NOT_CONSUMED" - Indicates suppression occurred due to the client
3003	// not consuming responses quickly enough.
3004	Reason string `json:"reason,omitempty"`
3005
3006	// SuppressedCount: A lower bound on the count of entries omitted due to
3007	// reason.
3008	SuppressedCount int64 `json:"suppressedCount,omitempty"`
3009
3010	// ForceSendFields is a list of field names (e.g. "Reason") to
3011	// unconditionally include in API requests. By default, fields with
3012	// empty values are omitted from API requests. However, any non-pointer,
3013	// non-interface field appearing in ForceSendFields will be sent to the
3014	// server regardless of whether the field is empty or not. This may be
3015	// used to include empty fields in Patch requests.
3016	ForceSendFields []string `json:"-"`
3017
3018	// NullFields is a list of field names (e.g. "Reason") to include in API
3019	// requests with the JSON null value. By default, fields with empty
3020	// values are omitted from API requests. However, any field with an
3021	// empty value appearing in NullFields will be sent to the server as
3022	// null. It is an error if a field in this list has a non-empty value.
3023	// This may be used to include null fields in Patch requests.
3024	NullFields []string `json:"-"`
3025}
3026
3027func (s *SuppressionInfo) MarshalJSON() ([]byte, error) {
3028	type NoMethod SuppressionInfo
3029	raw := NoMethod(*s)
3030	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3031}
3032
3033// TailLogEntriesRequest: The parameters to TailLogEntries.
3034type TailLogEntriesRequest struct {
3035	// BufferWindow: Optional. The amount of time to buffer log entries at
3036	// the server before being returned to prevent out of order results due
3037	// to late arriving log entries. Valid values are between 0-60000
3038	// milliseconds. Defaults to 2000 milliseconds.
3039	BufferWindow string `json:"bufferWindow,omitempty"`
3040
3041	// Filter: Optional. A filter that chooses which log entries to return.
3042	// See Advanced Logs Filters
3043	// (https://cloud.google.com/logging/docs/view/advanced_filters). Only
3044	// log entries that match the filter are returned. An empty filter
3045	// matches all log entries in the resources listed in resource_names.
3046	// Referencing a parent resource that is not in resource_names will
3047	// cause the filter to return no results. The maximum length of the
3048	// filter is 20000 characters.
3049	Filter string `json:"filter,omitempty"`
3050
3051	// ResourceNames: Required. Name of a parent resource from which to
3052	// retrieve log entries: "projects/[PROJECT_ID]"
3053	// "organizations/[ORGANIZATION_ID]"
3054	// "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" May
3055	// alternatively be one or more views:
3056	// "projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIE
3057	// W_ID"
3058	// "organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/
3059	// views/VIEW_ID"
3060	// "billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCK
3061	// ET_ID/views/VIEW_ID"
3062	// "folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_
3063	// ID"
3064	ResourceNames []string `json:"resourceNames,omitempty"`
3065
3066	// ForceSendFields is a list of field names (e.g. "BufferWindow") to
3067	// unconditionally include in API requests. By default, fields with
3068	// empty values are omitted from API requests. However, any non-pointer,
3069	// non-interface field appearing in ForceSendFields will be sent to the
3070	// server regardless of whether the field is empty or not. This may be
3071	// used to include empty fields in Patch requests.
3072	ForceSendFields []string `json:"-"`
3073
3074	// NullFields is a list of field names (e.g. "BufferWindow") to include
3075	// in API requests with the JSON null value. By default, fields with
3076	// empty values are omitted from API requests. However, any field with
3077	// an empty value appearing in NullFields will be sent to the server as
3078	// null. It is an error if a field in this list has a non-empty value.
3079	// This may be used to include null fields in Patch requests.
3080	NullFields []string `json:"-"`
3081}
3082
3083func (s *TailLogEntriesRequest) MarshalJSON() ([]byte, error) {
3084	type NoMethod TailLogEntriesRequest
3085	raw := NoMethod(*s)
3086	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3087}
3088
3089// TailLogEntriesResponse: Result returned from TailLogEntries.
3090type TailLogEntriesResponse struct {
3091	// Entries: A list of log entries. Each response in the stream will
3092	// order entries with increasing values of LogEntry.timestamp. Ordering
3093	// is not guaranteed between separate responses.
3094	Entries []*LogEntry `json:"entries,omitempty"`
3095
3096	// SuppressionInfo: If entries that otherwise would have been included
3097	// in the session were not sent back to the client, counts of relevant
3098	// entries omitted from the session with the reason that they were not
3099	// included. There will be at most one of each reason per response. The
3100	// counts represent the number of suppressed entries since the last
3101	// streamed response.
3102	SuppressionInfo []*SuppressionInfo `json:"suppressionInfo,omitempty"`
3103
3104	// ServerResponse contains the HTTP response code and headers from the
3105	// server.
3106	googleapi.ServerResponse `json:"-"`
3107
3108	// ForceSendFields is a list of field names (e.g. "Entries") to
3109	// unconditionally include in API requests. By default, fields with
3110	// empty values are omitted from API requests. However, any non-pointer,
3111	// non-interface field appearing in ForceSendFields will be sent to the
3112	// server regardless of whether the field is empty or not. This may be
3113	// used to include empty fields in Patch requests.
3114	ForceSendFields []string `json:"-"`
3115
3116	// NullFields is a list of field names (e.g. "Entries") to include in
3117	// API requests with the JSON null value. By default, fields with empty
3118	// values are omitted from API requests. However, any field with an
3119	// empty value appearing in NullFields will be sent to the server as
3120	// null. It is an error if a field in this list has a non-empty value.
3121	// This may be used to include null fields in Patch requests.
3122	NullFields []string `json:"-"`
3123}
3124
3125func (s *TailLogEntriesResponse) MarshalJSON() ([]byte, error) {
3126	type NoMethod TailLogEntriesResponse
3127	raw := NoMethod(*s)
3128	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3129}
3130
3131// UndeleteBucketRequest: The parameters to UndeleteBucket.
3132type UndeleteBucketRequest struct {
3133}
3134
3135// WriteLogEntriesRequest: The parameters to WriteLogEntries.
3136type WriteLogEntriesRequest struct {
3137	// DryRun: Optional. If true, the request should expect normal response,
3138	// but the entries won't be persisted nor exported. Useful for checking
3139	// whether the logging API endpoints are working properly before sending
3140	// valuable data.
3141	DryRun bool `json:"dryRun,omitempty"`
3142
3143	// Entries: Required. The log entries to send to Logging. The order of
3144	// log entries in this list does not matter. Values supplied in this
3145	// method's log_name, resource, and labels fields are copied into those
3146	// log entries in this list that do not include values for their
3147	// corresponding fields. For more information, see the LogEntry type.If
3148	// the timestamp or insert_id fields are missing in log entries, then
3149	// this method supplies the current time or a unique identifier,
3150	// respectively. The supplied values are chosen so that, among the log
3151	// entries that did not supply their own values, the entries earlier in
3152	// the list will sort before the entries later in the list. See the
3153	// entries.list method.Log entries with timestamps that are more than
3154	// the logs retention period
3155	// (https://cloud.google.com/logging/quota-policy) in the past or more
3156	// than 24 hours in the future will not be available when calling
3157	// entries.list. However, those log entries can still be exported with
3158	// LogSinks
3159	// (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).To
3160	// improve throughput and to avoid exceeding the quota limit
3161	// (https://cloud.google.com/logging/quota-policy) for calls to
3162	// entries.write, you should try to include several log entries in this
3163	// list, rather than calling this method for each individual log entry.
3164	Entries []*LogEntry `json:"entries,omitempty"`
3165
3166	// Labels: Optional. Default labels that are added to the labels field
3167	// of all log entries in entries. If a log entry already has a label
3168	// with the same key as a label in this parameter, then the log entry's
3169	// label is not changed. See LogEntry.
3170	Labels map[string]string `json:"labels,omitempty"`
3171
3172	// LogName: Optional. A default log resource name that is assigned to
3173	// all log entries in entries that do not specify a value for log_name:
3174	// "projects/[PROJECT_ID]/logs/[LOG_ID]"
3175	// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
3176	// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
3177	// "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For
3178	// example: "projects/my-project-id/logs/syslog"
3179	// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Fa
3180	// ctivity" The permission logging.logEntries.create is needed on each
3181	// project, organization, billing account, or folder that is receiving
3182	// new log entries, whether the resource is specified in logName or in
3183	// an individual log entry.
3184	LogName string `json:"logName,omitempty"`
3185
3186	// PartialSuccess: Optional. Whether valid entries should be written
3187	// even if some other entries fail due to INVALID_ARGUMENT or
3188	// PERMISSION_DENIED errors. If any entry is not written, then the
3189	// response status is the error associated with one of the failed
3190	// entries and the response includes error details keyed by the entries'
3191	// zero-based index in the entries.write method.
3192	PartialSuccess bool `json:"partialSuccess,omitempty"`
3193
3194	// Resource: Optional. A default monitored resource object that is
3195	// assigned to all log entries in entries that do not specify a value
3196	// for resource. Example: { "type": "gce_instance", "labels": { "zone":
3197	// "us-central1-a", "instance_id": "00000000000000000000" }} See
3198	// LogEntry.
3199	Resource *MonitoredResource `json:"resource,omitempty"`
3200
3201	// ForceSendFields is a list of field names (e.g. "DryRun") to
3202	// unconditionally include in API requests. By default, fields with
3203	// empty values are omitted from API requests. However, any non-pointer,
3204	// non-interface field appearing in ForceSendFields will be sent to the
3205	// server regardless of whether the field is empty or not. This may be
3206	// used to include empty fields in Patch requests.
3207	ForceSendFields []string `json:"-"`
3208
3209	// NullFields is a list of field names (e.g. "DryRun") to include in API
3210	// requests with the JSON null value. By default, fields with empty
3211	// values are omitted from API requests. However, any field with an
3212	// empty value appearing in NullFields will be sent to the server as
3213	// null. It is an error if a field in this list has a non-empty value.
3214	// This may be used to include null fields in Patch requests.
3215	NullFields []string `json:"-"`
3216}
3217
3218func (s *WriteLogEntriesRequest) MarshalJSON() ([]byte, error) {
3219	type NoMethod WriteLogEntriesRequest
3220	raw := NoMethod(*s)
3221	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3222}
3223
3224// WriteLogEntriesResponse: Result returned from WriteLogEntries.
3225type WriteLogEntriesResponse struct {
3226	// ServerResponse contains the HTTP response code and headers from the
3227	// server.
3228	googleapi.ServerResponse `json:"-"`
3229}
3230
3231// method id "logging.billingAccounts.buckets.get":
3232
3233type BillingAccountsBucketsGetCall struct {
3234	s            *Service
3235	name         string
3236	urlParams_   gensupport.URLParams
3237	ifNoneMatch_ string
3238	ctx_         context.Context
3239	header_      http.Header
3240}
3241
3242// Get: Gets a bucket.
3243func (r *BillingAccountsBucketsService) Get(name string) *BillingAccountsBucketsGetCall {
3244	c := &BillingAccountsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3245	c.name = name
3246	return c
3247}
3248
3249// Fields allows partial responses to be retrieved. See
3250// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3251// for more information.
3252func (c *BillingAccountsBucketsGetCall) Fields(s ...googleapi.Field) *BillingAccountsBucketsGetCall {
3253	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3254	return c
3255}
3256
3257// IfNoneMatch sets the optional parameter which makes the operation
3258// fail if the object's ETag matches the given value. This is useful for
3259// getting updates only after the object has changed since the last
3260// request. Use googleapi.IsNotModified to check whether the response
3261// error from Do is the result of In-None-Match.
3262func (c *BillingAccountsBucketsGetCall) IfNoneMatch(entityTag string) *BillingAccountsBucketsGetCall {
3263	c.ifNoneMatch_ = entityTag
3264	return c
3265}
3266
3267// Context sets the context to be used in this call's Do method. Any
3268// pending HTTP request will be aborted if the provided context is
3269// canceled.
3270func (c *BillingAccountsBucketsGetCall) Context(ctx context.Context) *BillingAccountsBucketsGetCall {
3271	c.ctx_ = ctx
3272	return c
3273}
3274
3275// Header returns an http.Header that can be modified by the caller to
3276// add HTTP headers to the request.
3277func (c *BillingAccountsBucketsGetCall) Header() http.Header {
3278	if c.header_ == nil {
3279		c.header_ = make(http.Header)
3280	}
3281	return c.header_
3282}
3283
3284func (c *BillingAccountsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
3285	reqHeaders := make(http.Header)
3286	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3287	for k, v := range c.header_ {
3288		reqHeaders[k] = v
3289	}
3290	reqHeaders.Set("User-Agent", c.s.userAgent())
3291	if c.ifNoneMatch_ != "" {
3292		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3293	}
3294	var body io.Reader = nil
3295	c.urlParams_.Set("alt", alt)
3296	c.urlParams_.Set("prettyPrint", "false")
3297	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3298	urls += "?" + c.urlParams_.Encode()
3299	req, err := http.NewRequest("GET", urls, body)
3300	if err != nil {
3301		return nil, err
3302	}
3303	req.Header = reqHeaders
3304	googleapi.Expand(req.URL, map[string]string{
3305		"name": c.name,
3306	})
3307	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3308}
3309
3310// Do executes the "logging.billingAccounts.buckets.get" call.
3311// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
3312// status code is an error. Response headers are in either
3313// *LogBucket.ServerResponse.Header or (if a response was returned at
3314// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3315// to check whether the returned error was because
3316// http.StatusNotModified was returned.
3317func (c *BillingAccountsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
3318	gensupport.SetOptions(c.urlParams_, opts...)
3319	res, err := c.doRequest("json")
3320	if res != nil && res.StatusCode == http.StatusNotModified {
3321		if res.Body != nil {
3322			res.Body.Close()
3323		}
3324		return nil, &googleapi.Error{
3325			Code:   res.StatusCode,
3326			Header: res.Header,
3327		}
3328	}
3329	if err != nil {
3330		return nil, err
3331	}
3332	defer googleapi.CloseBody(res)
3333	if err := googleapi.CheckResponse(res); err != nil {
3334		return nil, err
3335	}
3336	ret := &LogBucket{
3337		ServerResponse: googleapi.ServerResponse{
3338			Header:         res.Header,
3339			HTTPStatusCode: res.StatusCode,
3340		},
3341	}
3342	target := &ret
3343	if err := gensupport.DecodeResponse(target, res); err != nil {
3344		return nil, err
3345	}
3346	return ret, nil
3347	// {
3348	//   "description": "Gets a bucket.",
3349	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}",
3350	//   "httpMethod": "GET",
3351	//   "id": "logging.billingAccounts.buckets.get",
3352	//   "parameterOrder": [
3353	//     "name"
3354	//   ],
3355	//   "parameters": {
3356	//     "name": {
3357	//       "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
3358	//       "location": "path",
3359	//       "pattern": "^billingAccounts/[^/]+/buckets/[^/]+$",
3360	//       "required": true,
3361	//       "type": "string"
3362	//     }
3363	//   },
3364	//   "path": "v2/{+name}",
3365	//   "response": {
3366	//     "$ref": "LogBucket"
3367	//   },
3368	//   "scopes": [
3369	//     "https://www.googleapis.com/auth/cloud-platform",
3370	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3371	//     "https://www.googleapis.com/auth/logging.admin",
3372	//     "https://www.googleapis.com/auth/logging.read"
3373	//   ]
3374	// }
3375
3376}
3377
3378// method id "logging.billingAccounts.buckets.views.get":
3379
3380type BillingAccountsBucketsViewsGetCall struct {
3381	s            *Service
3382	name         string
3383	urlParams_   gensupport.URLParams
3384	ifNoneMatch_ string
3385	ctx_         context.Context
3386	header_      http.Header
3387}
3388
3389// Get: Gets a view.
3390func (r *BillingAccountsBucketsViewsService) Get(name string) *BillingAccountsBucketsViewsGetCall {
3391	c := &BillingAccountsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3392	c.name = name
3393	return c
3394}
3395
3396// Fields allows partial responses to be retrieved. See
3397// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3398// for more information.
3399func (c *BillingAccountsBucketsViewsGetCall) Fields(s ...googleapi.Field) *BillingAccountsBucketsViewsGetCall {
3400	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3401	return c
3402}
3403
3404// IfNoneMatch sets the optional parameter which makes the operation
3405// fail if the object's ETag matches the given value. This is useful for
3406// getting updates only after the object has changed since the last
3407// request. Use googleapi.IsNotModified to check whether the response
3408// error from Do is the result of In-None-Match.
3409func (c *BillingAccountsBucketsViewsGetCall) IfNoneMatch(entityTag string) *BillingAccountsBucketsViewsGetCall {
3410	c.ifNoneMatch_ = entityTag
3411	return c
3412}
3413
3414// Context sets the context to be used in this call's Do method. Any
3415// pending HTTP request will be aborted if the provided context is
3416// canceled.
3417func (c *BillingAccountsBucketsViewsGetCall) Context(ctx context.Context) *BillingAccountsBucketsViewsGetCall {
3418	c.ctx_ = ctx
3419	return c
3420}
3421
3422// Header returns an http.Header that can be modified by the caller to
3423// add HTTP headers to the request.
3424func (c *BillingAccountsBucketsViewsGetCall) Header() http.Header {
3425	if c.header_ == nil {
3426		c.header_ = make(http.Header)
3427	}
3428	return c.header_
3429}
3430
3431func (c *BillingAccountsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
3432	reqHeaders := make(http.Header)
3433	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3434	for k, v := range c.header_ {
3435		reqHeaders[k] = v
3436	}
3437	reqHeaders.Set("User-Agent", c.s.userAgent())
3438	if c.ifNoneMatch_ != "" {
3439		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3440	}
3441	var body io.Reader = nil
3442	c.urlParams_.Set("alt", alt)
3443	c.urlParams_.Set("prettyPrint", "false")
3444	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3445	urls += "?" + c.urlParams_.Encode()
3446	req, err := http.NewRequest("GET", urls, body)
3447	if err != nil {
3448		return nil, err
3449	}
3450	req.Header = reqHeaders
3451	googleapi.Expand(req.URL, map[string]string{
3452		"name": c.name,
3453	})
3454	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3455}
3456
3457// Do executes the "logging.billingAccounts.buckets.views.get" call.
3458// Exactly one of *LogView or error will be non-nil. Any non-2xx status
3459// code is an error. Response headers are in either
3460// *LogView.ServerResponse.Header or (if a response was returned at all)
3461// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3462// check whether the returned error was because http.StatusNotModified
3463// was returned.
3464func (c *BillingAccountsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
3465	gensupport.SetOptions(c.urlParams_, opts...)
3466	res, err := c.doRequest("json")
3467	if res != nil && res.StatusCode == http.StatusNotModified {
3468		if res.Body != nil {
3469			res.Body.Close()
3470		}
3471		return nil, &googleapi.Error{
3472			Code:   res.StatusCode,
3473			Header: res.Header,
3474		}
3475	}
3476	if err != nil {
3477		return nil, err
3478	}
3479	defer googleapi.CloseBody(res)
3480	if err := googleapi.CheckResponse(res); err != nil {
3481		return nil, err
3482	}
3483	ret := &LogView{
3484		ServerResponse: googleapi.ServerResponse{
3485			Header:         res.Header,
3486			HTTPStatusCode: res.StatusCode,
3487		},
3488	}
3489	target := &ret
3490	if err := gensupport.DecodeResponse(target, res); err != nil {
3491		return nil, err
3492	}
3493	return ret, nil
3494	// {
3495	//   "description": "Gets a view.",
3496	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}/views/{viewsId}",
3497	//   "httpMethod": "GET",
3498	//   "id": "logging.billingAccounts.buckets.views.get",
3499	//   "parameterOrder": [
3500	//     "name"
3501	//   ],
3502	//   "parameters": {
3503	//     "name": {
3504	//       "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
3505	//       "location": "path",
3506	//       "pattern": "^billingAccounts/[^/]+/buckets/[^/]+/views/[^/]+$",
3507	//       "required": true,
3508	//       "type": "string"
3509	//     }
3510	//   },
3511	//   "path": "v2/{+name}",
3512	//   "response": {
3513	//     "$ref": "LogView"
3514	//   },
3515	//   "scopes": [
3516	//     "https://www.googleapis.com/auth/cloud-platform",
3517	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3518	//     "https://www.googleapis.com/auth/logging.admin",
3519	//     "https://www.googleapis.com/auth/logging.read"
3520	//   ]
3521	// }
3522
3523}
3524
3525// method id "logging.billingAccounts.exclusions.create":
3526
3527type BillingAccountsExclusionsCreateCall struct {
3528	s            *Service
3529	parent       string
3530	logexclusion *LogExclusion
3531	urlParams_   gensupport.URLParams
3532	ctx_         context.Context
3533	header_      http.Header
3534}
3535
3536// Create: Creates a new exclusion in a specified parent resource. Only
3537// log entries belonging to that resource can be excluded. You can have
3538// up to 10 exclusions in a resource.
3539func (r *BillingAccountsExclusionsService) Create(parent string, logexclusion *LogExclusion) *BillingAccountsExclusionsCreateCall {
3540	c := &BillingAccountsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3541	c.parent = parent
3542	c.logexclusion = logexclusion
3543	return c
3544}
3545
3546// Fields allows partial responses to be retrieved. See
3547// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3548// for more information.
3549func (c *BillingAccountsExclusionsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsCreateCall {
3550	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3551	return c
3552}
3553
3554// Context sets the context to be used in this call's Do method. Any
3555// pending HTTP request will be aborted if the provided context is
3556// canceled.
3557func (c *BillingAccountsExclusionsCreateCall) Context(ctx context.Context) *BillingAccountsExclusionsCreateCall {
3558	c.ctx_ = ctx
3559	return c
3560}
3561
3562// Header returns an http.Header that can be modified by the caller to
3563// add HTTP headers to the request.
3564func (c *BillingAccountsExclusionsCreateCall) Header() http.Header {
3565	if c.header_ == nil {
3566		c.header_ = make(http.Header)
3567	}
3568	return c.header_
3569}
3570
3571func (c *BillingAccountsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
3572	reqHeaders := make(http.Header)
3573	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3574	for k, v := range c.header_ {
3575		reqHeaders[k] = v
3576	}
3577	reqHeaders.Set("User-Agent", c.s.userAgent())
3578	var body io.Reader = nil
3579	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
3580	if err != nil {
3581		return nil, err
3582	}
3583	reqHeaders.Set("Content-Type", "application/json")
3584	c.urlParams_.Set("alt", alt)
3585	c.urlParams_.Set("prettyPrint", "false")
3586	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
3587	urls += "?" + c.urlParams_.Encode()
3588	req, err := http.NewRequest("POST", urls, body)
3589	if err != nil {
3590		return nil, err
3591	}
3592	req.Header = reqHeaders
3593	googleapi.Expand(req.URL, map[string]string{
3594		"parent": c.parent,
3595	})
3596	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3597}
3598
3599// Do executes the "logging.billingAccounts.exclusions.create" call.
3600// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
3601// status code is an error. Response headers are in either
3602// *LogExclusion.ServerResponse.Header or (if a response was returned at
3603// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3604// to check whether the returned error was because
3605// http.StatusNotModified was returned.
3606func (c *BillingAccountsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
3607	gensupport.SetOptions(c.urlParams_, opts...)
3608	res, err := c.doRequest("json")
3609	if res != nil && res.StatusCode == http.StatusNotModified {
3610		if res.Body != nil {
3611			res.Body.Close()
3612		}
3613		return nil, &googleapi.Error{
3614			Code:   res.StatusCode,
3615			Header: res.Header,
3616		}
3617	}
3618	if err != nil {
3619		return nil, err
3620	}
3621	defer googleapi.CloseBody(res)
3622	if err := googleapi.CheckResponse(res); err != nil {
3623		return nil, err
3624	}
3625	ret := &LogExclusion{
3626		ServerResponse: googleapi.ServerResponse{
3627			Header:         res.Header,
3628			HTTPStatusCode: res.StatusCode,
3629		},
3630	}
3631	target := &ret
3632	if err := gensupport.DecodeResponse(target, res); err != nil {
3633		return nil, err
3634	}
3635	return ret, nil
3636	// {
3637	//   "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.",
3638	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions",
3639	//   "httpMethod": "POST",
3640	//   "id": "logging.billingAccounts.exclusions.create",
3641	//   "parameterOrder": [
3642	//     "parent"
3643	//   ],
3644	//   "parameters": {
3645	//     "parent": {
3646	//       "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" Examples: \"projects/my-logging-project\", \"organizations/123456789\".",
3647	//       "location": "path",
3648	//       "pattern": "^billingAccounts/[^/]+$",
3649	//       "required": true,
3650	//       "type": "string"
3651	//     }
3652	//   },
3653	//   "path": "v2/{+parent}/exclusions",
3654	//   "request": {
3655	//     "$ref": "LogExclusion"
3656	//   },
3657	//   "response": {
3658	//     "$ref": "LogExclusion"
3659	//   },
3660	//   "scopes": [
3661	//     "https://www.googleapis.com/auth/cloud-platform",
3662	//     "https://www.googleapis.com/auth/logging.admin"
3663	//   ]
3664	// }
3665
3666}
3667
3668// method id "logging.billingAccounts.exclusions.delete":
3669
3670type BillingAccountsExclusionsDeleteCall struct {
3671	s          *Service
3672	name       string
3673	urlParams_ gensupport.URLParams
3674	ctx_       context.Context
3675	header_    http.Header
3676}
3677
3678// Delete: Deletes an exclusion.
3679func (r *BillingAccountsExclusionsService) Delete(name string) *BillingAccountsExclusionsDeleteCall {
3680	c := &BillingAccountsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3681	c.name = name
3682	return c
3683}
3684
3685// Fields allows partial responses to be retrieved. See
3686// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3687// for more information.
3688func (c *BillingAccountsExclusionsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsDeleteCall {
3689	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3690	return c
3691}
3692
3693// Context sets the context to be used in this call's Do method. Any
3694// pending HTTP request will be aborted if the provided context is
3695// canceled.
3696func (c *BillingAccountsExclusionsDeleteCall) Context(ctx context.Context) *BillingAccountsExclusionsDeleteCall {
3697	c.ctx_ = ctx
3698	return c
3699}
3700
3701// Header returns an http.Header that can be modified by the caller to
3702// add HTTP headers to the request.
3703func (c *BillingAccountsExclusionsDeleteCall) Header() http.Header {
3704	if c.header_ == nil {
3705		c.header_ = make(http.Header)
3706	}
3707	return c.header_
3708}
3709
3710func (c *BillingAccountsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
3711	reqHeaders := make(http.Header)
3712	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3713	for k, v := range c.header_ {
3714		reqHeaders[k] = v
3715	}
3716	reqHeaders.Set("User-Agent", c.s.userAgent())
3717	var body io.Reader = nil
3718	c.urlParams_.Set("alt", alt)
3719	c.urlParams_.Set("prettyPrint", "false")
3720	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3721	urls += "?" + c.urlParams_.Encode()
3722	req, err := http.NewRequest("DELETE", urls, body)
3723	if err != nil {
3724		return nil, err
3725	}
3726	req.Header = reqHeaders
3727	googleapi.Expand(req.URL, map[string]string{
3728		"name": c.name,
3729	})
3730	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3731}
3732
3733// Do executes the "logging.billingAccounts.exclusions.delete" call.
3734// Exactly one of *Empty or error will be non-nil. Any non-2xx status
3735// code is an error. Response headers are in either
3736// *Empty.ServerResponse.Header or (if a response was returned at all)
3737// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3738// check whether the returned error was because http.StatusNotModified
3739// was returned.
3740func (c *BillingAccountsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3741	gensupport.SetOptions(c.urlParams_, opts...)
3742	res, err := c.doRequest("json")
3743	if res != nil && res.StatusCode == http.StatusNotModified {
3744		if res.Body != nil {
3745			res.Body.Close()
3746		}
3747		return nil, &googleapi.Error{
3748			Code:   res.StatusCode,
3749			Header: res.Header,
3750		}
3751	}
3752	if err != nil {
3753		return nil, err
3754	}
3755	defer googleapi.CloseBody(res)
3756	if err := googleapi.CheckResponse(res); err != nil {
3757		return nil, err
3758	}
3759	ret := &Empty{
3760		ServerResponse: googleapi.ServerResponse{
3761			Header:         res.Header,
3762			HTTPStatusCode: res.StatusCode,
3763		},
3764	}
3765	target := &ret
3766	if err := gensupport.DecodeResponse(target, res); err != nil {
3767		return nil, err
3768	}
3769	return ret, nil
3770	// {
3771	//   "description": "Deletes an exclusion.",
3772	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
3773	//   "httpMethod": "DELETE",
3774	//   "id": "logging.billingAccounts.exclusions.delete",
3775	//   "parameterOrder": [
3776	//     "name"
3777	//   ],
3778	//   "parameters": {
3779	//     "name": {
3780	//       "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
3781	//       "location": "path",
3782	//       "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
3783	//       "required": true,
3784	//       "type": "string"
3785	//     }
3786	//   },
3787	//   "path": "v2/{+name}",
3788	//   "response": {
3789	//     "$ref": "Empty"
3790	//   },
3791	//   "scopes": [
3792	//     "https://www.googleapis.com/auth/cloud-platform",
3793	//     "https://www.googleapis.com/auth/logging.admin"
3794	//   ]
3795	// }
3796
3797}
3798
3799// method id "logging.billingAccounts.exclusions.get":
3800
3801type BillingAccountsExclusionsGetCall struct {
3802	s            *Service
3803	name         string
3804	urlParams_   gensupport.URLParams
3805	ifNoneMatch_ string
3806	ctx_         context.Context
3807	header_      http.Header
3808}
3809
3810// Get: Gets the description of an exclusion.
3811func (r *BillingAccountsExclusionsService) Get(name string) *BillingAccountsExclusionsGetCall {
3812	c := &BillingAccountsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3813	c.name = name
3814	return c
3815}
3816
3817// Fields allows partial responses to be retrieved. See
3818// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3819// for more information.
3820func (c *BillingAccountsExclusionsGetCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsGetCall {
3821	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3822	return c
3823}
3824
3825// IfNoneMatch sets the optional parameter which makes the operation
3826// fail if the object's ETag matches the given value. This is useful for
3827// getting updates only after the object has changed since the last
3828// request. Use googleapi.IsNotModified to check whether the response
3829// error from Do is the result of In-None-Match.
3830func (c *BillingAccountsExclusionsGetCall) IfNoneMatch(entityTag string) *BillingAccountsExclusionsGetCall {
3831	c.ifNoneMatch_ = entityTag
3832	return c
3833}
3834
3835// Context sets the context to be used in this call's Do method. Any
3836// pending HTTP request will be aborted if the provided context is
3837// canceled.
3838func (c *BillingAccountsExclusionsGetCall) Context(ctx context.Context) *BillingAccountsExclusionsGetCall {
3839	c.ctx_ = ctx
3840	return c
3841}
3842
3843// Header returns an http.Header that can be modified by the caller to
3844// add HTTP headers to the request.
3845func (c *BillingAccountsExclusionsGetCall) Header() http.Header {
3846	if c.header_ == nil {
3847		c.header_ = make(http.Header)
3848	}
3849	return c.header_
3850}
3851
3852func (c *BillingAccountsExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
3853	reqHeaders := make(http.Header)
3854	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3855	for k, v := range c.header_ {
3856		reqHeaders[k] = v
3857	}
3858	reqHeaders.Set("User-Agent", c.s.userAgent())
3859	if c.ifNoneMatch_ != "" {
3860		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3861	}
3862	var body io.Reader = nil
3863	c.urlParams_.Set("alt", alt)
3864	c.urlParams_.Set("prettyPrint", "false")
3865	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3866	urls += "?" + c.urlParams_.Encode()
3867	req, err := http.NewRequest("GET", urls, body)
3868	if err != nil {
3869		return nil, err
3870	}
3871	req.Header = reqHeaders
3872	googleapi.Expand(req.URL, map[string]string{
3873		"name": c.name,
3874	})
3875	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3876}
3877
3878// Do executes the "logging.billingAccounts.exclusions.get" call.
3879// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
3880// status code is an error. Response headers are in either
3881// *LogExclusion.ServerResponse.Header or (if a response was returned at
3882// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3883// to check whether the returned error was because
3884// http.StatusNotModified was returned.
3885func (c *BillingAccountsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
3886	gensupport.SetOptions(c.urlParams_, opts...)
3887	res, err := c.doRequest("json")
3888	if res != nil && res.StatusCode == http.StatusNotModified {
3889		if res.Body != nil {
3890			res.Body.Close()
3891		}
3892		return nil, &googleapi.Error{
3893			Code:   res.StatusCode,
3894			Header: res.Header,
3895		}
3896	}
3897	if err != nil {
3898		return nil, err
3899	}
3900	defer googleapi.CloseBody(res)
3901	if err := googleapi.CheckResponse(res); err != nil {
3902		return nil, err
3903	}
3904	ret := &LogExclusion{
3905		ServerResponse: googleapi.ServerResponse{
3906			Header:         res.Header,
3907			HTTPStatusCode: res.StatusCode,
3908		},
3909	}
3910	target := &ret
3911	if err := gensupport.DecodeResponse(target, res); err != nil {
3912		return nil, err
3913	}
3914	return ret, nil
3915	// {
3916	//   "description": "Gets the description of an exclusion.",
3917	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
3918	//   "httpMethod": "GET",
3919	//   "id": "logging.billingAccounts.exclusions.get",
3920	//   "parameterOrder": [
3921	//     "name"
3922	//   ],
3923	//   "parameters": {
3924	//     "name": {
3925	//       "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
3926	//       "location": "path",
3927	//       "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
3928	//       "required": true,
3929	//       "type": "string"
3930	//     }
3931	//   },
3932	//   "path": "v2/{+name}",
3933	//   "response": {
3934	//     "$ref": "LogExclusion"
3935	//   },
3936	//   "scopes": [
3937	//     "https://www.googleapis.com/auth/cloud-platform",
3938	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3939	//     "https://www.googleapis.com/auth/logging.admin",
3940	//     "https://www.googleapis.com/auth/logging.read"
3941	//   ]
3942	// }
3943
3944}
3945
3946// method id "logging.billingAccounts.exclusions.list":
3947
3948type BillingAccountsExclusionsListCall struct {
3949	s            *Service
3950	parent       string
3951	urlParams_   gensupport.URLParams
3952	ifNoneMatch_ string
3953	ctx_         context.Context
3954	header_      http.Header
3955}
3956
3957// List: Lists all the exclusions in a parent resource.
3958func (r *BillingAccountsExclusionsService) List(parent string) *BillingAccountsExclusionsListCall {
3959	c := &BillingAccountsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3960	c.parent = parent
3961	return c
3962}
3963
3964// PageSize sets the optional parameter "pageSize": The maximum number
3965// of results to return from this request. Non-positive values are
3966// ignored. The presence of nextPageToken in the response indicates that
3967// more results might be available.
3968func (c *BillingAccountsExclusionsListCall) PageSize(pageSize int64) *BillingAccountsExclusionsListCall {
3969	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3970	return c
3971}
3972
3973// PageToken sets the optional parameter "pageToken": If present, then
3974// retrieve the next batch of results from the preceding call to this
3975// method. pageToken must be the value of nextPageToken from the
3976// previous response. The values of other method parameters should be
3977// identical to those in the previous call.
3978func (c *BillingAccountsExclusionsListCall) PageToken(pageToken string) *BillingAccountsExclusionsListCall {
3979	c.urlParams_.Set("pageToken", pageToken)
3980	return c
3981}
3982
3983// Fields allows partial responses to be retrieved. See
3984// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3985// for more information.
3986func (c *BillingAccountsExclusionsListCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsListCall {
3987	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3988	return c
3989}
3990
3991// IfNoneMatch sets the optional parameter which makes the operation
3992// fail if the object's ETag matches the given value. This is useful for
3993// getting updates only after the object has changed since the last
3994// request. Use googleapi.IsNotModified to check whether the response
3995// error from Do is the result of In-None-Match.
3996func (c *BillingAccountsExclusionsListCall) IfNoneMatch(entityTag string) *BillingAccountsExclusionsListCall {
3997	c.ifNoneMatch_ = entityTag
3998	return c
3999}
4000
4001// Context sets the context to be used in this call's Do method. Any
4002// pending HTTP request will be aborted if the provided context is
4003// canceled.
4004func (c *BillingAccountsExclusionsListCall) Context(ctx context.Context) *BillingAccountsExclusionsListCall {
4005	c.ctx_ = ctx
4006	return c
4007}
4008
4009// Header returns an http.Header that can be modified by the caller to
4010// add HTTP headers to the request.
4011func (c *BillingAccountsExclusionsListCall) Header() http.Header {
4012	if c.header_ == nil {
4013		c.header_ = make(http.Header)
4014	}
4015	return c.header_
4016}
4017
4018func (c *BillingAccountsExclusionsListCall) doRequest(alt string) (*http.Response, error) {
4019	reqHeaders := make(http.Header)
4020	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4021	for k, v := range c.header_ {
4022		reqHeaders[k] = v
4023	}
4024	reqHeaders.Set("User-Agent", c.s.userAgent())
4025	if c.ifNoneMatch_ != "" {
4026		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4027	}
4028	var body io.Reader = nil
4029	c.urlParams_.Set("alt", alt)
4030	c.urlParams_.Set("prettyPrint", "false")
4031	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
4032	urls += "?" + c.urlParams_.Encode()
4033	req, err := http.NewRequest("GET", urls, body)
4034	if err != nil {
4035		return nil, err
4036	}
4037	req.Header = reqHeaders
4038	googleapi.Expand(req.URL, map[string]string{
4039		"parent": c.parent,
4040	})
4041	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4042}
4043
4044// Do executes the "logging.billingAccounts.exclusions.list" call.
4045// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
4046// non-2xx status code is an error. Response headers are in either
4047// *ListExclusionsResponse.ServerResponse.Header or (if a response was
4048// returned at all) in error.(*googleapi.Error).Header. Use
4049// googleapi.IsNotModified to check whether the returned error was
4050// because http.StatusNotModified was returned.
4051func (c *BillingAccountsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
4052	gensupport.SetOptions(c.urlParams_, opts...)
4053	res, err := c.doRequest("json")
4054	if res != nil && res.StatusCode == http.StatusNotModified {
4055		if res.Body != nil {
4056			res.Body.Close()
4057		}
4058		return nil, &googleapi.Error{
4059			Code:   res.StatusCode,
4060			Header: res.Header,
4061		}
4062	}
4063	if err != nil {
4064		return nil, err
4065	}
4066	defer googleapi.CloseBody(res)
4067	if err := googleapi.CheckResponse(res); err != nil {
4068		return nil, err
4069	}
4070	ret := &ListExclusionsResponse{
4071		ServerResponse: googleapi.ServerResponse{
4072			Header:         res.Header,
4073			HTTPStatusCode: res.StatusCode,
4074		},
4075	}
4076	target := &ret
4077	if err := gensupport.DecodeResponse(target, res); err != nil {
4078		return nil, err
4079	}
4080	return ret, nil
4081	// {
4082	//   "description": "Lists all the exclusions in a parent resource.",
4083	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions",
4084	//   "httpMethod": "GET",
4085	//   "id": "logging.billingAccounts.exclusions.list",
4086	//   "parameterOrder": [
4087	//     "parent"
4088	//   ],
4089	//   "parameters": {
4090	//     "pageSize": {
4091	//       "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.",
4092	//       "format": "int32",
4093	//       "location": "query",
4094	//       "type": "integer"
4095	//     },
4096	//     "pageToken": {
4097	//       "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.",
4098	//       "location": "query",
4099	//       "type": "string"
4100	//     },
4101	//     "parent": {
4102	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
4103	//       "location": "path",
4104	//       "pattern": "^billingAccounts/[^/]+$",
4105	//       "required": true,
4106	//       "type": "string"
4107	//     }
4108	//   },
4109	//   "path": "v2/{+parent}/exclusions",
4110	//   "response": {
4111	//     "$ref": "ListExclusionsResponse"
4112	//   },
4113	//   "scopes": [
4114	//     "https://www.googleapis.com/auth/cloud-platform",
4115	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4116	//     "https://www.googleapis.com/auth/logging.admin",
4117	//     "https://www.googleapis.com/auth/logging.read"
4118	//   ]
4119	// }
4120
4121}
4122
4123// Pages invokes f for each page of results.
4124// A non-nil error returned from f will halt the iteration.
4125// The provided context supersedes any context provided to the Context method.
4126func (c *BillingAccountsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
4127	c.ctx_ = ctx
4128	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
4129	for {
4130		x, err := c.Do()
4131		if err != nil {
4132			return err
4133		}
4134		if err := f(x); err != nil {
4135			return err
4136		}
4137		if x.NextPageToken == "" {
4138			return nil
4139		}
4140		c.PageToken(x.NextPageToken)
4141	}
4142}
4143
4144// method id "logging.billingAccounts.exclusions.patch":
4145
4146type BillingAccountsExclusionsPatchCall struct {
4147	s            *Service
4148	name         string
4149	logexclusion *LogExclusion
4150	urlParams_   gensupport.URLParams
4151	ctx_         context.Context
4152	header_      http.Header
4153}
4154
4155// Patch: Changes one or more properties of an existing exclusion.
4156func (r *BillingAccountsExclusionsService) Patch(name string, logexclusion *LogExclusion) *BillingAccountsExclusionsPatchCall {
4157	c := &BillingAccountsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4158	c.name = name
4159	c.logexclusion = logexclusion
4160	return c
4161}
4162
4163// UpdateMask sets the optional parameter "updateMask": Required. A
4164// non-empty list of fields to change in the existing exclusion. New
4165// values for the fields are taken from the corresponding fields in the
4166// LogExclusion included in this request. Fields not mentioned in
4167// update_mask are not changed and are ignored in the request.For
4168// example, to change the filter and description of an exclusion,
4169// specify an update_mask of "filter,description".
4170func (c *BillingAccountsExclusionsPatchCall) UpdateMask(updateMask string) *BillingAccountsExclusionsPatchCall {
4171	c.urlParams_.Set("updateMask", updateMask)
4172	return c
4173}
4174
4175// Fields allows partial responses to be retrieved. See
4176// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4177// for more information.
4178func (c *BillingAccountsExclusionsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsPatchCall {
4179	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4180	return c
4181}
4182
4183// Context sets the context to be used in this call's Do method. Any
4184// pending HTTP request will be aborted if the provided context is
4185// canceled.
4186func (c *BillingAccountsExclusionsPatchCall) Context(ctx context.Context) *BillingAccountsExclusionsPatchCall {
4187	c.ctx_ = ctx
4188	return c
4189}
4190
4191// Header returns an http.Header that can be modified by the caller to
4192// add HTTP headers to the request.
4193func (c *BillingAccountsExclusionsPatchCall) Header() http.Header {
4194	if c.header_ == nil {
4195		c.header_ = make(http.Header)
4196	}
4197	return c.header_
4198}
4199
4200func (c *BillingAccountsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
4201	reqHeaders := make(http.Header)
4202	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4203	for k, v := range c.header_ {
4204		reqHeaders[k] = v
4205	}
4206	reqHeaders.Set("User-Agent", c.s.userAgent())
4207	var body io.Reader = nil
4208	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
4209	if err != nil {
4210		return nil, err
4211	}
4212	reqHeaders.Set("Content-Type", "application/json")
4213	c.urlParams_.Set("alt", alt)
4214	c.urlParams_.Set("prettyPrint", "false")
4215	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4216	urls += "?" + c.urlParams_.Encode()
4217	req, err := http.NewRequest("PATCH", urls, body)
4218	if err != nil {
4219		return nil, err
4220	}
4221	req.Header = reqHeaders
4222	googleapi.Expand(req.URL, map[string]string{
4223		"name": c.name,
4224	})
4225	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4226}
4227
4228// Do executes the "logging.billingAccounts.exclusions.patch" call.
4229// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
4230// status code is an error. Response headers are in either
4231// *LogExclusion.ServerResponse.Header or (if a response was returned at
4232// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4233// to check whether the returned error was because
4234// http.StatusNotModified was returned.
4235func (c *BillingAccountsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
4236	gensupport.SetOptions(c.urlParams_, opts...)
4237	res, err := c.doRequest("json")
4238	if res != nil && res.StatusCode == http.StatusNotModified {
4239		if res.Body != nil {
4240			res.Body.Close()
4241		}
4242		return nil, &googleapi.Error{
4243			Code:   res.StatusCode,
4244			Header: res.Header,
4245		}
4246	}
4247	if err != nil {
4248		return nil, err
4249	}
4250	defer googleapi.CloseBody(res)
4251	if err := googleapi.CheckResponse(res); err != nil {
4252		return nil, err
4253	}
4254	ret := &LogExclusion{
4255		ServerResponse: googleapi.ServerResponse{
4256			Header:         res.Header,
4257			HTTPStatusCode: res.StatusCode,
4258		},
4259	}
4260	target := &ret
4261	if err := gensupport.DecodeResponse(target, res); err != nil {
4262		return nil, err
4263	}
4264	return ret, nil
4265	// {
4266	//   "description": "Changes one or more properties of an existing exclusion.",
4267	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
4268	//   "httpMethod": "PATCH",
4269	//   "id": "logging.billingAccounts.exclusions.patch",
4270	//   "parameterOrder": [
4271	//     "name"
4272	//   ],
4273	//   "parameters": {
4274	//     "name": {
4275	//       "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
4276	//       "location": "path",
4277	//       "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
4278	//       "required": true,
4279	//       "type": "string"
4280	//     },
4281	//     "updateMask": {
4282	//       "description": "Required. A non-empty 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\".",
4283	//       "format": "google-fieldmask",
4284	//       "location": "query",
4285	//       "type": "string"
4286	//     }
4287	//   },
4288	//   "path": "v2/{+name}",
4289	//   "request": {
4290	//     "$ref": "LogExclusion"
4291	//   },
4292	//   "response": {
4293	//     "$ref": "LogExclusion"
4294	//   },
4295	//   "scopes": [
4296	//     "https://www.googleapis.com/auth/cloud-platform",
4297	//     "https://www.googleapis.com/auth/logging.admin"
4298	//   ]
4299	// }
4300
4301}
4302
4303// method id "logging.billingAccounts.locations.get":
4304
4305type BillingAccountsLocationsGetCall struct {
4306	s            *Service
4307	name         string
4308	urlParams_   gensupport.URLParams
4309	ifNoneMatch_ string
4310	ctx_         context.Context
4311	header_      http.Header
4312}
4313
4314// Get: Gets information about a location.
4315func (r *BillingAccountsLocationsService) Get(name string) *BillingAccountsLocationsGetCall {
4316	c := &BillingAccountsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4317	c.name = name
4318	return c
4319}
4320
4321// Fields allows partial responses to be retrieved. See
4322// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4323// for more information.
4324func (c *BillingAccountsLocationsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsGetCall {
4325	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4326	return c
4327}
4328
4329// IfNoneMatch sets the optional parameter which makes the operation
4330// fail if the object's ETag matches the given value. This is useful for
4331// getting updates only after the object has changed since the last
4332// request. Use googleapi.IsNotModified to check whether the response
4333// error from Do is the result of In-None-Match.
4334func (c *BillingAccountsLocationsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsGetCall {
4335	c.ifNoneMatch_ = entityTag
4336	return c
4337}
4338
4339// Context sets the context to be used in this call's Do method. Any
4340// pending HTTP request will be aborted if the provided context is
4341// canceled.
4342func (c *BillingAccountsLocationsGetCall) Context(ctx context.Context) *BillingAccountsLocationsGetCall {
4343	c.ctx_ = ctx
4344	return c
4345}
4346
4347// Header returns an http.Header that can be modified by the caller to
4348// add HTTP headers to the request.
4349func (c *BillingAccountsLocationsGetCall) Header() http.Header {
4350	if c.header_ == nil {
4351		c.header_ = make(http.Header)
4352	}
4353	return c.header_
4354}
4355
4356func (c *BillingAccountsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
4357	reqHeaders := make(http.Header)
4358	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4359	for k, v := range c.header_ {
4360		reqHeaders[k] = v
4361	}
4362	reqHeaders.Set("User-Agent", c.s.userAgent())
4363	if c.ifNoneMatch_ != "" {
4364		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4365	}
4366	var body io.Reader = nil
4367	c.urlParams_.Set("alt", alt)
4368	c.urlParams_.Set("prettyPrint", "false")
4369	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4370	urls += "?" + c.urlParams_.Encode()
4371	req, err := http.NewRequest("GET", urls, body)
4372	if err != nil {
4373		return nil, err
4374	}
4375	req.Header = reqHeaders
4376	googleapi.Expand(req.URL, map[string]string{
4377		"name": c.name,
4378	})
4379	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4380}
4381
4382// Do executes the "logging.billingAccounts.locations.get" call.
4383// Exactly one of *Location or error will be non-nil. Any non-2xx status
4384// code is an error. Response headers are in either
4385// *Location.ServerResponse.Header or (if a response was returned at
4386// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4387// to check whether the returned error was because
4388// http.StatusNotModified was returned.
4389func (c *BillingAccountsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
4390	gensupport.SetOptions(c.urlParams_, opts...)
4391	res, err := c.doRequest("json")
4392	if res != nil && res.StatusCode == http.StatusNotModified {
4393		if res.Body != nil {
4394			res.Body.Close()
4395		}
4396		return nil, &googleapi.Error{
4397			Code:   res.StatusCode,
4398			Header: res.Header,
4399		}
4400	}
4401	if err != nil {
4402		return nil, err
4403	}
4404	defer googleapi.CloseBody(res)
4405	if err := googleapi.CheckResponse(res); err != nil {
4406		return nil, err
4407	}
4408	ret := &Location{
4409		ServerResponse: googleapi.ServerResponse{
4410			Header:         res.Header,
4411			HTTPStatusCode: res.StatusCode,
4412		},
4413	}
4414	target := &ret
4415	if err := gensupport.DecodeResponse(target, res); err != nil {
4416		return nil, err
4417	}
4418	return ret, nil
4419	// {
4420	//   "description": "Gets information about a location.",
4421	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}",
4422	//   "httpMethod": "GET",
4423	//   "id": "logging.billingAccounts.locations.get",
4424	//   "parameterOrder": [
4425	//     "name"
4426	//   ],
4427	//   "parameters": {
4428	//     "name": {
4429	//       "description": "Resource name for the location.",
4430	//       "location": "path",
4431	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+$",
4432	//       "required": true,
4433	//       "type": "string"
4434	//     }
4435	//   },
4436	//   "path": "v2/{+name}",
4437	//   "response": {
4438	//     "$ref": "Location"
4439	//   },
4440	//   "scopes": [
4441	//     "https://www.googleapis.com/auth/cloud-platform",
4442	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4443	//     "https://www.googleapis.com/auth/logging.admin",
4444	//     "https://www.googleapis.com/auth/logging.read"
4445	//   ]
4446	// }
4447
4448}
4449
4450// method id "logging.billingAccounts.locations.list":
4451
4452type BillingAccountsLocationsListCall struct {
4453	s            *Service
4454	name         string
4455	urlParams_   gensupport.URLParams
4456	ifNoneMatch_ string
4457	ctx_         context.Context
4458	header_      http.Header
4459}
4460
4461// List: Lists information about the supported locations for this
4462// service.
4463func (r *BillingAccountsLocationsService) List(name string) *BillingAccountsLocationsListCall {
4464	c := &BillingAccountsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4465	c.name = name
4466	return c
4467}
4468
4469// Filter sets the optional parameter "filter": The standard list
4470// filter.
4471func (c *BillingAccountsLocationsListCall) Filter(filter string) *BillingAccountsLocationsListCall {
4472	c.urlParams_.Set("filter", filter)
4473	return c
4474}
4475
4476// PageSize sets the optional parameter "pageSize": The standard list
4477// page size.
4478func (c *BillingAccountsLocationsListCall) PageSize(pageSize int64) *BillingAccountsLocationsListCall {
4479	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4480	return c
4481}
4482
4483// PageToken sets the optional parameter "pageToken": The standard list
4484// page token.
4485func (c *BillingAccountsLocationsListCall) PageToken(pageToken string) *BillingAccountsLocationsListCall {
4486	c.urlParams_.Set("pageToken", pageToken)
4487	return c
4488}
4489
4490// Fields allows partial responses to be retrieved. See
4491// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4492// for more information.
4493func (c *BillingAccountsLocationsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsListCall {
4494	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4495	return c
4496}
4497
4498// IfNoneMatch sets the optional parameter which makes the operation
4499// fail if the object's ETag matches the given value. This is useful for
4500// getting updates only after the object has changed since the last
4501// request. Use googleapi.IsNotModified to check whether the response
4502// error from Do is the result of In-None-Match.
4503func (c *BillingAccountsLocationsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsListCall {
4504	c.ifNoneMatch_ = entityTag
4505	return c
4506}
4507
4508// Context sets the context to be used in this call's Do method. Any
4509// pending HTTP request will be aborted if the provided context is
4510// canceled.
4511func (c *BillingAccountsLocationsListCall) Context(ctx context.Context) *BillingAccountsLocationsListCall {
4512	c.ctx_ = ctx
4513	return c
4514}
4515
4516// Header returns an http.Header that can be modified by the caller to
4517// add HTTP headers to the request.
4518func (c *BillingAccountsLocationsListCall) Header() http.Header {
4519	if c.header_ == nil {
4520		c.header_ = make(http.Header)
4521	}
4522	return c.header_
4523}
4524
4525func (c *BillingAccountsLocationsListCall) doRequest(alt string) (*http.Response, error) {
4526	reqHeaders := make(http.Header)
4527	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4528	for k, v := range c.header_ {
4529		reqHeaders[k] = v
4530	}
4531	reqHeaders.Set("User-Agent", c.s.userAgent())
4532	if c.ifNoneMatch_ != "" {
4533		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4534	}
4535	var body io.Reader = nil
4536	c.urlParams_.Set("alt", alt)
4537	c.urlParams_.Set("prettyPrint", "false")
4538	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
4539	urls += "?" + c.urlParams_.Encode()
4540	req, err := http.NewRequest("GET", urls, body)
4541	if err != nil {
4542		return nil, err
4543	}
4544	req.Header = reqHeaders
4545	googleapi.Expand(req.URL, map[string]string{
4546		"name": c.name,
4547	})
4548	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4549}
4550
4551// Do executes the "logging.billingAccounts.locations.list" call.
4552// Exactly one of *ListLocationsResponse or error will be non-nil. Any
4553// non-2xx status code is an error. Response headers are in either
4554// *ListLocationsResponse.ServerResponse.Header or (if a response was
4555// returned at all) in error.(*googleapi.Error).Header. Use
4556// googleapi.IsNotModified to check whether the returned error was
4557// because http.StatusNotModified was returned.
4558func (c *BillingAccountsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
4559	gensupport.SetOptions(c.urlParams_, opts...)
4560	res, err := c.doRequest("json")
4561	if res != nil && res.StatusCode == http.StatusNotModified {
4562		if res.Body != nil {
4563			res.Body.Close()
4564		}
4565		return nil, &googleapi.Error{
4566			Code:   res.StatusCode,
4567			Header: res.Header,
4568		}
4569	}
4570	if err != nil {
4571		return nil, err
4572	}
4573	defer googleapi.CloseBody(res)
4574	if err := googleapi.CheckResponse(res); err != nil {
4575		return nil, err
4576	}
4577	ret := &ListLocationsResponse{
4578		ServerResponse: googleapi.ServerResponse{
4579			Header:         res.Header,
4580			HTTPStatusCode: res.StatusCode,
4581		},
4582	}
4583	target := &ret
4584	if err := gensupport.DecodeResponse(target, res); err != nil {
4585		return nil, err
4586	}
4587	return ret, nil
4588	// {
4589	//   "description": "Lists information about the supported locations for this service.",
4590	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations",
4591	//   "httpMethod": "GET",
4592	//   "id": "logging.billingAccounts.locations.list",
4593	//   "parameterOrder": [
4594	//     "name"
4595	//   ],
4596	//   "parameters": {
4597	//     "filter": {
4598	//       "description": "The standard list filter.",
4599	//       "location": "query",
4600	//       "type": "string"
4601	//     },
4602	//     "name": {
4603	//       "description": "The resource that owns the locations collection, if applicable.",
4604	//       "location": "path",
4605	//       "pattern": "^billingAccounts/[^/]+$",
4606	//       "required": true,
4607	//       "type": "string"
4608	//     },
4609	//     "pageSize": {
4610	//       "description": "The standard list page size.",
4611	//       "format": "int32",
4612	//       "location": "query",
4613	//       "type": "integer"
4614	//     },
4615	//     "pageToken": {
4616	//       "description": "The standard list page token.",
4617	//       "location": "query",
4618	//       "type": "string"
4619	//     }
4620	//   },
4621	//   "path": "v2/{+name}/locations",
4622	//   "response": {
4623	//     "$ref": "ListLocationsResponse"
4624	//   },
4625	//   "scopes": [
4626	//     "https://www.googleapis.com/auth/cloud-platform",
4627	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4628	//     "https://www.googleapis.com/auth/logging.admin",
4629	//     "https://www.googleapis.com/auth/logging.read"
4630	//   ]
4631	// }
4632
4633}
4634
4635// Pages invokes f for each page of results.
4636// A non-nil error returned from f will halt the iteration.
4637// The provided context supersedes any context provided to the Context method.
4638func (c *BillingAccountsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
4639	c.ctx_ = ctx
4640	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
4641	for {
4642		x, err := c.Do()
4643		if err != nil {
4644			return err
4645		}
4646		if err := f(x); err != nil {
4647			return err
4648		}
4649		if x.NextPageToken == "" {
4650			return nil
4651		}
4652		c.PageToken(x.NextPageToken)
4653	}
4654}
4655
4656// method id "logging.billingAccounts.locations.buckets.create":
4657
4658type BillingAccountsLocationsBucketsCreateCall struct {
4659	s          *Service
4660	parent     string
4661	logbucket  *LogBucket
4662	urlParams_ gensupport.URLParams
4663	ctx_       context.Context
4664	header_    http.Header
4665}
4666
4667// Create: Creates a bucket that can be used to store log entries. Once
4668// a bucket has been created, the region cannot be changed.
4669func (r *BillingAccountsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *BillingAccountsLocationsBucketsCreateCall {
4670	c := &BillingAccountsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4671	c.parent = parent
4672	c.logbucket = logbucket
4673	return c
4674}
4675
4676// BucketId sets the optional parameter "bucketId": Required. A
4677// client-assigned identifier such as "my-bucket". Identifiers are
4678// limited to 100 characters and can include only letters, digits,
4679// underscores, hyphens, and periods.
4680func (c *BillingAccountsLocationsBucketsCreateCall) BucketId(bucketId string) *BillingAccountsLocationsBucketsCreateCall {
4681	c.urlParams_.Set("bucketId", bucketId)
4682	return c
4683}
4684
4685// Fields allows partial responses to be retrieved. See
4686// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4687// for more information.
4688func (c *BillingAccountsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsCreateCall {
4689	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4690	return c
4691}
4692
4693// Context sets the context to be used in this call's Do method. Any
4694// pending HTTP request will be aborted if the provided context is
4695// canceled.
4696func (c *BillingAccountsLocationsBucketsCreateCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsCreateCall {
4697	c.ctx_ = ctx
4698	return c
4699}
4700
4701// Header returns an http.Header that can be modified by the caller to
4702// add HTTP headers to the request.
4703func (c *BillingAccountsLocationsBucketsCreateCall) Header() http.Header {
4704	if c.header_ == nil {
4705		c.header_ = make(http.Header)
4706	}
4707	return c.header_
4708}
4709
4710func (c *BillingAccountsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
4711	reqHeaders := make(http.Header)
4712	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4713	for k, v := range c.header_ {
4714		reqHeaders[k] = v
4715	}
4716	reqHeaders.Set("User-Agent", c.s.userAgent())
4717	var body io.Reader = nil
4718	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
4719	if err != nil {
4720		return nil, err
4721	}
4722	reqHeaders.Set("Content-Type", "application/json")
4723	c.urlParams_.Set("alt", alt)
4724	c.urlParams_.Set("prettyPrint", "false")
4725	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
4726	urls += "?" + c.urlParams_.Encode()
4727	req, err := http.NewRequest("POST", urls, body)
4728	if err != nil {
4729		return nil, err
4730	}
4731	req.Header = reqHeaders
4732	googleapi.Expand(req.URL, map[string]string{
4733		"parent": c.parent,
4734	})
4735	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4736}
4737
4738// Do executes the "logging.billingAccounts.locations.buckets.create" call.
4739// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
4740// status code is an error. Response headers are in either
4741// *LogBucket.ServerResponse.Header or (if a response was returned at
4742// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4743// to check whether the returned error was because
4744// http.StatusNotModified was returned.
4745func (c *BillingAccountsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
4746	gensupport.SetOptions(c.urlParams_, opts...)
4747	res, err := c.doRequest("json")
4748	if res != nil && res.StatusCode == http.StatusNotModified {
4749		if res.Body != nil {
4750			res.Body.Close()
4751		}
4752		return nil, &googleapi.Error{
4753			Code:   res.StatusCode,
4754			Header: res.Header,
4755		}
4756	}
4757	if err != nil {
4758		return nil, err
4759	}
4760	defer googleapi.CloseBody(res)
4761	if err := googleapi.CheckResponse(res); err != nil {
4762		return nil, err
4763	}
4764	ret := &LogBucket{
4765		ServerResponse: googleapi.ServerResponse{
4766			Header:         res.Header,
4767			HTTPStatusCode: res.StatusCode,
4768		},
4769	}
4770	target := &ret
4771	if err := gensupport.DecodeResponse(target, res); err != nil {
4772		return nil, err
4773	}
4774	return ret, nil
4775	// {
4776	//   "description": "Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.",
4777	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets",
4778	//   "httpMethod": "POST",
4779	//   "id": "logging.billingAccounts.locations.buckets.create",
4780	//   "parameterOrder": [
4781	//     "parent"
4782	//   ],
4783	//   "parameters": {
4784	//     "bucketId": {
4785	//       "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.",
4786	//       "location": "query",
4787	//       "type": "string"
4788	//     },
4789	//     "parent": {
4790	//       "description": "Required. The resource in which to create the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" Example: \"projects/my-logging-project/locations/global\"",
4791	//       "location": "path",
4792	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+$",
4793	//       "required": true,
4794	//       "type": "string"
4795	//     }
4796	//   },
4797	//   "path": "v2/{+parent}/buckets",
4798	//   "request": {
4799	//     "$ref": "LogBucket"
4800	//   },
4801	//   "response": {
4802	//     "$ref": "LogBucket"
4803	//   },
4804	//   "scopes": [
4805	//     "https://www.googleapis.com/auth/cloud-platform",
4806	//     "https://www.googleapis.com/auth/logging.admin"
4807	//   ]
4808	// }
4809
4810}
4811
4812// method id "logging.billingAccounts.locations.buckets.delete":
4813
4814type BillingAccountsLocationsBucketsDeleteCall struct {
4815	s          *Service
4816	name       string
4817	urlParams_ gensupport.URLParams
4818	ctx_       context.Context
4819	header_    http.Header
4820}
4821
4822// Delete: Deletes a bucket. Moves the bucket to the DELETE_REQUESTED
4823// state. After 7 days, the bucket will be purged and all logs in the
4824// bucket will be permanently deleted.
4825func (r *BillingAccountsLocationsBucketsService) Delete(name string) *BillingAccountsLocationsBucketsDeleteCall {
4826	c := &BillingAccountsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4827	c.name = name
4828	return c
4829}
4830
4831// Fields allows partial responses to be retrieved. See
4832// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4833// for more information.
4834func (c *BillingAccountsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsDeleteCall {
4835	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4836	return c
4837}
4838
4839// Context sets the context to be used in this call's Do method. Any
4840// pending HTTP request will be aborted if the provided context is
4841// canceled.
4842func (c *BillingAccountsLocationsBucketsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsDeleteCall {
4843	c.ctx_ = ctx
4844	return c
4845}
4846
4847// Header returns an http.Header that can be modified by the caller to
4848// add HTTP headers to the request.
4849func (c *BillingAccountsLocationsBucketsDeleteCall) Header() http.Header {
4850	if c.header_ == nil {
4851		c.header_ = make(http.Header)
4852	}
4853	return c.header_
4854}
4855
4856func (c *BillingAccountsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
4857	reqHeaders := make(http.Header)
4858	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4859	for k, v := range c.header_ {
4860		reqHeaders[k] = v
4861	}
4862	reqHeaders.Set("User-Agent", c.s.userAgent())
4863	var body io.Reader = nil
4864	c.urlParams_.Set("alt", alt)
4865	c.urlParams_.Set("prettyPrint", "false")
4866	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4867	urls += "?" + c.urlParams_.Encode()
4868	req, err := http.NewRequest("DELETE", urls, body)
4869	if err != nil {
4870		return nil, err
4871	}
4872	req.Header = reqHeaders
4873	googleapi.Expand(req.URL, map[string]string{
4874		"name": c.name,
4875	})
4876	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4877}
4878
4879// Do executes the "logging.billingAccounts.locations.buckets.delete" call.
4880// Exactly one of *Empty or error will be non-nil. Any non-2xx status
4881// code is an error. Response headers are in either
4882// *Empty.ServerResponse.Header or (if a response was returned at all)
4883// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4884// check whether the returned error was because http.StatusNotModified
4885// was returned.
4886func (c *BillingAccountsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4887	gensupport.SetOptions(c.urlParams_, opts...)
4888	res, err := c.doRequest("json")
4889	if res != nil && res.StatusCode == http.StatusNotModified {
4890		if res.Body != nil {
4891			res.Body.Close()
4892		}
4893		return nil, &googleapi.Error{
4894			Code:   res.StatusCode,
4895			Header: res.Header,
4896		}
4897	}
4898	if err != nil {
4899		return nil, err
4900	}
4901	defer googleapi.CloseBody(res)
4902	if err := googleapi.CheckResponse(res); err != nil {
4903		return nil, err
4904	}
4905	ret := &Empty{
4906		ServerResponse: googleapi.ServerResponse{
4907			Header:         res.Header,
4908			HTTPStatusCode: res.StatusCode,
4909		},
4910	}
4911	target := &ret
4912	if err := gensupport.DecodeResponse(target, res); err != nil {
4913		return nil, err
4914	}
4915	return ret, nil
4916	// {
4917	//   "description": "Deletes a bucket. Moves the bucket to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all logs in the bucket will be permanently deleted.",
4918	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}",
4919	//   "httpMethod": "DELETE",
4920	//   "id": "logging.billingAccounts.locations.buckets.delete",
4921	//   "parameterOrder": [
4922	//     "name"
4923	//   ],
4924	//   "parameters": {
4925	//     "name": {
4926	//       "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
4927	//       "location": "path",
4928	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
4929	//       "required": true,
4930	//       "type": "string"
4931	//     }
4932	//   },
4933	//   "path": "v2/{+name}",
4934	//   "response": {
4935	//     "$ref": "Empty"
4936	//   },
4937	//   "scopes": [
4938	//     "https://www.googleapis.com/auth/cloud-platform",
4939	//     "https://www.googleapis.com/auth/logging.admin"
4940	//   ]
4941	// }
4942
4943}
4944
4945// method id "logging.billingAccounts.locations.buckets.list":
4946
4947type BillingAccountsLocationsBucketsListCall struct {
4948	s            *Service
4949	parent       string
4950	urlParams_   gensupport.URLParams
4951	ifNoneMatch_ string
4952	ctx_         context.Context
4953	header_      http.Header
4954}
4955
4956// List: Lists buckets.
4957func (r *BillingAccountsLocationsBucketsService) List(parent string) *BillingAccountsLocationsBucketsListCall {
4958	c := &BillingAccountsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4959	c.parent = parent
4960	return c
4961}
4962
4963// PageSize sets the optional parameter "pageSize": The maximum number
4964// of results to return from this request. Non-positive values are
4965// ignored. The presence of nextPageToken in the response indicates that
4966// more results might be available.
4967func (c *BillingAccountsLocationsBucketsListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsListCall {
4968	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4969	return c
4970}
4971
4972// PageToken sets the optional parameter "pageToken": If present, then
4973// retrieve the next batch of results from the preceding call to this
4974// method. pageToken must be the value of nextPageToken from the
4975// previous response. The values of other method parameters should be
4976// identical to those in the previous call.
4977func (c *BillingAccountsLocationsBucketsListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsListCall {
4978	c.urlParams_.Set("pageToken", pageToken)
4979	return c
4980}
4981
4982// Fields allows partial responses to be retrieved. See
4983// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4984// for more information.
4985func (c *BillingAccountsLocationsBucketsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsListCall {
4986	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4987	return c
4988}
4989
4990// IfNoneMatch sets the optional parameter which makes the operation
4991// fail if the object's ETag matches the given value. This is useful for
4992// getting updates only after the object has changed since the last
4993// request. Use googleapi.IsNotModified to check whether the response
4994// error from Do is the result of In-None-Match.
4995func (c *BillingAccountsLocationsBucketsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsListCall {
4996	c.ifNoneMatch_ = entityTag
4997	return c
4998}
4999
5000// Context sets the context to be used in this call's Do method. Any
5001// pending HTTP request will be aborted if the provided context is
5002// canceled.
5003func (c *BillingAccountsLocationsBucketsListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsListCall {
5004	c.ctx_ = ctx
5005	return c
5006}
5007
5008// Header returns an http.Header that can be modified by the caller to
5009// add HTTP headers to the request.
5010func (c *BillingAccountsLocationsBucketsListCall) Header() http.Header {
5011	if c.header_ == nil {
5012		c.header_ = make(http.Header)
5013	}
5014	return c.header_
5015}
5016
5017func (c *BillingAccountsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
5018	reqHeaders := make(http.Header)
5019	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5020	for k, v := range c.header_ {
5021		reqHeaders[k] = v
5022	}
5023	reqHeaders.Set("User-Agent", c.s.userAgent())
5024	if c.ifNoneMatch_ != "" {
5025		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5026	}
5027	var body io.Reader = nil
5028	c.urlParams_.Set("alt", alt)
5029	c.urlParams_.Set("prettyPrint", "false")
5030	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
5031	urls += "?" + c.urlParams_.Encode()
5032	req, err := http.NewRequest("GET", urls, body)
5033	if err != nil {
5034		return nil, err
5035	}
5036	req.Header = reqHeaders
5037	googleapi.Expand(req.URL, map[string]string{
5038		"parent": c.parent,
5039	})
5040	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5041}
5042
5043// Do executes the "logging.billingAccounts.locations.buckets.list" call.
5044// Exactly one of *ListBucketsResponse or error will be non-nil. Any
5045// non-2xx status code is an error. Response headers are in either
5046// *ListBucketsResponse.ServerResponse.Header or (if a response was
5047// returned at all) in error.(*googleapi.Error).Header. Use
5048// googleapi.IsNotModified to check whether the returned error was
5049// because http.StatusNotModified was returned.
5050func (c *BillingAccountsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
5051	gensupport.SetOptions(c.urlParams_, opts...)
5052	res, err := c.doRequest("json")
5053	if res != nil && res.StatusCode == http.StatusNotModified {
5054		if res.Body != nil {
5055			res.Body.Close()
5056		}
5057		return nil, &googleapi.Error{
5058			Code:   res.StatusCode,
5059			Header: res.Header,
5060		}
5061	}
5062	if err != nil {
5063		return nil, err
5064	}
5065	defer googleapi.CloseBody(res)
5066	if err := googleapi.CheckResponse(res); err != nil {
5067		return nil, err
5068	}
5069	ret := &ListBucketsResponse{
5070		ServerResponse: googleapi.ServerResponse{
5071			Header:         res.Header,
5072			HTTPStatusCode: res.StatusCode,
5073		},
5074	}
5075	target := &ret
5076	if err := gensupport.DecodeResponse(target, res); err != nil {
5077		return nil, err
5078	}
5079	return ret, nil
5080	// {
5081	//   "description": "Lists buckets.",
5082	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets",
5083	//   "httpMethod": "GET",
5084	//   "id": "logging.billingAccounts.locations.buckets.list",
5085	//   "parameterOrder": [
5086	//     "parent"
5087	//   ],
5088	//   "parameters": {
5089	//     "pageSize": {
5090	//       "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.",
5091	//       "format": "int32",
5092	//       "location": "query",
5093	//       "type": "integer"
5094	//     },
5095	//     "pageToken": {
5096	//       "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.",
5097	//       "location": "query",
5098	//       "type": "string"
5099	//     },
5100	//     "parent": {
5101	//       "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.",
5102	//       "location": "path",
5103	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+$",
5104	//       "required": true,
5105	//       "type": "string"
5106	//     }
5107	//   },
5108	//   "path": "v2/{+parent}/buckets",
5109	//   "response": {
5110	//     "$ref": "ListBucketsResponse"
5111	//   },
5112	//   "scopes": [
5113	//     "https://www.googleapis.com/auth/cloud-platform",
5114	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5115	//     "https://www.googleapis.com/auth/logging.admin",
5116	//     "https://www.googleapis.com/auth/logging.read"
5117	//   ]
5118	// }
5119
5120}
5121
5122// Pages invokes f for each page of results.
5123// A non-nil error returned from f will halt the iteration.
5124// The provided context supersedes any context provided to the Context method.
5125func (c *BillingAccountsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
5126	c.ctx_ = ctx
5127	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
5128	for {
5129		x, err := c.Do()
5130		if err != nil {
5131			return err
5132		}
5133		if err := f(x); err != nil {
5134			return err
5135		}
5136		if x.NextPageToken == "" {
5137			return nil
5138		}
5139		c.PageToken(x.NextPageToken)
5140	}
5141}
5142
5143// method id "logging.billingAccounts.locations.buckets.patch":
5144
5145type BillingAccountsLocationsBucketsPatchCall struct {
5146	s          *Service
5147	name       string
5148	logbucket  *LogBucket
5149	urlParams_ gensupport.URLParams
5150	ctx_       context.Context
5151	header_    http.Header
5152}
5153
5154// Patch: Updates a bucket. This method replaces the following fields in
5155// the existing bucket with values from the new bucket:
5156// retention_periodIf the retention period is decreased and the bucket
5157// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
5158// LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
5159// returned.A buckets region may not be modified after it is created.
5160func (r *BillingAccountsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *BillingAccountsLocationsBucketsPatchCall {
5161	c := &BillingAccountsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5162	c.name = name
5163	c.logbucket = logbucket
5164	return c
5165}
5166
5167// UpdateMask sets the optional parameter "updateMask": Required. Field
5168// mask that specifies the fields in bucket that need an update. A
5169// bucket field will be overwritten if, and only if, it is in the update
5170// mask. name and output only fields cannot be updated.For a detailed
5171// FieldMask definition, see
5172// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
5173// updateMask=retention_days.
5174func (c *BillingAccountsLocationsBucketsPatchCall) UpdateMask(updateMask string) *BillingAccountsLocationsBucketsPatchCall {
5175	c.urlParams_.Set("updateMask", updateMask)
5176	return c
5177}
5178
5179// Fields allows partial responses to be retrieved. See
5180// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5181// for more information.
5182func (c *BillingAccountsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsPatchCall {
5183	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5184	return c
5185}
5186
5187// Context sets the context to be used in this call's Do method. Any
5188// pending HTTP request will be aborted if the provided context is
5189// canceled.
5190func (c *BillingAccountsLocationsBucketsPatchCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsPatchCall {
5191	c.ctx_ = ctx
5192	return c
5193}
5194
5195// Header returns an http.Header that can be modified by the caller to
5196// add HTTP headers to the request.
5197func (c *BillingAccountsLocationsBucketsPatchCall) Header() http.Header {
5198	if c.header_ == nil {
5199		c.header_ = make(http.Header)
5200	}
5201	return c.header_
5202}
5203
5204func (c *BillingAccountsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
5205	reqHeaders := make(http.Header)
5206	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5207	for k, v := range c.header_ {
5208		reqHeaders[k] = v
5209	}
5210	reqHeaders.Set("User-Agent", c.s.userAgent())
5211	var body io.Reader = nil
5212	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
5213	if err != nil {
5214		return nil, err
5215	}
5216	reqHeaders.Set("Content-Type", "application/json")
5217	c.urlParams_.Set("alt", alt)
5218	c.urlParams_.Set("prettyPrint", "false")
5219	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
5220	urls += "?" + c.urlParams_.Encode()
5221	req, err := http.NewRequest("PATCH", urls, body)
5222	if err != nil {
5223		return nil, err
5224	}
5225	req.Header = reqHeaders
5226	googleapi.Expand(req.URL, map[string]string{
5227		"name": c.name,
5228	})
5229	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5230}
5231
5232// Do executes the "logging.billingAccounts.locations.buckets.patch" call.
5233// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
5234// status code is an error. Response headers are in either
5235// *LogBucket.ServerResponse.Header or (if a response was returned at
5236// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5237// to check whether the returned error was because
5238// http.StatusNotModified was returned.
5239func (c *BillingAccountsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
5240	gensupport.SetOptions(c.urlParams_, opts...)
5241	res, err := c.doRequest("json")
5242	if res != nil && res.StatusCode == http.StatusNotModified {
5243		if res.Body != nil {
5244			res.Body.Close()
5245		}
5246		return nil, &googleapi.Error{
5247			Code:   res.StatusCode,
5248			Header: res.Header,
5249		}
5250	}
5251	if err != nil {
5252		return nil, err
5253	}
5254	defer googleapi.CloseBody(res)
5255	if err := googleapi.CheckResponse(res); err != nil {
5256		return nil, err
5257	}
5258	ret := &LogBucket{
5259		ServerResponse: googleapi.ServerResponse{
5260			Header:         res.Header,
5261			HTTPStatusCode: res.StatusCode,
5262		},
5263	}
5264	target := &ret
5265	if err := gensupport.DecodeResponse(target, res); err != nil {
5266		return nil, err
5267	}
5268	return ret, nil
5269	// {
5270	//   "description": "Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created.",
5271	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}",
5272	//   "httpMethod": "PATCH",
5273	//   "id": "logging.billingAccounts.locations.buckets.patch",
5274	//   "parameterOrder": [
5275	//     "name"
5276	//   ],
5277	//   "parameters": {
5278	//     "name": {
5279	//       "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\". Also requires permission \"resourcemanager.projects.updateLiens\" to set the locked property",
5280	//       "location": "path",
5281	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5282	//       "required": true,
5283	//       "type": "string"
5284	//     },
5285	//     "updateMask": {
5286	//       "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days.",
5287	//       "format": "google-fieldmask",
5288	//       "location": "query",
5289	//       "type": "string"
5290	//     }
5291	//   },
5292	//   "path": "v2/{+name}",
5293	//   "request": {
5294	//     "$ref": "LogBucket"
5295	//   },
5296	//   "response": {
5297	//     "$ref": "LogBucket"
5298	//   },
5299	//   "scopes": [
5300	//     "https://www.googleapis.com/auth/cloud-platform",
5301	//     "https://www.googleapis.com/auth/logging.admin"
5302	//   ]
5303	// }
5304
5305}
5306
5307// method id "logging.billingAccounts.locations.buckets.undelete":
5308
5309type BillingAccountsLocationsBucketsUndeleteCall struct {
5310	s                     *Service
5311	name                  string
5312	undeletebucketrequest *UndeleteBucketRequest
5313	urlParams_            gensupport.URLParams
5314	ctx_                  context.Context
5315	header_               http.Header
5316}
5317
5318// Undelete: Undeletes a bucket. A bucket that has been deleted may be
5319// undeleted within the grace period of 7 days.
5320func (r *BillingAccountsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *BillingAccountsLocationsBucketsUndeleteCall {
5321	c := &BillingAccountsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5322	c.name = name
5323	c.undeletebucketrequest = undeletebucketrequest
5324	return c
5325}
5326
5327// Fields allows partial responses to be retrieved. See
5328// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5329// for more information.
5330func (c *BillingAccountsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsUndeleteCall {
5331	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5332	return c
5333}
5334
5335// Context sets the context to be used in this call's Do method. Any
5336// pending HTTP request will be aborted if the provided context is
5337// canceled.
5338func (c *BillingAccountsLocationsBucketsUndeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsUndeleteCall {
5339	c.ctx_ = ctx
5340	return c
5341}
5342
5343// Header returns an http.Header that can be modified by the caller to
5344// add HTTP headers to the request.
5345func (c *BillingAccountsLocationsBucketsUndeleteCall) Header() http.Header {
5346	if c.header_ == nil {
5347		c.header_ = make(http.Header)
5348	}
5349	return c.header_
5350}
5351
5352func (c *BillingAccountsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
5353	reqHeaders := make(http.Header)
5354	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5355	for k, v := range c.header_ {
5356		reqHeaders[k] = v
5357	}
5358	reqHeaders.Set("User-Agent", c.s.userAgent())
5359	var body io.Reader = nil
5360	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
5361	if err != nil {
5362		return nil, err
5363	}
5364	reqHeaders.Set("Content-Type", "application/json")
5365	c.urlParams_.Set("alt", alt)
5366	c.urlParams_.Set("prettyPrint", "false")
5367	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
5368	urls += "?" + c.urlParams_.Encode()
5369	req, err := http.NewRequest("POST", urls, body)
5370	if err != nil {
5371		return nil, err
5372	}
5373	req.Header = reqHeaders
5374	googleapi.Expand(req.URL, map[string]string{
5375		"name": c.name,
5376	})
5377	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5378}
5379
5380// Do executes the "logging.billingAccounts.locations.buckets.undelete" call.
5381// Exactly one of *Empty or error will be non-nil. Any non-2xx status
5382// code is an error. Response headers are in either
5383// *Empty.ServerResponse.Header or (if a response was returned at all)
5384// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5385// check whether the returned error was because http.StatusNotModified
5386// was returned.
5387func (c *BillingAccountsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5388	gensupport.SetOptions(c.urlParams_, opts...)
5389	res, err := c.doRequest("json")
5390	if res != nil && res.StatusCode == http.StatusNotModified {
5391		if res.Body != nil {
5392			res.Body.Close()
5393		}
5394		return nil, &googleapi.Error{
5395			Code:   res.StatusCode,
5396			Header: res.Header,
5397		}
5398	}
5399	if err != nil {
5400		return nil, err
5401	}
5402	defer googleapi.CloseBody(res)
5403	if err := googleapi.CheckResponse(res); err != nil {
5404		return nil, err
5405	}
5406	ret := &Empty{
5407		ServerResponse: googleapi.ServerResponse{
5408			Header:         res.Header,
5409			HTTPStatusCode: res.StatusCode,
5410		},
5411	}
5412	target := &ret
5413	if err := gensupport.DecodeResponse(target, res); err != nil {
5414		return nil, err
5415	}
5416	return ret, nil
5417	// {
5418	//   "description": "Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.",
5419	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
5420	//   "httpMethod": "POST",
5421	//   "id": "logging.billingAccounts.locations.buckets.undelete",
5422	//   "parameterOrder": [
5423	//     "name"
5424	//   ],
5425	//   "parameters": {
5426	//     "name": {
5427	//       "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
5428	//       "location": "path",
5429	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5430	//       "required": true,
5431	//       "type": "string"
5432	//     }
5433	//   },
5434	//   "path": "v2/{+name}:undelete",
5435	//   "request": {
5436	//     "$ref": "UndeleteBucketRequest"
5437	//   },
5438	//   "response": {
5439	//     "$ref": "Empty"
5440	//   },
5441	//   "scopes": [
5442	//     "https://www.googleapis.com/auth/cloud-platform",
5443	//     "https://www.googleapis.com/auth/logging.admin"
5444	//   ]
5445	// }
5446
5447}
5448
5449// method id "logging.billingAccounts.locations.buckets.views.create":
5450
5451type BillingAccountsLocationsBucketsViewsCreateCall struct {
5452	s          *Service
5453	parent     string
5454	logview    *LogView
5455	urlParams_ gensupport.URLParams
5456	ctx_       context.Context
5457	header_    http.Header
5458}
5459
5460// Create: Creates a view over logs in a bucket. A bucket may contain a
5461// maximum of 50 views.
5462func (r *BillingAccountsLocationsBucketsViewsService) Create(parent string, logview *LogView) *BillingAccountsLocationsBucketsViewsCreateCall {
5463	c := &BillingAccountsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5464	c.parent = parent
5465	c.logview = logview
5466	return c
5467}
5468
5469// ViewId sets the optional parameter "viewId": Required. The id to use
5470// for this view.
5471func (c *BillingAccountsLocationsBucketsViewsCreateCall) ViewId(viewId string) *BillingAccountsLocationsBucketsViewsCreateCall {
5472	c.urlParams_.Set("viewId", viewId)
5473	return c
5474}
5475
5476// Fields allows partial responses to be retrieved. See
5477// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5478// for more information.
5479func (c *BillingAccountsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsCreateCall {
5480	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5481	return c
5482}
5483
5484// Context sets the context to be used in this call's Do method. Any
5485// pending HTTP request will be aborted if the provided context is
5486// canceled.
5487func (c *BillingAccountsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsCreateCall {
5488	c.ctx_ = ctx
5489	return c
5490}
5491
5492// Header returns an http.Header that can be modified by the caller to
5493// add HTTP headers to the request.
5494func (c *BillingAccountsLocationsBucketsViewsCreateCall) Header() http.Header {
5495	if c.header_ == nil {
5496		c.header_ = make(http.Header)
5497	}
5498	return c.header_
5499}
5500
5501func (c *BillingAccountsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
5502	reqHeaders := make(http.Header)
5503	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5504	for k, v := range c.header_ {
5505		reqHeaders[k] = v
5506	}
5507	reqHeaders.Set("User-Agent", c.s.userAgent())
5508	var body io.Reader = nil
5509	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
5510	if err != nil {
5511		return nil, err
5512	}
5513	reqHeaders.Set("Content-Type", "application/json")
5514	c.urlParams_.Set("alt", alt)
5515	c.urlParams_.Set("prettyPrint", "false")
5516	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
5517	urls += "?" + c.urlParams_.Encode()
5518	req, err := http.NewRequest("POST", urls, body)
5519	if err != nil {
5520		return nil, err
5521	}
5522	req.Header = reqHeaders
5523	googleapi.Expand(req.URL, map[string]string{
5524		"parent": c.parent,
5525	})
5526	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5527}
5528
5529// Do executes the "logging.billingAccounts.locations.buckets.views.create" call.
5530// Exactly one of *LogView or error will be non-nil. Any non-2xx status
5531// code is an error. Response headers are in either
5532// *LogView.ServerResponse.Header or (if a response was returned at all)
5533// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5534// check whether the returned error was because http.StatusNotModified
5535// was returned.
5536func (c *BillingAccountsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
5537	gensupport.SetOptions(c.urlParams_, opts...)
5538	res, err := c.doRequest("json")
5539	if res != nil && res.StatusCode == http.StatusNotModified {
5540		if res.Body != nil {
5541			res.Body.Close()
5542		}
5543		return nil, &googleapi.Error{
5544			Code:   res.StatusCode,
5545			Header: res.Header,
5546		}
5547	}
5548	if err != nil {
5549		return nil, err
5550	}
5551	defer googleapi.CloseBody(res)
5552	if err := googleapi.CheckResponse(res); err != nil {
5553		return nil, err
5554	}
5555	ret := &LogView{
5556		ServerResponse: googleapi.ServerResponse{
5557			Header:         res.Header,
5558			HTTPStatusCode: res.StatusCode,
5559		},
5560	}
5561	target := &ret
5562	if err := gensupport.DecodeResponse(target, res); err != nil {
5563		return nil, err
5564	}
5565	return ret, nil
5566	// {
5567	//   "description": "Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.",
5568	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views",
5569	//   "httpMethod": "POST",
5570	//   "id": "logging.billingAccounts.locations.buckets.views.create",
5571	//   "parameterOrder": [
5572	//     "parent"
5573	//   ],
5574	//   "parameters": {
5575	//     "parent": {
5576	//       "description": "Required. The bucket in which to create the view \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-logging-project/locations/my-location/buckets/my-bucket\"",
5577	//       "location": "path",
5578	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5579	//       "required": true,
5580	//       "type": "string"
5581	//     },
5582	//     "viewId": {
5583	//       "description": "Required. The id to use for this view.",
5584	//       "location": "query",
5585	//       "type": "string"
5586	//     }
5587	//   },
5588	//   "path": "v2/{+parent}/views",
5589	//   "request": {
5590	//     "$ref": "LogView"
5591	//   },
5592	//   "response": {
5593	//     "$ref": "LogView"
5594	//   },
5595	//   "scopes": [
5596	//     "https://www.googleapis.com/auth/cloud-platform",
5597	//     "https://www.googleapis.com/auth/logging.admin"
5598	//   ]
5599	// }
5600
5601}
5602
5603// method id "logging.billingAccounts.locations.buckets.views.delete":
5604
5605type BillingAccountsLocationsBucketsViewsDeleteCall struct {
5606	s          *Service
5607	name       string
5608	urlParams_ gensupport.URLParams
5609	ctx_       context.Context
5610	header_    http.Header
5611}
5612
5613// Delete: Deletes a view from a bucket.
5614func (r *BillingAccountsLocationsBucketsViewsService) Delete(name string) *BillingAccountsLocationsBucketsViewsDeleteCall {
5615	c := &BillingAccountsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5616	c.name = name
5617	return c
5618}
5619
5620// Fields allows partial responses to be retrieved. See
5621// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5622// for more information.
5623func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsDeleteCall {
5624	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5625	return c
5626}
5627
5628// Context sets the context to be used in this call's Do method. Any
5629// pending HTTP request will be aborted if the provided context is
5630// canceled.
5631func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsDeleteCall {
5632	c.ctx_ = ctx
5633	return c
5634}
5635
5636// Header returns an http.Header that can be modified by the caller to
5637// add HTTP headers to the request.
5638func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Header() http.Header {
5639	if c.header_ == nil {
5640		c.header_ = make(http.Header)
5641	}
5642	return c.header_
5643}
5644
5645func (c *BillingAccountsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
5646	reqHeaders := make(http.Header)
5647	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5648	for k, v := range c.header_ {
5649		reqHeaders[k] = v
5650	}
5651	reqHeaders.Set("User-Agent", c.s.userAgent())
5652	var body io.Reader = nil
5653	c.urlParams_.Set("alt", alt)
5654	c.urlParams_.Set("prettyPrint", "false")
5655	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
5656	urls += "?" + c.urlParams_.Encode()
5657	req, err := http.NewRequest("DELETE", urls, body)
5658	if err != nil {
5659		return nil, err
5660	}
5661	req.Header = reqHeaders
5662	googleapi.Expand(req.URL, map[string]string{
5663		"name": c.name,
5664	})
5665	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5666}
5667
5668// Do executes the "logging.billingAccounts.locations.buckets.views.delete" call.
5669// Exactly one of *Empty or error will be non-nil. Any non-2xx status
5670// code is an error. Response headers are in either
5671// *Empty.ServerResponse.Header or (if a response was returned at all)
5672// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5673// check whether the returned error was because http.StatusNotModified
5674// was returned.
5675func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5676	gensupport.SetOptions(c.urlParams_, opts...)
5677	res, err := c.doRequest("json")
5678	if res != nil && res.StatusCode == http.StatusNotModified {
5679		if res.Body != nil {
5680			res.Body.Close()
5681		}
5682		return nil, &googleapi.Error{
5683			Code:   res.StatusCode,
5684			Header: res.Header,
5685		}
5686	}
5687	if err != nil {
5688		return nil, err
5689	}
5690	defer googleapi.CloseBody(res)
5691	if err := googleapi.CheckResponse(res); err != nil {
5692		return nil, err
5693	}
5694	ret := &Empty{
5695		ServerResponse: googleapi.ServerResponse{
5696			Header:         res.Header,
5697			HTTPStatusCode: res.StatusCode,
5698		},
5699	}
5700	target := &ret
5701	if err := gensupport.DecodeResponse(target, res); err != nil {
5702		return nil, err
5703	}
5704	return ret, nil
5705	// {
5706	//   "description": "Deletes a view from a bucket.",
5707	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
5708	//   "httpMethod": "DELETE",
5709	//   "id": "logging.billingAccounts.locations.buckets.views.delete",
5710	//   "parameterOrder": [
5711	//     "name"
5712	//   ],
5713	//   "parameters": {
5714	//     "name": {
5715	//       "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
5716	//       "location": "path",
5717	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
5718	//       "required": true,
5719	//       "type": "string"
5720	//     }
5721	//   },
5722	//   "path": "v2/{+name}",
5723	//   "response": {
5724	//     "$ref": "Empty"
5725	//   },
5726	//   "scopes": [
5727	//     "https://www.googleapis.com/auth/cloud-platform",
5728	//     "https://www.googleapis.com/auth/logging.admin"
5729	//   ]
5730	// }
5731
5732}
5733
5734// method id "logging.billingAccounts.locations.buckets.views.list":
5735
5736type BillingAccountsLocationsBucketsViewsListCall struct {
5737	s            *Service
5738	parent       string
5739	urlParams_   gensupport.URLParams
5740	ifNoneMatch_ string
5741	ctx_         context.Context
5742	header_      http.Header
5743}
5744
5745// List: Lists views on a bucket.
5746func (r *BillingAccountsLocationsBucketsViewsService) List(parent string) *BillingAccountsLocationsBucketsViewsListCall {
5747	c := &BillingAccountsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5748	c.parent = parent
5749	return c
5750}
5751
5752// PageSize sets the optional parameter "pageSize": The maximum number
5753// of results to return from this request. Non-positive values are
5754// ignored. The presence of nextPageToken in the response indicates that
5755// more results might be available.
5756func (c *BillingAccountsLocationsBucketsViewsListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsViewsListCall {
5757	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5758	return c
5759}
5760
5761// PageToken sets the optional parameter "pageToken": If present, then
5762// retrieve the next batch of results from the preceding call to this
5763// method. pageToken must be the value of nextPageToken from the
5764// previous response. The values of other method parameters should be
5765// identical to those in the previous call.
5766func (c *BillingAccountsLocationsBucketsViewsListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsViewsListCall {
5767	c.urlParams_.Set("pageToken", pageToken)
5768	return c
5769}
5770
5771// Fields allows partial responses to be retrieved. See
5772// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5773// for more information.
5774func (c *BillingAccountsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsListCall {
5775	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5776	return c
5777}
5778
5779// IfNoneMatch sets the optional parameter which makes the operation
5780// fail if the object's ETag matches the given value. This is useful for
5781// getting updates only after the object has changed since the last
5782// request. Use googleapi.IsNotModified to check whether the response
5783// error from Do is the result of In-None-Match.
5784func (c *BillingAccountsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsViewsListCall {
5785	c.ifNoneMatch_ = entityTag
5786	return c
5787}
5788
5789// Context sets the context to be used in this call's Do method. Any
5790// pending HTTP request will be aborted if the provided context is
5791// canceled.
5792func (c *BillingAccountsLocationsBucketsViewsListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsListCall {
5793	c.ctx_ = ctx
5794	return c
5795}
5796
5797// Header returns an http.Header that can be modified by the caller to
5798// add HTTP headers to the request.
5799func (c *BillingAccountsLocationsBucketsViewsListCall) Header() http.Header {
5800	if c.header_ == nil {
5801		c.header_ = make(http.Header)
5802	}
5803	return c.header_
5804}
5805
5806func (c *BillingAccountsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
5807	reqHeaders := make(http.Header)
5808	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5809	for k, v := range c.header_ {
5810		reqHeaders[k] = v
5811	}
5812	reqHeaders.Set("User-Agent", c.s.userAgent())
5813	if c.ifNoneMatch_ != "" {
5814		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5815	}
5816	var body io.Reader = nil
5817	c.urlParams_.Set("alt", alt)
5818	c.urlParams_.Set("prettyPrint", "false")
5819	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
5820	urls += "?" + c.urlParams_.Encode()
5821	req, err := http.NewRequest("GET", urls, body)
5822	if err != nil {
5823		return nil, err
5824	}
5825	req.Header = reqHeaders
5826	googleapi.Expand(req.URL, map[string]string{
5827		"parent": c.parent,
5828	})
5829	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5830}
5831
5832// Do executes the "logging.billingAccounts.locations.buckets.views.list" call.
5833// Exactly one of *ListViewsResponse or error will be non-nil. Any
5834// non-2xx status code is an error. Response headers are in either
5835// *ListViewsResponse.ServerResponse.Header or (if a response was
5836// returned at all) in error.(*googleapi.Error).Header. Use
5837// googleapi.IsNotModified to check whether the returned error was
5838// because http.StatusNotModified was returned.
5839func (c *BillingAccountsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
5840	gensupport.SetOptions(c.urlParams_, opts...)
5841	res, err := c.doRequest("json")
5842	if res != nil && res.StatusCode == http.StatusNotModified {
5843		if res.Body != nil {
5844			res.Body.Close()
5845		}
5846		return nil, &googleapi.Error{
5847			Code:   res.StatusCode,
5848			Header: res.Header,
5849		}
5850	}
5851	if err != nil {
5852		return nil, err
5853	}
5854	defer googleapi.CloseBody(res)
5855	if err := googleapi.CheckResponse(res); err != nil {
5856		return nil, err
5857	}
5858	ret := &ListViewsResponse{
5859		ServerResponse: googleapi.ServerResponse{
5860			Header:         res.Header,
5861			HTTPStatusCode: res.StatusCode,
5862		},
5863	}
5864	target := &ret
5865	if err := gensupport.DecodeResponse(target, res); err != nil {
5866		return nil, err
5867	}
5868	return ret, nil
5869	// {
5870	//   "description": "Lists views on a bucket.",
5871	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views",
5872	//   "httpMethod": "GET",
5873	//   "id": "logging.billingAccounts.locations.buckets.views.list",
5874	//   "parameterOrder": [
5875	//     "parent"
5876	//   ],
5877	//   "parameters": {
5878	//     "pageSize": {
5879	//       "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.",
5880	//       "format": "int32",
5881	//       "location": "query",
5882	//       "type": "integer"
5883	//     },
5884	//     "pageToken": {
5885	//       "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.",
5886	//       "location": "query",
5887	//       "type": "string"
5888	//     },
5889	//     "parent": {
5890	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
5891	//       "location": "path",
5892	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5893	//       "required": true,
5894	//       "type": "string"
5895	//     }
5896	//   },
5897	//   "path": "v2/{+parent}/views",
5898	//   "response": {
5899	//     "$ref": "ListViewsResponse"
5900	//   },
5901	//   "scopes": [
5902	//     "https://www.googleapis.com/auth/cloud-platform",
5903	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5904	//     "https://www.googleapis.com/auth/logging.admin",
5905	//     "https://www.googleapis.com/auth/logging.read"
5906	//   ]
5907	// }
5908
5909}
5910
5911// Pages invokes f for each page of results.
5912// A non-nil error returned from f will halt the iteration.
5913// The provided context supersedes any context provided to the Context method.
5914func (c *BillingAccountsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
5915	c.ctx_ = ctx
5916	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
5917	for {
5918		x, err := c.Do()
5919		if err != nil {
5920			return err
5921		}
5922		if err := f(x); err != nil {
5923			return err
5924		}
5925		if x.NextPageToken == "" {
5926			return nil
5927		}
5928		c.PageToken(x.NextPageToken)
5929	}
5930}
5931
5932// method id "logging.billingAccounts.locations.buckets.views.patch":
5933
5934type BillingAccountsLocationsBucketsViewsPatchCall struct {
5935	s          *Service
5936	name       string
5937	logview    *LogView
5938	urlParams_ gensupport.URLParams
5939	ctx_       context.Context
5940	header_    http.Header
5941}
5942
5943// Patch: Updates a view. This method replaces the following fields in
5944// the existing view with values from the new view: filter.
5945func (r *BillingAccountsLocationsBucketsViewsService) Patch(name string, logview *LogView) *BillingAccountsLocationsBucketsViewsPatchCall {
5946	c := &BillingAccountsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5947	c.name = name
5948	c.logview = logview
5949	return c
5950}
5951
5952// UpdateMask sets the optional parameter "updateMask": Field mask that
5953// specifies the fields in view that need an update. A field will be
5954// overwritten if, and only if, it is in the update mask. name and
5955// output only fields cannot be updated.For a detailed FieldMask
5956// definition, see
5957// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
5958// updateMask=filter.
5959func (c *BillingAccountsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *BillingAccountsLocationsBucketsViewsPatchCall {
5960	c.urlParams_.Set("updateMask", updateMask)
5961	return c
5962}
5963
5964// Fields allows partial responses to be retrieved. See
5965// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5966// for more information.
5967func (c *BillingAccountsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsPatchCall {
5968	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5969	return c
5970}
5971
5972// Context sets the context to be used in this call's Do method. Any
5973// pending HTTP request will be aborted if the provided context is
5974// canceled.
5975func (c *BillingAccountsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsPatchCall {
5976	c.ctx_ = ctx
5977	return c
5978}
5979
5980// Header returns an http.Header that can be modified by the caller to
5981// add HTTP headers to the request.
5982func (c *BillingAccountsLocationsBucketsViewsPatchCall) Header() http.Header {
5983	if c.header_ == nil {
5984		c.header_ = make(http.Header)
5985	}
5986	return c.header_
5987}
5988
5989func (c *BillingAccountsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
5990	reqHeaders := make(http.Header)
5991	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5992	for k, v := range c.header_ {
5993		reqHeaders[k] = v
5994	}
5995	reqHeaders.Set("User-Agent", c.s.userAgent())
5996	var body io.Reader = nil
5997	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
5998	if err != nil {
5999		return nil, err
6000	}
6001	reqHeaders.Set("Content-Type", "application/json")
6002	c.urlParams_.Set("alt", alt)
6003	c.urlParams_.Set("prettyPrint", "false")
6004	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
6005	urls += "?" + c.urlParams_.Encode()
6006	req, err := http.NewRequest("PATCH", urls, body)
6007	if err != nil {
6008		return nil, err
6009	}
6010	req.Header = reqHeaders
6011	googleapi.Expand(req.URL, map[string]string{
6012		"name": c.name,
6013	})
6014	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6015}
6016
6017// Do executes the "logging.billingAccounts.locations.buckets.views.patch" call.
6018// Exactly one of *LogView or error will be non-nil. Any non-2xx status
6019// code is an error. Response headers are in either
6020// *LogView.ServerResponse.Header or (if a response was returned at all)
6021// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6022// check whether the returned error was because http.StatusNotModified
6023// was returned.
6024func (c *BillingAccountsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
6025	gensupport.SetOptions(c.urlParams_, opts...)
6026	res, err := c.doRequest("json")
6027	if res != nil && res.StatusCode == http.StatusNotModified {
6028		if res.Body != nil {
6029			res.Body.Close()
6030		}
6031		return nil, &googleapi.Error{
6032			Code:   res.StatusCode,
6033			Header: res.Header,
6034		}
6035	}
6036	if err != nil {
6037		return nil, err
6038	}
6039	defer googleapi.CloseBody(res)
6040	if err := googleapi.CheckResponse(res); err != nil {
6041		return nil, err
6042	}
6043	ret := &LogView{
6044		ServerResponse: googleapi.ServerResponse{
6045			Header:         res.Header,
6046			HTTPStatusCode: res.StatusCode,
6047		},
6048	}
6049	target := &ret
6050	if err := gensupport.DecodeResponse(target, res); err != nil {
6051		return nil, err
6052	}
6053	return ret, nil
6054	// {
6055	//   "description": "Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.",
6056	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
6057	//   "httpMethod": "PATCH",
6058	//   "id": "logging.billingAccounts.locations.buckets.views.patch",
6059	//   "parameterOrder": [
6060	//     "name"
6061	//   ],
6062	//   "parameters": {
6063	//     "name": {
6064	//       "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
6065	//       "location": "path",
6066	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
6067	//       "required": true,
6068	//       "type": "string"
6069	//     },
6070	//     "updateMask": {
6071	//       "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
6072	//       "format": "google-fieldmask",
6073	//       "location": "query",
6074	//       "type": "string"
6075	//     }
6076	//   },
6077	//   "path": "v2/{+name}",
6078	//   "request": {
6079	//     "$ref": "LogView"
6080	//   },
6081	//   "response": {
6082	//     "$ref": "LogView"
6083	//   },
6084	//   "scopes": [
6085	//     "https://www.googleapis.com/auth/cloud-platform",
6086	//     "https://www.googleapis.com/auth/logging.admin"
6087	//   ]
6088	// }
6089
6090}
6091
6092// method id "logging.billingAccounts.logs.delete":
6093
6094type BillingAccountsLogsDeleteCall struct {
6095	s          *Service
6096	logName    string
6097	urlParams_ gensupport.URLParams
6098	ctx_       context.Context
6099	header_    http.Header
6100}
6101
6102// Delete: Deletes all the log entries in a log. The log reappears if it
6103// receives new entries. Log entries written shortly before the delete
6104// operation might not be deleted. Entries received after the delete
6105// operation with a timestamp before the operation will be deleted.
6106func (r *BillingAccountsLogsService) Delete(logName string) *BillingAccountsLogsDeleteCall {
6107	c := &BillingAccountsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6108	c.logName = logName
6109	return c
6110}
6111
6112// Fields allows partial responses to be retrieved. See
6113// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6114// for more information.
6115func (c *BillingAccountsLogsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLogsDeleteCall {
6116	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6117	return c
6118}
6119
6120// Context sets the context to be used in this call's Do method. Any
6121// pending HTTP request will be aborted if the provided context is
6122// canceled.
6123func (c *BillingAccountsLogsDeleteCall) Context(ctx context.Context) *BillingAccountsLogsDeleteCall {
6124	c.ctx_ = ctx
6125	return c
6126}
6127
6128// Header returns an http.Header that can be modified by the caller to
6129// add HTTP headers to the request.
6130func (c *BillingAccountsLogsDeleteCall) Header() http.Header {
6131	if c.header_ == nil {
6132		c.header_ = make(http.Header)
6133	}
6134	return c.header_
6135}
6136
6137func (c *BillingAccountsLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
6138	reqHeaders := make(http.Header)
6139	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
6140	for k, v := range c.header_ {
6141		reqHeaders[k] = v
6142	}
6143	reqHeaders.Set("User-Agent", c.s.userAgent())
6144	var body io.Reader = nil
6145	c.urlParams_.Set("alt", alt)
6146	c.urlParams_.Set("prettyPrint", "false")
6147	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
6148	urls += "?" + c.urlParams_.Encode()
6149	req, err := http.NewRequest("DELETE", urls, body)
6150	if err != nil {
6151		return nil, err
6152	}
6153	req.Header = reqHeaders
6154	googleapi.Expand(req.URL, map[string]string{
6155		"logName": c.logName,
6156	})
6157	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6158}
6159
6160// Do executes the "logging.billingAccounts.logs.delete" call.
6161// Exactly one of *Empty or error will be non-nil. Any non-2xx status
6162// code is an error. Response headers are in either
6163// *Empty.ServerResponse.Header or (if a response was returned at all)
6164// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6165// check whether the returned error was because http.StatusNotModified
6166// was returned.
6167func (c *BillingAccountsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6168	gensupport.SetOptions(c.urlParams_, opts...)
6169	res, err := c.doRequest("json")
6170	if res != nil && res.StatusCode == http.StatusNotModified {
6171		if res.Body != nil {
6172			res.Body.Close()
6173		}
6174		return nil, &googleapi.Error{
6175			Code:   res.StatusCode,
6176			Header: res.Header,
6177		}
6178	}
6179	if err != nil {
6180		return nil, err
6181	}
6182	defer googleapi.CloseBody(res)
6183	if err := googleapi.CheckResponse(res); err != nil {
6184		return nil, err
6185	}
6186	ret := &Empty{
6187		ServerResponse: googleapi.ServerResponse{
6188			Header:         res.Header,
6189			HTTPStatusCode: res.StatusCode,
6190		},
6191	}
6192	target := &ret
6193	if err := gensupport.DecodeResponse(target, res); err != nil {
6194		return nil, err
6195	}
6196	return ret, nil
6197	// {
6198	//   "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. Entries received after the delete operation with a timestamp before the operation will be deleted.",
6199	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}",
6200	//   "httpMethod": "DELETE",
6201	//   "id": "logging.billingAccounts.logs.delete",
6202	//   "parameterOrder": [
6203	//     "logName"
6204	//   ],
6205	//   "parameters": {
6206	//     "logName": {
6207	//       "description": "Required. The resource name of the log to delete: \"projects/[PROJECT_ID]/logs/[LOG_ID]\" \"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\" \"folders/[FOLDER_ID]/logs/[LOG_ID]\" [LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.",
6208	//       "location": "path",
6209	//       "pattern": "^billingAccounts/[^/]+/logs/[^/]+$",
6210	//       "required": true,
6211	//       "type": "string"
6212	//     }
6213	//   },
6214	//   "path": "v2/{+logName}",
6215	//   "response": {
6216	//     "$ref": "Empty"
6217	//   },
6218	//   "scopes": [
6219	//     "https://www.googleapis.com/auth/cloud-platform",
6220	//     "https://www.googleapis.com/auth/logging.admin"
6221	//   ]
6222	// }
6223
6224}
6225
6226// method id "logging.billingAccounts.logs.list":
6227
6228type BillingAccountsLogsListCall struct {
6229	s            *Service
6230	parent       string
6231	urlParams_   gensupport.URLParams
6232	ifNoneMatch_ string
6233	ctx_         context.Context
6234	header_      http.Header
6235}
6236
6237// List: Lists the logs in projects, organizations, folders, or billing
6238// accounts. Only logs that have entries are listed.
6239func (r *BillingAccountsLogsService) List(parent string) *BillingAccountsLogsListCall {
6240	c := &BillingAccountsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6241	c.parent = parent
6242	return c
6243}
6244
6245// PageSize sets the optional parameter "pageSize": The maximum number
6246// of results to return from this request. Non-positive values are
6247// ignored. The presence of nextPageToken in the response indicates that
6248// more results might be available.
6249func (c *BillingAccountsLogsListCall) PageSize(pageSize int64) *BillingAccountsLogsListCall {
6250	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6251	return c
6252}
6253
6254// PageToken sets the optional parameter "pageToken": If present, then
6255// retrieve the next batch of results from the preceding call to this
6256// method. pageToken must be the value of nextPageToken from the
6257// previous response. The values of other method parameters should be
6258// identical to those in the previous call.
6259func (c *BillingAccountsLogsListCall) PageToken(pageToken string) *BillingAccountsLogsListCall {
6260	c.urlParams_.Set("pageToken", pageToken)
6261	return c
6262}
6263
6264// ResourceNames sets the optional parameter "resourceNames": The
6265// resource name that owns the logs:
6266// projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW
6267// _ID
6268// organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/v
6269// iews/VIEW_ID
6270// billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKE
6271// T_ID/views/VIEW_ID
6272// folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_I
6273// DTo support legacy queries, it could also be: "projects/PROJECT_ID"
6274// "organizations/ORGANIZATION_ID" "billingAccounts/BILLING_ACCOUNT_ID"
6275// "folders/FOLDER_ID"
6276func (c *BillingAccountsLogsListCall) ResourceNames(resourceNames ...string) *BillingAccountsLogsListCall {
6277	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
6278	return c
6279}
6280
6281// Fields allows partial responses to be retrieved. See
6282// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6283// for more information.
6284func (c *BillingAccountsLogsListCall) Fields(s ...googleapi.Field) *BillingAccountsLogsListCall {
6285	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6286	return c
6287}
6288
6289// IfNoneMatch sets the optional parameter which makes the operation
6290// fail if the object's ETag matches the given value. This is useful for
6291// getting updates only after the object has changed since the last
6292// request. Use googleapi.IsNotModified to check whether the response
6293// error from Do is the result of In-None-Match.
6294func (c *BillingAccountsLogsListCall) IfNoneMatch(entityTag string) *BillingAccountsLogsListCall {
6295	c.ifNoneMatch_ = entityTag
6296	return c
6297}
6298
6299// Context sets the context to be used in this call's Do method. Any
6300// pending HTTP request will be aborted if the provided context is
6301// canceled.
6302func (c *BillingAccountsLogsListCall) Context(ctx context.Context) *BillingAccountsLogsListCall {
6303	c.ctx_ = ctx
6304	return c
6305}
6306
6307// Header returns an http.Header that can be modified by the caller to
6308// add HTTP headers to the request.
6309func (c *BillingAccountsLogsListCall) Header() http.Header {
6310	if c.header_ == nil {
6311		c.header_ = make(http.Header)
6312	}
6313	return c.header_
6314}
6315
6316func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, error) {
6317	reqHeaders := make(http.Header)
6318	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
6319	for k, v := range c.header_ {
6320		reqHeaders[k] = v
6321	}
6322	reqHeaders.Set("User-Agent", c.s.userAgent())
6323	if c.ifNoneMatch_ != "" {
6324		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6325	}
6326	var body io.Reader = nil
6327	c.urlParams_.Set("alt", alt)
6328	c.urlParams_.Set("prettyPrint", "false")
6329	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
6330	urls += "?" + c.urlParams_.Encode()
6331	req, err := http.NewRequest("GET", urls, body)
6332	if err != nil {
6333		return nil, err
6334	}
6335	req.Header = reqHeaders
6336	googleapi.Expand(req.URL, map[string]string{
6337		"parent": c.parent,
6338	})
6339	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6340}
6341
6342// Do executes the "logging.billingAccounts.logs.list" call.
6343// Exactly one of *ListLogsResponse or error will be non-nil. Any
6344// non-2xx status code is an error. Response headers are in either
6345// *ListLogsResponse.ServerResponse.Header or (if a response was
6346// returned at all) in error.(*googleapi.Error).Header. Use
6347// googleapi.IsNotModified to check whether the returned error was
6348// because http.StatusNotModified was returned.
6349func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
6350	gensupport.SetOptions(c.urlParams_, opts...)
6351	res, err := c.doRequest("json")
6352	if res != nil && res.StatusCode == http.StatusNotModified {
6353		if res.Body != nil {
6354			res.Body.Close()
6355		}
6356		return nil, &googleapi.Error{
6357			Code:   res.StatusCode,
6358			Header: res.Header,
6359		}
6360	}
6361	if err != nil {
6362		return nil, err
6363	}
6364	defer googleapi.CloseBody(res)
6365	if err := googleapi.CheckResponse(res); err != nil {
6366		return nil, err
6367	}
6368	ret := &ListLogsResponse{
6369		ServerResponse: googleapi.ServerResponse{
6370			Header:         res.Header,
6371			HTTPStatusCode: res.StatusCode,
6372		},
6373	}
6374	target := &ret
6375	if err := gensupport.DecodeResponse(target, res); err != nil {
6376		return nil, err
6377	}
6378	return ret, nil
6379	// {
6380	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
6381	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/logs",
6382	//   "httpMethod": "GET",
6383	//   "id": "logging.billingAccounts.logs.list",
6384	//   "parameterOrder": [
6385	//     "parent"
6386	//   ],
6387	//   "parameters": {
6388	//     "pageSize": {
6389	//       "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.",
6390	//       "format": "int32",
6391	//       "location": "query",
6392	//       "type": "integer"
6393	//     },
6394	//     "pageToken": {
6395	//       "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.",
6396	//       "location": "query",
6397	//       "type": "string"
6398	//     },
6399	//     "parent": {
6400	//       "description": "Required. The resource name that owns the logs: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
6401	//       "location": "path",
6402	//       "pattern": "^billingAccounts/[^/]+$",
6403	//       "required": true,
6404	//       "type": "string"
6405	//     },
6406	//     "resourceNames": {
6407	//       "description": "Optional. The resource name that owns the logs: projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_IDTo support legacy queries, it could also be: \"projects/PROJECT_ID\" \"organizations/ORGANIZATION_ID\" \"billingAccounts/BILLING_ACCOUNT_ID\" \"folders/FOLDER_ID\"",
6408	//       "location": "query",
6409	//       "repeated": true,
6410	//       "type": "string"
6411	//     }
6412	//   },
6413	//   "path": "v2/{+parent}/logs",
6414	//   "response": {
6415	//     "$ref": "ListLogsResponse"
6416	//   },
6417	//   "scopes": [
6418	//     "https://www.googleapis.com/auth/cloud-platform",
6419	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
6420	//     "https://www.googleapis.com/auth/logging.admin",
6421	//     "https://www.googleapis.com/auth/logging.read"
6422	//   ]
6423	// }
6424
6425}
6426
6427// Pages invokes f for each page of results.
6428// A non-nil error returned from f will halt the iteration.
6429// The provided context supersedes any context provided to the Context method.
6430func (c *BillingAccountsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
6431	c.ctx_ = ctx
6432	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
6433	for {
6434		x, err := c.Do()
6435		if err != nil {
6436			return err
6437		}
6438		if err := f(x); err != nil {
6439			return err
6440		}
6441		if x.NextPageToken == "" {
6442			return nil
6443		}
6444		c.PageToken(x.NextPageToken)
6445	}
6446}
6447
6448// method id "logging.billingAccounts.sinks.create":
6449
6450type BillingAccountsSinksCreateCall struct {
6451	s          *Service
6452	parent     string
6453	logsink    *LogSink
6454	urlParams_ gensupport.URLParams
6455	ctx_       context.Context
6456	header_    http.Header
6457}
6458
6459// Create: Creates a sink that exports specified log entries to a
6460// destination. The export of newly-ingested log entries begins
6461// immediately, unless the sink's writer_identity is not permitted to
6462// write to the destination. A sink can export log entries only from the
6463// resource owning the sink.
6464func (r *BillingAccountsSinksService) Create(parent string, logsink *LogSink) *BillingAccountsSinksCreateCall {
6465	c := &BillingAccountsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6466	c.parent = parent
6467	c.logsink = logsink
6468	return c
6469}
6470
6471// UniqueWriterIdentity sets the optional parameter
6472// "uniqueWriterIdentity": Determines the kind of IAM identity returned
6473// as writer_identity in the new sink. If this value is omitted or set
6474// to false, and if the sink's parent is a project, then the value
6475// returned as writer_identity is the same group or service account used
6476// by Logging before the addition of writer identities to this API. The
6477// sink's destination must be in the same project as the sink itself.If
6478// this field is set to true, or if the sink is owned by a non-project
6479// resource such as an organization, then the value of writer_identity
6480// will be a unique service account used only for exports from the new
6481// sink. For more information, see writer_identity in LogSink.
6482func (c *BillingAccountsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksCreateCall {
6483	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
6484	return c
6485}
6486
6487// Fields allows partial responses to be retrieved. See
6488// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6489// for more information.
6490func (c *BillingAccountsSinksCreateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksCreateCall {
6491	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6492	return c
6493}
6494
6495// Context sets the context to be used in this call's Do method. Any
6496// pending HTTP request will be aborted if the provided context is
6497// canceled.
6498func (c *BillingAccountsSinksCreateCall) Context(ctx context.Context) *BillingAccountsSinksCreateCall {
6499	c.ctx_ = ctx
6500	return c
6501}
6502
6503// Header returns an http.Header that can be modified by the caller to
6504// add HTTP headers to the request.
6505func (c *BillingAccountsSinksCreateCall) Header() http.Header {
6506	if c.header_ == nil {
6507		c.header_ = make(http.Header)
6508	}
6509	return c.header_
6510}
6511
6512func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
6513	reqHeaders := make(http.Header)
6514	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
6515	for k, v := range c.header_ {
6516		reqHeaders[k] = v
6517	}
6518	reqHeaders.Set("User-Agent", c.s.userAgent())
6519	var body io.Reader = nil
6520	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
6521	if err != nil {
6522		return nil, err
6523	}
6524	reqHeaders.Set("Content-Type", "application/json")
6525	c.urlParams_.Set("alt", alt)
6526	c.urlParams_.Set("prettyPrint", "false")
6527	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
6528	urls += "?" + c.urlParams_.Encode()
6529	req, err := http.NewRequest("POST", urls, body)
6530	if err != nil {
6531		return nil, err
6532	}
6533	req.Header = reqHeaders
6534	googleapi.Expand(req.URL, map[string]string{
6535		"parent": c.parent,
6536	})
6537	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6538}
6539
6540// Do executes the "logging.billingAccounts.sinks.create" call.
6541// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
6542// code is an error. Response headers are in either
6543// *LogSink.ServerResponse.Header or (if a response was returned at all)
6544// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6545// check whether the returned error was because http.StatusNotModified
6546// was returned.
6547func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
6548	gensupport.SetOptions(c.urlParams_, opts...)
6549	res, err := c.doRequest("json")
6550	if res != nil && res.StatusCode == http.StatusNotModified {
6551		if res.Body != nil {
6552			res.Body.Close()
6553		}
6554		return nil, &googleapi.Error{
6555			Code:   res.StatusCode,
6556			Header: res.Header,
6557		}
6558	}
6559	if err != nil {
6560		return nil, err
6561	}
6562	defer googleapi.CloseBody(res)
6563	if err := googleapi.CheckResponse(res); err != nil {
6564		return nil, err
6565	}
6566	ret := &LogSink{
6567		ServerResponse: googleapi.ServerResponse{
6568			Header:         res.Header,
6569			HTTPStatusCode: res.StatusCode,
6570		},
6571	}
6572	target := &ret
6573	if err := gensupport.DecodeResponse(target, res); err != nil {
6574		return nil, err
6575	}
6576	return ret, nil
6577	// {
6578	//   "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.",
6579	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks",
6580	//   "httpMethod": "POST",
6581	//   "id": "logging.billingAccounts.sinks.create",
6582	//   "parameterOrder": [
6583	//     "parent"
6584	//   ],
6585	//   "parameters": {
6586	//     "parent": {
6587	//       "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" Examples: \"projects/my-logging-project\", \"organizations/123456789\".",
6588	//       "location": "path",
6589	//       "pattern": "^billingAccounts/[^/]+$",
6590	//       "required": true,
6591	//       "type": "string"
6592	//     },
6593	//     "uniqueWriterIdentity": {
6594	//       "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.",
6595	//       "location": "query",
6596	//       "type": "boolean"
6597	//     }
6598	//   },
6599	//   "path": "v2/{+parent}/sinks",
6600	//   "request": {
6601	//     "$ref": "LogSink"
6602	//   },
6603	//   "response": {
6604	//     "$ref": "LogSink"
6605	//   },
6606	//   "scopes": [
6607	//     "https://www.googleapis.com/auth/cloud-platform",
6608	//     "https://www.googleapis.com/auth/logging.admin"
6609	//   ]
6610	// }
6611
6612}
6613
6614// method id "logging.billingAccounts.sinks.delete":
6615
6616type BillingAccountsSinksDeleteCall struct {
6617	s          *Service
6618	sinkNameid string
6619	urlParams_ gensupport.URLParams
6620	ctx_       context.Context
6621	header_    http.Header
6622}
6623
6624// Delete: Deletes a sink. If the sink has a unique writer_identity,
6625// then that service account is also deleted.
6626func (r *BillingAccountsSinksService) Delete(sinkNameid string) *BillingAccountsSinksDeleteCall {
6627	c := &BillingAccountsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6628	c.sinkNameid = sinkNameid
6629	return c
6630}
6631
6632// Fields allows partial responses to be retrieved. See
6633// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6634// for more information.
6635func (c *BillingAccountsSinksDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsSinksDeleteCall {
6636	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6637	return c
6638}
6639
6640// Context sets the context to be used in this call's Do method. Any
6641// pending HTTP request will be aborted if the provided context is
6642// canceled.
6643func (c *BillingAccountsSinksDeleteCall) Context(ctx context.Context) *BillingAccountsSinksDeleteCall {
6644	c.ctx_ = ctx
6645	return c
6646}
6647
6648// Header returns an http.Header that can be modified by the caller to
6649// add HTTP headers to the request.
6650func (c *BillingAccountsSinksDeleteCall) Header() http.Header {
6651	if c.header_ == nil {
6652		c.header_ = make(http.Header)
6653	}
6654	return c.header_
6655}
6656
6657func (c *BillingAccountsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
6658	reqHeaders := make(http.Header)
6659	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
6660	for k, v := range c.header_ {
6661		reqHeaders[k] = v
6662	}
6663	reqHeaders.Set("User-Agent", c.s.userAgent())
6664	var body io.Reader = nil
6665	c.urlParams_.Set("alt", alt)
6666	c.urlParams_.Set("prettyPrint", "false")
6667	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
6668	urls += "?" + c.urlParams_.Encode()
6669	req, err := http.NewRequest("DELETE", urls, body)
6670	if err != nil {
6671		return nil, err
6672	}
6673	req.Header = reqHeaders
6674	googleapi.Expand(req.URL, map[string]string{
6675		"sinkName": c.sinkNameid,
6676	})
6677	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6678}
6679
6680// Do executes the "logging.billingAccounts.sinks.delete" call.
6681// Exactly one of *Empty or error will be non-nil. Any non-2xx status
6682// code is an error. Response headers are in either
6683// *Empty.ServerResponse.Header or (if a response was returned at all)
6684// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6685// check whether the returned error was because http.StatusNotModified
6686// was returned.
6687func (c *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6688	gensupport.SetOptions(c.urlParams_, opts...)
6689	res, err := c.doRequest("json")
6690	if res != nil && res.StatusCode == http.StatusNotModified {
6691		if res.Body != nil {
6692			res.Body.Close()
6693		}
6694		return nil, &googleapi.Error{
6695			Code:   res.StatusCode,
6696			Header: res.Header,
6697		}
6698	}
6699	if err != nil {
6700		return nil, err
6701	}
6702	defer googleapi.CloseBody(res)
6703	if err := googleapi.CheckResponse(res); err != nil {
6704		return nil, err
6705	}
6706	ret := &Empty{
6707		ServerResponse: googleapi.ServerResponse{
6708			Header:         res.Header,
6709			HTTPStatusCode: res.StatusCode,
6710		},
6711	}
6712	target := &ret
6713	if err := gensupport.DecodeResponse(target, res); err != nil {
6714		return nil, err
6715	}
6716	return ret, nil
6717	// {
6718	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
6719	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
6720	//   "httpMethod": "DELETE",
6721	//   "id": "logging.billingAccounts.sinks.delete",
6722	//   "parameterOrder": [
6723	//     "sinkName"
6724	//   ],
6725	//   "parameters": {
6726	//     "sinkName": {
6727	//       "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
6728	//       "location": "path",
6729	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
6730	//       "required": true,
6731	//       "type": "string"
6732	//     }
6733	//   },
6734	//   "path": "v2/{+sinkName}",
6735	//   "response": {
6736	//     "$ref": "Empty"
6737	//   },
6738	//   "scopes": [
6739	//     "https://www.googleapis.com/auth/cloud-platform",
6740	//     "https://www.googleapis.com/auth/logging.admin"
6741	//   ]
6742	// }
6743
6744}
6745
6746// method id "logging.billingAccounts.sinks.get":
6747
6748type BillingAccountsSinksGetCall struct {
6749	s            *Service
6750	sinkName     string
6751	urlParams_   gensupport.URLParams
6752	ifNoneMatch_ string
6753	ctx_         context.Context
6754	header_      http.Header
6755}
6756
6757// Get: Gets a sink.
6758func (r *BillingAccountsSinksService) Get(sinkName string) *BillingAccountsSinksGetCall {
6759	c := &BillingAccountsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6760	c.sinkName = sinkName
6761	return c
6762}
6763
6764// Fields allows partial responses to be retrieved. See
6765// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6766// for more information.
6767func (c *BillingAccountsSinksGetCall) Fields(s ...googleapi.Field) *BillingAccountsSinksGetCall {
6768	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6769	return c
6770}
6771
6772// IfNoneMatch sets the optional parameter which makes the operation
6773// fail if the object's ETag matches the given value. This is useful for
6774// getting updates only after the object has changed since the last
6775// request. Use googleapi.IsNotModified to check whether the response
6776// error from Do is the result of In-None-Match.
6777func (c *BillingAccountsSinksGetCall) IfNoneMatch(entityTag string) *BillingAccountsSinksGetCall {
6778	c.ifNoneMatch_ = entityTag
6779	return c
6780}
6781
6782// Context sets the context to be used in this call's Do method. Any
6783// pending HTTP request will be aborted if the provided context is
6784// canceled.
6785func (c *BillingAccountsSinksGetCall) Context(ctx context.Context) *BillingAccountsSinksGetCall {
6786	c.ctx_ = ctx
6787	return c
6788}
6789
6790// Header returns an http.Header that can be modified by the caller to
6791// add HTTP headers to the request.
6792func (c *BillingAccountsSinksGetCall) Header() http.Header {
6793	if c.header_ == nil {
6794		c.header_ = make(http.Header)
6795	}
6796	return c.header_
6797}
6798
6799func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, error) {
6800	reqHeaders := make(http.Header)
6801	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
6802	for k, v := range c.header_ {
6803		reqHeaders[k] = v
6804	}
6805	reqHeaders.Set("User-Agent", c.s.userAgent())
6806	if c.ifNoneMatch_ != "" {
6807		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6808	}
6809	var body io.Reader = nil
6810	c.urlParams_.Set("alt", alt)
6811	c.urlParams_.Set("prettyPrint", "false")
6812	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
6813	urls += "?" + c.urlParams_.Encode()
6814	req, err := http.NewRequest("GET", urls, body)
6815	if err != nil {
6816		return nil, err
6817	}
6818	req.Header = reqHeaders
6819	googleapi.Expand(req.URL, map[string]string{
6820		"sinkName": c.sinkName,
6821	})
6822	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6823}
6824
6825// Do executes the "logging.billingAccounts.sinks.get" call.
6826// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
6827// code is an error. Response headers are in either
6828// *LogSink.ServerResponse.Header or (if a response was returned at all)
6829// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6830// check whether the returned error was because http.StatusNotModified
6831// was returned.
6832func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
6833	gensupport.SetOptions(c.urlParams_, opts...)
6834	res, err := c.doRequest("json")
6835	if res != nil && res.StatusCode == http.StatusNotModified {
6836		if res.Body != nil {
6837			res.Body.Close()
6838		}
6839		return nil, &googleapi.Error{
6840			Code:   res.StatusCode,
6841			Header: res.Header,
6842		}
6843	}
6844	if err != nil {
6845		return nil, err
6846	}
6847	defer googleapi.CloseBody(res)
6848	if err := googleapi.CheckResponse(res); err != nil {
6849		return nil, err
6850	}
6851	ret := &LogSink{
6852		ServerResponse: googleapi.ServerResponse{
6853			Header:         res.Header,
6854			HTTPStatusCode: res.StatusCode,
6855		},
6856	}
6857	target := &ret
6858	if err := gensupport.DecodeResponse(target, res); err != nil {
6859		return nil, err
6860	}
6861	return ret, nil
6862	// {
6863	//   "description": "Gets a sink.",
6864	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
6865	//   "httpMethod": "GET",
6866	//   "id": "logging.billingAccounts.sinks.get",
6867	//   "parameterOrder": [
6868	//     "sinkName"
6869	//   ],
6870	//   "parameters": {
6871	//     "sinkName": {
6872	//       "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
6873	//       "location": "path",
6874	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
6875	//       "required": true,
6876	//       "type": "string"
6877	//     }
6878	//   },
6879	//   "path": "v2/{+sinkName}",
6880	//   "response": {
6881	//     "$ref": "LogSink"
6882	//   },
6883	//   "scopes": [
6884	//     "https://www.googleapis.com/auth/cloud-platform",
6885	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
6886	//     "https://www.googleapis.com/auth/logging.admin",
6887	//     "https://www.googleapis.com/auth/logging.read"
6888	//   ]
6889	// }
6890
6891}
6892
6893// method id "logging.billingAccounts.sinks.list":
6894
6895type BillingAccountsSinksListCall struct {
6896	s            *Service
6897	parent       string
6898	urlParams_   gensupport.URLParams
6899	ifNoneMatch_ string
6900	ctx_         context.Context
6901	header_      http.Header
6902}
6903
6904// List: Lists sinks.
6905func (r *BillingAccountsSinksService) List(parent string) *BillingAccountsSinksListCall {
6906	c := &BillingAccountsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6907	c.parent = parent
6908	return c
6909}
6910
6911// PageSize sets the optional parameter "pageSize": The maximum number
6912// of results to return from this request. Non-positive values are
6913// ignored. The presence of nextPageToken in the response indicates that
6914// more results might be available.
6915func (c *BillingAccountsSinksListCall) PageSize(pageSize int64) *BillingAccountsSinksListCall {
6916	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6917	return c
6918}
6919
6920// PageToken sets the optional parameter "pageToken": If present, then
6921// retrieve the next batch of results from the preceding call to this
6922// method. pageToken must be the value of nextPageToken from the
6923// previous response. The values of other method parameters should be
6924// identical to those in the previous call.
6925func (c *BillingAccountsSinksListCall) PageToken(pageToken string) *BillingAccountsSinksListCall {
6926	c.urlParams_.Set("pageToken", pageToken)
6927	return c
6928}
6929
6930// Fields allows partial responses to be retrieved. See
6931// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6932// for more information.
6933func (c *BillingAccountsSinksListCall) Fields(s ...googleapi.Field) *BillingAccountsSinksListCall {
6934	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6935	return c
6936}
6937
6938// IfNoneMatch sets the optional parameter which makes the operation
6939// fail if the object's ETag matches the given value. This is useful for
6940// getting updates only after the object has changed since the last
6941// request. Use googleapi.IsNotModified to check whether the response
6942// error from Do is the result of In-None-Match.
6943func (c *BillingAccountsSinksListCall) IfNoneMatch(entityTag string) *BillingAccountsSinksListCall {
6944	c.ifNoneMatch_ = entityTag
6945	return c
6946}
6947
6948// Context sets the context to be used in this call's Do method. Any
6949// pending HTTP request will be aborted if the provided context is
6950// canceled.
6951func (c *BillingAccountsSinksListCall) Context(ctx context.Context) *BillingAccountsSinksListCall {
6952	c.ctx_ = ctx
6953	return c
6954}
6955
6956// Header returns an http.Header that can be modified by the caller to
6957// add HTTP headers to the request.
6958func (c *BillingAccountsSinksListCall) Header() http.Header {
6959	if c.header_ == nil {
6960		c.header_ = make(http.Header)
6961	}
6962	return c.header_
6963}
6964
6965func (c *BillingAccountsSinksListCall) doRequest(alt string) (*http.Response, error) {
6966	reqHeaders := make(http.Header)
6967	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
6968	for k, v := range c.header_ {
6969		reqHeaders[k] = v
6970	}
6971	reqHeaders.Set("User-Agent", c.s.userAgent())
6972	if c.ifNoneMatch_ != "" {
6973		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6974	}
6975	var body io.Reader = nil
6976	c.urlParams_.Set("alt", alt)
6977	c.urlParams_.Set("prettyPrint", "false")
6978	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
6979	urls += "?" + c.urlParams_.Encode()
6980	req, err := http.NewRequest("GET", urls, body)
6981	if err != nil {
6982		return nil, err
6983	}
6984	req.Header = reqHeaders
6985	googleapi.Expand(req.URL, map[string]string{
6986		"parent": c.parent,
6987	})
6988	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6989}
6990
6991// Do executes the "logging.billingAccounts.sinks.list" call.
6992// Exactly one of *ListSinksResponse or error will be non-nil. Any
6993// non-2xx status code is an error. Response headers are in either
6994// *ListSinksResponse.ServerResponse.Header or (if a response was
6995// returned at all) in error.(*googleapi.Error).Header. Use
6996// googleapi.IsNotModified to check whether the returned error was
6997// because http.StatusNotModified was returned.
6998func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
6999	gensupport.SetOptions(c.urlParams_, opts...)
7000	res, err := c.doRequest("json")
7001	if res != nil && res.StatusCode == http.StatusNotModified {
7002		if res.Body != nil {
7003			res.Body.Close()
7004		}
7005		return nil, &googleapi.Error{
7006			Code:   res.StatusCode,
7007			Header: res.Header,
7008		}
7009	}
7010	if err != nil {
7011		return nil, err
7012	}
7013	defer googleapi.CloseBody(res)
7014	if err := googleapi.CheckResponse(res); err != nil {
7015		return nil, err
7016	}
7017	ret := &ListSinksResponse{
7018		ServerResponse: googleapi.ServerResponse{
7019			Header:         res.Header,
7020			HTTPStatusCode: res.StatusCode,
7021		},
7022	}
7023	target := &ret
7024	if err := gensupport.DecodeResponse(target, res); err != nil {
7025		return nil, err
7026	}
7027	return ret, nil
7028	// {
7029	//   "description": "Lists sinks.",
7030	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks",
7031	//   "httpMethod": "GET",
7032	//   "id": "logging.billingAccounts.sinks.list",
7033	//   "parameterOrder": [
7034	//     "parent"
7035	//   ],
7036	//   "parameters": {
7037	//     "pageSize": {
7038	//       "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.",
7039	//       "format": "int32",
7040	//       "location": "query",
7041	//       "type": "integer"
7042	//     },
7043	//     "pageToken": {
7044	//       "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.",
7045	//       "location": "query",
7046	//       "type": "string"
7047	//     },
7048	//     "parent": {
7049	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
7050	//       "location": "path",
7051	//       "pattern": "^billingAccounts/[^/]+$",
7052	//       "required": true,
7053	//       "type": "string"
7054	//     }
7055	//   },
7056	//   "path": "v2/{+parent}/sinks",
7057	//   "response": {
7058	//     "$ref": "ListSinksResponse"
7059	//   },
7060	//   "scopes": [
7061	//     "https://www.googleapis.com/auth/cloud-platform",
7062	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7063	//     "https://www.googleapis.com/auth/logging.admin",
7064	//     "https://www.googleapis.com/auth/logging.read"
7065	//   ]
7066	// }
7067
7068}
7069
7070// Pages invokes f for each page of results.
7071// A non-nil error returned from f will halt the iteration.
7072// The provided context supersedes any context provided to the Context method.
7073func (c *BillingAccountsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
7074	c.ctx_ = ctx
7075	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
7076	for {
7077		x, err := c.Do()
7078		if err != nil {
7079			return err
7080		}
7081		if err := f(x); err != nil {
7082			return err
7083		}
7084		if x.NextPageToken == "" {
7085			return nil
7086		}
7087		c.PageToken(x.NextPageToken)
7088	}
7089}
7090
7091// method id "logging.billingAccounts.sinks.patch":
7092
7093type BillingAccountsSinksPatchCall struct {
7094	s          *Service
7095	sinkNameid string
7096	logsink    *LogSink
7097	urlParams_ gensupport.URLParams
7098	ctx_       context.Context
7099	header_    http.Header
7100}
7101
7102// Patch: Updates a sink. This method replaces the following fields in
7103// the existing sink with values from the new sink: destination, and
7104// filter.The updated sink might also have a new writer_identity; see
7105// the unique_writer_identity field.
7106func (r *BillingAccountsSinksService) Patch(sinkNameid string, logsink *LogSink) *BillingAccountsSinksPatchCall {
7107	c := &BillingAccountsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7108	c.sinkNameid = sinkNameid
7109	c.logsink = logsink
7110	return c
7111}
7112
7113// UniqueWriterIdentity sets the optional parameter
7114// "uniqueWriterIdentity": See sinks.create for a description of this
7115// field. When updating a sink, the effect of this field on the value of
7116// writer_identity in the updated sink depends on both the old and new
7117// values of this field: If the old and new values of this field are
7118// both false or both true, then there is no change to the sink's
7119// writer_identity. If the old value is false and the new value is true,
7120// then writer_identity is changed to a unique service account. It is an
7121// error if the old value is true and the new value is set to false or
7122// defaulted to false.
7123func (c *BillingAccountsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksPatchCall {
7124	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
7125	return c
7126}
7127
7128// UpdateMask sets the optional parameter "updateMask": Field mask that
7129// specifies the fields in sink that need an update. A sink field will
7130// be overwritten if, and only if, it is in the update mask. name and
7131// output only fields cannot be updated.An empty updateMask is
7132// temporarily treated as using the following mask for backwards
7133// compatibility purposes: destination,filter,includeChildren At some
7134// point in the future, behavior will be removed and specifying an empty
7135// updateMask will be an error.For a detailed FieldMask definition, see
7136// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
7137// updateMask=filter.
7138func (c *BillingAccountsSinksPatchCall) UpdateMask(updateMask string) *BillingAccountsSinksPatchCall {
7139	c.urlParams_.Set("updateMask", updateMask)
7140	return c
7141}
7142
7143// Fields allows partial responses to be retrieved. See
7144// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7145// for more information.
7146func (c *BillingAccountsSinksPatchCall) Fields(s ...googleapi.Field) *BillingAccountsSinksPatchCall {
7147	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7148	return c
7149}
7150
7151// Context sets the context to be used in this call's Do method. Any
7152// pending HTTP request will be aborted if the provided context is
7153// canceled.
7154func (c *BillingAccountsSinksPatchCall) Context(ctx context.Context) *BillingAccountsSinksPatchCall {
7155	c.ctx_ = ctx
7156	return c
7157}
7158
7159// Header returns an http.Header that can be modified by the caller to
7160// add HTTP headers to the request.
7161func (c *BillingAccountsSinksPatchCall) Header() http.Header {
7162	if c.header_ == nil {
7163		c.header_ = make(http.Header)
7164	}
7165	return c.header_
7166}
7167
7168func (c *BillingAccountsSinksPatchCall) doRequest(alt string) (*http.Response, error) {
7169	reqHeaders := make(http.Header)
7170	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
7171	for k, v := range c.header_ {
7172		reqHeaders[k] = v
7173	}
7174	reqHeaders.Set("User-Agent", c.s.userAgent())
7175	var body io.Reader = nil
7176	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
7177	if err != nil {
7178		return nil, err
7179	}
7180	reqHeaders.Set("Content-Type", "application/json")
7181	c.urlParams_.Set("alt", alt)
7182	c.urlParams_.Set("prettyPrint", "false")
7183	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
7184	urls += "?" + c.urlParams_.Encode()
7185	req, err := http.NewRequest("PATCH", urls, body)
7186	if err != nil {
7187		return nil, err
7188	}
7189	req.Header = reqHeaders
7190	googleapi.Expand(req.URL, map[string]string{
7191		"sinkName": c.sinkNameid,
7192	})
7193	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7194}
7195
7196// Do executes the "logging.billingAccounts.sinks.patch" call.
7197// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
7198// code is an error. Response headers are in either
7199// *LogSink.ServerResponse.Header or (if a response was returned at all)
7200// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7201// check whether the returned error was because http.StatusNotModified
7202// was returned.
7203func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
7204	gensupport.SetOptions(c.urlParams_, opts...)
7205	res, err := c.doRequest("json")
7206	if res != nil && res.StatusCode == http.StatusNotModified {
7207		if res.Body != nil {
7208			res.Body.Close()
7209		}
7210		return nil, &googleapi.Error{
7211			Code:   res.StatusCode,
7212			Header: res.Header,
7213		}
7214	}
7215	if err != nil {
7216		return nil, err
7217	}
7218	defer googleapi.CloseBody(res)
7219	if err := googleapi.CheckResponse(res); err != nil {
7220		return nil, err
7221	}
7222	ret := &LogSink{
7223		ServerResponse: googleapi.ServerResponse{
7224			Header:         res.Header,
7225			HTTPStatusCode: res.StatusCode,
7226		},
7227	}
7228	target := &ret
7229	if err := gensupport.DecodeResponse(target, res); err != nil {
7230		return nil, err
7231	}
7232	return ret, nil
7233	// {
7234	//   "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.",
7235	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
7236	//   "httpMethod": "PATCH",
7237	//   "id": "logging.billingAccounts.sinks.patch",
7238	//   "parameterOrder": [
7239	//     "sinkName"
7240	//   ],
7241	//   "parameters": {
7242	//     "sinkName": {
7243	//       "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
7244	//       "location": "path",
7245	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
7246	//       "required": true,
7247	//       "type": "string"
7248	//     },
7249	//     "uniqueWriterIdentity": {
7250	//       "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: 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.",
7251	//       "location": "query",
7252	//       "type": "boolean"
7253	//     },
7254	//     "updateMask": {
7255	//       "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.",
7256	//       "format": "google-fieldmask",
7257	//       "location": "query",
7258	//       "type": "string"
7259	//     }
7260	//   },
7261	//   "path": "v2/{+sinkName}",
7262	//   "request": {
7263	//     "$ref": "LogSink"
7264	//   },
7265	//   "response": {
7266	//     "$ref": "LogSink"
7267	//   },
7268	//   "scopes": [
7269	//     "https://www.googleapis.com/auth/cloud-platform",
7270	//     "https://www.googleapis.com/auth/logging.admin"
7271	//   ]
7272	// }
7273
7274}
7275
7276// method id "logging.billingAccounts.sinks.update":
7277
7278type BillingAccountsSinksUpdateCall struct {
7279	s          *Service
7280	sinkNameid string
7281	logsink    *LogSink
7282	urlParams_ gensupport.URLParams
7283	ctx_       context.Context
7284	header_    http.Header
7285}
7286
7287// Update: Updates a sink. This method replaces the following fields in
7288// the existing sink with values from the new sink: destination, and
7289// filter.The updated sink might also have a new writer_identity; see
7290// the unique_writer_identity field.
7291func (r *BillingAccountsSinksService) Update(sinkNameid string, logsink *LogSink) *BillingAccountsSinksUpdateCall {
7292	c := &BillingAccountsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7293	c.sinkNameid = sinkNameid
7294	c.logsink = logsink
7295	return c
7296}
7297
7298// UniqueWriterIdentity sets the optional parameter
7299// "uniqueWriterIdentity": See sinks.create for a description of this
7300// field. When updating a sink, the effect of this field on the value of
7301// writer_identity in the updated sink depends on both the old and new
7302// values of this field: If the old and new values of this field are
7303// both false or both true, then there is no change to the sink's
7304// writer_identity. If the old value is false and the new value is true,
7305// then writer_identity is changed to a unique service account. It is an
7306// error if the old value is true and the new value is set to false or
7307// defaulted to false.
7308func (c *BillingAccountsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksUpdateCall {
7309	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
7310	return c
7311}
7312
7313// UpdateMask sets the optional parameter "updateMask": Field mask that
7314// specifies the fields in sink that need an update. A sink field will
7315// be overwritten if, and only if, it is in the update mask. name and
7316// output only fields cannot be updated.An empty updateMask is
7317// temporarily treated as using the following mask for backwards
7318// compatibility purposes: destination,filter,includeChildren At some
7319// point in the future, behavior will be removed and specifying an empty
7320// updateMask will be an error.For a detailed FieldMask definition, see
7321// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
7322// updateMask=filter.
7323func (c *BillingAccountsSinksUpdateCall) UpdateMask(updateMask string) *BillingAccountsSinksUpdateCall {
7324	c.urlParams_.Set("updateMask", updateMask)
7325	return c
7326}
7327
7328// Fields allows partial responses to be retrieved. See
7329// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7330// for more information.
7331func (c *BillingAccountsSinksUpdateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksUpdateCall {
7332	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7333	return c
7334}
7335
7336// Context sets the context to be used in this call's Do method. Any
7337// pending HTTP request will be aborted if the provided context is
7338// canceled.
7339func (c *BillingAccountsSinksUpdateCall) Context(ctx context.Context) *BillingAccountsSinksUpdateCall {
7340	c.ctx_ = ctx
7341	return c
7342}
7343
7344// Header returns an http.Header that can be modified by the caller to
7345// add HTTP headers to the request.
7346func (c *BillingAccountsSinksUpdateCall) Header() http.Header {
7347	if c.header_ == nil {
7348		c.header_ = make(http.Header)
7349	}
7350	return c.header_
7351}
7352
7353func (c *BillingAccountsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
7354	reqHeaders := make(http.Header)
7355	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
7356	for k, v := range c.header_ {
7357		reqHeaders[k] = v
7358	}
7359	reqHeaders.Set("User-Agent", c.s.userAgent())
7360	var body io.Reader = nil
7361	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
7362	if err != nil {
7363		return nil, err
7364	}
7365	reqHeaders.Set("Content-Type", "application/json")
7366	c.urlParams_.Set("alt", alt)
7367	c.urlParams_.Set("prettyPrint", "false")
7368	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
7369	urls += "?" + c.urlParams_.Encode()
7370	req, err := http.NewRequest("PUT", urls, body)
7371	if err != nil {
7372		return nil, err
7373	}
7374	req.Header = reqHeaders
7375	googleapi.Expand(req.URL, map[string]string{
7376		"sinkName": c.sinkNameid,
7377	})
7378	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7379}
7380
7381// Do executes the "logging.billingAccounts.sinks.update" call.
7382// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
7383// code is an error. Response headers are in either
7384// *LogSink.ServerResponse.Header or (if a response was returned at all)
7385// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7386// check whether the returned error was because http.StatusNotModified
7387// was returned.
7388func (c *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
7389	gensupport.SetOptions(c.urlParams_, opts...)
7390	res, err := c.doRequest("json")
7391	if res != nil && res.StatusCode == http.StatusNotModified {
7392		if res.Body != nil {
7393			res.Body.Close()
7394		}
7395		return nil, &googleapi.Error{
7396			Code:   res.StatusCode,
7397			Header: res.Header,
7398		}
7399	}
7400	if err != nil {
7401		return nil, err
7402	}
7403	defer googleapi.CloseBody(res)
7404	if err := googleapi.CheckResponse(res); err != nil {
7405		return nil, err
7406	}
7407	ret := &LogSink{
7408		ServerResponse: googleapi.ServerResponse{
7409			Header:         res.Header,
7410			HTTPStatusCode: res.StatusCode,
7411		},
7412	}
7413	target := &ret
7414	if err := gensupport.DecodeResponse(target, res); err != nil {
7415		return nil, err
7416	}
7417	return ret, nil
7418	// {
7419	//   "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.",
7420	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
7421	//   "httpMethod": "PUT",
7422	//   "id": "logging.billingAccounts.sinks.update",
7423	//   "parameterOrder": [
7424	//     "sinkName"
7425	//   ],
7426	//   "parameters": {
7427	//     "sinkName": {
7428	//       "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
7429	//       "location": "path",
7430	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
7431	//       "required": true,
7432	//       "type": "string"
7433	//     },
7434	//     "uniqueWriterIdentity": {
7435	//       "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: 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.",
7436	//       "location": "query",
7437	//       "type": "boolean"
7438	//     },
7439	//     "updateMask": {
7440	//       "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.",
7441	//       "format": "google-fieldmask",
7442	//       "location": "query",
7443	//       "type": "string"
7444	//     }
7445	//   },
7446	//   "path": "v2/{+sinkName}",
7447	//   "request": {
7448	//     "$ref": "LogSink"
7449	//   },
7450	//   "response": {
7451	//     "$ref": "LogSink"
7452	//   },
7453	//   "scopes": [
7454	//     "https://www.googleapis.com/auth/cloud-platform",
7455	//     "https://www.googleapis.com/auth/logging.admin"
7456	//   ]
7457	// }
7458
7459}
7460
7461// method id "logging.entries.list":
7462
7463type EntriesListCall struct {
7464	s                     *Service
7465	listlogentriesrequest *ListLogEntriesRequest
7466	urlParams_            gensupport.URLParams
7467	ctx_                  context.Context
7468	header_               http.Header
7469}
7470
7471// List: Lists log entries. Use this method to retrieve log entries that
7472// originated from a project/folder/organization/billing account. For
7473// ways to export log entries, see Exporting Logs
7474// (https://cloud.google.com/logging/docs/export).
7475func (r *EntriesService) List(listlogentriesrequest *ListLogEntriesRequest) *EntriesListCall {
7476	c := &EntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7477	c.listlogentriesrequest = listlogentriesrequest
7478	return c
7479}
7480
7481// Fields allows partial responses to be retrieved. See
7482// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7483// for more information.
7484func (c *EntriesListCall) Fields(s ...googleapi.Field) *EntriesListCall {
7485	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7486	return c
7487}
7488
7489// Context sets the context to be used in this call's Do method. Any
7490// pending HTTP request will be aborted if the provided context is
7491// canceled.
7492func (c *EntriesListCall) Context(ctx context.Context) *EntriesListCall {
7493	c.ctx_ = ctx
7494	return c
7495}
7496
7497// Header returns an http.Header that can be modified by the caller to
7498// add HTTP headers to the request.
7499func (c *EntriesListCall) Header() http.Header {
7500	if c.header_ == nil {
7501		c.header_ = make(http.Header)
7502	}
7503	return c.header_
7504}
7505
7506func (c *EntriesListCall) doRequest(alt string) (*http.Response, error) {
7507	reqHeaders := make(http.Header)
7508	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
7509	for k, v := range c.header_ {
7510		reqHeaders[k] = v
7511	}
7512	reqHeaders.Set("User-Agent", c.s.userAgent())
7513	var body io.Reader = nil
7514	body, err := googleapi.WithoutDataWrapper.JSONReader(c.listlogentriesrequest)
7515	if err != nil {
7516		return nil, err
7517	}
7518	reqHeaders.Set("Content-Type", "application/json")
7519	c.urlParams_.Set("alt", alt)
7520	c.urlParams_.Set("prettyPrint", "false")
7521	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:list")
7522	urls += "?" + c.urlParams_.Encode()
7523	req, err := http.NewRequest("POST", urls, body)
7524	if err != nil {
7525		return nil, err
7526	}
7527	req.Header = reqHeaders
7528	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7529}
7530
7531// Do executes the "logging.entries.list" call.
7532// Exactly one of *ListLogEntriesResponse or error will be non-nil. Any
7533// non-2xx status code is an error. Response headers are in either
7534// *ListLogEntriesResponse.ServerResponse.Header or (if a response was
7535// returned at all) in error.(*googleapi.Error).Header. Use
7536// googleapi.IsNotModified to check whether the returned error was
7537// because http.StatusNotModified was returned.
7538func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesResponse, error) {
7539	gensupport.SetOptions(c.urlParams_, opts...)
7540	res, err := c.doRequest("json")
7541	if res != nil && res.StatusCode == http.StatusNotModified {
7542		if res.Body != nil {
7543			res.Body.Close()
7544		}
7545		return nil, &googleapi.Error{
7546			Code:   res.StatusCode,
7547			Header: res.Header,
7548		}
7549	}
7550	if err != nil {
7551		return nil, err
7552	}
7553	defer googleapi.CloseBody(res)
7554	if err := googleapi.CheckResponse(res); err != nil {
7555		return nil, err
7556	}
7557	ret := &ListLogEntriesResponse{
7558		ServerResponse: googleapi.ServerResponse{
7559			Header:         res.Header,
7560			HTTPStatusCode: res.StatusCode,
7561		},
7562	}
7563	target := &ret
7564	if err := gensupport.DecodeResponse(target, res); err != nil {
7565		return nil, err
7566	}
7567	return ret, nil
7568	// {
7569	//   "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 (https://cloud.google.com/logging/docs/export).",
7570	//   "flatPath": "v2/entries:list",
7571	//   "httpMethod": "POST",
7572	//   "id": "logging.entries.list",
7573	//   "parameterOrder": [],
7574	//   "parameters": {},
7575	//   "path": "v2/entries:list",
7576	//   "request": {
7577	//     "$ref": "ListLogEntriesRequest"
7578	//   },
7579	//   "response": {
7580	//     "$ref": "ListLogEntriesResponse"
7581	//   },
7582	//   "scopes": [
7583	//     "https://www.googleapis.com/auth/cloud-platform",
7584	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7585	//     "https://www.googleapis.com/auth/logging.admin",
7586	//     "https://www.googleapis.com/auth/logging.read"
7587	//   ]
7588	// }
7589
7590}
7591
7592// Pages invokes f for each page of results.
7593// A non-nil error returned from f will halt the iteration.
7594// The provided context supersedes any context provided to the Context method.
7595func (c *EntriesListCall) Pages(ctx context.Context, f func(*ListLogEntriesResponse) error) error {
7596	c.ctx_ = ctx
7597	defer func(pt string) { c.listlogentriesrequest.PageToken = pt }(c.listlogentriesrequest.PageToken) // reset paging to original point
7598	for {
7599		x, err := c.Do()
7600		if err != nil {
7601			return err
7602		}
7603		if err := f(x); err != nil {
7604			return err
7605		}
7606		if x.NextPageToken == "" {
7607			return nil
7608		}
7609		c.listlogentriesrequest.PageToken = x.NextPageToken
7610	}
7611}
7612
7613// method id "logging.entries.tail":
7614
7615type EntriesTailCall struct {
7616	s                     *Service
7617	taillogentriesrequest *TailLogEntriesRequest
7618	urlParams_            gensupport.URLParams
7619	ctx_                  context.Context
7620	header_               http.Header
7621}
7622
7623// Tail: Streaming read of log entries as they are ingested. Until the
7624// stream is terminated, it will continue reading logs.
7625func (r *EntriesService) Tail(taillogentriesrequest *TailLogEntriesRequest) *EntriesTailCall {
7626	c := &EntriesTailCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7627	c.taillogentriesrequest = taillogentriesrequest
7628	return c
7629}
7630
7631// Fields allows partial responses to be retrieved. See
7632// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7633// for more information.
7634func (c *EntriesTailCall) Fields(s ...googleapi.Field) *EntriesTailCall {
7635	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7636	return c
7637}
7638
7639// Context sets the context to be used in this call's Do method. Any
7640// pending HTTP request will be aborted if the provided context is
7641// canceled.
7642func (c *EntriesTailCall) Context(ctx context.Context) *EntriesTailCall {
7643	c.ctx_ = ctx
7644	return c
7645}
7646
7647// Header returns an http.Header that can be modified by the caller to
7648// add HTTP headers to the request.
7649func (c *EntriesTailCall) Header() http.Header {
7650	if c.header_ == nil {
7651		c.header_ = make(http.Header)
7652	}
7653	return c.header_
7654}
7655
7656func (c *EntriesTailCall) doRequest(alt string) (*http.Response, error) {
7657	reqHeaders := make(http.Header)
7658	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
7659	for k, v := range c.header_ {
7660		reqHeaders[k] = v
7661	}
7662	reqHeaders.Set("User-Agent", c.s.userAgent())
7663	var body io.Reader = nil
7664	body, err := googleapi.WithoutDataWrapper.JSONReader(c.taillogentriesrequest)
7665	if err != nil {
7666		return nil, err
7667	}
7668	reqHeaders.Set("Content-Type", "application/json")
7669	c.urlParams_.Set("alt", alt)
7670	c.urlParams_.Set("prettyPrint", "false")
7671	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:tail")
7672	urls += "?" + c.urlParams_.Encode()
7673	req, err := http.NewRequest("POST", urls, body)
7674	if err != nil {
7675		return nil, err
7676	}
7677	req.Header = reqHeaders
7678	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7679}
7680
7681// Do executes the "logging.entries.tail" call.
7682// Exactly one of *TailLogEntriesResponse or error will be non-nil. Any
7683// non-2xx status code is an error. Response headers are in either
7684// *TailLogEntriesResponse.ServerResponse.Header or (if a response was
7685// returned at all) in error.(*googleapi.Error).Header. Use
7686// googleapi.IsNotModified to check whether the returned error was
7687// because http.StatusNotModified was returned.
7688func (c *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesResponse, error) {
7689	gensupport.SetOptions(c.urlParams_, opts...)
7690	res, err := c.doRequest("json")
7691	if res != nil && res.StatusCode == http.StatusNotModified {
7692		if res.Body != nil {
7693			res.Body.Close()
7694		}
7695		return nil, &googleapi.Error{
7696			Code:   res.StatusCode,
7697			Header: res.Header,
7698		}
7699	}
7700	if err != nil {
7701		return nil, err
7702	}
7703	defer googleapi.CloseBody(res)
7704	if err := googleapi.CheckResponse(res); err != nil {
7705		return nil, err
7706	}
7707	ret := &TailLogEntriesResponse{
7708		ServerResponse: googleapi.ServerResponse{
7709			Header:         res.Header,
7710			HTTPStatusCode: res.StatusCode,
7711		},
7712	}
7713	target := &ret
7714	if err := gensupport.DecodeResponse(target, res); err != nil {
7715		return nil, err
7716	}
7717	return ret, nil
7718	// {
7719	//   "description": "Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.",
7720	//   "flatPath": "v2/entries:tail",
7721	//   "httpMethod": "POST",
7722	//   "id": "logging.entries.tail",
7723	//   "parameterOrder": [],
7724	//   "parameters": {},
7725	//   "path": "v2/entries:tail",
7726	//   "request": {
7727	//     "$ref": "TailLogEntriesRequest"
7728	//   },
7729	//   "response": {
7730	//     "$ref": "TailLogEntriesResponse"
7731	//   },
7732	//   "scopes": [
7733	//     "https://www.googleapis.com/auth/cloud-platform",
7734	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7735	//     "https://www.googleapis.com/auth/logging.admin",
7736	//     "https://www.googleapis.com/auth/logging.read"
7737	//   ]
7738	// }
7739
7740}
7741
7742// method id "logging.entries.write":
7743
7744type EntriesWriteCall struct {
7745	s                      *Service
7746	writelogentriesrequest *WriteLogEntriesRequest
7747	urlParams_             gensupport.URLParams
7748	ctx_                   context.Context
7749	header_                http.Header
7750}
7751
7752// Write: Writes log entries to Logging. This API method is the only way
7753// to send log entries to Logging. This method is used, directly or
7754// indirectly, by the Logging agent (fluentd) and all logging libraries
7755// configured to use Logging. A single request may contain log entries
7756// for a maximum of 1000 different resources (projects, organizations,
7757// billing accounts or folders)
7758func (r *EntriesService) Write(writelogentriesrequest *WriteLogEntriesRequest) *EntriesWriteCall {
7759	c := &EntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7760	c.writelogentriesrequest = writelogentriesrequest
7761	return c
7762}
7763
7764// Fields allows partial responses to be retrieved. See
7765// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7766// for more information.
7767func (c *EntriesWriteCall) Fields(s ...googleapi.Field) *EntriesWriteCall {
7768	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7769	return c
7770}
7771
7772// Context sets the context to be used in this call's Do method. Any
7773// pending HTTP request will be aborted if the provided context is
7774// canceled.
7775func (c *EntriesWriteCall) Context(ctx context.Context) *EntriesWriteCall {
7776	c.ctx_ = ctx
7777	return c
7778}
7779
7780// Header returns an http.Header that can be modified by the caller to
7781// add HTTP headers to the request.
7782func (c *EntriesWriteCall) Header() http.Header {
7783	if c.header_ == nil {
7784		c.header_ = make(http.Header)
7785	}
7786	return c.header_
7787}
7788
7789func (c *EntriesWriteCall) doRequest(alt string) (*http.Response, error) {
7790	reqHeaders := make(http.Header)
7791	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
7792	for k, v := range c.header_ {
7793		reqHeaders[k] = v
7794	}
7795	reqHeaders.Set("User-Agent", c.s.userAgent())
7796	var body io.Reader = nil
7797	body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest)
7798	if err != nil {
7799		return nil, err
7800	}
7801	reqHeaders.Set("Content-Type", "application/json")
7802	c.urlParams_.Set("alt", alt)
7803	c.urlParams_.Set("prettyPrint", "false")
7804	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:write")
7805	urls += "?" + c.urlParams_.Encode()
7806	req, err := http.NewRequest("POST", urls, body)
7807	if err != nil {
7808		return nil, err
7809	}
7810	req.Header = reqHeaders
7811	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7812}
7813
7814// Do executes the "logging.entries.write" call.
7815// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any
7816// non-2xx status code is an error. Response headers are in either
7817// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was
7818// returned at all) in error.(*googleapi.Error).Header. Use
7819// googleapi.IsNotModified to check whether the returned error was
7820// because http.StatusNotModified was returned.
7821func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesResponse, error) {
7822	gensupport.SetOptions(c.urlParams_, opts...)
7823	res, err := c.doRequest("json")
7824	if res != nil && res.StatusCode == http.StatusNotModified {
7825		if res.Body != nil {
7826			res.Body.Close()
7827		}
7828		return nil, &googleapi.Error{
7829			Code:   res.StatusCode,
7830			Header: res.Header,
7831		}
7832	}
7833	if err != nil {
7834		return nil, err
7835	}
7836	defer googleapi.CloseBody(res)
7837	if err := googleapi.CheckResponse(res); err != nil {
7838		return nil, err
7839	}
7840	ret := &WriteLogEntriesResponse{
7841		ServerResponse: googleapi.ServerResponse{
7842			Header:         res.Header,
7843			HTTPStatusCode: res.StatusCode,
7844		},
7845	}
7846	target := &ret
7847	if err := gensupport.DecodeResponse(target, res); err != nil {
7848		return nil, err
7849	}
7850	return ret, nil
7851	// {
7852	//   "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)",
7853	//   "flatPath": "v2/entries:write",
7854	//   "httpMethod": "POST",
7855	//   "id": "logging.entries.write",
7856	//   "parameterOrder": [],
7857	//   "parameters": {},
7858	//   "path": "v2/entries:write",
7859	//   "request": {
7860	//     "$ref": "WriteLogEntriesRequest"
7861	//   },
7862	//   "response": {
7863	//     "$ref": "WriteLogEntriesResponse"
7864	//   },
7865	//   "scopes": [
7866	//     "https://www.googleapis.com/auth/cloud-platform",
7867	//     "https://www.googleapis.com/auth/logging.admin",
7868	//     "https://www.googleapis.com/auth/logging.write"
7869	//   ]
7870	// }
7871
7872}
7873
7874// method id "logging.exclusions.create":
7875
7876type ExclusionsCreateCall struct {
7877	s            *Service
7878	parent       string
7879	logexclusion *LogExclusion
7880	urlParams_   gensupport.URLParams
7881	ctx_         context.Context
7882	header_      http.Header
7883}
7884
7885// Create: Creates a new exclusion in a specified parent resource. Only
7886// log entries belonging to that resource can be excluded. You can have
7887// up to 10 exclusions in a resource.
7888func (r *ExclusionsService) Create(parent string, logexclusion *LogExclusion) *ExclusionsCreateCall {
7889	c := &ExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7890	c.parent = parent
7891	c.logexclusion = logexclusion
7892	return c
7893}
7894
7895// Fields allows partial responses to be retrieved. See
7896// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7897// for more information.
7898func (c *ExclusionsCreateCall) Fields(s ...googleapi.Field) *ExclusionsCreateCall {
7899	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7900	return c
7901}
7902
7903// Context sets the context to be used in this call's Do method. Any
7904// pending HTTP request will be aborted if the provided context is
7905// canceled.
7906func (c *ExclusionsCreateCall) Context(ctx context.Context) *ExclusionsCreateCall {
7907	c.ctx_ = ctx
7908	return c
7909}
7910
7911// Header returns an http.Header that can be modified by the caller to
7912// add HTTP headers to the request.
7913func (c *ExclusionsCreateCall) Header() http.Header {
7914	if c.header_ == nil {
7915		c.header_ = make(http.Header)
7916	}
7917	return c.header_
7918}
7919
7920func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
7921	reqHeaders := make(http.Header)
7922	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
7923	for k, v := range c.header_ {
7924		reqHeaders[k] = v
7925	}
7926	reqHeaders.Set("User-Agent", c.s.userAgent())
7927	var body io.Reader = nil
7928	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
7929	if err != nil {
7930		return nil, err
7931	}
7932	reqHeaders.Set("Content-Type", "application/json")
7933	c.urlParams_.Set("alt", alt)
7934	c.urlParams_.Set("prettyPrint", "false")
7935	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
7936	urls += "?" + c.urlParams_.Encode()
7937	req, err := http.NewRequest("POST", urls, body)
7938	if err != nil {
7939		return nil, err
7940	}
7941	req.Header = reqHeaders
7942	googleapi.Expand(req.URL, map[string]string{
7943		"parent": c.parent,
7944	})
7945	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7946}
7947
7948// Do executes the "logging.exclusions.create" call.
7949// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
7950// status code is an error. Response headers are in either
7951// *LogExclusion.ServerResponse.Header or (if a response was returned at
7952// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7953// to check whether the returned error was because
7954// http.StatusNotModified was returned.
7955func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
7956	gensupport.SetOptions(c.urlParams_, opts...)
7957	res, err := c.doRequest("json")
7958	if res != nil && res.StatusCode == http.StatusNotModified {
7959		if res.Body != nil {
7960			res.Body.Close()
7961		}
7962		return nil, &googleapi.Error{
7963			Code:   res.StatusCode,
7964			Header: res.Header,
7965		}
7966	}
7967	if err != nil {
7968		return nil, err
7969	}
7970	defer googleapi.CloseBody(res)
7971	if err := googleapi.CheckResponse(res); err != nil {
7972		return nil, err
7973	}
7974	ret := &LogExclusion{
7975		ServerResponse: googleapi.ServerResponse{
7976			Header:         res.Header,
7977			HTTPStatusCode: res.StatusCode,
7978		},
7979	}
7980	target := &ret
7981	if err := gensupport.DecodeResponse(target, res); err != nil {
7982		return nil, err
7983	}
7984	return ret, nil
7985	// {
7986	//   "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.",
7987	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions",
7988	//   "httpMethod": "POST",
7989	//   "id": "logging.exclusions.create",
7990	//   "parameterOrder": [
7991	//     "parent"
7992	//   ],
7993	//   "parameters": {
7994	//     "parent": {
7995	//       "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" Examples: \"projects/my-logging-project\", \"organizations/123456789\".",
7996	//       "location": "path",
7997	//       "pattern": "^[^/]+/[^/]+$",
7998	//       "required": true,
7999	//       "type": "string"
8000	//     }
8001	//   },
8002	//   "path": "v2/{+parent}/exclusions",
8003	//   "request": {
8004	//     "$ref": "LogExclusion"
8005	//   },
8006	//   "response": {
8007	//     "$ref": "LogExclusion"
8008	//   },
8009	//   "scopes": [
8010	//     "https://www.googleapis.com/auth/cloud-platform",
8011	//     "https://www.googleapis.com/auth/logging.admin"
8012	//   ]
8013	// }
8014
8015}
8016
8017// method id "logging.exclusions.delete":
8018
8019type ExclusionsDeleteCall struct {
8020	s          *Service
8021	name       string
8022	urlParams_ gensupport.URLParams
8023	ctx_       context.Context
8024	header_    http.Header
8025}
8026
8027// Delete: Deletes an exclusion.
8028func (r *ExclusionsService) Delete(name string) *ExclusionsDeleteCall {
8029	c := &ExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8030	c.name = name
8031	return c
8032}
8033
8034// Fields allows partial responses to be retrieved. See
8035// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8036// for more information.
8037func (c *ExclusionsDeleteCall) Fields(s ...googleapi.Field) *ExclusionsDeleteCall {
8038	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8039	return c
8040}
8041
8042// Context sets the context to be used in this call's Do method. Any
8043// pending HTTP request will be aborted if the provided context is
8044// canceled.
8045func (c *ExclusionsDeleteCall) Context(ctx context.Context) *ExclusionsDeleteCall {
8046	c.ctx_ = ctx
8047	return c
8048}
8049
8050// Header returns an http.Header that can be modified by the caller to
8051// add HTTP headers to the request.
8052func (c *ExclusionsDeleteCall) Header() http.Header {
8053	if c.header_ == nil {
8054		c.header_ = make(http.Header)
8055	}
8056	return c.header_
8057}
8058
8059func (c *ExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
8060	reqHeaders := make(http.Header)
8061	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
8062	for k, v := range c.header_ {
8063		reqHeaders[k] = v
8064	}
8065	reqHeaders.Set("User-Agent", c.s.userAgent())
8066	var body io.Reader = nil
8067	c.urlParams_.Set("alt", alt)
8068	c.urlParams_.Set("prettyPrint", "false")
8069	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
8070	urls += "?" + c.urlParams_.Encode()
8071	req, err := http.NewRequest("DELETE", urls, body)
8072	if err != nil {
8073		return nil, err
8074	}
8075	req.Header = reqHeaders
8076	googleapi.Expand(req.URL, map[string]string{
8077		"name": c.name,
8078	})
8079	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8080}
8081
8082// Do executes the "logging.exclusions.delete" call.
8083// Exactly one of *Empty or error will be non-nil. Any non-2xx status
8084// code is an error. Response headers are in either
8085// *Empty.ServerResponse.Header or (if a response was returned at all)
8086// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8087// check whether the returned error was because http.StatusNotModified
8088// was returned.
8089func (c *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
8090	gensupport.SetOptions(c.urlParams_, opts...)
8091	res, err := c.doRequest("json")
8092	if res != nil && res.StatusCode == http.StatusNotModified {
8093		if res.Body != nil {
8094			res.Body.Close()
8095		}
8096		return nil, &googleapi.Error{
8097			Code:   res.StatusCode,
8098			Header: res.Header,
8099		}
8100	}
8101	if err != nil {
8102		return nil, err
8103	}
8104	defer googleapi.CloseBody(res)
8105	if err := googleapi.CheckResponse(res); err != nil {
8106		return nil, err
8107	}
8108	ret := &Empty{
8109		ServerResponse: googleapi.ServerResponse{
8110			Header:         res.Header,
8111			HTTPStatusCode: res.StatusCode,
8112		},
8113	}
8114	target := &ret
8115	if err := gensupport.DecodeResponse(target, res); err != nil {
8116		return nil, err
8117	}
8118	return ret, nil
8119	// {
8120	//   "description": "Deletes an exclusion.",
8121	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
8122	//   "httpMethod": "DELETE",
8123	//   "id": "logging.exclusions.delete",
8124	//   "parameterOrder": [
8125	//     "name"
8126	//   ],
8127	//   "parameters": {
8128	//     "name": {
8129	//       "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
8130	//       "location": "path",
8131	//       "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
8132	//       "required": true,
8133	//       "type": "string"
8134	//     }
8135	//   },
8136	//   "path": "v2/{+name}",
8137	//   "response": {
8138	//     "$ref": "Empty"
8139	//   },
8140	//   "scopes": [
8141	//     "https://www.googleapis.com/auth/cloud-platform",
8142	//     "https://www.googleapis.com/auth/logging.admin"
8143	//   ]
8144	// }
8145
8146}
8147
8148// method id "logging.exclusions.get":
8149
8150type ExclusionsGetCall struct {
8151	s            *Service
8152	name         string
8153	urlParams_   gensupport.URLParams
8154	ifNoneMatch_ string
8155	ctx_         context.Context
8156	header_      http.Header
8157}
8158
8159// Get: Gets the description of an exclusion.
8160func (r *ExclusionsService) Get(name string) *ExclusionsGetCall {
8161	c := &ExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8162	c.name = name
8163	return c
8164}
8165
8166// Fields allows partial responses to be retrieved. See
8167// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8168// for more information.
8169func (c *ExclusionsGetCall) Fields(s ...googleapi.Field) *ExclusionsGetCall {
8170	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8171	return c
8172}
8173
8174// IfNoneMatch sets the optional parameter which makes the operation
8175// fail if the object's ETag matches the given value. This is useful for
8176// getting updates only after the object has changed since the last
8177// request. Use googleapi.IsNotModified to check whether the response
8178// error from Do is the result of In-None-Match.
8179func (c *ExclusionsGetCall) IfNoneMatch(entityTag string) *ExclusionsGetCall {
8180	c.ifNoneMatch_ = entityTag
8181	return c
8182}
8183
8184// Context sets the context to be used in this call's Do method. Any
8185// pending HTTP request will be aborted if the provided context is
8186// canceled.
8187func (c *ExclusionsGetCall) Context(ctx context.Context) *ExclusionsGetCall {
8188	c.ctx_ = ctx
8189	return c
8190}
8191
8192// Header returns an http.Header that can be modified by the caller to
8193// add HTTP headers to the request.
8194func (c *ExclusionsGetCall) Header() http.Header {
8195	if c.header_ == nil {
8196		c.header_ = make(http.Header)
8197	}
8198	return c.header_
8199}
8200
8201func (c *ExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
8202	reqHeaders := make(http.Header)
8203	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
8204	for k, v := range c.header_ {
8205		reqHeaders[k] = v
8206	}
8207	reqHeaders.Set("User-Agent", c.s.userAgent())
8208	if c.ifNoneMatch_ != "" {
8209		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8210	}
8211	var body io.Reader = nil
8212	c.urlParams_.Set("alt", alt)
8213	c.urlParams_.Set("prettyPrint", "false")
8214	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
8215	urls += "?" + c.urlParams_.Encode()
8216	req, err := http.NewRequest("GET", urls, body)
8217	if err != nil {
8218		return nil, err
8219	}
8220	req.Header = reqHeaders
8221	googleapi.Expand(req.URL, map[string]string{
8222		"name": c.name,
8223	})
8224	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8225}
8226
8227// Do executes the "logging.exclusions.get" call.
8228// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
8229// status code is an error. Response headers are in either
8230// *LogExclusion.ServerResponse.Header or (if a response was returned at
8231// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8232// to check whether the returned error was because
8233// http.StatusNotModified was returned.
8234func (c *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
8235	gensupport.SetOptions(c.urlParams_, opts...)
8236	res, err := c.doRequest("json")
8237	if res != nil && res.StatusCode == http.StatusNotModified {
8238		if res.Body != nil {
8239			res.Body.Close()
8240		}
8241		return nil, &googleapi.Error{
8242			Code:   res.StatusCode,
8243			Header: res.Header,
8244		}
8245	}
8246	if err != nil {
8247		return nil, err
8248	}
8249	defer googleapi.CloseBody(res)
8250	if err := googleapi.CheckResponse(res); err != nil {
8251		return nil, err
8252	}
8253	ret := &LogExclusion{
8254		ServerResponse: googleapi.ServerResponse{
8255			Header:         res.Header,
8256			HTTPStatusCode: res.StatusCode,
8257		},
8258	}
8259	target := &ret
8260	if err := gensupport.DecodeResponse(target, res); err != nil {
8261		return nil, err
8262	}
8263	return ret, nil
8264	// {
8265	//   "description": "Gets the description of an exclusion.",
8266	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
8267	//   "httpMethod": "GET",
8268	//   "id": "logging.exclusions.get",
8269	//   "parameterOrder": [
8270	//     "name"
8271	//   ],
8272	//   "parameters": {
8273	//     "name": {
8274	//       "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
8275	//       "location": "path",
8276	//       "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
8277	//       "required": true,
8278	//       "type": "string"
8279	//     }
8280	//   },
8281	//   "path": "v2/{+name}",
8282	//   "response": {
8283	//     "$ref": "LogExclusion"
8284	//   },
8285	//   "scopes": [
8286	//     "https://www.googleapis.com/auth/cloud-platform",
8287	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
8288	//     "https://www.googleapis.com/auth/logging.admin",
8289	//     "https://www.googleapis.com/auth/logging.read"
8290	//   ]
8291	// }
8292
8293}
8294
8295// method id "logging.exclusions.list":
8296
8297type ExclusionsListCall struct {
8298	s            *Service
8299	parent       string
8300	urlParams_   gensupport.URLParams
8301	ifNoneMatch_ string
8302	ctx_         context.Context
8303	header_      http.Header
8304}
8305
8306// List: Lists all the exclusions in a parent resource.
8307func (r *ExclusionsService) List(parent string) *ExclusionsListCall {
8308	c := &ExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8309	c.parent = parent
8310	return c
8311}
8312
8313// PageSize sets the optional parameter "pageSize": The maximum number
8314// of results to return from this request. Non-positive values are
8315// ignored. The presence of nextPageToken in the response indicates that
8316// more results might be available.
8317func (c *ExclusionsListCall) PageSize(pageSize int64) *ExclusionsListCall {
8318	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8319	return c
8320}
8321
8322// PageToken sets the optional parameter "pageToken": If present, then
8323// retrieve the next batch of results from the preceding call to this
8324// method. pageToken must be the value of nextPageToken from the
8325// previous response. The values of other method parameters should be
8326// identical to those in the previous call.
8327func (c *ExclusionsListCall) PageToken(pageToken string) *ExclusionsListCall {
8328	c.urlParams_.Set("pageToken", pageToken)
8329	return c
8330}
8331
8332// Fields allows partial responses to be retrieved. See
8333// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8334// for more information.
8335func (c *ExclusionsListCall) Fields(s ...googleapi.Field) *ExclusionsListCall {
8336	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8337	return c
8338}
8339
8340// IfNoneMatch sets the optional parameter which makes the operation
8341// fail if the object's ETag matches the given value. This is useful for
8342// getting updates only after the object has changed since the last
8343// request. Use googleapi.IsNotModified to check whether the response
8344// error from Do is the result of In-None-Match.
8345func (c *ExclusionsListCall) IfNoneMatch(entityTag string) *ExclusionsListCall {
8346	c.ifNoneMatch_ = entityTag
8347	return c
8348}
8349
8350// Context sets the context to be used in this call's Do method. Any
8351// pending HTTP request will be aborted if the provided context is
8352// canceled.
8353func (c *ExclusionsListCall) Context(ctx context.Context) *ExclusionsListCall {
8354	c.ctx_ = ctx
8355	return c
8356}
8357
8358// Header returns an http.Header that can be modified by the caller to
8359// add HTTP headers to the request.
8360func (c *ExclusionsListCall) Header() http.Header {
8361	if c.header_ == nil {
8362		c.header_ = make(http.Header)
8363	}
8364	return c.header_
8365}
8366
8367func (c *ExclusionsListCall) doRequest(alt string) (*http.Response, error) {
8368	reqHeaders := make(http.Header)
8369	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
8370	for k, v := range c.header_ {
8371		reqHeaders[k] = v
8372	}
8373	reqHeaders.Set("User-Agent", c.s.userAgent())
8374	if c.ifNoneMatch_ != "" {
8375		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8376	}
8377	var body io.Reader = nil
8378	c.urlParams_.Set("alt", alt)
8379	c.urlParams_.Set("prettyPrint", "false")
8380	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
8381	urls += "?" + c.urlParams_.Encode()
8382	req, err := http.NewRequest("GET", urls, body)
8383	if err != nil {
8384		return nil, err
8385	}
8386	req.Header = reqHeaders
8387	googleapi.Expand(req.URL, map[string]string{
8388		"parent": c.parent,
8389	})
8390	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8391}
8392
8393// Do executes the "logging.exclusions.list" call.
8394// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
8395// non-2xx status code is an error. Response headers are in either
8396// *ListExclusionsResponse.ServerResponse.Header or (if a response was
8397// returned at all) in error.(*googleapi.Error).Header. Use
8398// googleapi.IsNotModified to check whether the returned error was
8399// because http.StatusNotModified was returned.
8400func (c *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
8401	gensupport.SetOptions(c.urlParams_, opts...)
8402	res, err := c.doRequest("json")
8403	if res != nil && res.StatusCode == http.StatusNotModified {
8404		if res.Body != nil {
8405			res.Body.Close()
8406		}
8407		return nil, &googleapi.Error{
8408			Code:   res.StatusCode,
8409			Header: res.Header,
8410		}
8411	}
8412	if err != nil {
8413		return nil, err
8414	}
8415	defer googleapi.CloseBody(res)
8416	if err := googleapi.CheckResponse(res); err != nil {
8417		return nil, err
8418	}
8419	ret := &ListExclusionsResponse{
8420		ServerResponse: googleapi.ServerResponse{
8421			Header:         res.Header,
8422			HTTPStatusCode: res.StatusCode,
8423		},
8424	}
8425	target := &ret
8426	if err := gensupport.DecodeResponse(target, res); err != nil {
8427		return nil, err
8428	}
8429	return ret, nil
8430	// {
8431	//   "description": "Lists all the exclusions in a parent resource.",
8432	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions",
8433	//   "httpMethod": "GET",
8434	//   "id": "logging.exclusions.list",
8435	//   "parameterOrder": [
8436	//     "parent"
8437	//   ],
8438	//   "parameters": {
8439	//     "pageSize": {
8440	//       "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.",
8441	//       "format": "int32",
8442	//       "location": "query",
8443	//       "type": "integer"
8444	//     },
8445	//     "pageToken": {
8446	//       "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.",
8447	//       "location": "query",
8448	//       "type": "string"
8449	//     },
8450	//     "parent": {
8451	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
8452	//       "location": "path",
8453	//       "pattern": "^[^/]+/[^/]+$",
8454	//       "required": true,
8455	//       "type": "string"
8456	//     }
8457	//   },
8458	//   "path": "v2/{+parent}/exclusions",
8459	//   "response": {
8460	//     "$ref": "ListExclusionsResponse"
8461	//   },
8462	//   "scopes": [
8463	//     "https://www.googleapis.com/auth/cloud-platform",
8464	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
8465	//     "https://www.googleapis.com/auth/logging.admin",
8466	//     "https://www.googleapis.com/auth/logging.read"
8467	//   ]
8468	// }
8469
8470}
8471
8472// Pages invokes f for each page of results.
8473// A non-nil error returned from f will halt the iteration.
8474// The provided context supersedes any context provided to the Context method.
8475func (c *ExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
8476	c.ctx_ = ctx
8477	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
8478	for {
8479		x, err := c.Do()
8480		if err != nil {
8481			return err
8482		}
8483		if err := f(x); err != nil {
8484			return err
8485		}
8486		if x.NextPageToken == "" {
8487			return nil
8488		}
8489		c.PageToken(x.NextPageToken)
8490	}
8491}
8492
8493// method id "logging.exclusions.patch":
8494
8495type ExclusionsPatchCall struct {
8496	s            *Service
8497	name         string
8498	logexclusion *LogExclusion
8499	urlParams_   gensupport.URLParams
8500	ctx_         context.Context
8501	header_      http.Header
8502}
8503
8504// Patch: Changes one or more properties of an existing exclusion.
8505func (r *ExclusionsService) Patch(name string, logexclusion *LogExclusion) *ExclusionsPatchCall {
8506	c := &ExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8507	c.name = name
8508	c.logexclusion = logexclusion
8509	return c
8510}
8511
8512// UpdateMask sets the optional parameter "updateMask": Required. A
8513// non-empty list of fields to change in the existing exclusion. New
8514// values for the fields are taken from the corresponding fields in the
8515// LogExclusion included in this request. Fields not mentioned in
8516// update_mask are not changed and are ignored in the request.For
8517// example, to change the filter and description of an exclusion,
8518// specify an update_mask of "filter,description".
8519func (c *ExclusionsPatchCall) UpdateMask(updateMask string) *ExclusionsPatchCall {
8520	c.urlParams_.Set("updateMask", updateMask)
8521	return c
8522}
8523
8524// Fields allows partial responses to be retrieved. See
8525// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8526// for more information.
8527func (c *ExclusionsPatchCall) Fields(s ...googleapi.Field) *ExclusionsPatchCall {
8528	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8529	return c
8530}
8531
8532// Context sets the context to be used in this call's Do method. Any
8533// pending HTTP request will be aborted if the provided context is
8534// canceled.
8535func (c *ExclusionsPatchCall) Context(ctx context.Context) *ExclusionsPatchCall {
8536	c.ctx_ = ctx
8537	return c
8538}
8539
8540// Header returns an http.Header that can be modified by the caller to
8541// add HTTP headers to the request.
8542func (c *ExclusionsPatchCall) Header() http.Header {
8543	if c.header_ == nil {
8544		c.header_ = make(http.Header)
8545	}
8546	return c.header_
8547}
8548
8549func (c *ExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
8550	reqHeaders := make(http.Header)
8551	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
8552	for k, v := range c.header_ {
8553		reqHeaders[k] = v
8554	}
8555	reqHeaders.Set("User-Agent", c.s.userAgent())
8556	var body io.Reader = nil
8557	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
8558	if err != nil {
8559		return nil, err
8560	}
8561	reqHeaders.Set("Content-Type", "application/json")
8562	c.urlParams_.Set("alt", alt)
8563	c.urlParams_.Set("prettyPrint", "false")
8564	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
8565	urls += "?" + c.urlParams_.Encode()
8566	req, err := http.NewRequest("PATCH", urls, body)
8567	if err != nil {
8568		return nil, err
8569	}
8570	req.Header = reqHeaders
8571	googleapi.Expand(req.URL, map[string]string{
8572		"name": c.name,
8573	})
8574	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8575}
8576
8577// Do executes the "logging.exclusions.patch" call.
8578// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
8579// status code is an error. Response headers are in either
8580// *LogExclusion.ServerResponse.Header or (if a response was returned at
8581// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8582// to check whether the returned error was because
8583// http.StatusNotModified was returned.
8584func (c *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
8585	gensupport.SetOptions(c.urlParams_, opts...)
8586	res, err := c.doRequest("json")
8587	if res != nil && res.StatusCode == http.StatusNotModified {
8588		if res.Body != nil {
8589			res.Body.Close()
8590		}
8591		return nil, &googleapi.Error{
8592			Code:   res.StatusCode,
8593			Header: res.Header,
8594		}
8595	}
8596	if err != nil {
8597		return nil, err
8598	}
8599	defer googleapi.CloseBody(res)
8600	if err := googleapi.CheckResponse(res); err != nil {
8601		return nil, err
8602	}
8603	ret := &LogExclusion{
8604		ServerResponse: googleapi.ServerResponse{
8605			Header:         res.Header,
8606			HTTPStatusCode: res.StatusCode,
8607		},
8608	}
8609	target := &ret
8610	if err := gensupport.DecodeResponse(target, res); err != nil {
8611		return nil, err
8612	}
8613	return ret, nil
8614	// {
8615	//   "description": "Changes one or more properties of an existing exclusion.",
8616	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
8617	//   "httpMethod": "PATCH",
8618	//   "id": "logging.exclusions.patch",
8619	//   "parameterOrder": [
8620	//     "name"
8621	//   ],
8622	//   "parameters": {
8623	//     "name": {
8624	//       "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
8625	//       "location": "path",
8626	//       "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
8627	//       "required": true,
8628	//       "type": "string"
8629	//     },
8630	//     "updateMask": {
8631	//       "description": "Required. A non-empty 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\".",
8632	//       "format": "google-fieldmask",
8633	//       "location": "query",
8634	//       "type": "string"
8635	//     }
8636	//   },
8637	//   "path": "v2/{+name}",
8638	//   "request": {
8639	//     "$ref": "LogExclusion"
8640	//   },
8641	//   "response": {
8642	//     "$ref": "LogExclusion"
8643	//   },
8644	//   "scopes": [
8645	//     "https://www.googleapis.com/auth/cloud-platform",
8646	//     "https://www.googleapis.com/auth/logging.admin"
8647	//   ]
8648	// }
8649
8650}
8651
8652// method id "logging.folders.exclusions.create":
8653
8654type FoldersExclusionsCreateCall struct {
8655	s            *Service
8656	parent       string
8657	logexclusion *LogExclusion
8658	urlParams_   gensupport.URLParams
8659	ctx_         context.Context
8660	header_      http.Header
8661}
8662
8663// Create: Creates a new exclusion in a specified parent resource. Only
8664// log entries belonging to that resource can be excluded. You can have
8665// up to 10 exclusions in a resource.
8666func (r *FoldersExclusionsService) Create(parent string, logexclusion *LogExclusion) *FoldersExclusionsCreateCall {
8667	c := &FoldersExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8668	c.parent = parent
8669	c.logexclusion = logexclusion
8670	return c
8671}
8672
8673// Fields allows partial responses to be retrieved. See
8674// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8675// for more information.
8676func (c *FoldersExclusionsCreateCall) Fields(s ...googleapi.Field) *FoldersExclusionsCreateCall {
8677	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8678	return c
8679}
8680
8681// Context sets the context to be used in this call's Do method. Any
8682// pending HTTP request will be aborted if the provided context is
8683// canceled.
8684func (c *FoldersExclusionsCreateCall) Context(ctx context.Context) *FoldersExclusionsCreateCall {
8685	c.ctx_ = ctx
8686	return c
8687}
8688
8689// Header returns an http.Header that can be modified by the caller to
8690// add HTTP headers to the request.
8691func (c *FoldersExclusionsCreateCall) Header() http.Header {
8692	if c.header_ == nil {
8693		c.header_ = make(http.Header)
8694	}
8695	return c.header_
8696}
8697
8698func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
8699	reqHeaders := make(http.Header)
8700	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
8701	for k, v := range c.header_ {
8702		reqHeaders[k] = v
8703	}
8704	reqHeaders.Set("User-Agent", c.s.userAgent())
8705	var body io.Reader = nil
8706	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
8707	if err != nil {
8708		return nil, err
8709	}
8710	reqHeaders.Set("Content-Type", "application/json")
8711	c.urlParams_.Set("alt", alt)
8712	c.urlParams_.Set("prettyPrint", "false")
8713	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
8714	urls += "?" + c.urlParams_.Encode()
8715	req, err := http.NewRequest("POST", urls, body)
8716	if err != nil {
8717		return nil, err
8718	}
8719	req.Header = reqHeaders
8720	googleapi.Expand(req.URL, map[string]string{
8721		"parent": c.parent,
8722	})
8723	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8724}
8725
8726// Do executes the "logging.folders.exclusions.create" call.
8727// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
8728// status code is an error. Response headers are in either
8729// *LogExclusion.ServerResponse.Header or (if a response was returned at
8730// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8731// to check whether the returned error was because
8732// http.StatusNotModified was returned.
8733func (c *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
8734	gensupport.SetOptions(c.urlParams_, opts...)
8735	res, err := c.doRequest("json")
8736	if res != nil && res.StatusCode == http.StatusNotModified {
8737		if res.Body != nil {
8738			res.Body.Close()
8739		}
8740		return nil, &googleapi.Error{
8741			Code:   res.StatusCode,
8742			Header: res.Header,
8743		}
8744	}
8745	if err != nil {
8746		return nil, err
8747	}
8748	defer googleapi.CloseBody(res)
8749	if err := googleapi.CheckResponse(res); err != nil {
8750		return nil, err
8751	}
8752	ret := &LogExclusion{
8753		ServerResponse: googleapi.ServerResponse{
8754			Header:         res.Header,
8755			HTTPStatusCode: res.StatusCode,
8756		},
8757	}
8758	target := &ret
8759	if err := gensupport.DecodeResponse(target, res); err != nil {
8760		return nil, err
8761	}
8762	return ret, nil
8763	// {
8764	//   "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.",
8765	//   "flatPath": "v2/folders/{foldersId}/exclusions",
8766	//   "httpMethod": "POST",
8767	//   "id": "logging.folders.exclusions.create",
8768	//   "parameterOrder": [
8769	//     "parent"
8770	//   ],
8771	//   "parameters": {
8772	//     "parent": {
8773	//       "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" Examples: \"projects/my-logging-project\", \"organizations/123456789\".",
8774	//       "location": "path",
8775	//       "pattern": "^folders/[^/]+$",
8776	//       "required": true,
8777	//       "type": "string"
8778	//     }
8779	//   },
8780	//   "path": "v2/{+parent}/exclusions",
8781	//   "request": {
8782	//     "$ref": "LogExclusion"
8783	//   },
8784	//   "response": {
8785	//     "$ref": "LogExclusion"
8786	//   },
8787	//   "scopes": [
8788	//     "https://www.googleapis.com/auth/cloud-platform",
8789	//     "https://www.googleapis.com/auth/logging.admin"
8790	//   ]
8791	// }
8792
8793}
8794
8795// method id "logging.folders.exclusions.delete":
8796
8797type FoldersExclusionsDeleteCall struct {
8798	s          *Service
8799	name       string
8800	urlParams_ gensupport.URLParams
8801	ctx_       context.Context
8802	header_    http.Header
8803}
8804
8805// Delete: Deletes an exclusion.
8806func (r *FoldersExclusionsService) Delete(name string) *FoldersExclusionsDeleteCall {
8807	c := &FoldersExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8808	c.name = name
8809	return c
8810}
8811
8812// Fields allows partial responses to be retrieved. See
8813// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8814// for more information.
8815func (c *FoldersExclusionsDeleteCall) Fields(s ...googleapi.Field) *FoldersExclusionsDeleteCall {
8816	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8817	return c
8818}
8819
8820// Context sets the context to be used in this call's Do method. Any
8821// pending HTTP request will be aborted if the provided context is
8822// canceled.
8823func (c *FoldersExclusionsDeleteCall) Context(ctx context.Context) *FoldersExclusionsDeleteCall {
8824	c.ctx_ = ctx
8825	return c
8826}
8827
8828// Header returns an http.Header that can be modified by the caller to
8829// add HTTP headers to the request.
8830func (c *FoldersExclusionsDeleteCall) Header() http.Header {
8831	if c.header_ == nil {
8832		c.header_ = make(http.Header)
8833	}
8834	return c.header_
8835}
8836
8837func (c *FoldersExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
8838	reqHeaders := make(http.Header)
8839	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
8840	for k, v := range c.header_ {
8841		reqHeaders[k] = v
8842	}
8843	reqHeaders.Set("User-Agent", c.s.userAgent())
8844	var body io.Reader = nil
8845	c.urlParams_.Set("alt", alt)
8846	c.urlParams_.Set("prettyPrint", "false")
8847	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
8848	urls += "?" + c.urlParams_.Encode()
8849	req, err := http.NewRequest("DELETE", urls, body)
8850	if err != nil {
8851		return nil, err
8852	}
8853	req.Header = reqHeaders
8854	googleapi.Expand(req.URL, map[string]string{
8855		"name": c.name,
8856	})
8857	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8858}
8859
8860// Do executes the "logging.folders.exclusions.delete" call.
8861// Exactly one of *Empty or error will be non-nil. Any non-2xx status
8862// code is an error. Response headers are in either
8863// *Empty.ServerResponse.Header or (if a response was returned at all)
8864// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8865// check whether the returned error was because http.StatusNotModified
8866// was returned.
8867func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
8868	gensupport.SetOptions(c.urlParams_, opts...)
8869	res, err := c.doRequest("json")
8870	if res != nil && res.StatusCode == http.StatusNotModified {
8871		if res.Body != nil {
8872			res.Body.Close()
8873		}
8874		return nil, &googleapi.Error{
8875			Code:   res.StatusCode,
8876			Header: res.Header,
8877		}
8878	}
8879	if err != nil {
8880		return nil, err
8881	}
8882	defer googleapi.CloseBody(res)
8883	if err := googleapi.CheckResponse(res); err != nil {
8884		return nil, err
8885	}
8886	ret := &Empty{
8887		ServerResponse: googleapi.ServerResponse{
8888			Header:         res.Header,
8889			HTTPStatusCode: res.StatusCode,
8890		},
8891	}
8892	target := &ret
8893	if err := gensupport.DecodeResponse(target, res); err != nil {
8894		return nil, err
8895	}
8896	return ret, nil
8897	// {
8898	//   "description": "Deletes an exclusion.",
8899	//   "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
8900	//   "httpMethod": "DELETE",
8901	//   "id": "logging.folders.exclusions.delete",
8902	//   "parameterOrder": [
8903	//     "name"
8904	//   ],
8905	//   "parameters": {
8906	//     "name": {
8907	//       "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
8908	//       "location": "path",
8909	//       "pattern": "^folders/[^/]+/exclusions/[^/]+$",
8910	//       "required": true,
8911	//       "type": "string"
8912	//     }
8913	//   },
8914	//   "path": "v2/{+name}",
8915	//   "response": {
8916	//     "$ref": "Empty"
8917	//   },
8918	//   "scopes": [
8919	//     "https://www.googleapis.com/auth/cloud-platform",
8920	//     "https://www.googleapis.com/auth/logging.admin"
8921	//   ]
8922	// }
8923
8924}
8925
8926// method id "logging.folders.exclusions.get":
8927
8928type FoldersExclusionsGetCall struct {
8929	s            *Service
8930	name         string
8931	urlParams_   gensupport.URLParams
8932	ifNoneMatch_ string
8933	ctx_         context.Context
8934	header_      http.Header
8935}
8936
8937// Get: Gets the description of an exclusion.
8938func (r *FoldersExclusionsService) Get(name string) *FoldersExclusionsGetCall {
8939	c := &FoldersExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8940	c.name = name
8941	return c
8942}
8943
8944// Fields allows partial responses to be retrieved. See
8945// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8946// for more information.
8947func (c *FoldersExclusionsGetCall) Fields(s ...googleapi.Field) *FoldersExclusionsGetCall {
8948	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8949	return c
8950}
8951
8952// IfNoneMatch sets the optional parameter which makes the operation
8953// fail if the object's ETag matches the given value. This is useful for
8954// getting updates only after the object has changed since the last
8955// request. Use googleapi.IsNotModified to check whether the response
8956// error from Do is the result of In-None-Match.
8957func (c *FoldersExclusionsGetCall) IfNoneMatch(entityTag string) *FoldersExclusionsGetCall {
8958	c.ifNoneMatch_ = entityTag
8959	return c
8960}
8961
8962// Context sets the context to be used in this call's Do method. Any
8963// pending HTTP request will be aborted if the provided context is
8964// canceled.
8965func (c *FoldersExclusionsGetCall) Context(ctx context.Context) *FoldersExclusionsGetCall {
8966	c.ctx_ = ctx
8967	return c
8968}
8969
8970// Header returns an http.Header that can be modified by the caller to
8971// add HTTP headers to the request.
8972func (c *FoldersExclusionsGetCall) Header() http.Header {
8973	if c.header_ == nil {
8974		c.header_ = make(http.Header)
8975	}
8976	return c.header_
8977}
8978
8979func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
8980	reqHeaders := make(http.Header)
8981	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
8982	for k, v := range c.header_ {
8983		reqHeaders[k] = v
8984	}
8985	reqHeaders.Set("User-Agent", c.s.userAgent())
8986	if c.ifNoneMatch_ != "" {
8987		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8988	}
8989	var body io.Reader = nil
8990	c.urlParams_.Set("alt", alt)
8991	c.urlParams_.Set("prettyPrint", "false")
8992	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
8993	urls += "?" + c.urlParams_.Encode()
8994	req, err := http.NewRequest("GET", urls, body)
8995	if err != nil {
8996		return nil, err
8997	}
8998	req.Header = reqHeaders
8999	googleapi.Expand(req.URL, map[string]string{
9000		"name": c.name,
9001	})
9002	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9003}
9004
9005// Do executes the "logging.folders.exclusions.get" call.
9006// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
9007// status code is an error. Response headers are in either
9008// *LogExclusion.ServerResponse.Header or (if a response was returned at
9009// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9010// to check whether the returned error was because
9011// http.StatusNotModified was returned.
9012func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
9013	gensupport.SetOptions(c.urlParams_, opts...)
9014	res, err := c.doRequest("json")
9015	if res != nil && res.StatusCode == http.StatusNotModified {
9016		if res.Body != nil {
9017			res.Body.Close()
9018		}
9019		return nil, &googleapi.Error{
9020			Code:   res.StatusCode,
9021			Header: res.Header,
9022		}
9023	}
9024	if err != nil {
9025		return nil, err
9026	}
9027	defer googleapi.CloseBody(res)
9028	if err := googleapi.CheckResponse(res); err != nil {
9029		return nil, err
9030	}
9031	ret := &LogExclusion{
9032		ServerResponse: googleapi.ServerResponse{
9033			Header:         res.Header,
9034			HTTPStatusCode: res.StatusCode,
9035		},
9036	}
9037	target := &ret
9038	if err := gensupport.DecodeResponse(target, res); err != nil {
9039		return nil, err
9040	}
9041	return ret, nil
9042	// {
9043	//   "description": "Gets the description of an exclusion.",
9044	//   "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
9045	//   "httpMethod": "GET",
9046	//   "id": "logging.folders.exclusions.get",
9047	//   "parameterOrder": [
9048	//     "name"
9049	//   ],
9050	//   "parameters": {
9051	//     "name": {
9052	//       "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
9053	//       "location": "path",
9054	//       "pattern": "^folders/[^/]+/exclusions/[^/]+$",
9055	//       "required": true,
9056	//       "type": "string"
9057	//     }
9058	//   },
9059	//   "path": "v2/{+name}",
9060	//   "response": {
9061	//     "$ref": "LogExclusion"
9062	//   },
9063	//   "scopes": [
9064	//     "https://www.googleapis.com/auth/cloud-platform",
9065	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9066	//     "https://www.googleapis.com/auth/logging.admin",
9067	//     "https://www.googleapis.com/auth/logging.read"
9068	//   ]
9069	// }
9070
9071}
9072
9073// method id "logging.folders.exclusions.list":
9074
9075type FoldersExclusionsListCall struct {
9076	s            *Service
9077	parent       string
9078	urlParams_   gensupport.URLParams
9079	ifNoneMatch_ string
9080	ctx_         context.Context
9081	header_      http.Header
9082}
9083
9084// List: Lists all the exclusions in a parent resource.
9085func (r *FoldersExclusionsService) List(parent string) *FoldersExclusionsListCall {
9086	c := &FoldersExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9087	c.parent = parent
9088	return c
9089}
9090
9091// PageSize sets the optional parameter "pageSize": The maximum number
9092// of results to return from this request. Non-positive values are
9093// ignored. The presence of nextPageToken in the response indicates that
9094// more results might be available.
9095func (c *FoldersExclusionsListCall) PageSize(pageSize int64) *FoldersExclusionsListCall {
9096	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9097	return c
9098}
9099
9100// PageToken sets the optional parameter "pageToken": If present, then
9101// retrieve the next batch of results from the preceding call to this
9102// method. pageToken must be the value of nextPageToken from the
9103// previous response. The values of other method parameters should be
9104// identical to those in the previous call.
9105func (c *FoldersExclusionsListCall) PageToken(pageToken string) *FoldersExclusionsListCall {
9106	c.urlParams_.Set("pageToken", pageToken)
9107	return c
9108}
9109
9110// Fields allows partial responses to be retrieved. See
9111// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9112// for more information.
9113func (c *FoldersExclusionsListCall) Fields(s ...googleapi.Field) *FoldersExclusionsListCall {
9114	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9115	return c
9116}
9117
9118// IfNoneMatch sets the optional parameter which makes the operation
9119// fail if the object's ETag matches the given value. This is useful for
9120// getting updates only after the object has changed since the last
9121// request. Use googleapi.IsNotModified to check whether the response
9122// error from Do is the result of In-None-Match.
9123func (c *FoldersExclusionsListCall) IfNoneMatch(entityTag string) *FoldersExclusionsListCall {
9124	c.ifNoneMatch_ = entityTag
9125	return c
9126}
9127
9128// Context sets the context to be used in this call's Do method. Any
9129// pending HTTP request will be aborted if the provided context is
9130// canceled.
9131func (c *FoldersExclusionsListCall) Context(ctx context.Context) *FoldersExclusionsListCall {
9132	c.ctx_ = ctx
9133	return c
9134}
9135
9136// Header returns an http.Header that can be modified by the caller to
9137// add HTTP headers to the request.
9138func (c *FoldersExclusionsListCall) Header() http.Header {
9139	if c.header_ == nil {
9140		c.header_ = make(http.Header)
9141	}
9142	return c.header_
9143}
9144
9145func (c *FoldersExclusionsListCall) doRequest(alt string) (*http.Response, error) {
9146	reqHeaders := make(http.Header)
9147	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
9148	for k, v := range c.header_ {
9149		reqHeaders[k] = v
9150	}
9151	reqHeaders.Set("User-Agent", c.s.userAgent())
9152	if c.ifNoneMatch_ != "" {
9153		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9154	}
9155	var body io.Reader = nil
9156	c.urlParams_.Set("alt", alt)
9157	c.urlParams_.Set("prettyPrint", "false")
9158	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
9159	urls += "?" + c.urlParams_.Encode()
9160	req, err := http.NewRequest("GET", urls, body)
9161	if err != nil {
9162		return nil, err
9163	}
9164	req.Header = reqHeaders
9165	googleapi.Expand(req.URL, map[string]string{
9166		"parent": c.parent,
9167	})
9168	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9169}
9170
9171// Do executes the "logging.folders.exclusions.list" call.
9172// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
9173// non-2xx status code is an error. Response headers are in either
9174// *ListExclusionsResponse.ServerResponse.Header or (if a response was
9175// returned at all) in error.(*googleapi.Error).Header. Use
9176// googleapi.IsNotModified to check whether the returned error was
9177// because http.StatusNotModified was returned.
9178func (c *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
9179	gensupport.SetOptions(c.urlParams_, opts...)
9180	res, err := c.doRequest("json")
9181	if res != nil && res.StatusCode == http.StatusNotModified {
9182		if res.Body != nil {
9183			res.Body.Close()
9184		}
9185		return nil, &googleapi.Error{
9186			Code:   res.StatusCode,
9187			Header: res.Header,
9188		}
9189	}
9190	if err != nil {
9191		return nil, err
9192	}
9193	defer googleapi.CloseBody(res)
9194	if err := googleapi.CheckResponse(res); err != nil {
9195		return nil, err
9196	}
9197	ret := &ListExclusionsResponse{
9198		ServerResponse: googleapi.ServerResponse{
9199			Header:         res.Header,
9200			HTTPStatusCode: res.StatusCode,
9201		},
9202	}
9203	target := &ret
9204	if err := gensupport.DecodeResponse(target, res); err != nil {
9205		return nil, err
9206	}
9207	return ret, nil
9208	// {
9209	//   "description": "Lists all the exclusions in a parent resource.",
9210	//   "flatPath": "v2/folders/{foldersId}/exclusions",
9211	//   "httpMethod": "GET",
9212	//   "id": "logging.folders.exclusions.list",
9213	//   "parameterOrder": [
9214	//     "parent"
9215	//   ],
9216	//   "parameters": {
9217	//     "pageSize": {
9218	//       "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.",
9219	//       "format": "int32",
9220	//       "location": "query",
9221	//       "type": "integer"
9222	//     },
9223	//     "pageToken": {
9224	//       "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.",
9225	//       "location": "query",
9226	//       "type": "string"
9227	//     },
9228	//     "parent": {
9229	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
9230	//       "location": "path",
9231	//       "pattern": "^folders/[^/]+$",
9232	//       "required": true,
9233	//       "type": "string"
9234	//     }
9235	//   },
9236	//   "path": "v2/{+parent}/exclusions",
9237	//   "response": {
9238	//     "$ref": "ListExclusionsResponse"
9239	//   },
9240	//   "scopes": [
9241	//     "https://www.googleapis.com/auth/cloud-platform",
9242	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9243	//     "https://www.googleapis.com/auth/logging.admin",
9244	//     "https://www.googleapis.com/auth/logging.read"
9245	//   ]
9246	// }
9247
9248}
9249
9250// Pages invokes f for each page of results.
9251// A non-nil error returned from f will halt the iteration.
9252// The provided context supersedes any context provided to the Context method.
9253func (c *FoldersExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
9254	c.ctx_ = ctx
9255	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
9256	for {
9257		x, err := c.Do()
9258		if err != nil {
9259			return err
9260		}
9261		if err := f(x); err != nil {
9262			return err
9263		}
9264		if x.NextPageToken == "" {
9265			return nil
9266		}
9267		c.PageToken(x.NextPageToken)
9268	}
9269}
9270
9271// method id "logging.folders.exclusions.patch":
9272
9273type FoldersExclusionsPatchCall struct {
9274	s            *Service
9275	name         string
9276	logexclusion *LogExclusion
9277	urlParams_   gensupport.URLParams
9278	ctx_         context.Context
9279	header_      http.Header
9280}
9281
9282// Patch: Changes one or more properties of an existing exclusion.
9283func (r *FoldersExclusionsService) Patch(name string, logexclusion *LogExclusion) *FoldersExclusionsPatchCall {
9284	c := &FoldersExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9285	c.name = name
9286	c.logexclusion = logexclusion
9287	return c
9288}
9289
9290// UpdateMask sets the optional parameter "updateMask": Required. A
9291// non-empty list of fields to change in the existing exclusion. New
9292// values for the fields are taken from the corresponding fields in the
9293// LogExclusion included in this request. Fields not mentioned in
9294// update_mask are not changed and are ignored in the request.For
9295// example, to change the filter and description of an exclusion,
9296// specify an update_mask of "filter,description".
9297func (c *FoldersExclusionsPatchCall) UpdateMask(updateMask string) *FoldersExclusionsPatchCall {
9298	c.urlParams_.Set("updateMask", updateMask)
9299	return c
9300}
9301
9302// Fields allows partial responses to be retrieved. See
9303// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9304// for more information.
9305func (c *FoldersExclusionsPatchCall) Fields(s ...googleapi.Field) *FoldersExclusionsPatchCall {
9306	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9307	return c
9308}
9309
9310// Context sets the context to be used in this call's Do method. Any
9311// pending HTTP request will be aborted if the provided context is
9312// canceled.
9313func (c *FoldersExclusionsPatchCall) Context(ctx context.Context) *FoldersExclusionsPatchCall {
9314	c.ctx_ = ctx
9315	return c
9316}
9317
9318// Header returns an http.Header that can be modified by the caller to
9319// add HTTP headers to the request.
9320func (c *FoldersExclusionsPatchCall) Header() http.Header {
9321	if c.header_ == nil {
9322		c.header_ = make(http.Header)
9323	}
9324	return c.header_
9325}
9326
9327func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
9328	reqHeaders := make(http.Header)
9329	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
9330	for k, v := range c.header_ {
9331		reqHeaders[k] = v
9332	}
9333	reqHeaders.Set("User-Agent", c.s.userAgent())
9334	var body io.Reader = nil
9335	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
9336	if err != nil {
9337		return nil, err
9338	}
9339	reqHeaders.Set("Content-Type", "application/json")
9340	c.urlParams_.Set("alt", alt)
9341	c.urlParams_.Set("prettyPrint", "false")
9342	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
9343	urls += "?" + c.urlParams_.Encode()
9344	req, err := http.NewRequest("PATCH", urls, body)
9345	if err != nil {
9346		return nil, err
9347	}
9348	req.Header = reqHeaders
9349	googleapi.Expand(req.URL, map[string]string{
9350		"name": c.name,
9351	})
9352	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9353}
9354
9355// Do executes the "logging.folders.exclusions.patch" call.
9356// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
9357// status code is an error. Response headers are in either
9358// *LogExclusion.ServerResponse.Header or (if a response was returned at
9359// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9360// to check whether the returned error was because
9361// http.StatusNotModified was returned.
9362func (c *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
9363	gensupport.SetOptions(c.urlParams_, opts...)
9364	res, err := c.doRequest("json")
9365	if res != nil && res.StatusCode == http.StatusNotModified {
9366		if res.Body != nil {
9367			res.Body.Close()
9368		}
9369		return nil, &googleapi.Error{
9370			Code:   res.StatusCode,
9371			Header: res.Header,
9372		}
9373	}
9374	if err != nil {
9375		return nil, err
9376	}
9377	defer googleapi.CloseBody(res)
9378	if err := googleapi.CheckResponse(res); err != nil {
9379		return nil, err
9380	}
9381	ret := &LogExclusion{
9382		ServerResponse: googleapi.ServerResponse{
9383			Header:         res.Header,
9384			HTTPStatusCode: res.StatusCode,
9385		},
9386	}
9387	target := &ret
9388	if err := gensupport.DecodeResponse(target, res); err != nil {
9389		return nil, err
9390	}
9391	return ret, nil
9392	// {
9393	//   "description": "Changes one or more properties of an existing exclusion.",
9394	//   "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
9395	//   "httpMethod": "PATCH",
9396	//   "id": "logging.folders.exclusions.patch",
9397	//   "parameterOrder": [
9398	//     "name"
9399	//   ],
9400	//   "parameters": {
9401	//     "name": {
9402	//       "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
9403	//       "location": "path",
9404	//       "pattern": "^folders/[^/]+/exclusions/[^/]+$",
9405	//       "required": true,
9406	//       "type": "string"
9407	//     },
9408	//     "updateMask": {
9409	//       "description": "Required. A non-empty 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\".",
9410	//       "format": "google-fieldmask",
9411	//       "location": "query",
9412	//       "type": "string"
9413	//     }
9414	//   },
9415	//   "path": "v2/{+name}",
9416	//   "request": {
9417	//     "$ref": "LogExclusion"
9418	//   },
9419	//   "response": {
9420	//     "$ref": "LogExclusion"
9421	//   },
9422	//   "scopes": [
9423	//     "https://www.googleapis.com/auth/cloud-platform",
9424	//     "https://www.googleapis.com/auth/logging.admin"
9425	//   ]
9426	// }
9427
9428}
9429
9430// method id "logging.folders.locations.get":
9431
9432type FoldersLocationsGetCall struct {
9433	s            *Service
9434	name         string
9435	urlParams_   gensupport.URLParams
9436	ifNoneMatch_ string
9437	ctx_         context.Context
9438	header_      http.Header
9439}
9440
9441// Get: Gets information about a location.
9442func (r *FoldersLocationsService) Get(name string) *FoldersLocationsGetCall {
9443	c := &FoldersLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9444	c.name = name
9445	return c
9446}
9447
9448// Fields allows partial responses to be retrieved. See
9449// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9450// for more information.
9451func (c *FoldersLocationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsGetCall {
9452	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9453	return c
9454}
9455
9456// IfNoneMatch sets the optional parameter which makes the operation
9457// fail if the object's ETag matches the given value. This is useful for
9458// getting updates only after the object has changed since the last
9459// request. Use googleapi.IsNotModified to check whether the response
9460// error from Do is the result of In-None-Match.
9461func (c *FoldersLocationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsGetCall {
9462	c.ifNoneMatch_ = entityTag
9463	return c
9464}
9465
9466// Context sets the context to be used in this call's Do method. Any
9467// pending HTTP request will be aborted if the provided context is
9468// canceled.
9469func (c *FoldersLocationsGetCall) Context(ctx context.Context) *FoldersLocationsGetCall {
9470	c.ctx_ = ctx
9471	return c
9472}
9473
9474// Header returns an http.Header that can be modified by the caller to
9475// add HTTP headers to the request.
9476func (c *FoldersLocationsGetCall) Header() http.Header {
9477	if c.header_ == nil {
9478		c.header_ = make(http.Header)
9479	}
9480	return c.header_
9481}
9482
9483func (c *FoldersLocationsGetCall) doRequest(alt string) (*http.Response, error) {
9484	reqHeaders := make(http.Header)
9485	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
9486	for k, v := range c.header_ {
9487		reqHeaders[k] = v
9488	}
9489	reqHeaders.Set("User-Agent", c.s.userAgent())
9490	if c.ifNoneMatch_ != "" {
9491		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9492	}
9493	var body io.Reader = nil
9494	c.urlParams_.Set("alt", alt)
9495	c.urlParams_.Set("prettyPrint", "false")
9496	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
9497	urls += "?" + c.urlParams_.Encode()
9498	req, err := http.NewRequest("GET", urls, body)
9499	if err != nil {
9500		return nil, err
9501	}
9502	req.Header = reqHeaders
9503	googleapi.Expand(req.URL, map[string]string{
9504		"name": c.name,
9505	})
9506	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9507}
9508
9509// Do executes the "logging.folders.locations.get" call.
9510// Exactly one of *Location or error will be non-nil. Any non-2xx status
9511// code is an error. Response headers are in either
9512// *Location.ServerResponse.Header or (if a response was returned at
9513// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9514// to check whether the returned error was because
9515// http.StatusNotModified was returned.
9516func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
9517	gensupport.SetOptions(c.urlParams_, opts...)
9518	res, err := c.doRequest("json")
9519	if res != nil && res.StatusCode == http.StatusNotModified {
9520		if res.Body != nil {
9521			res.Body.Close()
9522		}
9523		return nil, &googleapi.Error{
9524			Code:   res.StatusCode,
9525			Header: res.Header,
9526		}
9527	}
9528	if err != nil {
9529		return nil, err
9530	}
9531	defer googleapi.CloseBody(res)
9532	if err := googleapi.CheckResponse(res); err != nil {
9533		return nil, err
9534	}
9535	ret := &Location{
9536		ServerResponse: googleapi.ServerResponse{
9537			Header:         res.Header,
9538			HTTPStatusCode: res.StatusCode,
9539		},
9540	}
9541	target := &ret
9542	if err := gensupport.DecodeResponse(target, res); err != nil {
9543		return nil, err
9544	}
9545	return ret, nil
9546	// {
9547	//   "description": "Gets information about a location.",
9548	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}",
9549	//   "httpMethod": "GET",
9550	//   "id": "logging.folders.locations.get",
9551	//   "parameterOrder": [
9552	//     "name"
9553	//   ],
9554	//   "parameters": {
9555	//     "name": {
9556	//       "description": "Resource name for the location.",
9557	//       "location": "path",
9558	//       "pattern": "^folders/[^/]+/locations/[^/]+$",
9559	//       "required": true,
9560	//       "type": "string"
9561	//     }
9562	//   },
9563	//   "path": "v2/{+name}",
9564	//   "response": {
9565	//     "$ref": "Location"
9566	//   },
9567	//   "scopes": [
9568	//     "https://www.googleapis.com/auth/cloud-platform",
9569	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9570	//     "https://www.googleapis.com/auth/logging.admin",
9571	//     "https://www.googleapis.com/auth/logging.read"
9572	//   ]
9573	// }
9574
9575}
9576
9577// method id "logging.folders.locations.list":
9578
9579type FoldersLocationsListCall struct {
9580	s            *Service
9581	name         string
9582	urlParams_   gensupport.URLParams
9583	ifNoneMatch_ string
9584	ctx_         context.Context
9585	header_      http.Header
9586}
9587
9588// List: Lists information about the supported locations for this
9589// service.
9590func (r *FoldersLocationsService) List(name string) *FoldersLocationsListCall {
9591	c := &FoldersLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9592	c.name = name
9593	return c
9594}
9595
9596// Filter sets the optional parameter "filter": The standard list
9597// filter.
9598func (c *FoldersLocationsListCall) Filter(filter string) *FoldersLocationsListCall {
9599	c.urlParams_.Set("filter", filter)
9600	return c
9601}
9602
9603// PageSize sets the optional parameter "pageSize": The standard list
9604// page size.
9605func (c *FoldersLocationsListCall) PageSize(pageSize int64) *FoldersLocationsListCall {
9606	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9607	return c
9608}
9609
9610// PageToken sets the optional parameter "pageToken": The standard list
9611// page token.
9612func (c *FoldersLocationsListCall) PageToken(pageToken string) *FoldersLocationsListCall {
9613	c.urlParams_.Set("pageToken", pageToken)
9614	return c
9615}
9616
9617// Fields allows partial responses to be retrieved. See
9618// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9619// for more information.
9620func (c *FoldersLocationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsListCall {
9621	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9622	return c
9623}
9624
9625// IfNoneMatch sets the optional parameter which makes the operation
9626// fail if the object's ETag matches the given value. This is useful for
9627// getting updates only after the object has changed since the last
9628// request. Use googleapi.IsNotModified to check whether the response
9629// error from Do is the result of In-None-Match.
9630func (c *FoldersLocationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsListCall {
9631	c.ifNoneMatch_ = entityTag
9632	return c
9633}
9634
9635// Context sets the context to be used in this call's Do method. Any
9636// pending HTTP request will be aborted if the provided context is
9637// canceled.
9638func (c *FoldersLocationsListCall) Context(ctx context.Context) *FoldersLocationsListCall {
9639	c.ctx_ = ctx
9640	return c
9641}
9642
9643// Header returns an http.Header that can be modified by the caller to
9644// add HTTP headers to the request.
9645func (c *FoldersLocationsListCall) Header() http.Header {
9646	if c.header_ == nil {
9647		c.header_ = make(http.Header)
9648	}
9649	return c.header_
9650}
9651
9652func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) {
9653	reqHeaders := make(http.Header)
9654	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
9655	for k, v := range c.header_ {
9656		reqHeaders[k] = v
9657	}
9658	reqHeaders.Set("User-Agent", c.s.userAgent())
9659	if c.ifNoneMatch_ != "" {
9660		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9661	}
9662	var body io.Reader = nil
9663	c.urlParams_.Set("alt", alt)
9664	c.urlParams_.Set("prettyPrint", "false")
9665	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
9666	urls += "?" + c.urlParams_.Encode()
9667	req, err := http.NewRequest("GET", urls, body)
9668	if err != nil {
9669		return nil, err
9670	}
9671	req.Header = reqHeaders
9672	googleapi.Expand(req.URL, map[string]string{
9673		"name": c.name,
9674	})
9675	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9676}
9677
9678// Do executes the "logging.folders.locations.list" call.
9679// Exactly one of *ListLocationsResponse or error will be non-nil. Any
9680// non-2xx status code is an error. Response headers are in either
9681// *ListLocationsResponse.ServerResponse.Header or (if a response was
9682// returned at all) in error.(*googleapi.Error).Header. Use
9683// googleapi.IsNotModified to check whether the returned error was
9684// because http.StatusNotModified was returned.
9685func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
9686	gensupport.SetOptions(c.urlParams_, opts...)
9687	res, err := c.doRequest("json")
9688	if res != nil && res.StatusCode == http.StatusNotModified {
9689		if res.Body != nil {
9690			res.Body.Close()
9691		}
9692		return nil, &googleapi.Error{
9693			Code:   res.StatusCode,
9694			Header: res.Header,
9695		}
9696	}
9697	if err != nil {
9698		return nil, err
9699	}
9700	defer googleapi.CloseBody(res)
9701	if err := googleapi.CheckResponse(res); err != nil {
9702		return nil, err
9703	}
9704	ret := &ListLocationsResponse{
9705		ServerResponse: googleapi.ServerResponse{
9706			Header:         res.Header,
9707			HTTPStatusCode: res.StatusCode,
9708		},
9709	}
9710	target := &ret
9711	if err := gensupport.DecodeResponse(target, res); err != nil {
9712		return nil, err
9713	}
9714	return ret, nil
9715	// {
9716	//   "description": "Lists information about the supported locations for this service.",
9717	//   "flatPath": "v2/folders/{foldersId}/locations",
9718	//   "httpMethod": "GET",
9719	//   "id": "logging.folders.locations.list",
9720	//   "parameterOrder": [
9721	//     "name"
9722	//   ],
9723	//   "parameters": {
9724	//     "filter": {
9725	//       "description": "The standard list filter.",
9726	//       "location": "query",
9727	//       "type": "string"
9728	//     },
9729	//     "name": {
9730	//       "description": "The resource that owns the locations collection, if applicable.",
9731	//       "location": "path",
9732	//       "pattern": "^folders/[^/]+$",
9733	//       "required": true,
9734	//       "type": "string"
9735	//     },
9736	//     "pageSize": {
9737	//       "description": "The standard list page size.",
9738	//       "format": "int32",
9739	//       "location": "query",
9740	//       "type": "integer"
9741	//     },
9742	//     "pageToken": {
9743	//       "description": "The standard list page token.",
9744	//       "location": "query",
9745	//       "type": "string"
9746	//     }
9747	//   },
9748	//   "path": "v2/{+name}/locations",
9749	//   "response": {
9750	//     "$ref": "ListLocationsResponse"
9751	//   },
9752	//   "scopes": [
9753	//     "https://www.googleapis.com/auth/cloud-platform",
9754	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9755	//     "https://www.googleapis.com/auth/logging.admin",
9756	//     "https://www.googleapis.com/auth/logging.read"
9757	//   ]
9758	// }
9759
9760}
9761
9762// Pages invokes f for each page of results.
9763// A non-nil error returned from f will halt the iteration.
9764// The provided context supersedes any context provided to the Context method.
9765func (c *FoldersLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
9766	c.ctx_ = ctx
9767	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
9768	for {
9769		x, err := c.Do()
9770		if err != nil {
9771			return err
9772		}
9773		if err := f(x); err != nil {
9774			return err
9775		}
9776		if x.NextPageToken == "" {
9777			return nil
9778		}
9779		c.PageToken(x.NextPageToken)
9780	}
9781}
9782
9783// method id "logging.folders.locations.buckets.create":
9784
9785type FoldersLocationsBucketsCreateCall struct {
9786	s          *Service
9787	parent     string
9788	logbucket  *LogBucket
9789	urlParams_ gensupport.URLParams
9790	ctx_       context.Context
9791	header_    http.Header
9792}
9793
9794// Create: Creates a bucket that can be used to store log entries. Once
9795// a bucket has been created, the region cannot be changed.
9796func (r *FoldersLocationsBucketsService) Create(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateCall {
9797	c := &FoldersLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9798	c.parent = parent
9799	c.logbucket = logbucket
9800	return c
9801}
9802
9803// BucketId sets the optional parameter "bucketId": Required. A
9804// client-assigned identifier such as "my-bucket". Identifiers are
9805// limited to 100 characters and can include only letters, digits,
9806// underscores, hyphens, and periods.
9807func (c *FoldersLocationsBucketsCreateCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateCall {
9808	c.urlParams_.Set("bucketId", bucketId)
9809	return c
9810}
9811
9812// Fields allows partial responses to be retrieved. See
9813// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9814// for more information.
9815func (c *FoldersLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateCall {
9816	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9817	return c
9818}
9819
9820// Context sets the context to be used in this call's Do method. Any
9821// pending HTTP request will be aborted if the provided context is
9822// canceled.
9823func (c *FoldersLocationsBucketsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateCall {
9824	c.ctx_ = ctx
9825	return c
9826}
9827
9828// Header returns an http.Header that can be modified by the caller to
9829// add HTTP headers to the request.
9830func (c *FoldersLocationsBucketsCreateCall) Header() http.Header {
9831	if c.header_ == nil {
9832		c.header_ = make(http.Header)
9833	}
9834	return c.header_
9835}
9836
9837func (c *FoldersLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
9838	reqHeaders := make(http.Header)
9839	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
9840	for k, v := range c.header_ {
9841		reqHeaders[k] = v
9842	}
9843	reqHeaders.Set("User-Agent", c.s.userAgent())
9844	var body io.Reader = nil
9845	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
9846	if err != nil {
9847		return nil, err
9848	}
9849	reqHeaders.Set("Content-Type", "application/json")
9850	c.urlParams_.Set("alt", alt)
9851	c.urlParams_.Set("prettyPrint", "false")
9852	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
9853	urls += "?" + c.urlParams_.Encode()
9854	req, err := http.NewRequest("POST", urls, body)
9855	if err != nil {
9856		return nil, err
9857	}
9858	req.Header = reqHeaders
9859	googleapi.Expand(req.URL, map[string]string{
9860		"parent": c.parent,
9861	})
9862	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9863}
9864
9865// Do executes the "logging.folders.locations.buckets.create" call.
9866// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
9867// status code is an error. Response headers are in either
9868// *LogBucket.ServerResponse.Header or (if a response was returned at
9869// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9870// to check whether the returned error was because
9871// http.StatusNotModified was returned.
9872func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
9873	gensupport.SetOptions(c.urlParams_, opts...)
9874	res, err := c.doRequest("json")
9875	if res != nil && res.StatusCode == http.StatusNotModified {
9876		if res.Body != nil {
9877			res.Body.Close()
9878		}
9879		return nil, &googleapi.Error{
9880			Code:   res.StatusCode,
9881			Header: res.Header,
9882		}
9883	}
9884	if err != nil {
9885		return nil, err
9886	}
9887	defer googleapi.CloseBody(res)
9888	if err := googleapi.CheckResponse(res); err != nil {
9889		return nil, err
9890	}
9891	ret := &LogBucket{
9892		ServerResponse: googleapi.ServerResponse{
9893			Header:         res.Header,
9894			HTTPStatusCode: res.StatusCode,
9895		},
9896	}
9897	target := &ret
9898	if err := gensupport.DecodeResponse(target, res); err != nil {
9899		return nil, err
9900	}
9901	return ret, nil
9902	// {
9903	//   "description": "Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.",
9904	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets",
9905	//   "httpMethod": "POST",
9906	//   "id": "logging.folders.locations.buckets.create",
9907	//   "parameterOrder": [
9908	//     "parent"
9909	//   ],
9910	//   "parameters": {
9911	//     "bucketId": {
9912	//       "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.",
9913	//       "location": "query",
9914	//       "type": "string"
9915	//     },
9916	//     "parent": {
9917	//       "description": "Required. The resource in which to create the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" Example: \"projects/my-logging-project/locations/global\"",
9918	//       "location": "path",
9919	//       "pattern": "^folders/[^/]+/locations/[^/]+$",
9920	//       "required": true,
9921	//       "type": "string"
9922	//     }
9923	//   },
9924	//   "path": "v2/{+parent}/buckets",
9925	//   "request": {
9926	//     "$ref": "LogBucket"
9927	//   },
9928	//   "response": {
9929	//     "$ref": "LogBucket"
9930	//   },
9931	//   "scopes": [
9932	//     "https://www.googleapis.com/auth/cloud-platform",
9933	//     "https://www.googleapis.com/auth/logging.admin"
9934	//   ]
9935	// }
9936
9937}
9938
9939// method id "logging.folders.locations.buckets.delete":
9940
9941type FoldersLocationsBucketsDeleteCall struct {
9942	s          *Service
9943	name       string
9944	urlParams_ gensupport.URLParams
9945	ctx_       context.Context
9946	header_    http.Header
9947}
9948
9949// Delete: Deletes a bucket. Moves the bucket to the DELETE_REQUESTED
9950// state. After 7 days, the bucket will be purged and all logs in the
9951// bucket will be permanently deleted.
9952func (r *FoldersLocationsBucketsService) Delete(name string) *FoldersLocationsBucketsDeleteCall {
9953	c := &FoldersLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9954	c.name = name
9955	return c
9956}
9957
9958// Fields allows partial responses to be retrieved. See
9959// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9960// for more information.
9961func (c *FoldersLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsDeleteCall {
9962	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9963	return c
9964}
9965
9966// Context sets the context to be used in this call's Do method. Any
9967// pending HTTP request will be aborted if the provided context is
9968// canceled.
9969func (c *FoldersLocationsBucketsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsDeleteCall {
9970	c.ctx_ = ctx
9971	return c
9972}
9973
9974// Header returns an http.Header that can be modified by the caller to
9975// add HTTP headers to the request.
9976func (c *FoldersLocationsBucketsDeleteCall) Header() http.Header {
9977	if c.header_ == nil {
9978		c.header_ = make(http.Header)
9979	}
9980	return c.header_
9981}
9982
9983func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
9984	reqHeaders := make(http.Header)
9985	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
9986	for k, v := range c.header_ {
9987		reqHeaders[k] = v
9988	}
9989	reqHeaders.Set("User-Agent", c.s.userAgent())
9990	var body io.Reader = nil
9991	c.urlParams_.Set("alt", alt)
9992	c.urlParams_.Set("prettyPrint", "false")
9993	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
9994	urls += "?" + c.urlParams_.Encode()
9995	req, err := http.NewRequest("DELETE", urls, body)
9996	if err != nil {
9997		return nil, err
9998	}
9999	req.Header = reqHeaders
10000	googleapi.Expand(req.URL, map[string]string{
10001		"name": c.name,
10002	})
10003	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10004}
10005
10006// Do executes the "logging.folders.locations.buckets.delete" call.
10007// Exactly one of *Empty or error will be non-nil. Any non-2xx status
10008// code is an error. Response headers are in either
10009// *Empty.ServerResponse.Header or (if a response was returned at all)
10010// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10011// check whether the returned error was because http.StatusNotModified
10012// was returned.
10013func (c *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
10014	gensupport.SetOptions(c.urlParams_, opts...)
10015	res, err := c.doRequest("json")
10016	if res != nil && res.StatusCode == http.StatusNotModified {
10017		if res.Body != nil {
10018			res.Body.Close()
10019		}
10020		return nil, &googleapi.Error{
10021			Code:   res.StatusCode,
10022			Header: res.Header,
10023		}
10024	}
10025	if err != nil {
10026		return nil, err
10027	}
10028	defer googleapi.CloseBody(res)
10029	if err := googleapi.CheckResponse(res); err != nil {
10030		return nil, err
10031	}
10032	ret := &Empty{
10033		ServerResponse: googleapi.ServerResponse{
10034			Header:         res.Header,
10035			HTTPStatusCode: res.StatusCode,
10036		},
10037	}
10038	target := &ret
10039	if err := gensupport.DecodeResponse(target, res); err != nil {
10040		return nil, err
10041	}
10042	return ret, nil
10043	// {
10044	//   "description": "Deletes a bucket. Moves the bucket to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all logs in the bucket will be permanently deleted.",
10045	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}",
10046	//   "httpMethod": "DELETE",
10047	//   "id": "logging.folders.locations.buckets.delete",
10048	//   "parameterOrder": [
10049	//     "name"
10050	//   ],
10051	//   "parameters": {
10052	//     "name": {
10053	//       "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
10054	//       "location": "path",
10055	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
10056	//       "required": true,
10057	//       "type": "string"
10058	//     }
10059	//   },
10060	//   "path": "v2/{+name}",
10061	//   "response": {
10062	//     "$ref": "Empty"
10063	//   },
10064	//   "scopes": [
10065	//     "https://www.googleapis.com/auth/cloud-platform",
10066	//     "https://www.googleapis.com/auth/logging.admin"
10067	//   ]
10068	// }
10069
10070}
10071
10072// method id "logging.folders.locations.buckets.get":
10073
10074type FoldersLocationsBucketsGetCall struct {
10075	s            *Service
10076	name         string
10077	urlParams_   gensupport.URLParams
10078	ifNoneMatch_ string
10079	ctx_         context.Context
10080	header_      http.Header
10081}
10082
10083// Get: Gets a bucket.
10084func (r *FoldersLocationsBucketsService) Get(name string) *FoldersLocationsBucketsGetCall {
10085	c := &FoldersLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10086	c.name = name
10087	return c
10088}
10089
10090// Fields allows partial responses to be retrieved. See
10091// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10092// for more information.
10093func (c *FoldersLocationsBucketsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsGetCall {
10094	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10095	return c
10096}
10097
10098// IfNoneMatch sets the optional parameter which makes the operation
10099// fail if the object's ETag matches the given value. This is useful for
10100// getting updates only after the object has changed since the last
10101// request. Use googleapi.IsNotModified to check whether the response
10102// error from Do is the result of In-None-Match.
10103func (c *FoldersLocationsBucketsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsGetCall {
10104	c.ifNoneMatch_ = entityTag
10105	return c
10106}
10107
10108// Context sets the context to be used in this call's Do method. Any
10109// pending HTTP request will be aborted if the provided context is
10110// canceled.
10111func (c *FoldersLocationsBucketsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsGetCall {
10112	c.ctx_ = ctx
10113	return c
10114}
10115
10116// Header returns an http.Header that can be modified by the caller to
10117// add HTTP headers to the request.
10118func (c *FoldersLocationsBucketsGetCall) Header() http.Header {
10119	if c.header_ == nil {
10120		c.header_ = make(http.Header)
10121	}
10122	return c.header_
10123}
10124
10125func (c *FoldersLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
10126	reqHeaders := make(http.Header)
10127	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
10128	for k, v := range c.header_ {
10129		reqHeaders[k] = v
10130	}
10131	reqHeaders.Set("User-Agent", c.s.userAgent())
10132	if c.ifNoneMatch_ != "" {
10133		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10134	}
10135	var body io.Reader = nil
10136	c.urlParams_.Set("alt", alt)
10137	c.urlParams_.Set("prettyPrint", "false")
10138	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
10139	urls += "?" + c.urlParams_.Encode()
10140	req, err := http.NewRequest("GET", urls, body)
10141	if err != nil {
10142		return nil, err
10143	}
10144	req.Header = reqHeaders
10145	googleapi.Expand(req.URL, map[string]string{
10146		"name": c.name,
10147	})
10148	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10149}
10150
10151// Do executes the "logging.folders.locations.buckets.get" call.
10152// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
10153// status code is an error. Response headers are in either
10154// *LogBucket.ServerResponse.Header or (if a response was returned at
10155// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10156// to check whether the returned error was because
10157// http.StatusNotModified was returned.
10158func (c *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
10159	gensupport.SetOptions(c.urlParams_, opts...)
10160	res, err := c.doRequest("json")
10161	if res != nil && res.StatusCode == http.StatusNotModified {
10162		if res.Body != nil {
10163			res.Body.Close()
10164		}
10165		return nil, &googleapi.Error{
10166			Code:   res.StatusCode,
10167			Header: res.Header,
10168		}
10169	}
10170	if err != nil {
10171		return nil, err
10172	}
10173	defer googleapi.CloseBody(res)
10174	if err := googleapi.CheckResponse(res); err != nil {
10175		return nil, err
10176	}
10177	ret := &LogBucket{
10178		ServerResponse: googleapi.ServerResponse{
10179			Header:         res.Header,
10180			HTTPStatusCode: res.StatusCode,
10181		},
10182	}
10183	target := &ret
10184	if err := gensupport.DecodeResponse(target, res); err != nil {
10185		return nil, err
10186	}
10187	return ret, nil
10188	// {
10189	//   "description": "Gets a bucket.",
10190	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}",
10191	//   "httpMethod": "GET",
10192	//   "id": "logging.folders.locations.buckets.get",
10193	//   "parameterOrder": [
10194	//     "name"
10195	//   ],
10196	//   "parameters": {
10197	//     "name": {
10198	//       "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
10199	//       "location": "path",
10200	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
10201	//       "required": true,
10202	//       "type": "string"
10203	//     }
10204	//   },
10205	//   "path": "v2/{+name}",
10206	//   "response": {
10207	//     "$ref": "LogBucket"
10208	//   },
10209	//   "scopes": [
10210	//     "https://www.googleapis.com/auth/cloud-platform",
10211	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10212	//     "https://www.googleapis.com/auth/logging.admin",
10213	//     "https://www.googleapis.com/auth/logging.read"
10214	//   ]
10215	// }
10216
10217}
10218
10219// method id "logging.folders.locations.buckets.list":
10220
10221type FoldersLocationsBucketsListCall struct {
10222	s            *Service
10223	parent       string
10224	urlParams_   gensupport.URLParams
10225	ifNoneMatch_ string
10226	ctx_         context.Context
10227	header_      http.Header
10228}
10229
10230// List: Lists buckets.
10231func (r *FoldersLocationsBucketsService) List(parent string) *FoldersLocationsBucketsListCall {
10232	c := &FoldersLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10233	c.parent = parent
10234	return c
10235}
10236
10237// PageSize sets the optional parameter "pageSize": The maximum number
10238// of results to return from this request. Non-positive values are
10239// ignored. The presence of nextPageToken in the response indicates that
10240// more results might be available.
10241func (c *FoldersLocationsBucketsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsListCall {
10242	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10243	return c
10244}
10245
10246// PageToken sets the optional parameter "pageToken": If present, then
10247// retrieve the next batch of results from the preceding call to this
10248// method. pageToken must be the value of nextPageToken from the
10249// previous response. The values of other method parameters should be
10250// identical to those in the previous call.
10251func (c *FoldersLocationsBucketsListCall) PageToken(pageToken string) *FoldersLocationsBucketsListCall {
10252	c.urlParams_.Set("pageToken", pageToken)
10253	return c
10254}
10255
10256// Fields allows partial responses to be retrieved. See
10257// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10258// for more information.
10259func (c *FoldersLocationsBucketsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsListCall {
10260	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10261	return c
10262}
10263
10264// IfNoneMatch sets the optional parameter which makes the operation
10265// fail if the object's ETag matches the given value. This is useful for
10266// getting updates only after the object has changed since the last
10267// request. Use googleapi.IsNotModified to check whether the response
10268// error from Do is the result of In-None-Match.
10269func (c *FoldersLocationsBucketsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsListCall {
10270	c.ifNoneMatch_ = entityTag
10271	return c
10272}
10273
10274// Context sets the context to be used in this call's Do method. Any
10275// pending HTTP request will be aborted if the provided context is
10276// canceled.
10277func (c *FoldersLocationsBucketsListCall) Context(ctx context.Context) *FoldersLocationsBucketsListCall {
10278	c.ctx_ = ctx
10279	return c
10280}
10281
10282// Header returns an http.Header that can be modified by the caller to
10283// add HTTP headers to the request.
10284func (c *FoldersLocationsBucketsListCall) Header() http.Header {
10285	if c.header_ == nil {
10286		c.header_ = make(http.Header)
10287	}
10288	return c.header_
10289}
10290
10291func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
10292	reqHeaders := make(http.Header)
10293	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
10294	for k, v := range c.header_ {
10295		reqHeaders[k] = v
10296	}
10297	reqHeaders.Set("User-Agent", c.s.userAgent())
10298	if c.ifNoneMatch_ != "" {
10299		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10300	}
10301	var body io.Reader = nil
10302	c.urlParams_.Set("alt", alt)
10303	c.urlParams_.Set("prettyPrint", "false")
10304	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
10305	urls += "?" + c.urlParams_.Encode()
10306	req, err := http.NewRequest("GET", urls, body)
10307	if err != nil {
10308		return nil, err
10309	}
10310	req.Header = reqHeaders
10311	googleapi.Expand(req.URL, map[string]string{
10312		"parent": c.parent,
10313	})
10314	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10315}
10316
10317// Do executes the "logging.folders.locations.buckets.list" call.
10318// Exactly one of *ListBucketsResponse or error will be non-nil. Any
10319// non-2xx status code is an error. Response headers are in either
10320// *ListBucketsResponse.ServerResponse.Header or (if a response was
10321// returned at all) in error.(*googleapi.Error).Header. Use
10322// googleapi.IsNotModified to check whether the returned error was
10323// because http.StatusNotModified was returned.
10324func (c *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
10325	gensupport.SetOptions(c.urlParams_, opts...)
10326	res, err := c.doRequest("json")
10327	if res != nil && res.StatusCode == http.StatusNotModified {
10328		if res.Body != nil {
10329			res.Body.Close()
10330		}
10331		return nil, &googleapi.Error{
10332			Code:   res.StatusCode,
10333			Header: res.Header,
10334		}
10335	}
10336	if err != nil {
10337		return nil, err
10338	}
10339	defer googleapi.CloseBody(res)
10340	if err := googleapi.CheckResponse(res); err != nil {
10341		return nil, err
10342	}
10343	ret := &ListBucketsResponse{
10344		ServerResponse: googleapi.ServerResponse{
10345			Header:         res.Header,
10346			HTTPStatusCode: res.StatusCode,
10347		},
10348	}
10349	target := &ret
10350	if err := gensupport.DecodeResponse(target, res); err != nil {
10351		return nil, err
10352	}
10353	return ret, nil
10354	// {
10355	//   "description": "Lists buckets.",
10356	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets",
10357	//   "httpMethod": "GET",
10358	//   "id": "logging.folders.locations.buckets.list",
10359	//   "parameterOrder": [
10360	//     "parent"
10361	//   ],
10362	//   "parameters": {
10363	//     "pageSize": {
10364	//       "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.",
10365	//       "format": "int32",
10366	//       "location": "query",
10367	//       "type": "integer"
10368	//     },
10369	//     "pageToken": {
10370	//       "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.",
10371	//       "location": "query",
10372	//       "type": "string"
10373	//     },
10374	//     "parent": {
10375	//       "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.",
10376	//       "location": "path",
10377	//       "pattern": "^folders/[^/]+/locations/[^/]+$",
10378	//       "required": true,
10379	//       "type": "string"
10380	//     }
10381	//   },
10382	//   "path": "v2/{+parent}/buckets",
10383	//   "response": {
10384	//     "$ref": "ListBucketsResponse"
10385	//   },
10386	//   "scopes": [
10387	//     "https://www.googleapis.com/auth/cloud-platform",
10388	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10389	//     "https://www.googleapis.com/auth/logging.admin",
10390	//     "https://www.googleapis.com/auth/logging.read"
10391	//   ]
10392	// }
10393
10394}
10395
10396// Pages invokes f for each page of results.
10397// A non-nil error returned from f will halt the iteration.
10398// The provided context supersedes any context provided to the Context method.
10399func (c *FoldersLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
10400	c.ctx_ = ctx
10401	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
10402	for {
10403		x, err := c.Do()
10404		if err != nil {
10405			return err
10406		}
10407		if err := f(x); err != nil {
10408			return err
10409		}
10410		if x.NextPageToken == "" {
10411			return nil
10412		}
10413		c.PageToken(x.NextPageToken)
10414	}
10415}
10416
10417// method id "logging.folders.locations.buckets.patch":
10418
10419type FoldersLocationsBucketsPatchCall struct {
10420	s          *Service
10421	name       string
10422	logbucket  *LogBucket
10423	urlParams_ gensupport.URLParams
10424	ctx_       context.Context
10425	header_    http.Header
10426}
10427
10428// Patch: Updates a bucket. This method replaces the following fields in
10429// the existing bucket with values from the new bucket:
10430// retention_periodIf the retention period is decreased and the bucket
10431// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
10432// LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
10433// returned.A buckets region may not be modified after it is created.
10434func (r *FoldersLocationsBucketsService) Patch(name string, logbucket *LogBucket) *FoldersLocationsBucketsPatchCall {
10435	c := &FoldersLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10436	c.name = name
10437	c.logbucket = logbucket
10438	return c
10439}
10440
10441// UpdateMask sets the optional parameter "updateMask": Required. Field
10442// mask that specifies the fields in bucket that need an update. A
10443// bucket field will be overwritten if, and only if, it is in the update
10444// mask. name and output only fields cannot be updated.For a detailed
10445// FieldMask definition, see
10446// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
10447// updateMask=retention_days.
10448func (c *FoldersLocationsBucketsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsPatchCall {
10449	c.urlParams_.Set("updateMask", updateMask)
10450	return c
10451}
10452
10453// Fields allows partial responses to be retrieved. See
10454// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10455// for more information.
10456func (c *FoldersLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsPatchCall {
10457	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10458	return c
10459}
10460
10461// Context sets the context to be used in this call's Do method. Any
10462// pending HTTP request will be aborted if the provided context is
10463// canceled.
10464func (c *FoldersLocationsBucketsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsPatchCall {
10465	c.ctx_ = ctx
10466	return c
10467}
10468
10469// Header returns an http.Header that can be modified by the caller to
10470// add HTTP headers to the request.
10471func (c *FoldersLocationsBucketsPatchCall) Header() http.Header {
10472	if c.header_ == nil {
10473		c.header_ = make(http.Header)
10474	}
10475	return c.header_
10476}
10477
10478func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
10479	reqHeaders := make(http.Header)
10480	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
10481	for k, v := range c.header_ {
10482		reqHeaders[k] = v
10483	}
10484	reqHeaders.Set("User-Agent", c.s.userAgent())
10485	var body io.Reader = nil
10486	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
10487	if err != nil {
10488		return nil, err
10489	}
10490	reqHeaders.Set("Content-Type", "application/json")
10491	c.urlParams_.Set("alt", alt)
10492	c.urlParams_.Set("prettyPrint", "false")
10493	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
10494	urls += "?" + c.urlParams_.Encode()
10495	req, err := http.NewRequest("PATCH", urls, body)
10496	if err != nil {
10497		return nil, err
10498	}
10499	req.Header = reqHeaders
10500	googleapi.Expand(req.URL, map[string]string{
10501		"name": c.name,
10502	})
10503	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10504}
10505
10506// Do executes the "logging.folders.locations.buckets.patch" call.
10507// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
10508// status code is an error. Response headers are in either
10509// *LogBucket.ServerResponse.Header or (if a response was returned at
10510// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10511// to check whether the returned error was because
10512// http.StatusNotModified was returned.
10513func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
10514	gensupport.SetOptions(c.urlParams_, opts...)
10515	res, err := c.doRequest("json")
10516	if res != nil && res.StatusCode == http.StatusNotModified {
10517		if res.Body != nil {
10518			res.Body.Close()
10519		}
10520		return nil, &googleapi.Error{
10521			Code:   res.StatusCode,
10522			Header: res.Header,
10523		}
10524	}
10525	if err != nil {
10526		return nil, err
10527	}
10528	defer googleapi.CloseBody(res)
10529	if err := googleapi.CheckResponse(res); err != nil {
10530		return nil, err
10531	}
10532	ret := &LogBucket{
10533		ServerResponse: googleapi.ServerResponse{
10534			Header:         res.Header,
10535			HTTPStatusCode: res.StatusCode,
10536		},
10537	}
10538	target := &ret
10539	if err := gensupport.DecodeResponse(target, res); err != nil {
10540		return nil, err
10541	}
10542	return ret, nil
10543	// {
10544	//   "description": "Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created.",
10545	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}",
10546	//   "httpMethod": "PATCH",
10547	//   "id": "logging.folders.locations.buckets.patch",
10548	//   "parameterOrder": [
10549	//     "name"
10550	//   ],
10551	//   "parameters": {
10552	//     "name": {
10553	//       "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\". Also requires permission \"resourcemanager.projects.updateLiens\" to set the locked property",
10554	//       "location": "path",
10555	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
10556	//       "required": true,
10557	//       "type": "string"
10558	//     },
10559	//     "updateMask": {
10560	//       "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days.",
10561	//       "format": "google-fieldmask",
10562	//       "location": "query",
10563	//       "type": "string"
10564	//     }
10565	//   },
10566	//   "path": "v2/{+name}",
10567	//   "request": {
10568	//     "$ref": "LogBucket"
10569	//   },
10570	//   "response": {
10571	//     "$ref": "LogBucket"
10572	//   },
10573	//   "scopes": [
10574	//     "https://www.googleapis.com/auth/cloud-platform",
10575	//     "https://www.googleapis.com/auth/logging.admin"
10576	//   ]
10577	// }
10578
10579}
10580
10581// method id "logging.folders.locations.buckets.undelete":
10582
10583type FoldersLocationsBucketsUndeleteCall struct {
10584	s                     *Service
10585	name                  string
10586	undeletebucketrequest *UndeleteBucketRequest
10587	urlParams_            gensupport.URLParams
10588	ctx_                  context.Context
10589	header_               http.Header
10590}
10591
10592// Undelete: Undeletes a bucket. A bucket that has been deleted may be
10593// undeleted within the grace period of 7 days.
10594func (r *FoldersLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *FoldersLocationsBucketsUndeleteCall {
10595	c := &FoldersLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10596	c.name = name
10597	c.undeletebucketrequest = undeletebucketrequest
10598	return c
10599}
10600
10601// Fields allows partial responses to be retrieved. See
10602// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10603// for more information.
10604func (c *FoldersLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUndeleteCall {
10605	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10606	return c
10607}
10608
10609// Context sets the context to be used in this call's Do method. Any
10610// pending HTTP request will be aborted if the provided context is
10611// canceled.
10612func (c *FoldersLocationsBucketsUndeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsUndeleteCall {
10613	c.ctx_ = ctx
10614	return c
10615}
10616
10617// Header returns an http.Header that can be modified by the caller to
10618// add HTTP headers to the request.
10619func (c *FoldersLocationsBucketsUndeleteCall) Header() http.Header {
10620	if c.header_ == nil {
10621		c.header_ = make(http.Header)
10622	}
10623	return c.header_
10624}
10625
10626func (c *FoldersLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
10627	reqHeaders := make(http.Header)
10628	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
10629	for k, v := range c.header_ {
10630		reqHeaders[k] = v
10631	}
10632	reqHeaders.Set("User-Agent", c.s.userAgent())
10633	var body io.Reader = nil
10634	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
10635	if err != nil {
10636		return nil, err
10637	}
10638	reqHeaders.Set("Content-Type", "application/json")
10639	c.urlParams_.Set("alt", alt)
10640	c.urlParams_.Set("prettyPrint", "false")
10641	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
10642	urls += "?" + c.urlParams_.Encode()
10643	req, err := http.NewRequest("POST", urls, body)
10644	if err != nil {
10645		return nil, err
10646	}
10647	req.Header = reqHeaders
10648	googleapi.Expand(req.URL, map[string]string{
10649		"name": c.name,
10650	})
10651	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10652}
10653
10654// Do executes the "logging.folders.locations.buckets.undelete" call.
10655// Exactly one of *Empty or error will be non-nil. Any non-2xx status
10656// code is an error. Response headers are in either
10657// *Empty.ServerResponse.Header or (if a response was returned at all)
10658// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10659// check whether the returned error was because http.StatusNotModified
10660// was returned.
10661func (c *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
10662	gensupport.SetOptions(c.urlParams_, opts...)
10663	res, err := c.doRequest("json")
10664	if res != nil && res.StatusCode == http.StatusNotModified {
10665		if res.Body != nil {
10666			res.Body.Close()
10667		}
10668		return nil, &googleapi.Error{
10669			Code:   res.StatusCode,
10670			Header: res.Header,
10671		}
10672	}
10673	if err != nil {
10674		return nil, err
10675	}
10676	defer googleapi.CloseBody(res)
10677	if err := googleapi.CheckResponse(res); err != nil {
10678		return nil, err
10679	}
10680	ret := &Empty{
10681		ServerResponse: googleapi.ServerResponse{
10682			Header:         res.Header,
10683			HTTPStatusCode: res.StatusCode,
10684		},
10685	}
10686	target := &ret
10687	if err := gensupport.DecodeResponse(target, res); err != nil {
10688		return nil, err
10689	}
10690	return ret, nil
10691	// {
10692	//   "description": "Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.",
10693	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
10694	//   "httpMethod": "POST",
10695	//   "id": "logging.folders.locations.buckets.undelete",
10696	//   "parameterOrder": [
10697	//     "name"
10698	//   ],
10699	//   "parameters": {
10700	//     "name": {
10701	//       "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
10702	//       "location": "path",
10703	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
10704	//       "required": true,
10705	//       "type": "string"
10706	//     }
10707	//   },
10708	//   "path": "v2/{+name}:undelete",
10709	//   "request": {
10710	//     "$ref": "UndeleteBucketRequest"
10711	//   },
10712	//   "response": {
10713	//     "$ref": "Empty"
10714	//   },
10715	//   "scopes": [
10716	//     "https://www.googleapis.com/auth/cloud-platform",
10717	//     "https://www.googleapis.com/auth/logging.admin"
10718	//   ]
10719	// }
10720
10721}
10722
10723// method id "logging.folders.locations.buckets.views.create":
10724
10725type FoldersLocationsBucketsViewsCreateCall struct {
10726	s          *Service
10727	parent     string
10728	logview    *LogView
10729	urlParams_ gensupport.URLParams
10730	ctx_       context.Context
10731	header_    http.Header
10732}
10733
10734// Create: Creates a view over logs in a bucket. A bucket may contain a
10735// maximum of 50 views.
10736func (r *FoldersLocationsBucketsViewsService) Create(parent string, logview *LogView) *FoldersLocationsBucketsViewsCreateCall {
10737	c := &FoldersLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10738	c.parent = parent
10739	c.logview = logview
10740	return c
10741}
10742
10743// ViewId sets the optional parameter "viewId": Required. The id to use
10744// for this view.
10745func (c *FoldersLocationsBucketsViewsCreateCall) ViewId(viewId string) *FoldersLocationsBucketsViewsCreateCall {
10746	c.urlParams_.Set("viewId", viewId)
10747	return c
10748}
10749
10750// Fields allows partial responses to be retrieved. See
10751// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10752// for more information.
10753func (c *FoldersLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsCreateCall {
10754	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10755	return c
10756}
10757
10758// Context sets the context to be used in this call's Do method. Any
10759// pending HTTP request will be aborted if the provided context is
10760// canceled.
10761func (c *FoldersLocationsBucketsViewsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsCreateCall {
10762	c.ctx_ = ctx
10763	return c
10764}
10765
10766// Header returns an http.Header that can be modified by the caller to
10767// add HTTP headers to the request.
10768func (c *FoldersLocationsBucketsViewsCreateCall) Header() http.Header {
10769	if c.header_ == nil {
10770		c.header_ = make(http.Header)
10771	}
10772	return c.header_
10773}
10774
10775func (c *FoldersLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
10776	reqHeaders := make(http.Header)
10777	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
10778	for k, v := range c.header_ {
10779		reqHeaders[k] = v
10780	}
10781	reqHeaders.Set("User-Agent", c.s.userAgent())
10782	var body io.Reader = nil
10783	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
10784	if err != nil {
10785		return nil, err
10786	}
10787	reqHeaders.Set("Content-Type", "application/json")
10788	c.urlParams_.Set("alt", alt)
10789	c.urlParams_.Set("prettyPrint", "false")
10790	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
10791	urls += "?" + c.urlParams_.Encode()
10792	req, err := http.NewRequest("POST", urls, body)
10793	if err != nil {
10794		return nil, err
10795	}
10796	req.Header = reqHeaders
10797	googleapi.Expand(req.URL, map[string]string{
10798		"parent": c.parent,
10799	})
10800	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10801}
10802
10803// Do executes the "logging.folders.locations.buckets.views.create" call.
10804// Exactly one of *LogView or error will be non-nil. Any non-2xx status
10805// code is an error. Response headers are in either
10806// *LogView.ServerResponse.Header or (if a response was returned at all)
10807// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10808// check whether the returned error was because http.StatusNotModified
10809// was returned.
10810func (c *FoldersLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
10811	gensupport.SetOptions(c.urlParams_, opts...)
10812	res, err := c.doRequest("json")
10813	if res != nil && res.StatusCode == http.StatusNotModified {
10814		if res.Body != nil {
10815			res.Body.Close()
10816		}
10817		return nil, &googleapi.Error{
10818			Code:   res.StatusCode,
10819			Header: res.Header,
10820		}
10821	}
10822	if err != nil {
10823		return nil, err
10824	}
10825	defer googleapi.CloseBody(res)
10826	if err := googleapi.CheckResponse(res); err != nil {
10827		return nil, err
10828	}
10829	ret := &LogView{
10830		ServerResponse: googleapi.ServerResponse{
10831			Header:         res.Header,
10832			HTTPStatusCode: res.StatusCode,
10833		},
10834	}
10835	target := &ret
10836	if err := gensupport.DecodeResponse(target, res); err != nil {
10837		return nil, err
10838	}
10839	return ret, nil
10840	// {
10841	//   "description": "Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.",
10842	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views",
10843	//   "httpMethod": "POST",
10844	//   "id": "logging.folders.locations.buckets.views.create",
10845	//   "parameterOrder": [
10846	//     "parent"
10847	//   ],
10848	//   "parameters": {
10849	//     "parent": {
10850	//       "description": "Required. The bucket in which to create the view \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-logging-project/locations/my-location/buckets/my-bucket\"",
10851	//       "location": "path",
10852	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
10853	//       "required": true,
10854	//       "type": "string"
10855	//     },
10856	//     "viewId": {
10857	//       "description": "Required. The id to use for this view.",
10858	//       "location": "query",
10859	//       "type": "string"
10860	//     }
10861	//   },
10862	//   "path": "v2/{+parent}/views",
10863	//   "request": {
10864	//     "$ref": "LogView"
10865	//   },
10866	//   "response": {
10867	//     "$ref": "LogView"
10868	//   },
10869	//   "scopes": [
10870	//     "https://www.googleapis.com/auth/cloud-platform",
10871	//     "https://www.googleapis.com/auth/logging.admin"
10872	//   ]
10873	// }
10874
10875}
10876
10877// method id "logging.folders.locations.buckets.views.delete":
10878
10879type FoldersLocationsBucketsViewsDeleteCall struct {
10880	s          *Service
10881	name       string
10882	urlParams_ gensupport.URLParams
10883	ctx_       context.Context
10884	header_    http.Header
10885}
10886
10887// Delete: Deletes a view from a bucket.
10888func (r *FoldersLocationsBucketsViewsService) Delete(name string) *FoldersLocationsBucketsViewsDeleteCall {
10889	c := &FoldersLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10890	c.name = name
10891	return c
10892}
10893
10894// Fields allows partial responses to be retrieved. See
10895// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10896// for more information.
10897func (c *FoldersLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsDeleteCall {
10898	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10899	return c
10900}
10901
10902// Context sets the context to be used in this call's Do method. Any
10903// pending HTTP request will be aborted if the provided context is
10904// canceled.
10905func (c *FoldersLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsDeleteCall {
10906	c.ctx_ = ctx
10907	return c
10908}
10909
10910// Header returns an http.Header that can be modified by the caller to
10911// add HTTP headers to the request.
10912func (c *FoldersLocationsBucketsViewsDeleteCall) Header() http.Header {
10913	if c.header_ == nil {
10914		c.header_ = make(http.Header)
10915	}
10916	return c.header_
10917}
10918
10919func (c *FoldersLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
10920	reqHeaders := make(http.Header)
10921	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
10922	for k, v := range c.header_ {
10923		reqHeaders[k] = v
10924	}
10925	reqHeaders.Set("User-Agent", c.s.userAgent())
10926	var body io.Reader = nil
10927	c.urlParams_.Set("alt", alt)
10928	c.urlParams_.Set("prettyPrint", "false")
10929	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
10930	urls += "?" + c.urlParams_.Encode()
10931	req, err := http.NewRequest("DELETE", urls, body)
10932	if err != nil {
10933		return nil, err
10934	}
10935	req.Header = reqHeaders
10936	googleapi.Expand(req.URL, map[string]string{
10937		"name": c.name,
10938	})
10939	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10940}
10941
10942// Do executes the "logging.folders.locations.buckets.views.delete" call.
10943// Exactly one of *Empty or error will be non-nil. Any non-2xx status
10944// code is an error. Response headers are in either
10945// *Empty.ServerResponse.Header or (if a response was returned at all)
10946// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10947// check whether the returned error was because http.StatusNotModified
10948// was returned.
10949func (c *FoldersLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
10950	gensupport.SetOptions(c.urlParams_, opts...)
10951	res, err := c.doRequest("json")
10952	if res != nil && res.StatusCode == http.StatusNotModified {
10953		if res.Body != nil {
10954			res.Body.Close()
10955		}
10956		return nil, &googleapi.Error{
10957			Code:   res.StatusCode,
10958			Header: res.Header,
10959		}
10960	}
10961	if err != nil {
10962		return nil, err
10963	}
10964	defer googleapi.CloseBody(res)
10965	if err := googleapi.CheckResponse(res); err != nil {
10966		return nil, err
10967	}
10968	ret := &Empty{
10969		ServerResponse: googleapi.ServerResponse{
10970			Header:         res.Header,
10971			HTTPStatusCode: res.StatusCode,
10972		},
10973	}
10974	target := &ret
10975	if err := gensupport.DecodeResponse(target, res); err != nil {
10976		return nil, err
10977	}
10978	return ret, nil
10979	// {
10980	//   "description": "Deletes a view from a bucket.",
10981	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
10982	//   "httpMethod": "DELETE",
10983	//   "id": "logging.folders.locations.buckets.views.delete",
10984	//   "parameterOrder": [
10985	//     "name"
10986	//   ],
10987	//   "parameters": {
10988	//     "name": {
10989	//       "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
10990	//       "location": "path",
10991	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
10992	//       "required": true,
10993	//       "type": "string"
10994	//     }
10995	//   },
10996	//   "path": "v2/{+name}",
10997	//   "response": {
10998	//     "$ref": "Empty"
10999	//   },
11000	//   "scopes": [
11001	//     "https://www.googleapis.com/auth/cloud-platform",
11002	//     "https://www.googleapis.com/auth/logging.admin"
11003	//   ]
11004	// }
11005
11006}
11007
11008// method id "logging.folders.locations.buckets.views.get":
11009
11010type FoldersLocationsBucketsViewsGetCall struct {
11011	s            *Service
11012	name         string
11013	urlParams_   gensupport.URLParams
11014	ifNoneMatch_ string
11015	ctx_         context.Context
11016	header_      http.Header
11017}
11018
11019// Get: Gets a view.
11020func (r *FoldersLocationsBucketsViewsService) Get(name string) *FoldersLocationsBucketsViewsGetCall {
11021	c := &FoldersLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11022	c.name = name
11023	return c
11024}
11025
11026// Fields allows partial responses to be retrieved. See
11027// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11028// for more information.
11029func (c *FoldersLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsGetCall {
11030	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11031	return c
11032}
11033
11034// IfNoneMatch sets the optional parameter which makes the operation
11035// fail if the object's ETag matches the given value. This is useful for
11036// getting updates only after the object has changed since the last
11037// request. Use googleapi.IsNotModified to check whether the response
11038// error from Do is the result of In-None-Match.
11039func (c *FoldersLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsGetCall {
11040	c.ifNoneMatch_ = entityTag
11041	return c
11042}
11043
11044// Context sets the context to be used in this call's Do method. Any
11045// pending HTTP request will be aborted if the provided context is
11046// canceled.
11047func (c *FoldersLocationsBucketsViewsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsGetCall {
11048	c.ctx_ = ctx
11049	return c
11050}
11051
11052// Header returns an http.Header that can be modified by the caller to
11053// add HTTP headers to the request.
11054func (c *FoldersLocationsBucketsViewsGetCall) Header() http.Header {
11055	if c.header_ == nil {
11056		c.header_ = make(http.Header)
11057	}
11058	return c.header_
11059}
11060
11061func (c *FoldersLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
11062	reqHeaders := make(http.Header)
11063	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
11064	for k, v := range c.header_ {
11065		reqHeaders[k] = v
11066	}
11067	reqHeaders.Set("User-Agent", c.s.userAgent())
11068	if c.ifNoneMatch_ != "" {
11069		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11070	}
11071	var body io.Reader = nil
11072	c.urlParams_.Set("alt", alt)
11073	c.urlParams_.Set("prettyPrint", "false")
11074	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
11075	urls += "?" + c.urlParams_.Encode()
11076	req, err := http.NewRequest("GET", urls, body)
11077	if err != nil {
11078		return nil, err
11079	}
11080	req.Header = reqHeaders
11081	googleapi.Expand(req.URL, map[string]string{
11082		"name": c.name,
11083	})
11084	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11085}
11086
11087// Do executes the "logging.folders.locations.buckets.views.get" call.
11088// Exactly one of *LogView or error will be non-nil. Any non-2xx status
11089// code is an error. Response headers are in either
11090// *LogView.ServerResponse.Header or (if a response was returned at all)
11091// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11092// check whether the returned error was because http.StatusNotModified
11093// was returned.
11094func (c *FoldersLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
11095	gensupport.SetOptions(c.urlParams_, opts...)
11096	res, err := c.doRequest("json")
11097	if res != nil && res.StatusCode == http.StatusNotModified {
11098		if res.Body != nil {
11099			res.Body.Close()
11100		}
11101		return nil, &googleapi.Error{
11102			Code:   res.StatusCode,
11103			Header: res.Header,
11104		}
11105	}
11106	if err != nil {
11107		return nil, err
11108	}
11109	defer googleapi.CloseBody(res)
11110	if err := googleapi.CheckResponse(res); err != nil {
11111		return nil, err
11112	}
11113	ret := &LogView{
11114		ServerResponse: googleapi.ServerResponse{
11115			Header:         res.Header,
11116			HTTPStatusCode: res.StatusCode,
11117		},
11118	}
11119	target := &ret
11120	if err := gensupport.DecodeResponse(target, res); err != nil {
11121		return nil, err
11122	}
11123	return ret, nil
11124	// {
11125	//   "description": "Gets a view.",
11126	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
11127	//   "httpMethod": "GET",
11128	//   "id": "logging.folders.locations.buckets.views.get",
11129	//   "parameterOrder": [
11130	//     "name"
11131	//   ],
11132	//   "parameters": {
11133	//     "name": {
11134	//       "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
11135	//       "location": "path",
11136	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
11137	//       "required": true,
11138	//       "type": "string"
11139	//     }
11140	//   },
11141	//   "path": "v2/{+name}",
11142	//   "response": {
11143	//     "$ref": "LogView"
11144	//   },
11145	//   "scopes": [
11146	//     "https://www.googleapis.com/auth/cloud-platform",
11147	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11148	//     "https://www.googleapis.com/auth/logging.admin",
11149	//     "https://www.googleapis.com/auth/logging.read"
11150	//   ]
11151	// }
11152
11153}
11154
11155// method id "logging.folders.locations.buckets.views.list":
11156
11157type FoldersLocationsBucketsViewsListCall struct {
11158	s            *Service
11159	parent       string
11160	urlParams_   gensupport.URLParams
11161	ifNoneMatch_ string
11162	ctx_         context.Context
11163	header_      http.Header
11164}
11165
11166// List: Lists views on a bucket.
11167func (r *FoldersLocationsBucketsViewsService) List(parent string) *FoldersLocationsBucketsViewsListCall {
11168	c := &FoldersLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11169	c.parent = parent
11170	return c
11171}
11172
11173// PageSize sets the optional parameter "pageSize": The maximum number
11174// of results to return from this request. Non-positive values are
11175// ignored. The presence of nextPageToken in the response indicates that
11176// more results might be available.
11177func (c *FoldersLocationsBucketsViewsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsViewsListCall {
11178	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11179	return c
11180}
11181
11182// PageToken sets the optional parameter "pageToken": If present, then
11183// retrieve the next batch of results from the preceding call to this
11184// method. pageToken must be the value of nextPageToken from the
11185// previous response. The values of other method parameters should be
11186// identical to those in the previous call.
11187func (c *FoldersLocationsBucketsViewsListCall) PageToken(pageToken string) *FoldersLocationsBucketsViewsListCall {
11188	c.urlParams_.Set("pageToken", pageToken)
11189	return c
11190}
11191
11192// Fields allows partial responses to be retrieved. See
11193// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11194// for more information.
11195func (c *FoldersLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsListCall {
11196	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11197	return c
11198}
11199
11200// IfNoneMatch sets the optional parameter which makes the operation
11201// fail if the object's ETag matches the given value. This is useful for
11202// getting updates only after the object has changed since the last
11203// request. Use googleapi.IsNotModified to check whether the response
11204// error from Do is the result of In-None-Match.
11205func (c *FoldersLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsListCall {
11206	c.ifNoneMatch_ = entityTag
11207	return c
11208}
11209
11210// Context sets the context to be used in this call's Do method. Any
11211// pending HTTP request will be aborted if the provided context is
11212// canceled.
11213func (c *FoldersLocationsBucketsViewsListCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsListCall {
11214	c.ctx_ = ctx
11215	return c
11216}
11217
11218// Header returns an http.Header that can be modified by the caller to
11219// add HTTP headers to the request.
11220func (c *FoldersLocationsBucketsViewsListCall) Header() http.Header {
11221	if c.header_ == nil {
11222		c.header_ = make(http.Header)
11223	}
11224	return c.header_
11225}
11226
11227func (c *FoldersLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
11228	reqHeaders := make(http.Header)
11229	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
11230	for k, v := range c.header_ {
11231		reqHeaders[k] = v
11232	}
11233	reqHeaders.Set("User-Agent", c.s.userAgent())
11234	if c.ifNoneMatch_ != "" {
11235		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11236	}
11237	var body io.Reader = nil
11238	c.urlParams_.Set("alt", alt)
11239	c.urlParams_.Set("prettyPrint", "false")
11240	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
11241	urls += "?" + c.urlParams_.Encode()
11242	req, err := http.NewRequest("GET", urls, body)
11243	if err != nil {
11244		return nil, err
11245	}
11246	req.Header = reqHeaders
11247	googleapi.Expand(req.URL, map[string]string{
11248		"parent": c.parent,
11249	})
11250	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11251}
11252
11253// Do executes the "logging.folders.locations.buckets.views.list" call.
11254// Exactly one of *ListViewsResponse or error will be non-nil. Any
11255// non-2xx status code is an error. Response headers are in either
11256// *ListViewsResponse.ServerResponse.Header or (if a response was
11257// returned at all) in error.(*googleapi.Error).Header. Use
11258// googleapi.IsNotModified to check whether the returned error was
11259// because http.StatusNotModified was returned.
11260func (c *FoldersLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
11261	gensupport.SetOptions(c.urlParams_, opts...)
11262	res, err := c.doRequest("json")
11263	if res != nil && res.StatusCode == http.StatusNotModified {
11264		if res.Body != nil {
11265			res.Body.Close()
11266		}
11267		return nil, &googleapi.Error{
11268			Code:   res.StatusCode,
11269			Header: res.Header,
11270		}
11271	}
11272	if err != nil {
11273		return nil, err
11274	}
11275	defer googleapi.CloseBody(res)
11276	if err := googleapi.CheckResponse(res); err != nil {
11277		return nil, err
11278	}
11279	ret := &ListViewsResponse{
11280		ServerResponse: googleapi.ServerResponse{
11281			Header:         res.Header,
11282			HTTPStatusCode: res.StatusCode,
11283		},
11284	}
11285	target := &ret
11286	if err := gensupport.DecodeResponse(target, res); err != nil {
11287		return nil, err
11288	}
11289	return ret, nil
11290	// {
11291	//   "description": "Lists views on a bucket.",
11292	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views",
11293	//   "httpMethod": "GET",
11294	//   "id": "logging.folders.locations.buckets.views.list",
11295	//   "parameterOrder": [
11296	//     "parent"
11297	//   ],
11298	//   "parameters": {
11299	//     "pageSize": {
11300	//       "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.",
11301	//       "format": "int32",
11302	//       "location": "query",
11303	//       "type": "integer"
11304	//     },
11305	//     "pageToken": {
11306	//       "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.",
11307	//       "location": "query",
11308	//       "type": "string"
11309	//     },
11310	//     "parent": {
11311	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
11312	//       "location": "path",
11313	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
11314	//       "required": true,
11315	//       "type": "string"
11316	//     }
11317	//   },
11318	//   "path": "v2/{+parent}/views",
11319	//   "response": {
11320	//     "$ref": "ListViewsResponse"
11321	//   },
11322	//   "scopes": [
11323	//     "https://www.googleapis.com/auth/cloud-platform",
11324	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11325	//     "https://www.googleapis.com/auth/logging.admin",
11326	//     "https://www.googleapis.com/auth/logging.read"
11327	//   ]
11328	// }
11329
11330}
11331
11332// Pages invokes f for each page of results.
11333// A non-nil error returned from f will halt the iteration.
11334// The provided context supersedes any context provided to the Context method.
11335func (c *FoldersLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
11336	c.ctx_ = ctx
11337	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
11338	for {
11339		x, err := c.Do()
11340		if err != nil {
11341			return err
11342		}
11343		if err := f(x); err != nil {
11344			return err
11345		}
11346		if x.NextPageToken == "" {
11347			return nil
11348		}
11349		c.PageToken(x.NextPageToken)
11350	}
11351}
11352
11353// method id "logging.folders.locations.buckets.views.patch":
11354
11355type FoldersLocationsBucketsViewsPatchCall struct {
11356	s          *Service
11357	name       string
11358	logview    *LogView
11359	urlParams_ gensupport.URLParams
11360	ctx_       context.Context
11361	header_    http.Header
11362}
11363
11364// Patch: Updates a view. This method replaces the following fields in
11365// the existing view with values from the new view: filter.
11366func (r *FoldersLocationsBucketsViewsService) Patch(name string, logview *LogView) *FoldersLocationsBucketsViewsPatchCall {
11367	c := &FoldersLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11368	c.name = name
11369	c.logview = logview
11370	return c
11371}
11372
11373// UpdateMask sets the optional parameter "updateMask": Field mask that
11374// specifies the fields in view that need an update. A field will be
11375// overwritten if, and only if, it is in the update mask. name and
11376// output only fields cannot be updated.For a detailed FieldMask
11377// definition, see
11378// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
11379// updateMask=filter.
11380func (c *FoldersLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsViewsPatchCall {
11381	c.urlParams_.Set("updateMask", updateMask)
11382	return c
11383}
11384
11385// Fields allows partial responses to be retrieved. See
11386// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11387// for more information.
11388func (c *FoldersLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsPatchCall {
11389	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11390	return c
11391}
11392
11393// Context sets the context to be used in this call's Do method. Any
11394// pending HTTP request will be aborted if the provided context is
11395// canceled.
11396func (c *FoldersLocationsBucketsViewsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsPatchCall {
11397	c.ctx_ = ctx
11398	return c
11399}
11400
11401// Header returns an http.Header that can be modified by the caller to
11402// add HTTP headers to the request.
11403func (c *FoldersLocationsBucketsViewsPatchCall) Header() http.Header {
11404	if c.header_ == nil {
11405		c.header_ = make(http.Header)
11406	}
11407	return c.header_
11408}
11409
11410func (c *FoldersLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
11411	reqHeaders := make(http.Header)
11412	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
11413	for k, v := range c.header_ {
11414		reqHeaders[k] = v
11415	}
11416	reqHeaders.Set("User-Agent", c.s.userAgent())
11417	var body io.Reader = nil
11418	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
11419	if err != nil {
11420		return nil, err
11421	}
11422	reqHeaders.Set("Content-Type", "application/json")
11423	c.urlParams_.Set("alt", alt)
11424	c.urlParams_.Set("prettyPrint", "false")
11425	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
11426	urls += "?" + c.urlParams_.Encode()
11427	req, err := http.NewRequest("PATCH", urls, body)
11428	if err != nil {
11429		return nil, err
11430	}
11431	req.Header = reqHeaders
11432	googleapi.Expand(req.URL, map[string]string{
11433		"name": c.name,
11434	})
11435	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11436}
11437
11438// Do executes the "logging.folders.locations.buckets.views.patch" call.
11439// Exactly one of *LogView or error will be non-nil. Any non-2xx status
11440// code is an error. Response headers are in either
11441// *LogView.ServerResponse.Header or (if a response was returned at all)
11442// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11443// check whether the returned error was because http.StatusNotModified
11444// was returned.
11445func (c *FoldersLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
11446	gensupport.SetOptions(c.urlParams_, opts...)
11447	res, err := c.doRequest("json")
11448	if res != nil && res.StatusCode == http.StatusNotModified {
11449		if res.Body != nil {
11450			res.Body.Close()
11451		}
11452		return nil, &googleapi.Error{
11453			Code:   res.StatusCode,
11454			Header: res.Header,
11455		}
11456	}
11457	if err != nil {
11458		return nil, err
11459	}
11460	defer googleapi.CloseBody(res)
11461	if err := googleapi.CheckResponse(res); err != nil {
11462		return nil, err
11463	}
11464	ret := &LogView{
11465		ServerResponse: googleapi.ServerResponse{
11466			Header:         res.Header,
11467			HTTPStatusCode: res.StatusCode,
11468		},
11469	}
11470	target := &ret
11471	if err := gensupport.DecodeResponse(target, res); err != nil {
11472		return nil, err
11473	}
11474	return ret, nil
11475	// {
11476	//   "description": "Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.",
11477	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
11478	//   "httpMethod": "PATCH",
11479	//   "id": "logging.folders.locations.buckets.views.patch",
11480	//   "parameterOrder": [
11481	//     "name"
11482	//   ],
11483	//   "parameters": {
11484	//     "name": {
11485	//       "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
11486	//       "location": "path",
11487	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
11488	//       "required": true,
11489	//       "type": "string"
11490	//     },
11491	//     "updateMask": {
11492	//       "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
11493	//       "format": "google-fieldmask",
11494	//       "location": "query",
11495	//       "type": "string"
11496	//     }
11497	//   },
11498	//   "path": "v2/{+name}",
11499	//   "request": {
11500	//     "$ref": "LogView"
11501	//   },
11502	//   "response": {
11503	//     "$ref": "LogView"
11504	//   },
11505	//   "scopes": [
11506	//     "https://www.googleapis.com/auth/cloud-platform",
11507	//     "https://www.googleapis.com/auth/logging.admin"
11508	//   ]
11509	// }
11510
11511}
11512
11513// method id "logging.folders.logs.delete":
11514
11515type FoldersLogsDeleteCall struct {
11516	s          *Service
11517	logName    string
11518	urlParams_ gensupport.URLParams
11519	ctx_       context.Context
11520	header_    http.Header
11521}
11522
11523// Delete: Deletes all the log entries in a log. The log reappears if it
11524// receives new entries. Log entries written shortly before the delete
11525// operation might not be deleted. Entries received after the delete
11526// operation with a timestamp before the operation will be deleted.
11527func (r *FoldersLogsService) Delete(logName string) *FoldersLogsDeleteCall {
11528	c := &FoldersLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11529	c.logName = logName
11530	return c
11531}
11532
11533// Fields allows partial responses to be retrieved. See
11534// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11535// for more information.
11536func (c *FoldersLogsDeleteCall) Fields(s ...googleapi.Field) *FoldersLogsDeleteCall {
11537	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11538	return c
11539}
11540
11541// Context sets the context to be used in this call's Do method. Any
11542// pending HTTP request will be aborted if the provided context is
11543// canceled.
11544func (c *FoldersLogsDeleteCall) Context(ctx context.Context) *FoldersLogsDeleteCall {
11545	c.ctx_ = ctx
11546	return c
11547}
11548
11549// Header returns an http.Header that can be modified by the caller to
11550// add HTTP headers to the request.
11551func (c *FoldersLogsDeleteCall) Header() http.Header {
11552	if c.header_ == nil {
11553		c.header_ = make(http.Header)
11554	}
11555	return c.header_
11556}
11557
11558func (c *FoldersLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
11559	reqHeaders := make(http.Header)
11560	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
11561	for k, v := range c.header_ {
11562		reqHeaders[k] = v
11563	}
11564	reqHeaders.Set("User-Agent", c.s.userAgent())
11565	var body io.Reader = nil
11566	c.urlParams_.Set("alt", alt)
11567	c.urlParams_.Set("prettyPrint", "false")
11568	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
11569	urls += "?" + c.urlParams_.Encode()
11570	req, err := http.NewRequest("DELETE", urls, body)
11571	if err != nil {
11572		return nil, err
11573	}
11574	req.Header = reqHeaders
11575	googleapi.Expand(req.URL, map[string]string{
11576		"logName": c.logName,
11577	})
11578	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11579}
11580
11581// Do executes the "logging.folders.logs.delete" call.
11582// Exactly one of *Empty or error will be non-nil. Any non-2xx status
11583// code is an error. Response headers are in either
11584// *Empty.ServerResponse.Header or (if a response was returned at all)
11585// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11586// check whether the returned error was because http.StatusNotModified
11587// was returned.
11588func (c *FoldersLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
11589	gensupport.SetOptions(c.urlParams_, opts...)
11590	res, err := c.doRequest("json")
11591	if res != nil && res.StatusCode == http.StatusNotModified {
11592		if res.Body != nil {
11593			res.Body.Close()
11594		}
11595		return nil, &googleapi.Error{
11596			Code:   res.StatusCode,
11597			Header: res.Header,
11598		}
11599	}
11600	if err != nil {
11601		return nil, err
11602	}
11603	defer googleapi.CloseBody(res)
11604	if err := googleapi.CheckResponse(res); err != nil {
11605		return nil, err
11606	}
11607	ret := &Empty{
11608		ServerResponse: googleapi.ServerResponse{
11609			Header:         res.Header,
11610			HTTPStatusCode: res.StatusCode,
11611		},
11612	}
11613	target := &ret
11614	if err := gensupport.DecodeResponse(target, res); err != nil {
11615		return nil, err
11616	}
11617	return ret, nil
11618	// {
11619	//   "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. Entries received after the delete operation with a timestamp before the operation will be deleted.",
11620	//   "flatPath": "v2/folders/{foldersId}/logs/{logsId}",
11621	//   "httpMethod": "DELETE",
11622	//   "id": "logging.folders.logs.delete",
11623	//   "parameterOrder": [
11624	//     "logName"
11625	//   ],
11626	//   "parameters": {
11627	//     "logName": {
11628	//       "description": "Required. The resource name of the log to delete: \"projects/[PROJECT_ID]/logs/[LOG_ID]\" \"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\" \"folders/[FOLDER_ID]/logs/[LOG_ID]\" [LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.",
11629	//       "location": "path",
11630	//       "pattern": "^folders/[^/]+/logs/[^/]+$",
11631	//       "required": true,
11632	//       "type": "string"
11633	//     }
11634	//   },
11635	//   "path": "v2/{+logName}",
11636	//   "response": {
11637	//     "$ref": "Empty"
11638	//   },
11639	//   "scopes": [
11640	//     "https://www.googleapis.com/auth/cloud-platform",
11641	//     "https://www.googleapis.com/auth/logging.admin"
11642	//   ]
11643	// }
11644
11645}
11646
11647// method id "logging.folders.logs.list":
11648
11649type FoldersLogsListCall struct {
11650	s            *Service
11651	parent       string
11652	urlParams_   gensupport.URLParams
11653	ifNoneMatch_ string
11654	ctx_         context.Context
11655	header_      http.Header
11656}
11657
11658// List: Lists the logs in projects, organizations, folders, or billing
11659// accounts. Only logs that have entries are listed.
11660func (r *FoldersLogsService) List(parent string) *FoldersLogsListCall {
11661	c := &FoldersLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11662	c.parent = parent
11663	return c
11664}
11665
11666// PageSize sets the optional parameter "pageSize": The maximum number
11667// of results to return from this request. Non-positive values are
11668// ignored. The presence of nextPageToken in the response indicates that
11669// more results might be available.
11670func (c *FoldersLogsListCall) PageSize(pageSize int64) *FoldersLogsListCall {
11671	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11672	return c
11673}
11674
11675// PageToken sets the optional parameter "pageToken": If present, then
11676// retrieve the next batch of results from the preceding call to this
11677// method. pageToken must be the value of nextPageToken from the
11678// previous response. The values of other method parameters should be
11679// identical to those in the previous call.
11680func (c *FoldersLogsListCall) PageToken(pageToken string) *FoldersLogsListCall {
11681	c.urlParams_.Set("pageToken", pageToken)
11682	return c
11683}
11684
11685// ResourceNames sets the optional parameter "resourceNames": The
11686// resource name that owns the logs:
11687// projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW
11688// _ID
11689// organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/v
11690// iews/VIEW_ID
11691// billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKE
11692// T_ID/views/VIEW_ID
11693// folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_I
11694// DTo support legacy queries, it could also be: "projects/PROJECT_ID"
11695// "organizations/ORGANIZATION_ID" "billingAccounts/BILLING_ACCOUNT_ID"
11696// "folders/FOLDER_ID"
11697func (c *FoldersLogsListCall) ResourceNames(resourceNames ...string) *FoldersLogsListCall {
11698	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
11699	return c
11700}
11701
11702// Fields allows partial responses to be retrieved. See
11703// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11704// for more information.
11705func (c *FoldersLogsListCall) Fields(s ...googleapi.Field) *FoldersLogsListCall {
11706	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11707	return c
11708}
11709
11710// IfNoneMatch sets the optional parameter which makes the operation
11711// fail if the object's ETag matches the given value. This is useful for
11712// getting updates only after the object has changed since the last
11713// request. Use googleapi.IsNotModified to check whether the response
11714// error from Do is the result of In-None-Match.
11715func (c *FoldersLogsListCall) IfNoneMatch(entityTag string) *FoldersLogsListCall {
11716	c.ifNoneMatch_ = entityTag
11717	return c
11718}
11719
11720// Context sets the context to be used in this call's Do method. Any
11721// pending HTTP request will be aborted if the provided context is
11722// canceled.
11723func (c *FoldersLogsListCall) Context(ctx context.Context) *FoldersLogsListCall {
11724	c.ctx_ = ctx
11725	return c
11726}
11727
11728// Header returns an http.Header that can be modified by the caller to
11729// add HTTP headers to the request.
11730func (c *FoldersLogsListCall) Header() http.Header {
11731	if c.header_ == nil {
11732		c.header_ = make(http.Header)
11733	}
11734	return c.header_
11735}
11736
11737func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) {
11738	reqHeaders := make(http.Header)
11739	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
11740	for k, v := range c.header_ {
11741		reqHeaders[k] = v
11742	}
11743	reqHeaders.Set("User-Agent", c.s.userAgent())
11744	if c.ifNoneMatch_ != "" {
11745		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11746	}
11747	var body io.Reader = nil
11748	c.urlParams_.Set("alt", alt)
11749	c.urlParams_.Set("prettyPrint", "false")
11750	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
11751	urls += "?" + c.urlParams_.Encode()
11752	req, err := http.NewRequest("GET", urls, body)
11753	if err != nil {
11754		return nil, err
11755	}
11756	req.Header = reqHeaders
11757	googleapi.Expand(req.URL, map[string]string{
11758		"parent": c.parent,
11759	})
11760	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11761}
11762
11763// Do executes the "logging.folders.logs.list" call.
11764// Exactly one of *ListLogsResponse or error will be non-nil. Any
11765// non-2xx status code is an error. Response headers are in either
11766// *ListLogsResponse.ServerResponse.Header or (if a response was
11767// returned at all) in error.(*googleapi.Error).Header. Use
11768// googleapi.IsNotModified to check whether the returned error was
11769// because http.StatusNotModified was returned.
11770func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
11771	gensupport.SetOptions(c.urlParams_, opts...)
11772	res, err := c.doRequest("json")
11773	if res != nil && res.StatusCode == http.StatusNotModified {
11774		if res.Body != nil {
11775			res.Body.Close()
11776		}
11777		return nil, &googleapi.Error{
11778			Code:   res.StatusCode,
11779			Header: res.Header,
11780		}
11781	}
11782	if err != nil {
11783		return nil, err
11784	}
11785	defer googleapi.CloseBody(res)
11786	if err := googleapi.CheckResponse(res); err != nil {
11787		return nil, err
11788	}
11789	ret := &ListLogsResponse{
11790		ServerResponse: googleapi.ServerResponse{
11791			Header:         res.Header,
11792			HTTPStatusCode: res.StatusCode,
11793		},
11794	}
11795	target := &ret
11796	if err := gensupport.DecodeResponse(target, res); err != nil {
11797		return nil, err
11798	}
11799	return ret, nil
11800	// {
11801	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
11802	//   "flatPath": "v2/folders/{foldersId}/logs",
11803	//   "httpMethod": "GET",
11804	//   "id": "logging.folders.logs.list",
11805	//   "parameterOrder": [
11806	//     "parent"
11807	//   ],
11808	//   "parameters": {
11809	//     "pageSize": {
11810	//       "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.",
11811	//       "format": "int32",
11812	//       "location": "query",
11813	//       "type": "integer"
11814	//     },
11815	//     "pageToken": {
11816	//       "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.",
11817	//       "location": "query",
11818	//       "type": "string"
11819	//     },
11820	//     "parent": {
11821	//       "description": "Required. The resource name that owns the logs: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
11822	//       "location": "path",
11823	//       "pattern": "^folders/[^/]+$",
11824	//       "required": true,
11825	//       "type": "string"
11826	//     },
11827	//     "resourceNames": {
11828	//       "description": "Optional. The resource name that owns the logs: projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_IDTo support legacy queries, it could also be: \"projects/PROJECT_ID\" \"organizations/ORGANIZATION_ID\" \"billingAccounts/BILLING_ACCOUNT_ID\" \"folders/FOLDER_ID\"",
11829	//       "location": "query",
11830	//       "repeated": true,
11831	//       "type": "string"
11832	//     }
11833	//   },
11834	//   "path": "v2/{+parent}/logs",
11835	//   "response": {
11836	//     "$ref": "ListLogsResponse"
11837	//   },
11838	//   "scopes": [
11839	//     "https://www.googleapis.com/auth/cloud-platform",
11840	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11841	//     "https://www.googleapis.com/auth/logging.admin",
11842	//     "https://www.googleapis.com/auth/logging.read"
11843	//   ]
11844	// }
11845
11846}
11847
11848// Pages invokes f for each page of results.
11849// A non-nil error returned from f will halt the iteration.
11850// The provided context supersedes any context provided to the Context method.
11851func (c *FoldersLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
11852	c.ctx_ = ctx
11853	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
11854	for {
11855		x, err := c.Do()
11856		if err != nil {
11857			return err
11858		}
11859		if err := f(x); err != nil {
11860			return err
11861		}
11862		if x.NextPageToken == "" {
11863			return nil
11864		}
11865		c.PageToken(x.NextPageToken)
11866	}
11867}
11868
11869// method id "logging.folders.sinks.create":
11870
11871type FoldersSinksCreateCall struct {
11872	s          *Service
11873	parent     string
11874	logsink    *LogSink
11875	urlParams_ gensupport.URLParams
11876	ctx_       context.Context
11877	header_    http.Header
11878}
11879
11880// Create: Creates a sink that exports specified log entries to a
11881// destination. The export of newly-ingested log entries begins
11882// immediately, unless the sink's writer_identity is not permitted to
11883// write to the destination. A sink can export log entries only from the
11884// resource owning the sink.
11885func (r *FoldersSinksService) Create(parent string, logsink *LogSink) *FoldersSinksCreateCall {
11886	c := &FoldersSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11887	c.parent = parent
11888	c.logsink = logsink
11889	return c
11890}
11891
11892// UniqueWriterIdentity sets the optional parameter
11893// "uniqueWriterIdentity": Determines the kind of IAM identity returned
11894// as writer_identity in the new sink. If this value is omitted or set
11895// to false, and if the sink's parent is a project, then the value
11896// returned as writer_identity is the same group or service account used
11897// by Logging before the addition of writer identities to this API. The
11898// sink's destination must be in the same project as the sink itself.If
11899// this field is set to true, or if the sink is owned by a non-project
11900// resource such as an organization, then the value of writer_identity
11901// will be a unique service account used only for exports from the new
11902// sink. For more information, see writer_identity in LogSink.
11903func (c *FoldersSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksCreateCall {
11904	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
11905	return c
11906}
11907
11908// Fields allows partial responses to be retrieved. See
11909// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11910// for more information.
11911func (c *FoldersSinksCreateCall) Fields(s ...googleapi.Field) *FoldersSinksCreateCall {
11912	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11913	return c
11914}
11915
11916// Context sets the context to be used in this call's Do method. Any
11917// pending HTTP request will be aborted if the provided context is
11918// canceled.
11919func (c *FoldersSinksCreateCall) Context(ctx context.Context) *FoldersSinksCreateCall {
11920	c.ctx_ = ctx
11921	return c
11922}
11923
11924// Header returns an http.Header that can be modified by the caller to
11925// add HTTP headers to the request.
11926func (c *FoldersSinksCreateCall) Header() http.Header {
11927	if c.header_ == nil {
11928		c.header_ = make(http.Header)
11929	}
11930	return c.header_
11931}
11932
11933func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) {
11934	reqHeaders := make(http.Header)
11935	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
11936	for k, v := range c.header_ {
11937		reqHeaders[k] = v
11938	}
11939	reqHeaders.Set("User-Agent", c.s.userAgent())
11940	var body io.Reader = nil
11941	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
11942	if err != nil {
11943		return nil, err
11944	}
11945	reqHeaders.Set("Content-Type", "application/json")
11946	c.urlParams_.Set("alt", alt)
11947	c.urlParams_.Set("prettyPrint", "false")
11948	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
11949	urls += "?" + c.urlParams_.Encode()
11950	req, err := http.NewRequest("POST", urls, body)
11951	if err != nil {
11952		return nil, err
11953	}
11954	req.Header = reqHeaders
11955	googleapi.Expand(req.URL, map[string]string{
11956		"parent": c.parent,
11957	})
11958	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11959}
11960
11961// Do executes the "logging.folders.sinks.create" call.
11962// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
11963// code is an error. Response headers are in either
11964// *LogSink.ServerResponse.Header or (if a response was returned at all)
11965// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11966// check whether the returned error was because http.StatusNotModified
11967// was returned.
11968func (c *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
11969	gensupport.SetOptions(c.urlParams_, opts...)
11970	res, err := c.doRequest("json")
11971	if res != nil && res.StatusCode == http.StatusNotModified {
11972		if res.Body != nil {
11973			res.Body.Close()
11974		}
11975		return nil, &googleapi.Error{
11976			Code:   res.StatusCode,
11977			Header: res.Header,
11978		}
11979	}
11980	if err != nil {
11981		return nil, err
11982	}
11983	defer googleapi.CloseBody(res)
11984	if err := googleapi.CheckResponse(res); err != nil {
11985		return nil, err
11986	}
11987	ret := &LogSink{
11988		ServerResponse: googleapi.ServerResponse{
11989			Header:         res.Header,
11990			HTTPStatusCode: res.StatusCode,
11991		},
11992	}
11993	target := &ret
11994	if err := gensupport.DecodeResponse(target, res); err != nil {
11995		return nil, err
11996	}
11997	return ret, nil
11998	// {
11999	//   "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.",
12000	//   "flatPath": "v2/folders/{foldersId}/sinks",
12001	//   "httpMethod": "POST",
12002	//   "id": "logging.folders.sinks.create",
12003	//   "parameterOrder": [
12004	//     "parent"
12005	//   ],
12006	//   "parameters": {
12007	//     "parent": {
12008	//       "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" Examples: \"projects/my-logging-project\", \"organizations/123456789\".",
12009	//       "location": "path",
12010	//       "pattern": "^folders/[^/]+$",
12011	//       "required": true,
12012	//       "type": "string"
12013	//     },
12014	//     "uniqueWriterIdentity": {
12015	//       "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.",
12016	//       "location": "query",
12017	//       "type": "boolean"
12018	//     }
12019	//   },
12020	//   "path": "v2/{+parent}/sinks",
12021	//   "request": {
12022	//     "$ref": "LogSink"
12023	//   },
12024	//   "response": {
12025	//     "$ref": "LogSink"
12026	//   },
12027	//   "scopes": [
12028	//     "https://www.googleapis.com/auth/cloud-platform",
12029	//     "https://www.googleapis.com/auth/logging.admin"
12030	//   ]
12031	// }
12032
12033}
12034
12035// method id "logging.folders.sinks.delete":
12036
12037type FoldersSinksDeleteCall struct {
12038	s          *Service
12039	sinkNameid string
12040	urlParams_ gensupport.URLParams
12041	ctx_       context.Context
12042	header_    http.Header
12043}
12044
12045// Delete: Deletes a sink. If the sink has a unique writer_identity,
12046// then that service account is also deleted.
12047func (r *FoldersSinksService) Delete(sinkNameid string) *FoldersSinksDeleteCall {
12048	c := &FoldersSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12049	c.sinkNameid = sinkNameid
12050	return c
12051}
12052
12053// Fields allows partial responses to be retrieved. See
12054// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12055// for more information.
12056func (c *FoldersSinksDeleteCall) Fields(s ...googleapi.Field) *FoldersSinksDeleteCall {
12057	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12058	return c
12059}
12060
12061// Context sets the context to be used in this call's Do method. Any
12062// pending HTTP request will be aborted if the provided context is
12063// canceled.
12064func (c *FoldersSinksDeleteCall) Context(ctx context.Context) *FoldersSinksDeleteCall {
12065	c.ctx_ = ctx
12066	return c
12067}
12068
12069// Header returns an http.Header that can be modified by the caller to
12070// add HTTP headers to the request.
12071func (c *FoldersSinksDeleteCall) Header() http.Header {
12072	if c.header_ == nil {
12073		c.header_ = make(http.Header)
12074	}
12075	return c.header_
12076}
12077
12078func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
12079	reqHeaders := make(http.Header)
12080	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
12081	for k, v := range c.header_ {
12082		reqHeaders[k] = v
12083	}
12084	reqHeaders.Set("User-Agent", c.s.userAgent())
12085	var body io.Reader = nil
12086	c.urlParams_.Set("alt", alt)
12087	c.urlParams_.Set("prettyPrint", "false")
12088	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
12089	urls += "?" + c.urlParams_.Encode()
12090	req, err := http.NewRequest("DELETE", urls, body)
12091	if err != nil {
12092		return nil, err
12093	}
12094	req.Header = reqHeaders
12095	googleapi.Expand(req.URL, map[string]string{
12096		"sinkName": c.sinkNameid,
12097	})
12098	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12099}
12100
12101// Do executes the "logging.folders.sinks.delete" call.
12102// Exactly one of *Empty or error will be non-nil. Any non-2xx status
12103// code is an error. Response headers are in either
12104// *Empty.ServerResponse.Header or (if a response was returned at all)
12105// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12106// check whether the returned error was because http.StatusNotModified
12107// was returned.
12108func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12109	gensupport.SetOptions(c.urlParams_, opts...)
12110	res, err := c.doRequest("json")
12111	if res != nil && res.StatusCode == http.StatusNotModified {
12112		if res.Body != nil {
12113			res.Body.Close()
12114		}
12115		return nil, &googleapi.Error{
12116			Code:   res.StatusCode,
12117			Header: res.Header,
12118		}
12119	}
12120	if err != nil {
12121		return nil, err
12122	}
12123	defer googleapi.CloseBody(res)
12124	if err := googleapi.CheckResponse(res); err != nil {
12125		return nil, err
12126	}
12127	ret := &Empty{
12128		ServerResponse: googleapi.ServerResponse{
12129			Header:         res.Header,
12130			HTTPStatusCode: res.StatusCode,
12131		},
12132	}
12133	target := &ret
12134	if err := gensupport.DecodeResponse(target, res); err != nil {
12135		return nil, err
12136	}
12137	return ret, nil
12138	// {
12139	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
12140	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
12141	//   "httpMethod": "DELETE",
12142	//   "id": "logging.folders.sinks.delete",
12143	//   "parameterOrder": [
12144	//     "sinkName"
12145	//   ],
12146	//   "parameters": {
12147	//     "sinkName": {
12148	//       "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
12149	//       "location": "path",
12150	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
12151	//       "required": true,
12152	//       "type": "string"
12153	//     }
12154	//   },
12155	//   "path": "v2/{+sinkName}",
12156	//   "response": {
12157	//     "$ref": "Empty"
12158	//   },
12159	//   "scopes": [
12160	//     "https://www.googleapis.com/auth/cloud-platform",
12161	//     "https://www.googleapis.com/auth/logging.admin"
12162	//   ]
12163	// }
12164
12165}
12166
12167// method id "logging.folders.sinks.get":
12168
12169type FoldersSinksGetCall struct {
12170	s            *Service
12171	sinkName     string
12172	urlParams_   gensupport.URLParams
12173	ifNoneMatch_ string
12174	ctx_         context.Context
12175	header_      http.Header
12176}
12177
12178// Get: Gets a sink.
12179func (r *FoldersSinksService) Get(sinkName string) *FoldersSinksGetCall {
12180	c := &FoldersSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12181	c.sinkName = sinkName
12182	return c
12183}
12184
12185// Fields allows partial responses to be retrieved. See
12186// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12187// for more information.
12188func (c *FoldersSinksGetCall) Fields(s ...googleapi.Field) *FoldersSinksGetCall {
12189	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12190	return c
12191}
12192
12193// IfNoneMatch sets the optional parameter which makes the operation
12194// fail if the object's ETag matches the given value. This is useful for
12195// getting updates only after the object has changed since the last
12196// request. Use googleapi.IsNotModified to check whether the response
12197// error from Do is the result of In-None-Match.
12198func (c *FoldersSinksGetCall) IfNoneMatch(entityTag string) *FoldersSinksGetCall {
12199	c.ifNoneMatch_ = entityTag
12200	return c
12201}
12202
12203// Context sets the context to be used in this call's Do method. Any
12204// pending HTTP request will be aborted if the provided context is
12205// canceled.
12206func (c *FoldersSinksGetCall) Context(ctx context.Context) *FoldersSinksGetCall {
12207	c.ctx_ = ctx
12208	return c
12209}
12210
12211// Header returns an http.Header that can be modified by the caller to
12212// add HTTP headers to the request.
12213func (c *FoldersSinksGetCall) Header() http.Header {
12214	if c.header_ == nil {
12215		c.header_ = make(http.Header)
12216	}
12217	return c.header_
12218}
12219
12220func (c *FoldersSinksGetCall) doRequest(alt string) (*http.Response, error) {
12221	reqHeaders := make(http.Header)
12222	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
12223	for k, v := range c.header_ {
12224		reqHeaders[k] = v
12225	}
12226	reqHeaders.Set("User-Agent", c.s.userAgent())
12227	if c.ifNoneMatch_ != "" {
12228		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12229	}
12230	var body io.Reader = nil
12231	c.urlParams_.Set("alt", alt)
12232	c.urlParams_.Set("prettyPrint", "false")
12233	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
12234	urls += "?" + c.urlParams_.Encode()
12235	req, err := http.NewRequest("GET", urls, body)
12236	if err != nil {
12237		return nil, err
12238	}
12239	req.Header = reqHeaders
12240	googleapi.Expand(req.URL, map[string]string{
12241		"sinkName": c.sinkName,
12242	})
12243	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12244}
12245
12246// Do executes the "logging.folders.sinks.get" call.
12247// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
12248// code is an error. Response headers are in either
12249// *LogSink.ServerResponse.Header or (if a response was returned at all)
12250// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12251// check whether the returned error was because http.StatusNotModified
12252// was returned.
12253func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
12254	gensupport.SetOptions(c.urlParams_, opts...)
12255	res, err := c.doRequest("json")
12256	if res != nil && res.StatusCode == http.StatusNotModified {
12257		if res.Body != nil {
12258			res.Body.Close()
12259		}
12260		return nil, &googleapi.Error{
12261			Code:   res.StatusCode,
12262			Header: res.Header,
12263		}
12264	}
12265	if err != nil {
12266		return nil, err
12267	}
12268	defer googleapi.CloseBody(res)
12269	if err := googleapi.CheckResponse(res); err != nil {
12270		return nil, err
12271	}
12272	ret := &LogSink{
12273		ServerResponse: googleapi.ServerResponse{
12274			Header:         res.Header,
12275			HTTPStatusCode: res.StatusCode,
12276		},
12277	}
12278	target := &ret
12279	if err := gensupport.DecodeResponse(target, res); err != nil {
12280		return nil, err
12281	}
12282	return ret, nil
12283	// {
12284	//   "description": "Gets a sink.",
12285	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
12286	//   "httpMethod": "GET",
12287	//   "id": "logging.folders.sinks.get",
12288	//   "parameterOrder": [
12289	//     "sinkName"
12290	//   ],
12291	//   "parameters": {
12292	//     "sinkName": {
12293	//       "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
12294	//       "location": "path",
12295	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
12296	//       "required": true,
12297	//       "type": "string"
12298	//     }
12299	//   },
12300	//   "path": "v2/{+sinkName}",
12301	//   "response": {
12302	//     "$ref": "LogSink"
12303	//   },
12304	//   "scopes": [
12305	//     "https://www.googleapis.com/auth/cloud-platform",
12306	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12307	//     "https://www.googleapis.com/auth/logging.admin",
12308	//     "https://www.googleapis.com/auth/logging.read"
12309	//   ]
12310	// }
12311
12312}
12313
12314// method id "logging.folders.sinks.list":
12315
12316type FoldersSinksListCall struct {
12317	s            *Service
12318	parent       string
12319	urlParams_   gensupport.URLParams
12320	ifNoneMatch_ string
12321	ctx_         context.Context
12322	header_      http.Header
12323}
12324
12325// List: Lists sinks.
12326func (r *FoldersSinksService) List(parent string) *FoldersSinksListCall {
12327	c := &FoldersSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12328	c.parent = parent
12329	return c
12330}
12331
12332// PageSize sets the optional parameter "pageSize": The maximum number
12333// of results to return from this request. Non-positive values are
12334// ignored. The presence of nextPageToken in the response indicates that
12335// more results might be available.
12336func (c *FoldersSinksListCall) PageSize(pageSize int64) *FoldersSinksListCall {
12337	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
12338	return c
12339}
12340
12341// PageToken sets the optional parameter "pageToken": If present, then
12342// retrieve the next batch of results from the preceding call to this
12343// method. pageToken must be the value of nextPageToken from the
12344// previous response. The values of other method parameters should be
12345// identical to those in the previous call.
12346func (c *FoldersSinksListCall) PageToken(pageToken string) *FoldersSinksListCall {
12347	c.urlParams_.Set("pageToken", pageToken)
12348	return c
12349}
12350
12351// Fields allows partial responses to be retrieved. See
12352// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12353// for more information.
12354func (c *FoldersSinksListCall) Fields(s ...googleapi.Field) *FoldersSinksListCall {
12355	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12356	return c
12357}
12358
12359// IfNoneMatch sets the optional parameter which makes the operation
12360// fail if the object's ETag matches the given value. This is useful for
12361// getting updates only after the object has changed since the last
12362// request. Use googleapi.IsNotModified to check whether the response
12363// error from Do is the result of In-None-Match.
12364func (c *FoldersSinksListCall) IfNoneMatch(entityTag string) *FoldersSinksListCall {
12365	c.ifNoneMatch_ = entityTag
12366	return c
12367}
12368
12369// Context sets the context to be used in this call's Do method. Any
12370// pending HTTP request will be aborted if the provided context is
12371// canceled.
12372func (c *FoldersSinksListCall) Context(ctx context.Context) *FoldersSinksListCall {
12373	c.ctx_ = ctx
12374	return c
12375}
12376
12377// Header returns an http.Header that can be modified by the caller to
12378// add HTTP headers to the request.
12379func (c *FoldersSinksListCall) Header() http.Header {
12380	if c.header_ == nil {
12381		c.header_ = make(http.Header)
12382	}
12383	return c.header_
12384}
12385
12386func (c *FoldersSinksListCall) doRequest(alt string) (*http.Response, error) {
12387	reqHeaders := make(http.Header)
12388	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
12389	for k, v := range c.header_ {
12390		reqHeaders[k] = v
12391	}
12392	reqHeaders.Set("User-Agent", c.s.userAgent())
12393	if c.ifNoneMatch_ != "" {
12394		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12395	}
12396	var body io.Reader = nil
12397	c.urlParams_.Set("alt", alt)
12398	c.urlParams_.Set("prettyPrint", "false")
12399	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
12400	urls += "?" + c.urlParams_.Encode()
12401	req, err := http.NewRequest("GET", urls, body)
12402	if err != nil {
12403		return nil, err
12404	}
12405	req.Header = reqHeaders
12406	googleapi.Expand(req.URL, map[string]string{
12407		"parent": c.parent,
12408	})
12409	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12410}
12411
12412// Do executes the "logging.folders.sinks.list" call.
12413// Exactly one of *ListSinksResponse or error will be non-nil. Any
12414// non-2xx status code is an error. Response headers are in either
12415// *ListSinksResponse.ServerResponse.Header or (if a response was
12416// returned at all) in error.(*googleapi.Error).Header. Use
12417// googleapi.IsNotModified to check whether the returned error was
12418// because http.StatusNotModified was returned.
12419func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
12420	gensupport.SetOptions(c.urlParams_, opts...)
12421	res, err := c.doRequest("json")
12422	if res != nil && res.StatusCode == http.StatusNotModified {
12423		if res.Body != nil {
12424			res.Body.Close()
12425		}
12426		return nil, &googleapi.Error{
12427			Code:   res.StatusCode,
12428			Header: res.Header,
12429		}
12430	}
12431	if err != nil {
12432		return nil, err
12433	}
12434	defer googleapi.CloseBody(res)
12435	if err := googleapi.CheckResponse(res); err != nil {
12436		return nil, err
12437	}
12438	ret := &ListSinksResponse{
12439		ServerResponse: googleapi.ServerResponse{
12440			Header:         res.Header,
12441			HTTPStatusCode: res.StatusCode,
12442		},
12443	}
12444	target := &ret
12445	if err := gensupport.DecodeResponse(target, res); err != nil {
12446		return nil, err
12447	}
12448	return ret, nil
12449	// {
12450	//   "description": "Lists sinks.",
12451	//   "flatPath": "v2/folders/{foldersId}/sinks",
12452	//   "httpMethod": "GET",
12453	//   "id": "logging.folders.sinks.list",
12454	//   "parameterOrder": [
12455	//     "parent"
12456	//   ],
12457	//   "parameters": {
12458	//     "pageSize": {
12459	//       "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.",
12460	//       "format": "int32",
12461	//       "location": "query",
12462	//       "type": "integer"
12463	//     },
12464	//     "pageToken": {
12465	//       "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.",
12466	//       "location": "query",
12467	//       "type": "string"
12468	//     },
12469	//     "parent": {
12470	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
12471	//       "location": "path",
12472	//       "pattern": "^folders/[^/]+$",
12473	//       "required": true,
12474	//       "type": "string"
12475	//     }
12476	//   },
12477	//   "path": "v2/{+parent}/sinks",
12478	//   "response": {
12479	//     "$ref": "ListSinksResponse"
12480	//   },
12481	//   "scopes": [
12482	//     "https://www.googleapis.com/auth/cloud-platform",
12483	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12484	//     "https://www.googleapis.com/auth/logging.admin",
12485	//     "https://www.googleapis.com/auth/logging.read"
12486	//   ]
12487	// }
12488
12489}
12490
12491// Pages invokes f for each page of results.
12492// A non-nil error returned from f will halt the iteration.
12493// The provided context supersedes any context provided to the Context method.
12494func (c *FoldersSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
12495	c.ctx_ = ctx
12496	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
12497	for {
12498		x, err := c.Do()
12499		if err != nil {
12500			return err
12501		}
12502		if err := f(x); err != nil {
12503			return err
12504		}
12505		if x.NextPageToken == "" {
12506			return nil
12507		}
12508		c.PageToken(x.NextPageToken)
12509	}
12510}
12511
12512// method id "logging.folders.sinks.patch":
12513
12514type FoldersSinksPatchCall struct {
12515	s          *Service
12516	sinkNameid string
12517	logsink    *LogSink
12518	urlParams_ gensupport.URLParams
12519	ctx_       context.Context
12520	header_    http.Header
12521}
12522
12523// Patch: Updates a sink. This method replaces the following fields in
12524// the existing sink with values from the new sink: destination, and
12525// filter.The updated sink might also have a new writer_identity; see
12526// the unique_writer_identity field.
12527func (r *FoldersSinksService) Patch(sinkNameid string, logsink *LogSink) *FoldersSinksPatchCall {
12528	c := &FoldersSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12529	c.sinkNameid = sinkNameid
12530	c.logsink = logsink
12531	return c
12532}
12533
12534// UniqueWriterIdentity sets the optional parameter
12535// "uniqueWriterIdentity": See sinks.create for a description of this
12536// field. When updating a sink, the effect of this field on the value of
12537// writer_identity in the updated sink depends on both the old and new
12538// values of this field: If the old and new values of this field are
12539// both false or both true, then there is no change to the sink's
12540// writer_identity. If the old value is false and the new value is true,
12541// then writer_identity is changed to a unique service account. It is an
12542// error if the old value is true and the new value is set to false or
12543// defaulted to false.
12544func (c *FoldersSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksPatchCall {
12545	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
12546	return c
12547}
12548
12549// UpdateMask sets the optional parameter "updateMask": Field mask that
12550// specifies the fields in sink that need an update. A sink field will
12551// be overwritten if, and only if, it is in the update mask. name and
12552// output only fields cannot be updated.An empty updateMask is
12553// temporarily treated as using the following mask for backwards
12554// compatibility purposes: destination,filter,includeChildren At some
12555// point in the future, behavior will be removed and specifying an empty
12556// updateMask will be an error.For a detailed FieldMask definition, see
12557// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
12558// updateMask=filter.
12559func (c *FoldersSinksPatchCall) UpdateMask(updateMask string) *FoldersSinksPatchCall {
12560	c.urlParams_.Set("updateMask", updateMask)
12561	return c
12562}
12563
12564// Fields allows partial responses to be retrieved. See
12565// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12566// for more information.
12567func (c *FoldersSinksPatchCall) Fields(s ...googleapi.Field) *FoldersSinksPatchCall {
12568	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12569	return c
12570}
12571
12572// Context sets the context to be used in this call's Do method. Any
12573// pending HTTP request will be aborted if the provided context is
12574// canceled.
12575func (c *FoldersSinksPatchCall) Context(ctx context.Context) *FoldersSinksPatchCall {
12576	c.ctx_ = ctx
12577	return c
12578}
12579
12580// Header returns an http.Header that can be modified by the caller to
12581// add HTTP headers to the request.
12582func (c *FoldersSinksPatchCall) Header() http.Header {
12583	if c.header_ == nil {
12584		c.header_ = make(http.Header)
12585	}
12586	return c.header_
12587}
12588
12589func (c *FoldersSinksPatchCall) doRequest(alt string) (*http.Response, error) {
12590	reqHeaders := make(http.Header)
12591	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
12592	for k, v := range c.header_ {
12593		reqHeaders[k] = v
12594	}
12595	reqHeaders.Set("User-Agent", c.s.userAgent())
12596	var body io.Reader = nil
12597	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
12598	if err != nil {
12599		return nil, err
12600	}
12601	reqHeaders.Set("Content-Type", "application/json")
12602	c.urlParams_.Set("alt", alt)
12603	c.urlParams_.Set("prettyPrint", "false")
12604	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
12605	urls += "?" + c.urlParams_.Encode()
12606	req, err := http.NewRequest("PATCH", urls, body)
12607	if err != nil {
12608		return nil, err
12609	}
12610	req.Header = reqHeaders
12611	googleapi.Expand(req.URL, map[string]string{
12612		"sinkName": c.sinkNameid,
12613	})
12614	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12615}
12616
12617// Do executes the "logging.folders.sinks.patch" call.
12618// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
12619// code is an error. Response headers are in either
12620// *LogSink.ServerResponse.Header or (if a response was returned at all)
12621// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12622// check whether the returned error was because http.StatusNotModified
12623// was returned.
12624func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
12625	gensupport.SetOptions(c.urlParams_, opts...)
12626	res, err := c.doRequest("json")
12627	if res != nil && res.StatusCode == http.StatusNotModified {
12628		if res.Body != nil {
12629			res.Body.Close()
12630		}
12631		return nil, &googleapi.Error{
12632			Code:   res.StatusCode,
12633			Header: res.Header,
12634		}
12635	}
12636	if err != nil {
12637		return nil, err
12638	}
12639	defer googleapi.CloseBody(res)
12640	if err := googleapi.CheckResponse(res); err != nil {
12641		return nil, err
12642	}
12643	ret := &LogSink{
12644		ServerResponse: googleapi.ServerResponse{
12645			Header:         res.Header,
12646			HTTPStatusCode: res.StatusCode,
12647		},
12648	}
12649	target := &ret
12650	if err := gensupport.DecodeResponse(target, res); err != nil {
12651		return nil, err
12652	}
12653	return ret, nil
12654	// {
12655	//   "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.",
12656	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
12657	//   "httpMethod": "PATCH",
12658	//   "id": "logging.folders.sinks.patch",
12659	//   "parameterOrder": [
12660	//     "sinkName"
12661	//   ],
12662	//   "parameters": {
12663	//     "sinkName": {
12664	//       "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
12665	//       "location": "path",
12666	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
12667	//       "required": true,
12668	//       "type": "string"
12669	//     },
12670	//     "uniqueWriterIdentity": {
12671	//       "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: 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.",
12672	//       "location": "query",
12673	//       "type": "boolean"
12674	//     },
12675	//     "updateMask": {
12676	//       "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.",
12677	//       "format": "google-fieldmask",
12678	//       "location": "query",
12679	//       "type": "string"
12680	//     }
12681	//   },
12682	//   "path": "v2/{+sinkName}",
12683	//   "request": {
12684	//     "$ref": "LogSink"
12685	//   },
12686	//   "response": {
12687	//     "$ref": "LogSink"
12688	//   },
12689	//   "scopes": [
12690	//     "https://www.googleapis.com/auth/cloud-platform",
12691	//     "https://www.googleapis.com/auth/logging.admin"
12692	//   ]
12693	// }
12694
12695}
12696
12697// method id "logging.folders.sinks.update":
12698
12699type FoldersSinksUpdateCall struct {
12700	s          *Service
12701	sinkNameid string
12702	logsink    *LogSink
12703	urlParams_ gensupport.URLParams
12704	ctx_       context.Context
12705	header_    http.Header
12706}
12707
12708// Update: Updates a sink. This method replaces the following fields in
12709// the existing sink with values from the new sink: destination, and
12710// filter.The updated sink might also have a new writer_identity; see
12711// the unique_writer_identity field.
12712func (r *FoldersSinksService) Update(sinkNameid string, logsink *LogSink) *FoldersSinksUpdateCall {
12713	c := &FoldersSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12714	c.sinkNameid = sinkNameid
12715	c.logsink = logsink
12716	return c
12717}
12718
12719// UniqueWriterIdentity sets the optional parameter
12720// "uniqueWriterIdentity": See sinks.create for a description of this
12721// field. When updating a sink, the effect of this field on the value of
12722// writer_identity in the updated sink depends on both the old and new
12723// values of this field: If the old and new values of this field are
12724// both false or both true, then there is no change to the sink's
12725// writer_identity. If the old value is false and the new value is true,
12726// then writer_identity is changed to a unique service account. It is an
12727// error if the old value is true and the new value is set to false or
12728// defaulted to false.
12729func (c *FoldersSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksUpdateCall {
12730	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
12731	return c
12732}
12733
12734// UpdateMask sets the optional parameter "updateMask": Field mask that
12735// specifies the fields in sink that need an update. A sink field will
12736// be overwritten if, and only if, it is in the update mask. name and
12737// output only fields cannot be updated.An empty updateMask is
12738// temporarily treated as using the following mask for backwards
12739// compatibility purposes: destination,filter,includeChildren At some
12740// point in the future, behavior will be removed and specifying an empty
12741// updateMask will be an error.For a detailed FieldMask definition, see
12742// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
12743// updateMask=filter.
12744func (c *FoldersSinksUpdateCall) UpdateMask(updateMask string) *FoldersSinksUpdateCall {
12745	c.urlParams_.Set("updateMask", updateMask)
12746	return c
12747}
12748
12749// Fields allows partial responses to be retrieved. See
12750// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12751// for more information.
12752func (c *FoldersSinksUpdateCall) Fields(s ...googleapi.Field) *FoldersSinksUpdateCall {
12753	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12754	return c
12755}
12756
12757// Context sets the context to be used in this call's Do method. Any
12758// pending HTTP request will be aborted if the provided context is
12759// canceled.
12760func (c *FoldersSinksUpdateCall) Context(ctx context.Context) *FoldersSinksUpdateCall {
12761	c.ctx_ = ctx
12762	return c
12763}
12764
12765// Header returns an http.Header that can be modified by the caller to
12766// add HTTP headers to the request.
12767func (c *FoldersSinksUpdateCall) Header() http.Header {
12768	if c.header_ == nil {
12769		c.header_ = make(http.Header)
12770	}
12771	return c.header_
12772}
12773
12774func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
12775	reqHeaders := make(http.Header)
12776	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
12777	for k, v := range c.header_ {
12778		reqHeaders[k] = v
12779	}
12780	reqHeaders.Set("User-Agent", c.s.userAgent())
12781	var body io.Reader = nil
12782	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
12783	if err != nil {
12784		return nil, err
12785	}
12786	reqHeaders.Set("Content-Type", "application/json")
12787	c.urlParams_.Set("alt", alt)
12788	c.urlParams_.Set("prettyPrint", "false")
12789	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
12790	urls += "?" + c.urlParams_.Encode()
12791	req, err := http.NewRequest("PUT", urls, body)
12792	if err != nil {
12793		return nil, err
12794	}
12795	req.Header = reqHeaders
12796	googleapi.Expand(req.URL, map[string]string{
12797		"sinkName": c.sinkNameid,
12798	})
12799	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12800}
12801
12802// Do executes the "logging.folders.sinks.update" call.
12803// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
12804// code is an error. Response headers are in either
12805// *LogSink.ServerResponse.Header or (if a response was returned at all)
12806// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12807// check whether the returned error was because http.StatusNotModified
12808// was returned.
12809func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
12810	gensupport.SetOptions(c.urlParams_, opts...)
12811	res, err := c.doRequest("json")
12812	if res != nil && res.StatusCode == http.StatusNotModified {
12813		if res.Body != nil {
12814			res.Body.Close()
12815		}
12816		return nil, &googleapi.Error{
12817			Code:   res.StatusCode,
12818			Header: res.Header,
12819		}
12820	}
12821	if err != nil {
12822		return nil, err
12823	}
12824	defer googleapi.CloseBody(res)
12825	if err := googleapi.CheckResponse(res); err != nil {
12826		return nil, err
12827	}
12828	ret := &LogSink{
12829		ServerResponse: googleapi.ServerResponse{
12830			Header:         res.Header,
12831			HTTPStatusCode: res.StatusCode,
12832		},
12833	}
12834	target := &ret
12835	if err := gensupport.DecodeResponse(target, res); err != nil {
12836		return nil, err
12837	}
12838	return ret, nil
12839	// {
12840	//   "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.",
12841	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
12842	//   "httpMethod": "PUT",
12843	//   "id": "logging.folders.sinks.update",
12844	//   "parameterOrder": [
12845	//     "sinkName"
12846	//   ],
12847	//   "parameters": {
12848	//     "sinkName": {
12849	//       "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
12850	//       "location": "path",
12851	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
12852	//       "required": true,
12853	//       "type": "string"
12854	//     },
12855	//     "uniqueWriterIdentity": {
12856	//       "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: 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.",
12857	//       "location": "query",
12858	//       "type": "boolean"
12859	//     },
12860	//     "updateMask": {
12861	//       "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.",
12862	//       "format": "google-fieldmask",
12863	//       "location": "query",
12864	//       "type": "string"
12865	//     }
12866	//   },
12867	//   "path": "v2/{+sinkName}",
12868	//   "request": {
12869	//     "$ref": "LogSink"
12870	//   },
12871	//   "response": {
12872	//     "$ref": "LogSink"
12873	//   },
12874	//   "scopes": [
12875	//     "https://www.googleapis.com/auth/cloud-platform",
12876	//     "https://www.googleapis.com/auth/logging.admin"
12877	//   ]
12878	// }
12879
12880}
12881
12882// method id "logging.locations.get":
12883
12884type LocationsGetCall struct {
12885	s            *Service
12886	name         string
12887	urlParams_   gensupport.URLParams
12888	ifNoneMatch_ string
12889	ctx_         context.Context
12890	header_      http.Header
12891}
12892
12893// Get: Gets information about a location.
12894func (r *LocationsService) Get(name string) *LocationsGetCall {
12895	c := &LocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12896	c.name = name
12897	return c
12898}
12899
12900// Fields allows partial responses to be retrieved. See
12901// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12902// for more information.
12903func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall {
12904	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12905	return c
12906}
12907
12908// IfNoneMatch sets the optional parameter which makes the operation
12909// fail if the object's ETag matches the given value. This is useful for
12910// getting updates only after the object has changed since the last
12911// request. Use googleapi.IsNotModified to check whether the response
12912// error from Do is the result of In-None-Match.
12913func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall {
12914	c.ifNoneMatch_ = entityTag
12915	return c
12916}
12917
12918// Context sets the context to be used in this call's Do method. Any
12919// pending HTTP request will be aborted if the provided context is
12920// canceled.
12921func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall {
12922	c.ctx_ = ctx
12923	return c
12924}
12925
12926// Header returns an http.Header that can be modified by the caller to
12927// add HTTP headers to the request.
12928func (c *LocationsGetCall) Header() http.Header {
12929	if c.header_ == nil {
12930		c.header_ = make(http.Header)
12931	}
12932	return c.header_
12933}
12934
12935func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) {
12936	reqHeaders := make(http.Header)
12937	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
12938	for k, v := range c.header_ {
12939		reqHeaders[k] = v
12940	}
12941	reqHeaders.Set("User-Agent", c.s.userAgent())
12942	if c.ifNoneMatch_ != "" {
12943		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12944	}
12945	var body io.Reader = nil
12946	c.urlParams_.Set("alt", alt)
12947	c.urlParams_.Set("prettyPrint", "false")
12948	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
12949	urls += "?" + c.urlParams_.Encode()
12950	req, err := http.NewRequest("GET", urls, body)
12951	if err != nil {
12952		return nil, err
12953	}
12954	req.Header = reqHeaders
12955	googleapi.Expand(req.URL, map[string]string{
12956		"name": c.name,
12957	})
12958	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12959}
12960
12961// Do executes the "logging.locations.get" call.
12962// Exactly one of *Location or error will be non-nil. Any non-2xx status
12963// code is an error. Response headers are in either
12964// *Location.ServerResponse.Header or (if a response was returned at
12965// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
12966// to check whether the returned error was because
12967// http.StatusNotModified was returned.
12968func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
12969	gensupport.SetOptions(c.urlParams_, opts...)
12970	res, err := c.doRequest("json")
12971	if res != nil && res.StatusCode == http.StatusNotModified {
12972		if res.Body != nil {
12973			res.Body.Close()
12974		}
12975		return nil, &googleapi.Error{
12976			Code:   res.StatusCode,
12977			Header: res.Header,
12978		}
12979	}
12980	if err != nil {
12981		return nil, err
12982	}
12983	defer googleapi.CloseBody(res)
12984	if err := googleapi.CheckResponse(res); err != nil {
12985		return nil, err
12986	}
12987	ret := &Location{
12988		ServerResponse: googleapi.ServerResponse{
12989			Header:         res.Header,
12990			HTTPStatusCode: res.StatusCode,
12991		},
12992	}
12993	target := &ret
12994	if err := gensupport.DecodeResponse(target, res); err != nil {
12995		return nil, err
12996	}
12997	return ret, nil
12998	// {
12999	//   "description": "Gets information about a location.",
13000	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}",
13001	//   "httpMethod": "GET",
13002	//   "id": "logging.locations.get",
13003	//   "parameterOrder": [
13004	//     "name"
13005	//   ],
13006	//   "parameters": {
13007	//     "name": {
13008	//       "description": "Resource name for the location.",
13009	//       "location": "path",
13010	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+$",
13011	//       "required": true,
13012	//       "type": "string"
13013	//     }
13014	//   },
13015	//   "path": "v2/{+name}",
13016	//   "response": {
13017	//     "$ref": "Location"
13018	//   },
13019	//   "scopes": [
13020	//     "https://www.googleapis.com/auth/cloud-platform",
13021	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13022	//     "https://www.googleapis.com/auth/logging.admin",
13023	//     "https://www.googleapis.com/auth/logging.read"
13024	//   ]
13025	// }
13026
13027}
13028
13029// method id "logging.locations.list":
13030
13031type LocationsListCall struct {
13032	s            *Service
13033	name         string
13034	urlParams_   gensupport.URLParams
13035	ifNoneMatch_ string
13036	ctx_         context.Context
13037	header_      http.Header
13038}
13039
13040// List: Lists information about the supported locations for this
13041// service.
13042func (r *LocationsService) List(name string) *LocationsListCall {
13043	c := &LocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13044	c.name = name
13045	return c
13046}
13047
13048// Filter sets the optional parameter "filter": The standard list
13049// filter.
13050func (c *LocationsListCall) Filter(filter string) *LocationsListCall {
13051	c.urlParams_.Set("filter", filter)
13052	return c
13053}
13054
13055// PageSize sets the optional parameter "pageSize": The standard list
13056// page size.
13057func (c *LocationsListCall) PageSize(pageSize int64) *LocationsListCall {
13058	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
13059	return c
13060}
13061
13062// PageToken sets the optional parameter "pageToken": The standard list
13063// page token.
13064func (c *LocationsListCall) PageToken(pageToken string) *LocationsListCall {
13065	c.urlParams_.Set("pageToken", pageToken)
13066	return c
13067}
13068
13069// Fields allows partial responses to be retrieved. See
13070// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13071// for more information.
13072func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall {
13073	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13074	return c
13075}
13076
13077// IfNoneMatch sets the optional parameter which makes the operation
13078// fail if the object's ETag matches the given value. This is useful for
13079// getting updates only after the object has changed since the last
13080// request. Use googleapi.IsNotModified to check whether the response
13081// error from Do is the result of In-None-Match.
13082func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall {
13083	c.ifNoneMatch_ = entityTag
13084	return c
13085}
13086
13087// Context sets the context to be used in this call's Do method. Any
13088// pending HTTP request will be aborted if the provided context is
13089// canceled.
13090func (c *LocationsListCall) Context(ctx context.Context) *LocationsListCall {
13091	c.ctx_ = ctx
13092	return c
13093}
13094
13095// Header returns an http.Header that can be modified by the caller to
13096// add HTTP headers to the request.
13097func (c *LocationsListCall) Header() http.Header {
13098	if c.header_ == nil {
13099		c.header_ = make(http.Header)
13100	}
13101	return c.header_
13102}
13103
13104func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) {
13105	reqHeaders := make(http.Header)
13106	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
13107	for k, v := range c.header_ {
13108		reqHeaders[k] = v
13109	}
13110	reqHeaders.Set("User-Agent", c.s.userAgent())
13111	if c.ifNoneMatch_ != "" {
13112		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13113	}
13114	var body io.Reader = nil
13115	c.urlParams_.Set("alt", alt)
13116	c.urlParams_.Set("prettyPrint", "false")
13117	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
13118	urls += "?" + c.urlParams_.Encode()
13119	req, err := http.NewRequest("GET", urls, body)
13120	if err != nil {
13121		return nil, err
13122	}
13123	req.Header = reqHeaders
13124	googleapi.Expand(req.URL, map[string]string{
13125		"name": c.name,
13126	})
13127	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13128}
13129
13130// Do executes the "logging.locations.list" call.
13131// Exactly one of *ListLocationsResponse or error will be non-nil. Any
13132// non-2xx status code is an error. Response headers are in either
13133// *ListLocationsResponse.ServerResponse.Header or (if a response was
13134// returned at all) in error.(*googleapi.Error).Header. Use
13135// googleapi.IsNotModified to check whether the returned error was
13136// because http.StatusNotModified was returned.
13137func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
13138	gensupport.SetOptions(c.urlParams_, opts...)
13139	res, err := c.doRequest("json")
13140	if res != nil && res.StatusCode == http.StatusNotModified {
13141		if res.Body != nil {
13142			res.Body.Close()
13143		}
13144		return nil, &googleapi.Error{
13145			Code:   res.StatusCode,
13146			Header: res.Header,
13147		}
13148	}
13149	if err != nil {
13150		return nil, err
13151	}
13152	defer googleapi.CloseBody(res)
13153	if err := googleapi.CheckResponse(res); err != nil {
13154		return nil, err
13155	}
13156	ret := &ListLocationsResponse{
13157		ServerResponse: googleapi.ServerResponse{
13158			Header:         res.Header,
13159			HTTPStatusCode: res.StatusCode,
13160		},
13161	}
13162	target := &ret
13163	if err := gensupport.DecodeResponse(target, res); err != nil {
13164		return nil, err
13165	}
13166	return ret, nil
13167	// {
13168	//   "description": "Lists information about the supported locations for this service.",
13169	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations",
13170	//   "httpMethod": "GET",
13171	//   "id": "logging.locations.list",
13172	//   "parameterOrder": [
13173	//     "name"
13174	//   ],
13175	//   "parameters": {
13176	//     "filter": {
13177	//       "description": "The standard list filter.",
13178	//       "location": "query",
13179	//       "type": "string"
13180	//     },
13181	//     "name": {
13182	//       "description": "The resource that owns the locations collection, if applicable.",
13183	//       "location": "path",
13184	//       "pattern": "^[^/]+/[^/]+$",
13185	//       "required": true,
13186	//       "type": "string"
13187	//     },
13188	//     "pageSize": {
13189	//       "description": "The standard list page size.",
13190	//       "format": "int32",
13191	//       "location": "query",
13192	//       "type": "integer"
13193	//     },
13194	//     "pageToken": {
13195	//       "description": "The standard list page token.",
13196	//       "location": "query",
13197	//       "type": "string"
13198	//     }
13199	//   },
13200	//   "path": "v2/{+name}/locations",
13201	//   "response": {
13202	//     "$ref": "ListLocationsResponse"
13203	//   },
13204	//   "scopes": [
13205	//     "https://www.googleapis.com/auth/cloud-platform",
13206	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13207	//     "https://www.googleapis.com/auth/logging.admin",
13208	//     "https://www.googleapis.com/auth/logging.read"
13209	//   ]
13210	// }
13211
13212}
13213
13214// Pages invokes f for each page of results.
13215// A non-nil error returned from f will halt the iteration.
13216// The provided context supersedes any context provided to the Context method.
13217func (c *LocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
13218	c.ctx_ = ctx
13219	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
13220	for {
13221		x, err := c.Do()
13222		if err != nil {
13223			return err
13224		}
13225		if err := f(x); err != nil {
13226			return err
13227		}
13228		if x.NextPageToken == "" {
13229			return nil
13230		}
13231		c.PageToken(x.NextPageToken)
13232	}
13233}
13234
13235// method id "logging.locations.buckets.create":
13236
13237type LocationsBucketsCreateCall struct {
13238	s          *Service
13239	parent     string
13240	logbucket  *LogBucket
13241	urlParams_ gensupport.URLParams
13242	ctx_       context.Context
13243	header_    http.Header
13244}
13245
13246// Create: Creates a bucket that can be used to store log entries. Once
13247// a bucket has been created, the region cannot be changed.
13248func (r *LocationsBucketsService) Create(parent string, logbucket *LogBucket) *LocationsBucketsCreateCall {
13249	c := &LocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13250	c.parent = parent
13251	c.logbucket = logbucket
13252	return c
13253}
13254
13255// BucketId sets the optional parameter "bucketId": Required. A
13256// client-assigned identifier such as "my-bucket". Identifiers are
13257// limited to 100 characters and can include only letters, digits,
13258// underscores, hyphens, and periods.
13259func (c *LocationsBucketsCreateCall) BucketId(bucketId string) *LocationsBucketsCreateCall {
13260	c.urlParams_.Set("bucketId", bucketId)
13261	return c
13262}
13263
13264// Fields allows partial responses to be retrieved. See
13265// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13266// for more information.
13267func (c *LocationsBucketsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateCall {
13268	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13269	return c
13270}
13271
13272// Context sets the context to be used in this call's Do method. Any
13273// pending HTTP request will be aborted if the provided context is
13274// canceled.
13275func (c *LocationsBucketsCreateCall) Context(ctx context.Context) *LocationsBucketsCreateCall {
13276	c.ctx_ = ctx
13277	return c
13278}
13279
13280// Header returns an http.Header that can be modified by the caller to
13281// add HTTP headers to the request.
13282func (c *LocationsBucketsCreateCall) Header() http.Header {
13283	if c.header_ == nil {
13284		c.header_ = make(http.Header)
13285	}
13286	return c.header_
13287}
13288
13289func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
13290	reqHeaders := make(http.Header)
13291	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
13292	for k, v := range c.header_ {
13293		reqHeaders[k] = v
13294	}
13295	reqHeaders.Set("User-Agent", c.s.userAgent())
13296	var body io.Reader = nil
13297	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
13298	if err != nil {
13299		return nil, err
13300	}
13301	reqHeaders.Set("Content-Type", "application/json")
13302	c.urlParams_.Set("alt", alt)
13303	c.urlParams_.Set("prettyPrint", "false")
13304	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
13305	urls += "?" + c.urlParams_.Encode()
13306	req, err := http.NewRequest("POST", urls, body)
13307	if err != nil {
13308		return nil, err
13309	}
13310	req.Header = reqHeaders
13311	googleapi.Expand(req.URL, map[string]string{
13312		"parent": c.parent,
13313	})
13314	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13315}
13316
13317// Do executes the "logging.locations.buckets.create" call.
13318// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
13319// status code is an error. Response headers are in either
13320// *LogBucket.ServerResponse.Header or (if a response was returned at
13321// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
13322// to check whether the returned error was because
13323// http.StatusNotModified was returned.
13324func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
13325	gensupport.SetOptions(c.urlParams_, opts...)
13326	res, err := c.doRequest("json")
13327	if res != nil && res.StatusCode == http.StatusNotModified {
13328		if res.Body != nil {
13329			res.Body.Close()
13330		}
13331		return nil, &googleapi.Error{
13332			Code:   res.StatusCode,
13333			Header: res.Header,
13334		}
13335	}
13336	if err != nil {
13337		return nil, err
13338	}
13339	defer googleapi.CloseBody(res)
13340	if err := googleapi.CheckResponse(res); err != nil {
13341		return nil, err
13342	}
13343	ret := &LogBucket{
13344		ServerResponse: googleapi.ServerResponse{
13345			Header:         res.Header,
13346			HTTPStatusCode: res.StatusCode,
13347		},
13348	}
13349	target := &ret
13350	if err := gensupport.DecodeResponse(target, res); err != nil {
13351		return nil, err
13352	}
13353	return ret, nil
13354	// {
13355	//   "description": "Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.",
13356	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets",
13357	//   "httpMethod": "POST",
13358	//   "id": "logging.locations.buckets.create",
13359	//   "parameterOrder": [
13360	//     "parent"
13361	//   ],
13362	//   "parameters": {
13363	//     "bucketId": {
13364	//       "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.",
13365	//       "location": "query",
13366	//       "type": "string"
13367	//     },
13368	//     "parent": {
13369	//       "description": "Required. The resource in which to create the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" Example: \"projects/my-logging-project/locations/global\"",
13370	//       "location": "path",
13371	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+$",
13372	//       "required": true,
13373	//       "type": "string"
13374	//     }
13375	//   },
13376	//   "path": "v2/{+parent}/buckets",
13377	//   "request": {
13378	//     "$ref": "LogBucket"
13379	//   },
13380	//   "response": {
13381	//     "$ref": "LogBucket"
13382	//   },
13383	//   "scopes": [
13384	//     "https://www.googleapis.com/auth/cloud-platform",
13385	//     "https://www.googleapis.com/auth/logging.admin"
13386	//   ]
13387	// }
13388
13389}
13390
13391// method id "logging.locations.buckets.delete":
13392
13393type LocationsBucketsDeleteCall struct {
13394	s          *Service
13395	name       string
13396	urlParams_ gensupport.URLParams
13397	ctx_       context.Context
13398	header_    http.Header
13399}
13400
13401// Delete: Deletes a bucket. Moves the bucket to the DELETE_REQUESTED
13402// state. After 7 days, the bucket will be purged and all logs in the
13403// bucket will be permanently deleted.
13404func (r *LocationsBucketsService) Delete(name string) *LocationsBucketsDeleteCall {
13405	c := &LocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13406	c.name = name
13407	return c
13408}
13409
13410// Fields allows partial responses to be retrieved. See
13411// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13412// for more information.
13413func (c *LocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsDeleteCall {
13414	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13415	return c
13416}
13417
13418// Context sets the context to be used in this call's Do method. Any
13419// pending HTTP request will be aborted if the provided context is
13420// canceled.
13421func (c *LocationsBucketsDeleteCall) Context(ctx context.Context) *LocationsBucketsDeleteCall {
13422	c.ctx_ = ctx
13423	return c
13424}
13425
13426// Header returns an http.Header that can be modified by the caller to
13427// add HTTP headers to the request.
13428func (c *LocationsBucketsDeleteCall) Header() http.Header {
13429	if c.header_ == nil {
13430		c.header_ = make(http.Header)
13431	}
13432	return c.header_
13433}
13434
13435func (c *LocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
13436	reqHeaders := make(http.Header)
13437	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
13438	for k, v := range c.header_ {
13439		reqHeaders[k] = v
13440	}
13441	reqHeaders.Set("User-Agent", c.s.userAgent())
13442	var body io.Reader = nil
13443	c.urlParams_.Set("alt", alt)
13444	c.urlParams_.Set("prettyPrint", "false")
13445	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
13446	urls += "?" + c.urlParams_.Encode()
13447	req, err := http.NewRequest("DELETE", urls, body)
13448	if err != nil {
13449		return nil, err
13450	}
13451	req.Header = reqHeaders
13452	googleapi.Expand(req.URL, map[string]string{
13453		"name": c.name,
13454	})
13455	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13456}
13457
13458// Do executes the "logging.locations.buckets.delete" call.
13459// Exactly one of *Empty or error will be non-nil. Any non-2xx status
13460// code is an error. Response headers are in either
13461// *Empty.ServerResponse.Header or (if a response was returned at all)
13462// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13463// check whether the returned error was because http.StatusNotModified
13464// was returned.
13465func (c *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
13466	gensupport.SetOptions(c.urlParams_, opts...)
13467	res, err := c.doRequest("json")
13468	if res != nil && res.StatusCode == http.StatusNotModified {
13469		if res.Body != nil {
13470			res.Body.Close()
13471		}
13472		return nil, &googleapi.Error{
13473			Code:   res.StatusCode,
13474			Header: res.Header,
13475		}
13476	}
13477	if err != nil {
13478		return nil, err
13479	}
13480	defer googleapi.CloseBody(res)
13481	if err := googleapi.CheckResponse(res); err != nil {
13482		return nil, err
13483	}
13484	ret := &Empty{
13485		ServerResponse: googleapi.ServerResponse{
13486			Header:         res.Header,
13487			HTTPStatusCode: res.StatusCode,
13488		},
13489	}
13490	target := &ret
13491	if err := gensupport.DecodeResponse(target, res); err != nil {
13492		return nil, err
13493	}
13494	return ret, nil
13495	// {
13496	//   "description": "Deletes a bucket. Moves the bucket to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all logs in the bucket will be permanently deleted.",
13497	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}",
13498	//   "httpMethod": "DELETE",
13499	//   "id": "logging.locations.buckets.delete",
13500	//   "parameterOrder": [
13501	//     "name"
13502	//   ],
13503	//   "parameters": {
13504	//     "name": {
13505	//       "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
13506	//       "location": "path",
13507	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
13508	//       "required": true,
13509	//       "type": "string"
13510	//     }
13511	//   },
13512	//   "path": "v2/{+name}",
13513	//   "response": {
13514	//     "$ref": "Empty"
13515	//   },
13516	//   "scopes": [
13517	//     "https://www.googleapis.com/auth/cloud-platform",
13518	//     "https://www.googleapis.com/auth/logging.admin"
13519	//   ]
13520	// }
13521
13522}
13523
13524// method id "logging.locations.buckets.get":
13525
13526type LocationsBucketsGetCall struct {
13527	s            *Service
13528	name         string
13529	urlParams_   gensupport.URLParams
13530	ifNoneMatch_ string
13531	ctx_         context.Context
13532	header_      http.Header
13533}
13534
13535// Get: Gets a bucket.
13536func (r *LocationsBucketsService) Get(name string) *LocationsBucketsGetCall {
13537	c := &LocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13538	c.name = name
13539	return c
13540}
13541
13542// Fields allows partial responses to be retrieved. See
13543// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13544// for more information.
13545func (c *LocationsBucketsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsGetCall {
13546	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13547	return c
13548}
13549
13550// IfNoneMatch sets the optional parameter which makes the operation
13551// fail if the object's ETag matches the given value. This is useful for
13552// getting updates only after the object has changed since the last
13553// request. Use googleapi.IsNotModified to check whether the response
13554// error from Do is the result of In-None-Match.
13555func (c *LocationsBucketsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsGetCall {
13556	c.ifNoneMatch_ = entityTag
13557	return c
13558}
13559
13560// Context sets the context to be used in this call's Do method. Any
13561// pending HTTP request will be aborted if the provided context is
13562// canceled.
13563func (c *LocationsBucketsGetCall) Context(ctx context.Context) *LocationsBucketsGetCall {
13564	c.ctx_ = ctx
13565	return c
13566}
13567
13568// Header returns an http.Header that can be modified by the caller to
13569// add HTTP headers to the request.
13570func (c *LocationsBucketsGetCall) Header() http.Header {
13571	if c.header_ == nil {
13572		c.header_ = make(http.Header)
13573	}
13574	return c.header_
13575}
13576
13577func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
13578	reqHeaders := make(http.Header)
13579	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
13580	for k, v := range c.header_ {
13581		reqHeaders[k] = v
13582	}
13583	reqHeaders.Set("User-Agent", c.s.userAgent())
13584	if c.ifNoneMatch_ != "" {
13585		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13586	}
13587	var body io.Reader = nil
13588	c.urlParams_.Set("alt", alt)
13589	c.urlParams_.Set("prettyPrint", "false")
13590	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
13591	urls += "?" + c.urlParams_.Encode()
13592	req, err := http.NewRequest("GET", urls, body)
13593	if err != nil {
13594		return nil, err
13595	}
13596	req.Header = reqHeaders
13597	googleapi.Expand(req.URL, map[string]string{
13598		"name": c.name,
13599	})
13600	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13601}
13602
13603// Do executes the "logging.locations.buckets.get" call.
13604// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
13605// status code is an error. Response headers are in either
13606// *LogBucket.ServerResponse.Header or (if a response was returned at
13607// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
13608// to check whether the returned error was because
13609// http.StatusNotModified was returned.
13610func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
13611	gensupport.SetOptions(c.urlParams_, opts...)
13612	res, err := c.doRequest("json")
13613	if res != nil && res.StatusCode == http.StatusNotModified {
13614		if res.Body != nil {
13615			res.Body.Close()
13616		}
13617		return nil, &googleapi.Error{
13618			Code:   res.StatusCode,
13619			Header: res.Header,
13620		}
13621	}
13622	if err != nil {
13623		return nil, err
13624	}
13625	defer googleapi.CloseBody(res)
13626	if err := googleapi.CheckResponse(res); err != nil {
13627		return nil, err
13628	}
13629	ret := &LogBucket{
13630		ServerResponse: googleapi.ServerResponse{
13631			Header:         res.Header,
13632			HTTPStatusCode: res.StatusCode,
13633		},
13634	}
13635	target := &ret
13636	if err := gensupport.DecodeResponse(target, res); err != nil {
13637		return nil, err
13638	}
13639	return ret, nil
13640	// {
13641	//   "description": "Gets a bucket.",
13642	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}",
13643	//   "httpMethod": "GET",
13644	//   "id": "logging.locations.buckets.get",
13645	//   "parameterOrder": [
13646	//     "name"
13647	//   ],
13648	//   "parameters": {
13649	//     "name": {
13650	//       "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
13651	//       "location": "path",
13652	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
13653	//       "required": true,
13654	//       "type": "string"
13655	//     }
13656	//   },
13657	//   "path": "v2/{+name}",
13658	//   "response": {
13659	//     "$ref": "LogBucket"
13660	//   },
13661	//   "scopes": [
13662	//     "https://www.googleapis.com/auth/cloud-platform",
13663	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13664	//     "https://www.googleapis.com/auth/logging.admin",
13665	//     "https://www.googleapis.com/auth/logging.read"
13666	//   ]
13667	// }
13668
13669}
13670
13671// method id "logging.locations.buckets.list":
13672
13673type LocationsBucketsListCall struct {
13674	s            *Service
13675	parent       string
13676	urlParams_   gensupport.URLParams
13677	ifNoneMatch_ string
13678	ctx_         context.Context
13679	header_      http.Header
13680}
13681
13682// List: Lists buckets.
13683func (r *LocationsBucketsService) List(parent string) *LocationsBucketsListCall {
13684	c := &LocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13685	c.parent = parent
13686	return c
13687}
13688
13689// PageSize sets the optional parameter "pageSize": The maximum number
13690// of results to return from this request. Non-positive values are
13691// ignored. The presence of nextPageToken in the response indicates that
13692// more results might be available.
13693func (c *LocationsBucketsListCall) PageSize(pageSize int64) *LocationsBucketsListCall {
13694	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
13695	return c
13696}
13697
13698// PageToken sets the optional parameter "pageToken": If present, then
13699// retrieve the next batch of results from the preceding call to this
13700// method. pageToken must be the value of nextPageToken from the
13701// previous response. The values of other method parameters should be
13702// identical to those in the previous call.
13703func (c *LocationsBucketsListCall) PageToken(pageToken string) *LocationsBucketsListCall {
13704	c.urlParams_.Set("pageToken", pageToken)
13705	return c
13706}
13707
13708// Fields allows partial responses to be retrieved. See
13709// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13710// for more information.
13711func (c *LocationsBucketsListCall) Fields(s ...googleapi.Field) *LocationsBucketsListCall {
13712	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13713	return c
13714}
13715
13716// IfNoneMatch sets the optional parameter which makes the operation
13717// fail if the object's ETag matches the given value. This is useful for
13718// getting updates only after the object has changed since the last
13719// request. Use googleapi.IsNotModified to check whether the response
13720// error from Do is the result of In-None-Match.
13721func (c *LocationsBucketsListCall) IfNoneMatch(entityTag string) *LocationsBucketsListCall {
13722	c.ifNoneMatch_ = entityTag
13723	return c
13724}
13725
13726// Context sets the context to be used in this call's Do method. Any
13727// pending HTTP request will be aborted if the provided context is
13728// canceled.
13729func (c *LocationsBucketsListCall) Context(ctx context.Context) *LocationsBucketsListCall {
13730	c.ctx_ = ctx
13731	return c
13732}
13733
13734// Header returns an http.Header that can be modified by the caller to
13735// add HTTP headers to the request.
13736func (c *LocationsBucketsListCall) Header() http.Header {
13737	if c.header_ == nil {
13738		c.header_ = make(http.Header)
13739	}
13740	return c.header_
13741}
13742
13743func (c *LocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
13744	reqHeaders := make(http.Header)
13745	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
13746	for k, v := range c.header_ {
13747		reqHeaders[k] = v
13748	}
13749	reqHeaders.Set("User-Agent", c.s.userAgent())
13750	if c.ifNoneMatch_ != "" {
13751		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13752	}
13753	var body io.Reader = nil
13754	c.urlParams_.Set("alt", alt)
13755	c.urlParams_.Set("prettyPrint", "false")
13756	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
13757	urls += "?" + c.urlParams_.Encode()
13758	req, err := http.NewRequest("GET", urls, body)
13759	if err != nil {
13760		return nil, err
13761	}
13762	req.Header = reqHeaders
13763	googleapi.Expand(req.URL, map[string]string{
13764		"parent": c.parent,
13765	})
13766	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13767}
13768
13769// Do executes the "logging.locations.buckets.list" call.
13770// Exactly one of *ListBucketsResponse or error will be non-nil. Any
13771// non-2xx status code is an error. Response headers are in either
13772// *ListBucketsResponse.ServerResponse.Header or (if a response was
13773// returned at all) in error.(*googleapi.Error).Header. Use
13774// googleapi.IsNotModified to check whether the returned error was
13775// because http.StatusNotModified was returned.
13776func (c *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
13777	gensupport.SetOptions(c.urlParams_, opts...)
13778	res, err := c.doRequest("json")
13779	if res != nil && res.StatusCode == http.StatusNotModified {
13780		if res.Body != nil {
13781			res.Body.Close()
13782		}
13783		return nil, &googleapi.Error{
13784			Code:   res.StatusCode,
13785			Header: res.Header,
13786		}
13787	}
13788	if err != nil {
13789		return nil, err
13790	}
13791	defer googleapi.CloseBody(res)
13792	if err := googleapi.CheckResponse(res); err != nil {
13793		return nil, err
13794	}
13795	ret := &ListBucketsResponse{
13796		ServerResponse: googleapi.ServerResponse{
13797			Header:         res.Header,
13798			HTTPStatusCode: res.StatusCode,
13799		},
13800	}
13801	target := &ret
13802	if err := gensupport.DecodeResponse(target, res); err != nil {
13803		return nil, err
13804	}
13805	return ret, nil
13806	// {
13807	//   "description": "Lists buckets.",
13808	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets",
13809	//   "httpMethod": "GET",
13810	//   "id": "logging.locations.buckets.list",
13811	//   "parameterOrder": [
13812	//     "parent"
13813	//   ],
13814	//   "parameters": {
13815	//     "pageSize": {
13816	//       "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.",
13817	//       "format": "int32",
13818	//       "location": "query",
13819	//       "type": "integer"
13820	//     },
13821	//     "pageToken": {
13822	//       "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.",
13823	//       "location": "query",
13824	//       "type": "string"
13825	//     },
13826	//     "parent": {
13827	//       "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.",
13828	//       "location": "path",
13829	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+$",
13830	//       "required": true,
13831	//       "type": "string"
13832	//     }
13833	//   },
13834	//   "path": "v2/{+parent}/buckets",
13835	//   "response": {
13836	//     "$ref": "ListBucketsResponse"
13837	//   },
13838	//   "scopes": [
13839	//     "https://www.googleapis.com/auth/cloud-platform",
13840	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13841	//     "https://www.googleapis.com/auth/logging.admin",
13842	//     "https://www.googleapis.com/auth/logging.read"
13843	//   ]
13844	// }
13845
13846}
13847
13848// Pages invokes f for each page of results.
13849// A non-nil error returned from f will halt the iteration.
13850// The provided context supersedes any context provided to the Context method.
13851func (c *LocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
13852	c.ctx_ = ctx
13853	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
13854	for {
13855		x, err := c.Do()
13856		if err != nil {
13857			return err
13858		}
13859		if err := f(x); err != nil {
13860			return err
13861		}
13862		if x.NextPageToken == "" {
13863			return nil
13864		}
13865		c.PageToken(x.NextPageToken)
13866	}
13867}
13868
13869// method id "logging.locations.buckets.patch":
13870
13871type LocationsBucketsPatchCall struct {
13872	s          *Service
13873	name       string
13874	logbucket  *LogBucket
13875	urlParams_ gensupport.URLParams
13876	ctx_       context.Context
13877	header_    http.Header
13878}
13879
13880// Patch: Updates a bucket. This method replaces the following fields in
13881// the existing bucket with values from the new bucket:
13882// retention_periodIf the retention period is decreased and the bucket
13883// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
13884// LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
13885// returned.A buckets region may not be modified after it is created.
13886func (r *LocationsBucketsService) Patch(name string, logbucket *LogBucket) *LocationsBucketsPatchCall {
13887	c := &LocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13888	c.name = name
13889	c.logbucket = logbucket
13890	return c
13891}
13892
13893// UpdateMask sets the optional parameter "updateMask": Required. Field
13894// mask that specifies the fields in bucket that need an update. A
13895// bucket field will be overwritten if, and only if, it is in the update
13896// mask. name and output only fields cannot be updated.For a detailed
13897// FieldMask definition, see
13898// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
13899// updateMask=retention_days.
13900func (c *LocationsBucketsPatchCall) UpdateMask(updateMask string) *LocationsBucketsPatchCall {
13901	c.urlParams_.Set("updateMask", updateMask)
13902	return c
13903}
13904
13905// Fields allows partial responses to be retrieved. See
13906// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13907// for more information.
13908func (c *LocationsBucketsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsPatchCall {
13909	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13910	return c
13911}
13912
13913// Context sets the context to be used in this call's Do method. Any
13914// pending HTTP request will be aborted if the provided context is
13915// canceled.
13916func (c *LocationsBucketsPatchCall) Context(ctx context.Context) *LocationsBucketsPatchCall {
13917	c.ctx_ = ctx
13918	return c
13919}
13920
13921// Header returns an http.Header that can be modified by the caller to
13922// add HTTP headers to the request.
13923func (c *LocationsBucketsPatchCall) Header() http.Header {
13924	if c.header_ == nil {
13925		c.header_ = make(http.Header)
13926	}
13927	return c.header_
13928}
13929
13930func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
13931	reqHeaders := make(http.Header)
13932	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
13933	for k, v := range c.header_ {
13934		reqHeaders[k] = v
13935	}
13936	reqHeaders.Set("User-Agent", c.s.userAgent())
13937	var body io.Reader = nil
13938	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
13939	if err != nil {
13940		return nil, err
13941	}
13942	reqHeaders.Set("Content-Type", "application/json")
13943	c.urlParams_.Set("alt", alt)
13944	c.urlParams_.Set("prettyPrint", "false")
13945	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
13946	urls += "?" + c.urlParams_.Encode()
13947	req, err := http.NewRequest("PATCH", urls, body)
13948	if err != nil {
13949		return nil, err
13950	}
13951	req.Header = reqHeaders
13952	googleapi.Expand(req.URL, map[string]string{
13953		"name": c.name,
13954	})
13955	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13956}
13957
13958// Do executes the "logging.locations.buckets.patch" call.
13959// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
13960// status code is an error. Response headers are in either
13961// *LogBucket.ServerResponse.Header or (if a response was returned at
13962// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
13963// to check whether the returned error was because
13964// http.StatusNotModified was returned.
13965func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
13966	gensupport.SetOptions(c.urlParams_, opts...)
13967	res, err := c.doRequest("json")
13968	if res != nil && res.StatusCode == http.StatusNotModified {
13969		if res.Body != nil {
13970			res.Body.Close()
13971		}
13972		return nil, &googleapi.Error{
13973			Code:   res.StatusCode,
13974			Header: res.Header,
13975		}
13976	}
13977	if err != nil {
13978		return nil, err
13979	}
13980	defer googleapi.CloseBody(res)
13981	if err := googleapi.CheckResponse(res); err != nil {
13982		return nil, err
13983	}
13984	ret := &LogBucket{
13985		ServerResponse: googleapi.ServerResponse{
13986			Header:         res.Header,
13987			HTTPStatusCode: res.StatusCode,
13988		},
13989	}
13990	target := &ret
13991	if err := gensupport.DecodeResponse(target, res); err != nil {
13992		return nil, err
13993	}
13994	return ret, nil
13995	// {
13996	//   "description": "Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created.",
13997	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}",
13998	//   "httpMethod": "PATCH",
13999	//   "id": "logging.locations.buckets.patch",
14000	//   "parameterOrder": [
14001	//     "name"
14002	//   ],
14003	//   "parameters": {
14004	//     "name": {
14005	//       "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\". Also requires permission \"resourcemanager.projects.updateLiens\" to set the locked property",
14006	//       "location": "path",
14007	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
14008	//       "required": true,
14009	//       "type": "string"
14010	//     },
14011	//     "updateMask": {
14012	//       "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days.",
14013	//       "format": "google-fieldmask",
14014	//       "location": "query",
14015	//       "type": "string"
14016	//     }
14017	//   },
14018	//   "path": "v2/{+name}",
14019	//   "request": {
14020	//     "$ref": "LogBucket"
14021	//   },
14022	//   "response": {
14023	//     "$ref": "LogBucket"
14024	//   },
14025	//   "scopes": [
14026	//     "https://www.googleapis.com/auth/cloud-platform",
14027	//     "https://www.googleapis.com/auth/logging.admin"
14028	//   ]
14029	// }
14030
14031}
14032
14033// method id "logging.locations.buckets.undelete":
14034
14035type LocationsBucketsUndeleteCall struct {
14036	s                     *Service
14037	name                  string
14038	undeletebucketrequest *UndeleteBucketRequest
14039	urlParams_            gensupport.URLParams
14040	ctx_                  context.Context
14041	header_               http.Header
14042}
14043
14044// Undelete: Undeletes a bucket. A bucket that has been deleted may be
14045// undeleted within the grace period of 7 days.
14046func (r *LocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *LocationsBucketsUndeleteCall {
14047	c := &LocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14048	c.name = name
14049	c.undeletebucketrequest = undeletebucketrequest
14050	return c
14051}
14052
14053// Fields allows partial responses to be retrieved. See
14054// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14055// for more information.
14056func (c *LocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsUndeleteCall {
14057	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14058	return c
14059}
14060
14061// Context sets the context to be used in this call's Do method. Any
14062// pending HTTP request will be aborted if the provided context is
14063// canceled.
14064func (c *LocationsBucketsUndeleteCall) Context(ctx context.Context) *LocationsBucketsUndeleteCall {
14065	c.ctx_ = ctx
14066	return c
14067}
14068
14069// Header returns an http.Header that can be modified by the caller to
14070// add HTTP headers to the request.
14071func (c *LocationsBucketsUndeleteCall) Header() http.Header {
14072	if c.header_ == nil {
14073		c.header_ = make(http.Header)
14074	}
14075	return c.header_
14076}
14077
14078func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
14079	reqHeaders := make(http.Header)
14080	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
14081	for k, v := range c.header_ {
14082		reqHeaders[k] = v
14083	}
14084	reqHeaders.Set("User-Agent", c.s.userAgent())
14085	var body io.Reader = nil
14086	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
14087	if err != nil {
14088		return nil, err
14089	}
14090	reqHeaders.Set("Content-Type", "application/json")
14091	c.urlParams_.Set("alt", alt)
14092	c.urlParams_.Set("prettyPrint", "false")
14093	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
14094	urls += "?" + c.urlParams_.Encode()
14095	req, err := http.NewRequest("POST", urls, body)
14096	if err != nil {
14097		return nil, err
14098	}
14099	req.Header = reqHeaders
14100	googleapi.Expand(req.URL, map[string]string{
14101		"name": c.name,
14102	})
14103	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14104}
14105
14106// Do executes the "logging.locations.buckets.undelete" call.
14107// Exactly one of *Empty or error will be non-nil. Any non-2xx status
14108// code is an error. Response headers are in either
14109// *Empty.ServerResponse.Header or (if a response was returned at all)
14110// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14111// check whether the returned error was because http.StatusNotModified
14112// was returned.
14113func (c *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
14114	gensupport.SetOptions(c.urlParams_, opts...)
14115	res, err := c.doRequest("json")
14116	if res != nil && res.StatusCode == http.StatusNotModified {
14117		if res.Body != nil {
14118			res.Body.Close()
14119		}
14120		return nil, &googleapi.Error{
14121			Code:   res.StatusCode,
14122			Header: res.Header,
14123		}
14124	}
14125	if err != nil {
14126		return nil, err
14127	}
14128	defer googleapi.CloseBody(res)
14129	if err := googleapi.CheckResponse(res); err != nil {
14130		return nil, err
14131	}
14132	ret := &Empty{
14133		ServerResponse: googleapi.ServerResponse{
14134			Header:         res.Header,
14135			HTTPStatusCode: res.StatusCode,
14136		},
14137	}
14138	target := &ret
14139	if err := gensupport.DecodeResponse(target, res); err != nil {
14140		return nil, err
14141	}
14142	return ret, nil
14143	// {
14144	//   "description": "Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.",
14145	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:undelete",
14146	//   "httpMethod": "POST",
14147	//   "id": "logging.locations.buckets.undelete",
14148	//   "parameterOrder": [
14149	//     "name"
14150	//   ],
14151	//   "parameters": {
14152	//     "name": {
14153	//       "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
14154	//       "location": "path",
14155	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
14156	//       "required": true,
14157	//       "type": "string"
14158	//     }
14159	//   },
14160	//   "path": "v2/{+name}:undelete",
14161	//   "request": {
14162	//     "$ref": "UndeleteBucketRequest"
14163	//   },
14164	//   "response": {
14165	//     "$ref": "Empty"
14166	//   },
14167	//   "scopes": [
14168	//     "https://www.googleapis.com/auth/cloud-platform",
14169	//     "https://www.googleapis.com/auth/logging.admin"
14170	//   ]
14171	// }
14172
14173}
14174
14175// method id "logging.locations.buckets.views.create":
14176
14177type LocationsBucketsViewsCreateCall struct {
14178	s          *Service
14179	parent     string
14180	logview    *LogView
14181	urlParams_ gensupport.URLParams
14182	ctx_       context.Context
14183	header_    http.Header
14184}
14185
14186// Create: Creates a view over logs in a bucket. A bucket may contain a
14187// maximum of 50 views.
14188func (r *LocationsBucketsViewsService) Create(parent string, logview *LogView) *LocationsBucketsViewsCreateCall {
14189	c := &LocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14190	c.parent = parent
14191	c.logview = logview
14192	return c
14193}
14194
14195// ViewId sets the optional parameter "viewId": Required. The id to use
14196// for this view.
14197func (c *LocationsBucketsViewsCreateCall) ViewId(viewId string) *LocationsBucketsViewsCreateCall {
14198	c.urlParams_.Set("viewId", viewId)
14199	return c
14200}
14201
14202// Fields allows partial responses to be retrieved. See
14203// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14204// for more information.
14205func (c *LocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsCreateCall {
14206	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14207	return c
14208}
14209
14210// Context sets the context to be used in this call's Do method. Any
14211// pending HTTP request will be aborted if the provided context is
14212// canceled.
14213func (c *LocationsBucketsViewsCreateCall) Context(ctx context.Context) *LocationsBucketsViewsCreateCall {
14214	c.ctx_ = ctx
14215	return c
14216}
14217
14218// Header returns an http.Header that can be modified by the caller to
14219// add HTTP headers to the request.
14220func (c *LocationsBucketsViewsCreateCall) Header() http.Header {
14221	if c.header_ == nil {
14222		c.header_ = make(http.Header)
14223	}
14224	return c.header_
14225}
14226
14227func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
14228	reqHeaders := make(http.Header)
14229	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
14230	for k, v := range c.header_ {
14231		reqHeaders[k] = v
14232	}
14233	reqHeaders.Set("User-Agent", c.s.userAgent())
14234	var body io.Reader = nil
14235	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
14236	if err != nil {
14237		return nil, err
14238	}
14239	reqHeaders.Set("Content-Type", "application/json")
14240	c.urlParams_.Set("alt", alt)
14241	c.urlParams_.Set("prettyPrint", "false")
14242	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
14243	urls += "?" + c.urlParams_.Encode()
14244	req, err := http.NewRequest("POST", urls, body)
14245	if err != nil {
14246		return nil, err
14247	}
14248	req.Header = reqHeaders
14249	googleapi.Expand(req.URL, map[string]string{
14250		"parent": c.parent,
14251	})
14252	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14253}
14254
14255// Do executes the "logging.locations.buckets.views.create" call.
14256// Exactly one of *LogView or error will be non-nil. Any non-2xx status
14257// code is an error. Response headers are in either
14258// *LogView.ServerResponse.Header or (if a response was returned at all)
14259// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14260// check whether the returned error was because http.StatusNotModified
14261// was returned.
14262func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
14263	gensupport.SetOptions(c.urlParams_, opts...)
14264	res, err := c.doRequest("json")
14265	if res != nil && res.StatusCode == http.StatusNotModified {
14266		if res.Body != nil {
14267			res.Body.Close()
14268		}
14269		return nil, &googleapi.Error{
14270			Code:   res.StatusCode,
14271			Header: res.Header,
14272		}
14273	}
14274	if err != nil {
14275		return nil, err
14276	}
14277	defer googleapi.CloseBody(res)
14278	if err := googleapi.CheckResponse(res); err != nil {
14279		return nil, err
14280	}
14281	ret := &LogView{
14282		ServerResponse: googleapi.ServerResponse{
14283			Header:         res.Header,
14284			HTTPStatusCode: res.StatusCode,
14285		},
14286	}
14287	target := &ret
14288	if err := gensupport.DecodeResponse(target, res); err != nil {
14289		return nil, err
14290	}
14291	return ret, nil
14292	// {
14293	//   "description": "Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.",
14294	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views",
14295	//   "httpMethod": "POST",
14296	//   "id": "logging.locations.buckets.views.create",
14297	//   "parameterOrder": [
14298	//     "parent"
14299	//   ],
14300	//   "parameters": {
14301	//     "parent": {
14302	//       "description": "Required. The bucket in which to create the view \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-logging-project/locations/my-location/buckets/my-bucket\"",
14303	//       "location": "path",
14304	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
14305	//       "required": true,
14306	//       "type": "string"
14307	//     },
14308	//     "viewId": {
14309	//       "description": "Required. The id to use for this view.",
14310	//       "location": "query",
14311	//       "type": "string"
14312	//     }
14313	//   },
14314	//   "path": "v2/{+parent}/views",
14315	//   "request": {
14316	//     "$ref": "LogView"
14317	//   },
14318	//   "response": {
14319	//     "$ref": "LogView"
14320	//   },
14321	//   "scopes": [
14322	//     "https://www.googleapis.com/auth/cloud-platform",
14323	//     "https://www.googleapis.com/auth/logging.admin"
14324	//   ]
14325	// }
14326
14327}
14328
14329// method id "logging.locations.buckets.views.delete":
14330
14331type LocationsBucketsViewsDeleteCall struct {
14332	s          *Service
14333	name       string
14334	urlParams_ gensupport.URLParams
14335	ctx_       context.Context
14336	header_    http.Header
14337}
14338
14339// Delete: Deletes a view from a bucket.
14340func (r *LocationsBucketsViewsService) Delete(name string) *LocationsBucketsViewsDeleteCall {
14341	c := &LocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14342	c.name = name
14343	return c
14344}
14345
14346// Fields allows partial responses to be retrieved. See
14347// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14348// for more information.
14349func (c *LocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsDeleteCall {
14350	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14351	return c
14352}
14353
14354// Context sets the context to be used in this call's Do method. Any
14355// pending HTTP request will be aborted if the provided context is
14356// canceled.
14357func (c *LocationsBucketsViewsDeleteCall) Context(ctx context.Context) *LocationsBucketsViewsDeleteCall {
14358	c.ctx_ = ctx
14359	return c
14360}
14361
14362// Header returns an http.Header that can be modified by the caller to
14363// add HTTP headers to the request.
14364func (c *LocationsBucketsViewsDeleteCall) Header() http.Header {
14365	if c.header_ == nil {
14366		c.header_ = make(http.Header)
14367	}
14368	return c.header_
14369}
14370
14371func (c *LocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
14372	reqHeaders := make(http.Header)
14373	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
14374	for k, v := range c.header_ {
14375		reqHeaders[k] = v
14376	}
14377	reqHeaders.Set("User-Agent", c.s.userAgent())
14378	var body io.Reader = nil
14379	c.urlParams_.Set("alt", alt)
14380	c.urlParams_.Set("prettyPrint", "false")
14381	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
14382	urls += "?" + c.urlParams_.Encode()
14383	req, err := http.NewRequest("DELETE", urls, body)
14384	if err != nil {
14385		return nil, err
14386	}
14387	req.Header = reqHeaders
14388	googleapi.Expand(req.URL, map[string]string{
14389		"name": c.name,
14390	})
14391	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14392}
14393
14394// Do executes the "logging.locations.buckets.views.delete" call.
14395// Exactly one of *Empty or error will be non-nil. Any non-2xx status
14396// code is an error. Response headers are in either
14397// *Empty.ServerResponse.Header or (if a response was returned at all)
14398// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14399// check whether the returned error was because http.StatusNotModified
14400// was returned.
14401func (c *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
14402	gensupport.SetOptions(c.urlParams_, opts...)
14403	res, err := c.doRequest("json")
14404	if res != nil && res.StatusCode == http.StatusNotModified {
14405		if res.Body != nil {
14406			res.Body.Close()
14407		}
14408		return nil, &googleapi.Error{
14409			Code:   res.StatusCode,
14410			Header: res.Header,
14411		}
14412	}
14413	if err != nil {
14414		return nil, err
14415	}
14416	defer googleapi.CloseBody(res)
14417	if err := googleapi.CheckResponse(res); err != nil {
14418		return nil, err
14419	}
14420	ret := &Empty{
14421		ServerResponse: googleapi.ServerResponse{
14422			Header:         res.Header,
14423			HTTPStatusCode: res.StatusCode,
14424		},
14425	}
14426	target := &ret
14427	if err := gensupport.DecodeResponse(target, res); err != nil {
14428		return nil, err
14429	}
14430	return ret, nil
14431	// {
14432	//   "description": "Deletes a view from a bucket.",
14433	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
14434	//   "httpMethod": "DELETE",
14435	//   "id": "logging.locations.buckets.views.delete",
14436	//   "parameterOrder": [
14437	//     "name"
14438	//   ],
14439	//   "parameters": {
14440	//     "name": {
14441	//       "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
14442	//       "location": "path",
14443	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
14444	//       "required": true,
14445	//       "type": "string"
14446	//     }
14447	//   },
14448	//   "path": "v2/{+name}",
14449	//   "response": {
14450	//     "$ref": "Empty"
14451	//   },
14452	//   "scopes": [
14453	//     "https://www.googleapis.com/auth/cloud-platform",
14454	//     "https://www.googleapis.com/auth/logging.admin"
14455	//   ]
14456	// }
14457
14458}
14459
14460// method id "logging.locations.buckets.views.get":
14461
14462type LocationsBucketsViewsGetCall struct {
14463	s            *Service
14464	name         string
14465	urlParams_   gensupport.URLParams
14466	ifNoneMatch_ string
14467	ctx_         context.Context
14468	header_      http.Header
14469}
14470
14471// Get: Gets a view.
14472func (r *LocationsBucketsViewsService) Get(name string) *LocationsBucketsViewsGetCall {
14473	c := &LocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14474	c.name = name
14475	return c
14476}
14477
14478// Fields allows partial responses to be retrieved. See
14479// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14480// for more information.
14481func (c *LocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsGetCall {
14482	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14483	return c
14484}
14485
14486// IfNoneMatch sets the optional parameter which makes the operation
14487// fail if the object's ETag matches the given value. This is useful for
14488// getting updates only after the object has changed since the last
14489// request. Use googleapi.IsNotModified to check whether the response
14490// error from Do is the result of In-None-Match.
14491func (c *LocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsGetCall {
14492	c.ifNoneMatch_ = entityTag
14493	return c
14494}
14495
14496// Context sets the context to be used in this call's Do method. Any
14497// pending HTTP request will be aborted if the provided context is
14498// canceled.
14499func (c *LocationsBucketsViewsGetCall) Context(ctx context.Context) *LocationsBucketsViewsGetCall {
14500	c.ctx_ = ctx
14501	return c
14502}
14503
14504// Header returns an http.Header that can be modified by the caller to
14505// add HTTP headers to the request.
14506func (c *LocationsBucketsViewsGetCall) Header() http.Header {
14507	if c.header_ == nil {
14508		c.header_ = make(http.Header)
14509	}
14510	return c.header_
14511}
14512
14513func (c *LocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
14514	reqHeaders := make(http.Header)
14515	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
14516	for k, v := range c.header_ {
14517		reqHeaders[k] = v
14518	}
14519	reqHeaders.Set("User-Agent", c.s.userAgent())
14520	if c.ifNoneMatch_ != "" {
14521		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14522	}
14523	var body io.Reader = nil
14524	c.urlParams_.Set("alt", alt)
14525	c.urlParams_.Set("prettyPrint", "false")
14526	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
14527	urls += "?" + c.urlParams_.Encode()
14528	req, err := http.NewRequest("GET", urls, body)
14529	if err != nil {
14530		return nil, err
14531	}
14532	req.Header = reqHeaders
14533	googleapi.Expand(req.URL, map[string]string{
14534		"name": c.name,
14535	})
14536	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14537}
14538
14539// Do executes the "logging.locations.buckets.views.get" call.
14540// Exactly one of *LogView or error will be non-nil. Any non-2xx status
14541// code is an error. Response headers are in either
14542// *LogView.ServerResponse.Header or (if a response was returned at all)
14543// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14544// check whether the returned error was because http.StatusNotModified
14545// was returned.
14546func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
14547	gensupport.SetOptions(c.urlParams_, opts...)
14548	res, err := c.doRequest("json")
14549	if res != nil && res.StatusCode == http.StatusNotModified {
14550		if res.Body != nil {
14551			res.Body.Close()
14552		}
14553		return nil, &googleapi.Error{
14554			Code:   res.StatusCode,
14555			Header: res.Header,
14556		}
14557	}
14558	if err != nil {
14559		return nil, err
14560	}
14561	defer googleapi.CloseBody(res)
14562	if err := googleapi.CheckResponse(res); err != nil {
14563		return nil, err
14564	}
14565	ret := &LogView{
14566		ServerResponse: googleapi.ServerResponse{
14567			Header:         res.Header,
14568			HTTPStatusCode: res.StatusCode,
14569		},
14570	}
14571	target := &ret
14572	if err := gensupport.DecodeResponse(target, res); err != nil {
14573		return nil, err
14574	}
14575	return ret, nil
14576	// {
14577	//   "description": "Gets a view.",
14578	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
14579	//   "httpMethod": "GET",
14580	//   "id": "logging.locations.buckets.views.get",
14581	//   "parameterOrder": [
14582	//     "name"
14583	//   ],
14584	//   "parameters": {
14585	//     "name": {
14586	//       "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
14587	//       "location": "path",
14588	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
14589	//       "required": true,
14590	//       "type": "string"
14591	//     }
14592	//   },
14593	//   "path": "v2/{+name}",
14594	//   "response": {
14595	//     "$ref": "LogView"
14596	//   },
14597	//   "scopes": [
14598	//     "https://www.googleapis.com/auth/cloud-platform",
14599	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
14600	//     "https://www.googleapis.com/auth/logging.admin",
14601	//     "https://www.googleapis.com/auth/logging.read"
14602	//   ]
14603	// }
14604
14605}
14606
14607// method id "logging.locations.buckets.views.list":
14608
14609type LocationsBucketsViewsListCall struct {
14610	s            *Service
14611	parent       string
14612	urlParams_   gensupport.URLParams
14613	ifNoneMatch_ string
14614	ctx_         context.Context
14615	header_      http.Header
14616}
14617
14618// List: Lists views on a bucket.
14619func (r *LocationsBucketsViewsService) List(parent string) *LocationsBucketsViewsListCall {
14620	c := &LocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14621	c.parent = parent
14622	return c
14623}
14624
14625// PageSize sets the optional parameter "pageSize": The maximum number
14626// of results to return from this request. Non-positive values are
14627// ignored. The presence of nextPageToken in the response indicates that
14628// more results might be available.
14629func (c *LocationsBucketsViewsListCall) PageSize(pageSize int64) *LocationsBucketsViewsListCall {
14630	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
14631	return c
14632}
14633
14634// PageToken sets the optional parameter "pageToken": If present, then
14635// retrieve the next batch of results from the preceding call to this
14636// method. pageToken must be the value of nextPageToken from the
14637// previous response. The values of other method parameters should be
14638// identical to those in the previous call.
14639func (c *LocationsBucketsViewsListCall) PageToken(pageToken string) *LocationsBucketsViewsListCall {
14640	c.urlParams_.Set("pageToken", pageToken)
14641	return c
14642}
14643
14644// Fields allows partial responses to be retrieved. See
14645// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14646// for more information.
14647func (c *LocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsListCall {
14648	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14649	return c
14650}
14651
14652// IfNoneMatch sets the optional parameter which makes the operation
14653// fail if the object's ETag matches the given value. This is useful for
14654// getting updates only after the object has changed since the last
14655// request. Use googleapi.IsNotModified to check whether the response
14656// error from Do is the result of In-None-Match.
14657func (c *LocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsListCall {
14658	c.ifNoneMatch_ = entityTag
14659	return c
14660}
14661
14662// Context sets the context to be used in this call's Do method. Any
14663// pending HTTP request will be aborted if the provided context is
14664// canceled.
14665func (c *LocationsBucketsViewsListCall) Context(ctx context.Context) *LocationsBucketsViewsListCall {
14666	c.ctx_ = ctx
14667	return c
14668}
14669
14670// Header returns an http.Header that can be modified by the caller to
14671// add HTTP headers to the request.
14672func (c *LocationsBucketsViewsListCall) Header() http.Header {
14673	if c.header_ == nil {
14674		c.header_ = make(http.Header)
14675	}
14676	return c.header_
14677}
14678
14679func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
14680	reqHeaders := make(http.Header)
14681	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
14682	for k, v := range c.header_ {
14683		reqHeaders[k] = v
14684	}
14685	reqHeaders.Set("User-Agent", c.s.userAgent())
14686	if c.ifNoneMatch_ != "" {
14687		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14688	}
14689	var body io.Reader = nil
14690	c.urlParams_.Set("alt", alt)
14691	c.urlParams_.Set("prettyPrint", "false")
14692	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
14693	urls += "?" + c.urlParams_.Encode()
14694	req, err := http.NewRequest("GET", urls, body)
14695	if err != nil {
14696		return nil, err
14697	}
14698	req.Header = reqHeaders
14699	googleapi.Expand(req.URL, map[string]string{
14700		"parent": c.parent,
14701	})
14702	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14703}
14704
14705// Do executes the "logging.locations.buckets.views.list" call.
14706// Exactly one of *ListViewsResponse or error will be non-nil. Any
14707// non-2xx status code is an error. Response headers are in either
14708// *ListViewsResponse.ServerResponse.Header or (if a response was
14709// returned at all) in error.(*googleapi.Error).Header. Use
14710// googleapi.IsNotModified to check whether the returned error was
14711// because http.StatusNotModified was returned.
14712func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
14713	gensupport.SetOptions(c.urlParams_, opts...)
14714	res, err := c.doRequest("json")
14715	if res != nil && res.StatusCode == http.StatusNotModified {
14716		if res.Body != nil {
14717			res.Body.Close()
14718		}
14719		return nil, &googleapi.Error{
14720			Code:   res.StatusCode,
14721			Header: res.Header,
14722		}
14723	}
14724	if err != nil {
14725		return nil, err
14726	}
14727	defer googleapi.CloseBody(res)
14728	if err := googleapi.CheckResponse(res); err != nil {
14729		return nil, err
14730	}
14731	ret := &ListViewsResponse{
14732		ServerResponse: googleapi.ServerResponse{
14733			Header:         res.Header,
14734			HTTPStatusCode: res.StatusCode,
14735		},
14736	}
14737	target := &ret
14738	if err := gensupport.DecodeResponse(target, res); err != nil {
14739		return nil, err
14740	}
14741	return ret, nil
14742	// {
14743	//   "description": "Lists views on a bucket.",
14744	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views",
14745	//   "httpMethod": "GET",
14746	//   "id": "logging.locations.buckets.views.list",
14747	//   "parameterOrder": [
14748	//     "parent"
14749	//   ],
14750	//   "parameters": {
14751	//     "pageSize": {
14752	//       "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.",
14753	//       "format": "int32",
14754	//       "location": "query",
14755	//       "type": "integer"
14756	//     },
14757	//     "pageToken": {
14758	//       "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.",
14759	//       "location": "query",
14760	//       "type": "string"
14761	//     },
14762	//     "parent": {
14763	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
14764	//       "location": "path",
14765	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
14766	//       "required": true,
14767	//       "type": "string"
14768	//     }
14769	//   },
14770	//   "path": "v2/{+parent}/views",
14771	//   "response": {
14772	//     "$ref": "ListViewsResponse"
14773	//   },
14774	//   "scopes": [
14775	//     "https://www.googleapis.com/auth/cloud-platform",
14776	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
14777	//     "https://www.googleapis.com/auth/logging.admin",
14778	//     "https://www.googleapis.com/auth/logging.read"
14779	//   ]
14780	// }
14781
14782}
14783
14784// Pages invokes f for each page of results.
14785// A non-nil error returned from f will halt the iteration.
14786// The provided context supersedes any context provided to the Context method.
14787func (c *LocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
14788	c.ctx_ = ctx
14789	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
14790	for {
14791		x, err := c.Do()
14792		if err != nil {
14793			return err
14794		}
14795		if err := f(x); err != nil {
14796			return err
14797		}
14798		if x.NextPageToken == "" {
14799			return nil
14800		}
14801		c.PageToken(x.NextPageToken)
14802	}
14803}
14804
14805// method id "logging.locations.buckets.views.patch":
14806
14807type LocationsBucketsViewsPatchCall struct {
14808	s          *Service
14809	name       string
14810	logview    *LogView
14811	urlParams_ gensupport.URLParams
14812	ctx_       context.Context
14813	header_    http.Header
14814}
14815
14816// Patch: Updates a view. This method replaces the following fields in
14817// the existing view with values from the new view: filter.
14818func (r *LocationsBucketsViewsService) Patch(name string, logview *LogView) *LocationsBucketsViewsPatchCall {
14819	c := &LocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14820	c.name = name
14821	c.logview = logview
14822	return c
14823}
14824
14825// UpdateMask sets the optional parameter "updateMask": Field mask that
14826// specifies the fields in view that need an update. A field will be
14827// overwritten if, and only if, it is in the update mask. name and
14828// output only fields cannot be updated.For a detailed FieldMask
14829// definition, see
14830// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
14831// updateMask=filter.
14832func (c *LocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *LocationsBucketsViewsPatchCall {
14833	c.urlParams_.Set("updateMask", updateMask)
14834	return c
14835}
14836
14837// Fields allows partial responses to be retrieved. See
14838// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14839// for more information.
14840func (c *LocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsPatchCall {
14841	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14842	return c
14843}
14844
14845// Context sets the context to be used in this call's Do method. Any
14846// pending HTTP request will be aborted if the provided context is
14847// canceled.
14848func (c *LocationsBucketsViewsPatchCall) Context(ctx context.Context) *LocationsBucketsViewsPatchCall {
14849	c.ctx_ = ctx
14850	return c
14851}
14852
14853// Header returns an http.Header that can be modified by the caller to
14854// add HTTP headers to the request.
14855func (c *LocationsBucketsViewsPatchCall) Header() http.Header {
14856	if c.header_ == nil {
14857		c.header_ = make(http.Header)
14858	}
14859	return c.header_
14860}
14861
14862func (c *LocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
14863	reqHeaders := make(http.Header)
14864	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
14865	for k, v := range c.header_ {
14866		reqHeaders[k] = v
14867	}
14868	reqHeaders.Set("User-Agent", c.s.userAgent())
14869	var body io.Reader = nil
14870	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
14871	if err != nil {
14872		return nil, err
14873	}
14874	reqHeaders.Set("Content-Type", "application/json")
14875	c.urlParams_.Set("alt", alt)
14876	c.urlParams_.Set("prettyPrint", "false")
14877	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
14878	urls += "?" + c.urlParams_.Encode()
14879	req, err := http.NewRequest("PATCH", urls, body)
14880	if err != nil {
14881		return nil, err
14882	}
14883	req.Header = reqHeaders
14884	googleapi.Expand(req.URL, map[string]string{
14885		"name": c.name,
14886	})
14887	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14888}
14889
14890// Do executes the "logging.locations.buckets.views.patch" call.
14891// Exactly one of *LogView or error will be non-nil. Any non-2xx status
14892// code is an error. Response headers are in either
14893// *LogView.ServerResponse.Header or (if a response was returned at all)
14894// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14895// check whether the returned error was because http.StatusNotModified
14896// was returned.
14897func (c *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
14898	gensupport.SetOptions(c.urlParams_, opts...)
14899	res, err := c.doRequest("json")
14900	if res != nil && res.StatusCode == http.StatusNotModified {
14901		if res.Body != nil {
14902			res.Body.Close()
14903		}
14904		return nil, &googleapi.Error{
14905			Code:   res.StatusCode,
14906			Header: res.Header,
14907		}
14908	}
14909	if err != nil {
14910		return nil, err
14911	}
14912	defer googleapi.CloseBody(res)
14913	if err := googleapi.CheckResponse(res); err != nil {
14914		return nil, err
14915	}
14916	ret := &LogView{
14917		ServerResponse: googleapi.ServerResponse{
14918			Header:         res.Header,
14919			HTTPStatusCode: res.StatusCode,
14920		},
14921	}
14922	target := &ret
14923	if err := gensupport.DecodeResponse(target, res); err != nil {
14924		return nil, err
14925	}
14926	return ret, nil
14927	// {
14928	//   "description": "Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.",
14929	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
14930	//   "httpMethod": "PATCH",
14931	//   "id": "logging.locations.buckets.views.patch",
14932	//   "parameterOrder": [
14933	//     "name"
14934	//   ],
14935	//   "parameters": {
14936	//     "name": {
14937	//       "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
14938	//       "location": "path",
14939	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
14940	//       "required": true,
14941	//       "type": "string"
14942	//     },
14943	//     "updateMask": {
14944	//       "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
14945	//       "format": "google-fieldmask",
14946	//       "location": "query",
14947	//       "type": "string"
14948	//     }
14949	//   },
14950	//   "path": "v2/{+name}",
14951	//   "request": {
14952	//     "$ref": "LogView"
14953	//   },
14954	//   "response": {
14955	//     "$ref": "LogView"
14956	//   },
14957	//   "scopes": [
14958	//     "https://www.googleapis.com/auth/cloud-platform",
14959	//     "https://www.googleapis.com/auth/logging.admin"
14960	//   ]
14961	// }
14962
14963}
14964
14965// method id "logging.logs.delete":
14966
14967type LogsDeleteCall struct {
14968	s          *Service
14969	logName    string
14970	urlParams_ gensupport.URLParams
14971	ctx_       context.Context
14972	header_    http.Header
14973}
14974
14975// Delete: Deletes all the log entries in a log. The log reappears if it
14976// receives new entries. Log entries written shortly before the delete
14977// operation might not be deleted. Entries received after the delete
14978// operation with a timestamp before the operation will be deleted.
14979func (r *LogsService) Delete(logName string) *LogsDeleteCall {
14980	c := &LogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14981	c.logName = logName
14982	return c
14983}
14984
14985// Fields allows partial responses to be retrieved. See
14986// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14987// for more information.
14988func (c *LogsDeleteCall) Fields(s ...googleapi.Field) *LogsDeleteCall {
14989	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14990	return c
14991}
14992
14993// Context sets the context to be used in this call's Do method. Any
14994// pending HTTP request will be aborted if the provided context is
14995// canceled.
14996func (c *LogsDeleteCall) Context(ctx context.Context) *LogsDeleteCall {
14997	c.ctx_ = ctx
14998	return c
14999}
15000
15001// Header returns an http.Header that can be modified by the caller to
15002// add HTTP headers to the request.
15003func (c *LogsDeleteCall) Header() http.Header {
15004	if c.header_ == nil {
15005		c.header_ = make(http.Header)
15006	}
15007	return c.header_
15008}
15009
15010func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) {
15011	reqHeaders := make(http.Header)
15012	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
15013	for k, v := range c.header_ {
15014		reqHeaders[k] = v
15015	}
15016	reqHeaders.Set("User-Agent", c.s.userAgent())
15017	var body io.Reader = nil
15018	c.urlParams_.Set("alt", alt)
15019	c.urlParams_.Set("prettyPrint", "false")
15020	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
15021	urls += "?" + c.urlParams_.Encode()
15022	req, err := http.NewRequest("DELETE", urls, body)
15023	if err != nil {
15024		return nil, err
15025	}
15026	req.Header = reqHeaders
15027	googleapi.Expand(req.URL, map[string]string{
15028		"logName": c.logName,
15029	})
15030	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15031}
15032
15033// Do executes the "logging.logs.delete" call.
15034// Exactly one of *Empty or error will be non-nil. Any non-2xx status
15035// code is an error. Response headers are in either
15036// *Empty.ServerResponse.Header or (if a response was returned at all)
15037// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
15038// check whether the returned error was because http.StatusNotModified
15039// was returned.
15040func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
15041	gensupport.SetOptions(c.urlParams_, opts...)
15042	res, err := c.doRequest("json")
15043	if res != nil && res.StatusCode == http.StatusNotModified {
15044		if res.Body != nil {
15045			res.Body.Close()
15046		}
15047		return nil, &googleapi.Error{
15048			Code:   res.StatusCode,
15049			Header: res.Header,
15050		}
15051	}
15052	if err != nil {
15053		return nil, err
15054	}
15055	defer googleapi.CloseBody(res)
15056	if err := googleapi.CheckResponse(res); err != nil {
15057		return nil, err
15058	}
15059	ret := &Empty{
15060		ServerResponse: googleapi.ServerResponse{
15061			Header:         res.Header,
15062			HTTPStatusCode: res.StatusCode,
15063		},
15064	}
15065	target := &ret
15066	if err := gensupport.DecodeResponse(target, res); err != nil {
15067		return nil, err
15068	}
15069	return ret, nil
15070	// {
15071	//   "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. Entries received after the delete operation with a timestamp before the operation will be deleted.",
15072	//   "flatPath": "v2/{v2Id}/{v2Id1}/logs/{logsId}",
15073	//   "httpMethod": "DELETE",
15074	//   "id": "logging.logs.delete",
15075	//   "parameterOrder": [
15076	//     "logName"
15077	//   ],
15078	//   "parameters": {
15079	//     "logName": {
15080	//       "description": "Required. The resource name of the log to delete: \"projects/[PROJECT_ID]/logs/[LOG_ID]\" \"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\" \"folders/[FOLDER_ID]/logs/[LOG_ID]\" [LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.",
15081	//       "location": "path",
15082	//       "pattern": "^[^/]+/[^/]+/logs/[^/]+$",
15083	//       "required": true,
15084	//       "type": "string"
15085	//     }
15086	//   },
15087	//   "path": "v2/{+logName}",
15088	//   "response": {
15089	//     "$ref": "Empty"
15090	//   },
15091	//   "scopes": [
15092	//     "https://www.googleapis.com/auth/cloud-platform",
15093	//     "https://www.googleapis.com/auth/logging.admin"
15094	//   ]
15095	// }
15096
15097}
15098
15099// method id "logging.logs.list":
15100
15101type LogsListCall struct {
15102	s            *Service
15103	parent       string
15104	urlParams_   gensupport.URLParams
15105	ifNoneMatch_ string
15106	ctx_         context.Context
15107	header_      http.Header
15108}
15109
15110// List: Lists the logs in projects, organizations, folders, or billing
15111// accounts. Only logs that have entries are listed.
15112func (r *LogsService) List(parent string) *LogsListCall {
15113	c := &LogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15114	c.parent = parent
15115	return c
15116}
15117
15118// PageSize sets the optional parameter "pageSize": The maximum number
15119// of results to return from this request. Non-positive values are
15120// ignored. The presence of nextPageToken in the response indicates that
15121// more results might be available.
15122func (c *LogsListCall) PageSize(pageSize int64) *LogsListCall {
15123	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
15124	return c
15125}
15126
15127// PageToken sets the optional parameter "pageToken": If present, then
15128// retrieve the next batch of results from the preceding call to this
15129// method. pageToken must be the value of nextPageToken from the
15130// previous response. The values of other method parameters should be
15131// identical to those in the previous call.
15132func (c *LogsListCall) PageToken(pageToken string) *LogsListCall {
15133	c.urlParams_.Set("pageToken", pageToken)
15134	return c
15135}
15136
15137// ResourceNames sets the optional parameter "resourceNames": The
15138// resource name that owns the logs:
15139// projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW
15140// _ID
15141// organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/v
15142// iews/VIEW_ID
15143// billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKE
15144// T_ID/views/VIEW_ID
15145// folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_I
15146// DTo support legacy queries, it could also be: "projects/PROJECT_ID"
15147// "organizations/ORGANIZATION_ID" "billingAccounts/BILLING_ACCOUNT_ID"
15148// "folders/FOLDER_ID"
15149func (c *LogsListCall) ResourceNames(resourceNames ...string) *LogsListCall {
15150	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
15151	return c
15152}
15153
15154// Fields allows partial responses to be retrieved. See
15155// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15156// for more information.
15157func (c *LogsListCall) Fields(s ...googleapi.Field) *LogsListCall {
15158	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15159	return c
15160}
15161
15162// IfNoneMatch sets the optional parameter which makes the operation
15163// fail if the object's ETag matches the given value. This is useful for
15164// getting updates only after the object has changed since the last
15165// request. Use googleapi.IsNotModified to check whether the response
15166// error from Do is the result of In-None-Match.
15167func (c *LogsListCall) IfNoneMatch(entityTag string) *LogsListCall {
15168	c.ifNoneMatch_ = entityTag
15169	return c
15170}
15171
15172// Context sets the context to be used in this call's Do method. Any
15173// pending HTTP request will be aborted if the provided context is
15174// canceled.
15175func (c *LogsListCall) Context(ctx context.Context) *LogsListCall {
15176	c.ctx_ = ctx
15177	return c
15178}
15179
15180// Header returns an http.Header that can be modified by the caller to
15181// add HTTP headers to the request.
15182func (c *LogsListCall) Header() http.Header {
15183	if c.header_ == nil {
15184		c.header_ = make(http.Header)
15185	}
15186	return c.header_
15187}
15188
15189func (c *LogsListCall) doRequest(alt string) (*http.Response, error) {
15190	reqHeaders := make(http.Header)
15191	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
15192	for k, v := range c.header_ {
15193		reqHeaders[k] = v
15194	}
15195	reqHeaders.Set("User-Agent", c.s.userAgent())
15196	if c.ifNoneMatch_ != "" {
15197		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15198	}
15199	var body io.Reader = nil
15200	c.urlParams_.Set("alt", alt)
15201	c.urlParams_.Set("prettyPrint", "false")
15202	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
15203	urls += "?" + c.urlParams_.Encode()
15204	req, err := http.NewRequest("GET", urls, body)
15205	if err != nil {
15206		return nil, err
15207	}
15208	req.Header = reqHeaders
15209	googleapi.Expand(req.URL, map[string]string{
15210		"parent": c.parent,
15211	})
15212	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15213}
15214
15215// Do executes the "logging.logs.list" call.
15216// Exactly one of *ListLogsResponse or error will be non-nil. Any
15217// non-2xx status code is an error. Response headers are in either
15218// *ListLogsResponse.ServerResponse.Header or (if a response was
15219// returned at all) in error.(*googleapi.Error).Header. Use
15220// googleapi.IsNotModified to check whether the returned error was
15221// because http.StatusNotModified was returned.
15222func (c *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
15223	gensupport.SetOptions(c.urlParams_, opts...)
15224	res, err := c.doRequest("json")
15225	if res != nil && res.StatusCode == http.StatusNotModified {
15226		if res.Body != nil {
15227			res.Body.Close()
15228		}
15229		return nil, &googleapi.Error{
15230			Code:   res.StatusCode,
15231			Header: res.Header,
15232		}
15233	}
15234	if err != nil {
15235		return nil, err
15236	}
15237	defer googleapi.CloseBody(res)
15238	if err := googleapi.CheckResponse(res); err != nil {
15239		return nil, err
15240	}
15241	ret := &ListLogsResponse{
15242		ServerResponse: googleapi.ServerResponse{
15243			Header:         res.Header,
15244			HTTPStatusCode: res.StatusCode,
15245		},
15246	}
15247	target := &ret
15248	if err := gensupport.DecodeResponse(target, res); err != nil {
15249		return nil, err
15250	}
15251	return ret, nil
15252	// {
15253	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
15254	//   "flatPath": "v2/{v2Id}/{v2Id1}/logs",
15255	//   "httpMethod": "GET",
15256	//   "id": "logging.logs.list",
15257	//   "parameterOrder": [
15258	//     "parent"
15259	//   ],
15260	//   "parameters": {
15261	//     "pageSize": {
15262	//       "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.",
15263	//       "format": "int32",
15264	//       "location": "query",
15265	//       "type": "integer"
15266	//     },
15267	//     "pageToken": {
15268	//       "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.",
15269	//       "location": "query",
15270	//       "type": "string"
15271	//     },
15272	//     "parent": {
15273	//       "description": "Required. The resource name that owns the logs: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
15274	//       "location": "path",
15275	//       "pattern": "^[^/]+/[^/]+$",
15276	//       "required": true,
15277	//       "type": "string"
15278	//     },
15279	//     "resourceNames": {
15280	//       "description": "Optional. The resource name that owns the logs: projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_IDTo support legacy queries, it could also be: \"projects/PROJECT_ID\" \"organizations/ORGANIZATION_ID\" \"billingAccounts/BILLING_ACCOUNT_ID\" \"folders/FOLDER_ID\"",
15281	//       "location": "query",
15282	//       "repeated": true,
15283	//       "type": "string"
15284	//     }
15285	//   },
15286	//   "path": "v2/{+parent}/logs",
15287	//   "response": {
15288	//     "$ref": "ListLogsResponse"
15289	//   },
15290	//   "scopes": [
15291	//     "https://www.googleapis.com/auth/cloud-platform",
15292	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
15293	//     "https://www.googleapis.com/auth/logging.admin",
15294	//     "https://www.googleapis.com/auth/logging.read"
15295	//   ]
15296	// }
15297
15298}
15299
15300// Pages invokes f for each page of results.
15301// A non-nil error returned from f will halt the iteration.
15302// The provided context supersedes any context provided to the Context method.
15303func (c *LogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
15304	c.ctx_ = ctx
15305	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
15306	for {
15307		x, err := c.Do()
15308		if err != nil {
15309			return err
15310		}
15311		if err := f(x); err != nil {
15312			return err
15313		}
15314		if x.NextPageToken == "" {
15315			return nil
15316		}
15317		c.PageToken(x.NextPageToken)
15318	}
15319}
15320
15321// method id "logging.monitoredResourceDescriptors.list":
15322
15323type MonitoredResourceDescriptorsListCall struct {
15324	s            *Service
15325	urlParams_   gensupport.URLParams
15326	ifNoneMatch_ string
15327	ctx_         context.Context
15328	header_      http.Header
15329}
15330
15331// List: Lists the descriptors for monitored resource types used by
15332// Logging.
15333func (r *MonitoredResourceDescriptorsService) List() *MonitoredResourceDescriptorsListCall {
15334	c := &MonitoredResourceDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15335	return c
15336}
15337
15338// PageSize sets the optional parameter "pageSize": The maximum number
15339// of results to return from this request. Non-positive values are
15340// ignored. The presence of nextPageToken in the response indicates that
15341// more results might be available.
15342func (c *MonitoredResourceDescriptorsListCall) PageSize(pageSize int64) *MonitoredResourceDescriptorsListCall {
15343	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
15344	return c
15345}
15346
15347// PageToken sets the optional parameter "pageToken": If present, then
15348// retrieve the next batch of results from the preceding call to this
15349// method. pageToken must be the value of nextPageToken from the
15350// previous response. The values of other method parameters should be
15351// identical to those in the previous call.
15352func (c *MonitoredResourceDescriptorsListCall) PageToken(pageToken string) *MonitoredResourceDescriptorsListCall {
15353	c.urlParams_.Set("pageToken", pageToken)
15354	return c
15355}
15356
15357// Fields allows partial responses to be retrieved. See
15358// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15359// for more information.
15360func (c *MonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *MonitoredResourceDescriptorsListCall {
15361	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15362	return c
15363}
15364
15365// IfNoneMatch sets the optional parameter which makes the operation
15366// fail if the object's ETag matches the given value. This is useful for
15367// getting updates only after the object has changed since the last
15368// request. Use googleapi.IsNotModified to check whether the response
15369// error from Do is the result of In-None-Match.
15370func (c *MonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *MonitoredResourceDescriptorsListCall {
15371	c.ifNoneMatch_ = entityTag
15372	return c
15373}
15374
15375// Context sets the context to be used in this call's Do method. Any
15376// pending HTTP request will be aborted if the provided context is
15377// canceled.
15378func (c *MonitoredResourceDescriptorsListCall) Context(ctx context.Context) *MonitoredResourceDescriptorsListCall {
15379	c.ctx_ = ctx
15380	return c
15381}
15382
15383// Header returns an http.Header that can be modified by the caller to
15384// add HTTP headers to the request.
15385func (c *MonitoredResourceDescriptorsListCall) Header() http.Header {
15386	if c.header_ == nil {
15387		c.header_ = make(http.Header)
15388	}
15389	return c.header_
15390}
15391
15392func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Response, error) {
15393	reqHeaders := make(http.Header)
15394	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
15395	for k, v := range c.header_ {
15396		reqHeaders[k] = v
15397	}
15398	reqHeaders.Set("User-Agent", c.s.userAgent())
15399	if c.ifNoneMatch_ != "" {
15400		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15401	}
15402	var body io.Reader = nil
15403	c.urlParams_.Set("alt", alt)
15404	c.urlParams_.Set("prettyPrint", "false")
15405	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/monitoredResourceDescriptors")
15406	urls += "?" + c.urlParams_.Encode()
15407	req, err := http.NewRequest("GET", urls, body)
15408	if err != nil {
15409		return nil, err
15410	}
15411	req.Header = reqHeaders
15412	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15413}
15414
15415// Do executes the "logging.monitoredResourceDescriptors.list" call.
15416// Exactly one of *ListMonitoredResourceDescriptorsResponse or error
15417// will be non-nil. Any non-2xx status code is an error. Response
15418// headers are in either
15419// *ListMonitoredResourceDescriptorsResponse.ServerResponse.Header or
15420// (if a response was returned at all) in
15421// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15422// whether the returned error was because http.StatusNotModified was
15423// returned.
15424func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) {
15425	gensupport.SetOptions(c.urlParams_, opts...)
15426	res, err := c.doRequest("json")
15427	if res != nil && res.StatusCode == http.StatusNotModified {
15428		if res.Body != nil {
15429			res.Body.Close()
15430		}
15431		return nil, &googleapi.Error{
15432			Code:   res.StatusCode,
15433			Header: res.Header,
15434		}
15435	}
15436	if err != nil {
15437		return nil, err
15438	}
15439	defer googleapi.CloseBody(res)
15440	if err := googleapi.CheckResponse(res); err != nil {
15441		return nil, err
15442	}
15443	ret := &ListMonitoredResourceDescriptorsResponse{
15444		ServerResponse: googleapi.ServerResponse{
15445			Header:         res.Header,
15446			HTTPStatusCode: res.StatusCode,
15447		},
15448	}
15449	target := &ret
15450	if err := gensupport.DecodeResponse(target, res); err != nil {
15451		return nil, err
15452	}
15453	return ret, nil
15454	// {
15455	//   "description": "Lists the descriptors for monitored resource types used by Logging.",
15456	//   "flatPath": "v2/monitoredResourceDescriptors",
15457	//   "httpMethod": "GET",
15458	//   "id": "logging.monitoredResourceDescriptors.list",
15459	//   "parameterOrder": [],
15460	//   "parameters": {
15461	//     "pageSize": {
15462	//       "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.",
15463	//       "format": "int32",
15464	//       "location": "query",
15465	//       "type": "integer"
15466	//     },
15467	//     "pageToken": {
15468	//       "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.",
15469	//       "location": "query",
15470	//       "type": "string"
15471	//     }
15472	//   },
15473	//   "path": "v2/monitoredResourceDescriptors",
15474	//   "response": {
15475	//     "$ref": "ListMonitoredResourceDescriptorsResponse"
15476	//   },
15477	//   "scopes": [
15478	//     "https://www.googleapis.com/auth/cloud-platform",
15479	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
15480	//     "https://www.googleapis.com/auth/logging.admin",
15481	//     "https://www.googleapis.com/auth/logging.read"
15482	//   ]
15483	// }
15484
15485}
15486
15487// Pages invokes f for each page of results.
15488// A non-nil error returned from f will halt the iteration.
15489// The provided context supersedes any context provided to the Context method.
15490func (c *MonitoredResourceDescriptorsListCall) Pages(ctx context.Context, f func(*ListMonitoredResourceDescriptorsResponse) error) error {
15491	c.ctx_ = ctx
15492	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
15493	for {
15494		x, err := c.Do()
15495		if err != nil {
15496			return err
15497		}
15498		if err := f(x); err != nil {
15499			return err
15500		}
15501		if x.NextPageToken == "" {
15502			return nil
15503		}
15504		c.PageToken(x.NextPageToken)
15505	}
15506}
15507
15508// method id "logging.organizations.getCmekSettings":
15509
15510type OrganizationsGetCmekSettingsCall struct {
15511	s            *Service
15512	name         string
15513	urlParams_   gensupport.URLParams
15514	ifNoneMatch_ string
15515	ctx_         context.Context
15516	header_      http.Header
15517}
15518
15519// GetCmekSettings: Gets the Logs Router CMEK settings for the given
15520// resource.Note: CMEK for the Logs Router can currently only be
15521// configured for GCP organizations. Once configured, it applies to all
15522// projects and folders in the GCP organization.See Enabling CMEK for
15523// Logs Router
15524// (https://cloud.google.com/logging/docs/routing/managed-encryption)
15525// for more information.
15526func (r *OrganizationsService) GetCmekSettings(name string) *OrganizationsGetCmekSettingsCall {
15527	c := &OrganizationsGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15528	c.name = name
15529	return c
15530}
15531
15532// Fields allows partial responses to be retrieved. See
15533// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15534// for more information.
15535func (c *OrganizationsGetCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetCmekSettingsCall {
15536	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15537	return c
15538}
15539
15540// IfNoneMatch sets the optional parameter which makes the operation
15541// fail if the object's ETag matches the given value. This is useful for
15542// getting updates only after the object has changed since the last
15543// request. Use googleapi.IsNotModified to check whether the response
15544// error from Do is the result of In-None-Match.
15545func (c *OrganizationsGetCmekSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetCmekSettingsCall {
15546	c.ifNoneMatch_ = entityTag
15547	return c
15548}
15549
15550// Context sets the context to be used in this call's Do method. Any
15551// pending HTTP request will be aborted if the provided context is
15552// canceled.
15553func (c *OrganizationsGetCmekSettingsCall) Context(ctx context.Context) *OrganizationsGetCmekSettingsCall {
15554	c.ctx_ = ctx
15555	return c
15556}
15557
15558// Header returns an http.Header that can be modified by the caller to
15559// add HTTP headers to the request.
15560func (c *OrganizationsGetCmekSettingsCall) Header() http.Header {
15561	if c.header_ == nil {
15562		c.header_ = make(http.Header)
15563	}
15564	return c.header_
15565}
15566
15567func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
15568	reqHeaders := make(http.Header)
15569	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
15570	for k, v := range c.header_ {
15571		reqHeaders[k] = v
15572	}
15573	reqHeaders.Set("User-Agent", c.s.userAgent())
15574	if c.ifNoneMatch_ != "" {
15575		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15576	}
15577	var body io.Reader = nil
15578	c.urlParams_.Set("alt", alt)
15579	c.urlParams_.Set("prettyPrint", "false")
15580	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
15581	urls += "?" + c.urlParams_.Encode()
15582	req, err := http.NewRequest("GET", urls, body)
15583	if err != nil {
15584		return nil, err
15585	}
15586	req.Header = reqHeaders
15587	googleapi.Expand(req.URL, map[string]string{
15588		"name": c.name,
15589	})
15590	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15591}
15592
15593// Do executes the "logging.organizations.getCmekSettings" call.
15594// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
15595// status code is an error. Response headers are in either
15596// *CmekSettings.ServerResponse.Header or (if a response was returned at
15597// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
15598// to check whether the returned error was because
15599// http.StatusNotModified was returned.
15600func (c *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
15601	gensupport.SetOptions(c.urlParams_, opts...)
15602	res, err := c.doRequest("json")
15603	if res != nil && res.StatusCode == http.StatusNotModified {
15604		if res.Body != nil {
15605			res.Body.Close()
15606		}
15607		return nil, &googleapi.Error{
15608			Code:   res.StatusCode,
15609			Header: res.Header,
15610		}
15611	}
15612	if err != nil {
15613		return nil, err
15614	}
15615	defer googleapi.CloseBody(res)
15616	if err := googleapi.CheckResponse(res); err != nil {
15617		return nil, err
15618	}
15619	ret := &CmekSettings{
15620		ServerResponse: googleapi.ServerResponse{
15621			Header:         res.Header,
15622			HTTPStatusCode: res.StatusCode,
15623		},
15624	}
15625	target := &ret
15626	if err := gensupport.DecodeResponse(target, res); err != nil {
15627		return nil, err
15628	}
15629	return ret, nil
15630	// {
15631	//   "description": "Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.",
15632	//   "flatPath": "v2/organizations/{organizationsId}/cmekSettings",
15633	//   "httpMethod": "GET",
15634	//   "id": "logging.organizations.getCmekSettings",
15635	//   "parameterOrder": [
15636	//     "name"
15637	//   ],
15638	//   "parameters": {
15639	//     "name": {
15640	//       "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" Example: \"organizations/12345/cmekSettings\".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.",
15641	//       "location": "path",
15642	//       "pattern": "^organizations/[^/]+$",
15643	//       "required": true,
15644	//       "type": "string"
15645	//     }
15646	//   },
15647	//   "path": "v2/{+name}/cmekSettings",
15648	//   "response": {
15649	//     "$ref": "CmekSettings"
15650	//   },
15651	//   "scopes": [
15652	//     "https://www.googleapis.com/auth/cloud-platform",
15653	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
15654	//     "https://www.googleapis.com/auth/logging.admin",
15655	//     "https://www.googleapis.com/auth/logging.read"
15656	//   ]
15657	// }
15658
15659}
15660
15661// method id "logging.organizations.updateCmekSettings":
15662
15663type OrganizationsUpdateCmekSettingsCall struct {
15664	s            *Service
15665	name         string
15666	cmeksettings *CmekSettings
15667	urlParams_   gensupport.URLParams
15668	ctx_         context.Context
15669	header_      http.Header
15670}
15671
15672// UpdateCmekSettings: Updates the Logs Router CMEK settings for the
15673// given resource.Note: CMEK for the Logs Router can currently only be
15674// configured for GCP organizations. Once configured, it applies to all
15675// projects and folders in the GCP organization.UpdateCmekSettings will
15676// fail if 1) kms_key_name is invalid, or 2) the associated service
15677// account does not have the required
15678// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key,
15679// or 3) access to the key is disabled.See Enabling CMEK for Logs Router
15680// (https://cloud.google.com/logging/docs/routing/managed-encryption)
15681// for more information.
15682func (r *OrganizationsService) UpdateCmekSettings(name string, cmeksettings *CmekSettings) *OrganizationsUpdateCmekSettingsCall {
15683	c := &OrganizationsUpdateCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15684	c.name = name
15685	c.cmeksettings = cmeksettings
15686	return c
15687}
15688
15689// UpdateMask sets the optional parameter "updateMask": Field mask
15690// identifying which fields from cmek_settings should be updated. A
15691// field will be overwritten if and only if it is in the update mask.
15692// Output only fields cannot be updated.See FieldMask for more
15693// information.Example: "updateMask=kmsKeyName"
15694func (c *OrganizationsUpdateCmekSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateCmekSettingsCall {
15695	c.urlParams_.Set("updateMask", updateMask)
15696	return c
15697}
15698
15699// Fields allows partial responses to be retrieved. See
15700// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15701// for more information.
15702func (c *OrganizationsUpdateCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateCmekSettingsCall {
15703	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15704	return c
15705}
15706
15707// Context sets the context to be used in this call's Do method. Any
15708// pending HTTP request will be aborted if the provided context is
15709// canceled.
15710func (c *OrganizationsUpdateCmekSettingsCall) Context(ctx context.Context) *OrganizationsUpdateCmekSettingsCall {
15711	c.ctx_ = ctx
15712	return c
15713}
15714
15715// Header returns an http.Header that can be modified by the caller to
15716// add HTTP headers to the request.
15717func (c *OrganizationsUpdateCmekSettingsCall) Header() http.Header {
15718	if c.header_ == nil {
15719		c.header_ = make(http.Header)
15720	}
15721	return c.header_
15722}
15723
15724func (c *OrganizationsUpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
15725	reqHeaders := make(http.Header)
15726	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
15727	for k, v := range c.header_ {
15728		reqHeaders[k] = v
15729	}
15730	reqHeaders.Set("User-Agent", c.s.userAgent())
15731	var body io.Reader = nil
15732	body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings)
15733	if err != nil {
15734		return nil, err
15735	}
15736	reqHeaders.Set("Content-Type", "application/json")
15737	c.urlParams_.Set("alt", alt)
15738	c.urlParams_.Set("prettyPrint", "false")
15739	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
15740	urls += "?" + c.urlParams_.Encode()
15741	req, err := http.NewRequest("PATCH", urls, body)
15742	if err != nil {
15743		return nil, err
15744	}
15745	req.Header = reqHeaders
15746	googleapi.Expand(req.URL, map[string]string{
15747		"name": c.name,
15748	})
15749	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15750}
15751
15752// Do executes the "logging.organizations.updateCmekSettings" call.
15753// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
15754// status code is an error. Response headers are in either
15755// *CmekSettings.ServerResponse.Header or (if a response was returned at
15756// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
15757// to check whether the returned error was because
15758// http.StatusNotModified was returned.
15759func (c *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
15760	gensupport.SetOptions(c.urlParams_, opts...)
15761	res, err := c.doRequest("json")
15762	if res != nil && res.StatusCode == http.StatusNotModified {
15763		if res.Body != nil {
15764			res.Body.Close()
15765		}
15766		return nil, &googleapi.Error{
15767			Code:   res.StatusCode,
15768			Header: res.Header,
15769		}
15770	}
15771	if err != nil {
15772		return nil, err
15773	}
15774	defer googleapi.CloseBody(res)
15775	if err := googleapi.CheckResponse(res); err != nil {
15776		return nil, err
15777	}
15778	ret := &CmekSettings{
15779		ServerResponse: googleapi.ServerResponse{
15780			Header:         res.Header,
15781			HTTPStatusCode: res.StatusCode,
15782		},
15783	}
15784	target := &ret
15785	if err := gensupport.DecodeResponse(target, res); err != nil {
15786		return nil, err
15787	}
15788	return ret, nil
15789	// {
15790	//   "description": "Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Logs Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.",
15791	//   "flatPath": "v2/organizations/{organizationsId}/cmekSettings",
15792	//   "httpMethod": "PATCH",
15793	//   "id": "logging.organizations.updateCmekSettings",
15794	//   "parameterOrder": [
15795	//     "name"
15796	//   ],
15797	//   "parameters": {
15798	//     "name": {
15799	//       "description": "Required. The resource name for the CMEK settings to update. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" Example: \"organizations/12345/cmekSettings\".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.",
15800	//       "location": "path",
15801	//       "pattern": "^organizations/[^/]+$",
15802	//       "required": true,
15803	//       "type": "string"
15804	//     },
15805	//     "updateMask": {
15806	//       "description": "Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.Example: \"updateMask=kmsKeyName\"",
15807	//       "format": "google-fieldmask",
15808	//       "location": "query",
15809	//       "type": "string"
15810	//     }
15811	//   },
15812	//   "path": "v2/{+name}/cmekSettings",
15813	//   "request": {
15814	//     "$ref": "CmekSettings"
15815	//   },
15816	//   "response": {
15817	//     "$ref": "CmekSettings"
15818	//   },
15819	//   "scopes": [
15820	//     "https://www.googleapis.com/auth/cloud-platform",
15821	//     "https://www.googleapis.com/auth/logging.admin"
15822	//   ]
15823	// }
15824
15825}
15826
15827// method id "logging.organizations.exclusions.create":
15828
15829type OrganizationsExclusionsCreateCall struct {
15830	s            *Service
15831	parent       string
15832	logexclusion *LogExclusion
15833	urlParams_   gensupport.URLParams
15834	ctx_         context.Context
15835	header_      http.Header
15836}
15837
15838// Create: Creates a new exclusion in a specified parent resource. Only
15839// log entries belonging to that resource can be excluded. You can have
15840// up to 10 exclusions in a resource.
15841func (r *OrganizationsExclusionsService) Create(parent string, logexclusion *LogExclusion) *OrganizationsExclusionsCreateCall {
15842	c := &OrganizationsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15843	c.parent = parent
15844	c.logexclusion = logexclusion
15845	return c
15846}
15847
15848// Fields allows partial responses to be retrieved. See
15849// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15850// for more information.
15851func (c *OrganizationsExclusionsCreateCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsCreateCall {
15852	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15853	return c
15854}
15855
15856// Context sets the context to be used in this call's Do method. Any
15857// pending HTTP request will be aborted if the provided context is
15858// canceled.
15859func (c *OrganizationsExclusionsCreateCall) Context(ctx context.Context) *OrganizationsExclusionsCreateCall {
15860	c.ctx_ = ctx
15861	return c
15862}
15863
15864// Header returns an http.Header that can be modified by the caller to
15865// add HTTP headers to the request.
15866func (c *OrganizationsExclusionsCreateCall) Header() http.Header {
15867	if c.header_ == nil {
15868		c.header_ = make(http.Header)
15869	}
15870	return c.header_
15871}
15872
15873func (c *OrganizationsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
15874	reqHeaders := make(http.Header)
15875	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
15876	for k, v := range c.header_ {
15877		reqHeaders[k] = v
15878	}
15879	reqHeaders.Set("User-Agent", c.s.userAgent())
15880	var body io.Reader = nil
15881	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
15882	if err != nil {
15883		return nil, err
15884	}
15885	reqHeaders.Set("Content-Type", "application/json")
15886	c.urlParams_.Set("alt", alt)
15887	c.urlParams_.Set("prettyPrint", "false")
15888	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
15889	urls += "?" + c.urlParams_.Encode()
15890	req, err := http.NewRequest("POST", urls, body)
15891	if err != nil {
15892		return nil, err
15893	}
15894	req.Header = reqHeaders
15895	googleapi.Expand(req.URL, map[string]string{
15896		"parent": c.parent,
15897	})
15898	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15899}
15900
15901// Do executes the "logging.organizations.exclusions.create" call.
15902// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
15903// status code is an error. Response headers are in either
15904// *LogExclusion.ServerResponse.Header or (if a response was returned at
15905// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
15906// to check whether the returned error was because
15907// http.StatusNotModified was returned.
15908func (c *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
15909	gensupport.SetOptions(c.urlParams_, opts...)
15910	res, err := c.doRequest("json")
15911	if res != nil && res.StatusCode == http.StatusNotModified {
15912		if res.Body != nil {
15913			res.Body.Close()
15914		}
15915		return nil, &googleapi.Error{
15916			Code:   res.StatusCode,
15917			Header: res.Header,
15918		}
15919	}
15920	if err != nil {
15921		return nil, err
15922	}
15923	defer googleapi.CloseBody(res)
15924	if err := googleapi.CheckResponse(res); err != nil {
15925		return nil, err
15926	}
15927	ret := &LogExclusion{
15928		ServerResponse: googleapi.ServerResponse{
15929			Header:         res.Header,
15930			HTTPStatusCode: res.StatusCode,
15931		},
15932	}
15933	target := &ret
15934	if err := gensupport.DecodeResponse(target, res); err != nil {
15935		return nil, err
15936	}
15937	return ret, nil
15938	// {
15939	//   "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.",
15940	//   "flatPath": "v2/organizations/{organizationsId}/exclusions",
15941	//   "httpMethod": "POST",
15942	//   "id": "logging.organizations.exclusions.create",
15943	//   "parameterOrder": [
15944	//     "parent"
15945	//   ],
15946	//   "parameters": {
15947	//     "parent": {
15948	//       "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" Examples: \"projects/my-logging-project\", \"organizations/123456789\".",
15949	//       "location": "path",
15950	//       "pattern": "^organizations/[^/]+$",
15951	//       "required": true,
15952	//       "type": "string"
15953	//     }
15954	//   },
15955	//   "path": "v2/{+parent}/exclusions",
15956	//   "request": {
15957	//     "$ref": "LogExclusion"
15958	//   },
15959	//   "response": {
15960	//     "$ref": "LogExclusion"
15961	//   },
15962	//   "scopes": [
15963	//     "https://www.googleapis.com/auth/cloud-platform",
15964	//     "https://www.googleapis.com/auth/logging.admin"
15965	//   ]
15966	// }
15967
15968}
15969
15970// method id "logging.organizations.exclusions.delete":
15971
15972type OrganizationsExclusionsDeleteCall struct {
15973	s          *Service
15974	name       string
15975	urlParams_ gensupport.URLParams
15976	ctx_       context.Context
15977	header_    http.Header
15978}
15979
15980// Delete: Deletes an exclusion.
15981func (r *OrganizationsExclusionsService) Delete(name string) *OrganizationsExclusionsDeleteCall {
15982	c := &OrganizationsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15983	c.name = name
15984	return c
15985}
15986
15987// Fields allows partial responses to be retrieved. See
15988// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15989// for more information.
15990func (c *OrganizationsExclusionsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsDeleteCall {
15991	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15992	return c
15993}
15994
15995// Context sets the context to be used in this call's Do method. Any
15996// pending HTTP request will be aborted if the provided context is
15997// canceled.
15998func (c *OrganizationsExclusionsDeleteCall) Context(ctx context.Context) *OrganizationsExclusionsDeleteCall {
15999	c.ctx_ = ctx
16000	return c
16001}
16002
16003// Header returns an http.Header that can be modified by the caller to
16004// add HTTP headers to the request.
16005func (c *OrganizationsExclusionsDeleteCall) Header() http.Header {
16006	if c.header_ == nil {
16007		c.header_ = make(http.Header)
16008	}
16009	return c.header_
16010}
16011
16012func (c *OrganizationsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
16013	reqHeaders := make(http.Header)
16014	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
16015	for k, v := range c.header_ {
16016		reqHeaders[k] = v
16017	}
16018	reqHeaders.Set("User-Agent", c.s.userAgent())
16019	var body io.Reader = nil
16020	c.urlParams_.Set("alt", alt)
16021	c.urlParams_.Set("prettyPrint", "false")
16022	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
16023	urls += "?" + c.urlParams_.Encode()
16024	req, err := http.NewRequest("DELETE", urls, body)
16025	if err != nil {
16026		return nil, err
16027	}
16028	req.Header = reqHeaders
16029	googleapi.Expand(req.URL, map[string]string{
16030		"name": c.name,
16031	})
16032	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16033}
16034
16035// Do executes the "logging.organizations.exclusions.delete" call.
16036// Exactly one of *Empty or error will be non-nil. Any non-2xx status
16037// code is an error. Response headers are in either
16038// *Empty.ServerResponse.Header or (if a response was returned at all)
16039// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
16040// check whether the returned error was because http.StatusNotModified
16041// was returned.
16042func (c *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
16043	gensupport.SetOptions(c.urlParams_, opts...)
16044	res, err := c.doRequest("json")
16045	if res != nil && res.StatusCode == http.StatusNotModified {
16046		if res.Body != nil {
16047			res.Body.Close()
16048		}
16049		return nil, &googleapi.Error{
16050			Code:   res.StatusCode,
16051			Header: res.Header,
16052		}
16053	}
16054	if err != nil {
16055		return nil, err
16056	}
16057	defer googleapi.CloseBody(res)
16058	if err := googleapi.CheckResponse(res); err != nil {
16059		return nil, err
16060	}
16061	ret := &Empty{
16062		ServerResponse: googleapi.ServerResponse{
16063			Header:         res.Header,
16064			HTTPStatusCode: res.StatusCode,
16065		},
16066	}
16067	target := &ret
16068	if err := gensupport.DecodeResponse(target, res); err != nil {
16069		return nil, err
16070	}
16071	return ret, nil
16072	// {
16073	//   "description": "Deletes an exclusion.",
16074	//   "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
16075	//   "httpMethod": "DELETE",
16076	//   "id": "logging.organizations.exclusions.delete",
16077	//   "parameterOrder": [
16078	//     "name"
16079	//   ],
16080	//   "parameters": {
16081	//     "name": {
16082	//       "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
16083	//       "location": "path",
16084	//       "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
16085	//       "required": true,
16086	//       "type": "string"
16087	//     }
16088	//   },
16089	//   "path": "v2/{+name}",
16090	//   "response": {
16091	//     "$ref": "Empty"
16092	//   },
16093	//   "scopes": [
16094	//     "https://www.googleapis.com/auth/cloud-platform",
16095	//     "https://www.googleapis.com/auth/logging.admin"
16096	//   ]
16097	// }
16098
16099}
16100
16101// method id "logging.organizations.exclusions.get":
16102
16103type OrganizationsExclusionsGetCall struct {
16104	s            *Service
16105	name         string
16106	urlParams_   gensupport.URLParams
16107	ifNoneMatch_ string
16108	ctx_         context.Context
16109	header_      http.Header
16110}
16111
16112// Get: Gets the description of an exclusion.
16113func (r *OrganizationsExclusionsService) Get(name string) *OrganizationsExclusionsGetCall {
16114	c := &OrganizationsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16115	c.name = name
16116	return c
16117}
16118
16119// Fields allows partial responses to be retrieved. See
16120// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16121// for more information.
16122func (c *OrganizationsExclusionsGetCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsGetCall {
16123	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16124	return c
16125}
16126
16127// IfNoneMatch sets the optional parameter which makes the operation
16128// fail if the object's ETag matches the given value. This is useful for
16129// getting updates only after the object has changed since the last
16130// request. Use googleapi.IsNotModified to check whether the response
16131// error from Do is the result of In-None-Match.
16132func (c *OrganizationsExclusionsGetCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsGetCall {
16133	c.ifNoneMatch_ = entityTag
16134	return c
16135}
16136
16137// Context sets the context to be used in this call's Do method. Any
16138// pending HTTP request will be aborted if the provided context is
16139// canceled.
16140func (c *OrganizationsExclusionsGetCall) Context(ctx context.Context) *OrganizationsExclusionsGetCall {
16141	c.ctx_ = ctx
16142	return c
16143}
16144
16145// Header returns an http.Header that can be modified by the caller to
16146// add HTTP headers to the request.
16147func (c *OrganizationsExclusionsGetCall) Header() http.Header {
16148	if c.header_ == nil {
16149		c.header_ = make(http.Header)
16150	}
16151	return c.header_
16152}
16153
16154func (c *OrganizationsExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
16155	reqHeaders := make(http.Header)
16156	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
16157	for k, v := range c.header_ {
16158		reqHeaders[k] = v
16159	}
16160	reqHeaders.Set("User-Agent", c.s.userAgent())
16161	if c.ifNoneMatch_ != "" {
16162		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16163	}
16164	var body io.Reader = nil
16165	c.urlParams_.Set("alt", alt)
16166	c.urlParams_.Set("prettyPrint", "false")
16167	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
16168	urls += "?" + c.urlParams_.Encode()
16169	req, err := http.NewRequest("GET", urls, body)
16170	if err != nil {
16171		return nil, err
16172	}
16173	req.Header = reqHeaders
16174	googleapi.Expand(req.URL, map[string]string{
16175		"name": c.name,
16176	})
16177	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16178}
16179
16180// Do executes the "logging.organizations.exclusions.get" call.
16181// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
16182// status code is an error. Response headers are in either
16183// *LogExclusion.ServerResponse.Header or (if a response was returned at
16184// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
16185// to check whether the returned error was because
16186// http.StatusNotModified was returned.
16187func (c *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
16188	gensupport.SetOptions(c.urlParams_, opts...)
16189	res, err := c.doRequest("json")
16190	if res != nil && res.StatusCode == http.StatusNotModified {
16191		if res.Body != nil {
16192			res.Body.Close()
16193		}
16194		return nil, &googleapi.Error{
16195			Code:   res.StatusCode,
16196			Header: res.Header,
16197		}
16198	}
16199	if err != nil {
16200		return nil, err
16201	}
16202	defer googleapi.CloseBody(res)
16203	if err := googleapi.CheckResponse(res); err != nil {
16204		return nil, err
16205	}
16206	ret := &LogExclusion{
16207		ServerResponse: googleapi.ServerResponse{
16208			Header:         res.Header,
16209			HTTPStatusCode: res.StatusCode,
16210		},
16211	}
16212	target := &ret
16213	if err := gensupport.DecodeResponse(target, res); err != nil {
16214		return nil, err
16215	}
16216	return ret, nil
16217	// {
16218	//   "description": "Gets the description of an exclusion.",
16219	//   "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
16220	//   "httpMethod": "GET",
16221	//   "id": "logging.organizations.exclusions.get",
16222	//   "parameterOrder": [
16223	//     "name"
16224	//   ],
16225	//   "parameters": {
16226	//     "name": {
16227	//       "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
16228	//       "location": "path",
16229	//       "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
16230	//       "required": true,
16231	//       "type": "string"
16232	//     }
16233	//   },
16234	//   "path": "v2/{+name}",
16235	//   "response": {
16236	//     "$ref": "LogExclusion"
16237	//   },
16238	//   "scopes": [
16239	//     "https://www.googleapis.com/auth/cloud-platform",
16240	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
16241	//     "https://www.googleapis.com/auth/logging.admin",
16242	//     "https://www.googleapis.com/auth/logging.read"
16243	//   ]
16244	// }
16245
16246}
16247
16248// method id "logging.organizations.exclusions.list":
16249
16250type OrganizationsExclusionsListCall struct {
16251	s            *Service
16252	parent       string
16253	urlParams_   gensupport.URLParams
16254	ifNoneMatch_ string
16255	ctx_         context.Context
16256	header_      http.Header
16257}
16258
16259// List: Lists all the exclusions in a parent resource.
16260func (r *OrganizationsExclusionsService) List(parent string) *OrganizationsExclusionsListCall {
16261	c := &OrganizationsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16262	c.parent = parent
16263	return c
16264}
16265
16266// PageSize sets the optional parameter "pageSize": The maximum number
16267// of results to return from this request. Non-positive values are
16268// ignored. The presence of nextPageToken in the response indicates that
16269// more results might be available.
16270func (c *OrganizationsExclusionsListCall) PageSize(pageSize int64) *OrganizationsExclusionsListCall {
16271	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
16272	return c
16273}
16274
16275// PageToken sets the optional parameter "pageToken": If present, then
16276// retrieve the next batch of results from the preceding call to this
16277// method. pageToken must be the value of nextPageToken from the
16278// previous response. The values of other method parameters should be
16279// identical to those in the previous call.
16280func (c *OrganizationsExclusionsListCall) PageToken(pageToken string) *OrganizationsExclusionsListCall {
16281	c.urlParams_.Set("pageToken", pageToken)
16282	return c
16283}
16284
16285// Fields allows partial responses to be retrieved. See
16286// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16287// for more information.
16288func (c *OrganizationsExclusionsListCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsListCall {
16289	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16290	return c
16291}
16292
16293// IfNoneMatch sets the optional parameter which makes the operation
16294// fail if the object's ETag matches the given value. This is useful for
16295// getting updates only after the object has changed since the last
16296// request. Use googleapi.IsNotModified to check whether the response
16297// error from Do is the result of In-None-Match.
16298func (c *OrganizationsExclusionsListCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsListCall {
16299	c.ifNoneMatch_ = entityTag
16300	return c
16301}
16302
16303// Context sets the context to be used in this call's Do method. Any
16304// pending HTTP request will be aborted if the provided context is
16305// canceled.
16306func (c *OrganizationsExclusionsListCall) Context(ctx context.Context) *OrganizationsExclusionsListCall {
16307	c.ctx_ = ctx
16308	return c
16309}
16310
16311// Header returns an http.Header that can be modified by the caller to
16312// add HTTP headers to the request.
16313func (c *OrganizationsExclusionsListCall) Header() http.Header {
16314	if c.header_ == nil {
16315		c.header_ = make(http.Header)
16316	}
16317	return c.header_
16318}
16319
16320func (c *OrganizationsExclusionsListCall) doRequest(alt string) (*http.Response, error) {
16321	reqHeaders := make(http.Header)
16322	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
16323	for k, v := range c.header_ {
16324		reqHeaders[k] = v
16325	}
16326	reqHeaders.Set("User-Agent", c.s.userAgent())
16327	if c.ifNoneMatch_ != "" {
16328		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16329	}
16330	var body io.Reader = nil
16331	c.urlParams_.Set("alt", alt)
16332	c.urlParams_.Set("prettyPrint", "false")
16333	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
16334	urls += "?" + c.urlParams_.Encode()
16335	req, err := http.NewRequest("GET", urls, body)
16336	if err != nil {
16337		return nil, err
16338	}
16339	req.Header = reqHeaders
16340	googleapi.Expand(req.URL, map[string]string{
16341		"parent": c.parent,
16342	})
16343	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16344}
16345
16346// Do executes the "logging.organizations.exclusions.list" call.
16347// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
16348// non-2xx status code is an error. Response headers are in either
16349// *ListExclusionsResponse.ServerResponse.Header or (if a response was
16350// returned at all) in error.(*googleapi.Error).Header. Use
16351// googleapi.IsNotModified to check whether the returned error was
16352// because http.StatusNotModified was returned.
16353func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
16354	gensupport.SetOptions(c.urlParams_, opts...)
16355	res, err := c.doRequest("json")
16356	if res != nil && res.StatusCode == http.StatusNotModified {
16357		if res.Body != nil {
16358			res.Body.Close()
16359		}
16360		return nil, &googleapi.Error{
16361			Code:   res.StatusCode,
16362			Header: res.Header,
16363		}
16364	}
16365	if err != nil {
16366		return nil, err
16367	}
16368	defer googleapi.CloseBody(res)
16369	if err := googleapi.CheckResponse(res); err != nil {
16370		return nil, err
16371	}
16372	ret := &ListExclusionsResponse{
16373		ServerResponse: googleapi.ServerResponse{
16374			Header:         res.Header,
16375			HTTPStatusCode: res.StatusCode,
16376		},
16377	}
16378	target := &ret
16379	if err := gensupport.DecodeResponse(target, res); err != nil {
16380		return nil, err
16381	}
16382	return ret, nil
16383	// {
16384	//   "description": "Lists all the exclusions in a parent resource.",
16385	//   "flatPath": "v2/organizations/{organizationsId}/exclusions",
16386	//   "httpMethod": "GET",
16387	//   "id": "logging.organizations.exclusions.list",
16388	//   "parameterOrder": [
16389	//     "parent"
16390	//   ],
16391	//   "parameters": {
16392	//     "pageSize": {
16393	//       "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.",
16394	//       "format": "int32",
16395	//       "location": "query",
16396	//       "type": "integer"
16397	//     },
16398	//     "pageToken": {
16399	//       "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.",
16400	//       "location": "query",
16401	//       "type": "string"
16402	//     },
16403	//     "parent": {
16404	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
16405	//       "location": "path",
16406	//       "pattern": "^organizations/[^/]+$",
16407	//       "required": true,
16408	//       "type": "string"
16409	//     }
16410	//   },
16411	//   "path": "v2/{+parent}/exclusions",
16412	//   "response": {
16413	//     "$ref": "ListExclusionsResponse"
16414	//   },
16415	//   "scopes": [
16416	//     "https://www.googleapis.com/auth/cloud-platform",
16417	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
16418	//     "https://www.googleapis.com/auth/logging.admin",
16419	//     "https://www.googleapis.com/auth/logging.read"
16420	//   ]
16421	// }
16422
16423}
16424
16425// Pages invokes f for each page of results.
16426// A non-nil error returned from f will halt the iteration.
16427// The provided context supersedes any context provided to the Context method.
16428func (c *OrganizationsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
16429	c.ctx_ = ctx
16430	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
16431	for {
16432		x, err := c.Do()
16433		if err != nil {
16434			return err
16435		}
16436		if err := f(x); err != nil {
16437			return err
16438		}
16439		if x.NextPageToken == "" {
16440			return nil
16441		}
16442		c.PageToken(x.NextPageToken)
16443	}
16444}
16445
16446// method id "logging.organizations.exclusions.patch":
16447
16448type OrganizationsExclusionsPatchCall struct {
16449	s            *Service
16450	name         string
16451	logexclusion *LogExclusion
16452	urlParams_   gensupport.URLParams
16453	ctx_         context.Context
16454	header_      http.Header
16455}
16456
16457// Patch: Changes one or more properties of an existing exclusion.
16458func (r *OrganizationsExclusionsService) Patch(name string, logexclusion *LogExclusion) *OrganizationsExclusionsPatchCall {
16459	c := &OrganizationsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16460	c.name = name
16461	c.logexclusion = logexclusion
16462	return c
16463}
16464
16465// UpdateMask sets the optional parameter "updateMask": Required. A
16466// non-empty list of fields to change in the existing exclusion. New
16467// values for the fields are taken from the corresponding fields in the
16468// LogExclusion included in this request. Fields not mentioned in
16469// update_mask are not changed and are ignored in the request.For
16470// example, to change the filter and description of an exclusion,
16471// specify an update_mask of "filter,description".
16472func (c *OrganizationsExclusionsPatchCall) UpdateMask(updateMask string) *OrganizationsExclusionsPatchCall {
16473	c.urlParams_.Set("updateMask", updateMask)
16474	return c
16475}
16476
16477// Fields allows partial responses to be retrieved. See
16478// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16479// for more information.
16480func (c *OrganizationsExclusionsPatchCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsPatchCall {
16481	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16482	return c
16483}
16484
16485// Context sets the context to be used in this call's Do method. Any
16486// pending HTTP request will be aborted if the provided context is
16487// canceled.
16488func (c *OrganizationsExclusionsPatchCall) Context(ctx context.Context) *OrganizationsExclusionsPatchCall {
16489	c.ctx_ = ctx
16490	return c
16491}
16492
16493// Header returns an http.Header that can be modified by the caller to
16494// add HTTP headers to the request.
16495func (c *OrganizationsExclusionsPatchCall) Header() http.Header {
16496	if c.header_ == nil {
16497		c.header_ = make(http.Header)
16498	}
16499	return c.header_
16500}
16501
16502func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
16503	reqHeaders := make(http.Header)
16504	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
16505	for k, v := range c.header_ {
16506		reqHeaders[k] = v
16507	}
16508	reqHeaders.Set("User-Agent", c.s.userAgent())
16509	var body io.Reader = nil
16510	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
16511	if err != nil {
16512		return nil, err
16513	}
16514	reqHeaders.Set("Content-Type", "application/json")
16515	c.urlParams_.Set("alt", alt)
16516	c.urlParams_.Set("prettyPrint", "false")
16517	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
16518	urls += "?" + c.urlParams_.Encode()
16519	req, err := http.NewRequest("PATCH", urls, body)
16520	if err != nil {
16521		return nil, err
16522	}
16523	req.Header = reqHeaders
16524	googleapi.Expand(req.URL, map[string]string{
16525		"name": c.name,
16526	})
16527	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16528}
16529
16530// Do executes the "logging.organizations.exclusions.patch" call.
16531// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
16532// status code is an error. Response headers are in either
16533// *LogExclusion.ServerResponse.Header or (if a response was returned at
16534// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
16535// to check whether the returned error was because
16536// http.StatusNotModified was returned.
16537func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
16538	gensupport.SetOptions(c.urlParams_, opts...)
16539	res, err := c.doRequest("json")
16540	if res != nil && res.StatusCode == http.StatusNotModified {
16541		if res.Body != nil {
16542			res.Body.Close()
16543		}
16544		return nil, &googleapi.Error{
16545			Code:   res.StatusCode,
16546			Header: res.Header,
16547		}
16548	}
16549	if err != nil {
16550		return nil, err
16551	}
16552	defer googleapi.CloseBody(res)
16553	if err := googleapi.CheckResponse(res); err != nil {
16554		return nil, err
16555	}
16556	ret := &LogExclusion{
16557		ServerResponse: googleapi.ServerResponse{
16558			Header:         res.Header,
16559			HTTPStatusCode: res.StatusCode,
16560		},
16561	}
16562	target := &ret
16563	if err := gensupport.DecodeResponse(target, res); err != nil {
16564		return nil, err
16565	}
16566	return ret, nil
16567	// {
16568	//   "description": "Changes one or more properties of an existing exclusion.",
16569	//   "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
16570	//   "httpMethod": "PATCH",
16571	//   "id": "logging.organizations.exclusions.patch",
16572	//   "parameterOrder": [
16573	//     "name"
16574	//   ],
16575	//   "parameters": {
16576	//     "name": {
16577	//       "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
16578	//       "location": "path",
16579	//       "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
16580	//       "required": true,
16581	//       "type": "string"
16582	//     },
16583	//     "updateMask": {
16584	//       "description": "Required. A non-empty 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\".",
16585	//       "format": "google-fieldmask",
16586	//       "location": "query",
16587	//       "type": "string"
16588	//     }
16589	//   },
16590	//   "path": "v2/{+name}",
16591	//   "request": {
16592	//     "$ref": "LogExclusion"
16593	//   },
16594	//   "response": {
16595	//     "$ref": "LogExclusion"
16596	//   },
16597	//   "scopes": [
16598	//     "https://www.googleapis.com/auth/cloud-platform",
16599	//     "https://www.googleapis.com/auth/logging.admin"
16600	//   ]
16601	// }
16602
16603}
16604
16605// method id "logging.organizations.locations.get":
16606
16607type OrganizationsLocationsGetCall struct {
16608	s            *Service
16609	name         string
16610	urlParams_   gensupport.URLParams
16611	ifNoneMatch_ string
16612	ctx_         context.Context
16613	header_      http.Header
16614}
16615
16616// Get: Gets information about a location.
16617func (r *OrganizationsLocationsService) Get(name string) *OrganizationsLocationsGetCall {
16618	c := &OrganizationsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16619	c.name = name
16620	return c
16621}
16622
16623// Fields allows partial responses to be retrieved. See
16624// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16625// for more information.
16626func (c *OrganizationsLocationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsGetCall {
16627	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16628	return c
16629}
16630
16631// IfNoneMatch sets the optional parameter which makes the operation
16632// fail if the object's ETag matches the given value. This is useful for
16633// getting updates only after the object has changed since the last
16634// request. Use googleapi.IsNotModified to check whether the response
16635// error from Do is the result of In-None-Match.
16636func (c *OrganizationsLocationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsGetCall {
16637	c.ifNoneMatch_ = entityTag
16638	return c
16639}
16640
16641// Context sets the context to be used in this call's Do method. Any
16642// pending HTTP request will be aborted if the provided context is
16643// canceled.
16644func (c *OrganizationsLocationsGetCall) Context(ctx context.Context) *OrganizationsLocationsGetCall {
16645	c.ctx_ = ctx
16646	return c
16647}
16648
16649// Header returns an http.Header that can be modified by the caller to
16650// add HTTP headers to the request.
16651func (c *OrganizationsLocationsGetCall) Header() http.Header {
16652	if c.header_ == nil {
16653		c.header_ = make(http.Header)
16654	}
16655	return c.header_
16656}
16657
16658func (c *OrganizationsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
16659	reqHeaders := make(http.Header)
16660	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
16661	for k, v := range c.header_ {
16662		reqHeaders[k] = v
16663	}
16664	reqHeaders.Set("User-Agent", c.s.userAgent())
16665	if c.ifNoneMatch_ != "" {
16666		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16667	}
16668	var body io.Reader = nil
16669	c.urlParams_.Set("alt", alt)
16670	c.urlParams_.Set("prettyPrint", "false")
16671	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
16672	urls += "?" + c.urlParams_.Encode()
16673	req, err := http.NewRequest("GET", urls, body)
16674	if err != nil {
16675		return nil, err
16676	}
16677	req.Header = reqHeaders
16678	googleapi.Expand(req.URL, map[string]string{
16679		"name": c.name,
16680	})
16681	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16682}
16683
16684// Do executes the "logging.organizations.locations.get" call.
16685// Exactly one of *Location or error will be non-nil. Any non-2xx status
16686// code is an error. Response headers are in either
16687// *Location.ServerResponse.Header or (if a response was returned at
16688// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
16689// to check whether the returned error was because
16690// http.StatusNotModified was returned.
16691func (c *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
16692	gensupport.SetOptions(c.urlParams_, opts...)
16693	res, err := c.doRequest("json")
16694	if res != nil && res.StatusCode == http.StatusNotModified {
16695		if res.Body != nil {
16696			res.Body.Close()
16697		}
16698		return nil, &googleapi.Error{
16699			Code:   res.StatusCode,
16700			Header: res.Header,
16701		}
16702	}
16703	if err != nil {
16704		return nil, err
16705	}
16706	defer googleapi.CloseBody(res)
16707	if err := googleapi.CheckResponse(res); err != nil {
16708		return nil, err
16709	}
16710	ret := &Location{
16711		ServerResponse: googleapi.ServerResponse{
16712			Header:         res.Header,
16713			HTTPStatusCode: res.StatusCode,
16714		},
16715	}
16716	target := &ret
16717	if err := gensupport.DecodeResponse(target, res); err != nil {
16718		return nil, err
16719	}
16720	return ret, nil
16721	// {
16722	//   "description": "Gets information about a location.",
16723	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}",
16724	//   "httpMethod": "GET",
16725	//   "id": "logging.organizations.locations.get",
16726	//   "parameterOrder": [
16727	//     "name"
16728	//   ],
16729	//   "parameters": {
16730	//     "name": {
16731	//       "description": "Resource name for the location.",
16732	//       "location": "path",
16733	//       "pattern": "^organizations/[^/]+/locations/[^/]+$",
16734	//       "required": true,
16735	//       "type": "string"
16736	//     }
16737	//   },
16738	//   "path": "v2/{+name}",
16739	//   "response": {
16740	//     "$ref": "Location"
16741	//   },
16742	//   "scopes": [
16743	//     "https://www.googleapis.com/auth/cloud-platform",
16744	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
16745	//     "https://www.googleapis.com/auth/logging.admin",
16746	//     "https://www.googleapis.com/auth/logging.read"
16747	//   ]
16748	// }
16749
16750}
16751
16752// method id "logging.organizations.locations.list":
16753
16754type OrganizationsLocationsListCall struct {
16755	s            *Service
16756	name         string
16757	urlParams_   gensupport.URLParams
16758	ifNoneMatch_ string
16759	ctx_         context.Context
16760	header_      http.Header
16761}
16762
16763// List: Lists information about the supported locations for this
16764// service.
16765func (r *OrganizationsLocationsService) List(name string) *OrganizationsLocationsListCall {
16766	c := &OrganizationsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16767	c.name = name
16768	return c
16769}
16770
16771// Filter sets the optional parameter "filter": The standard list
16772// filter.
16773func (c *OrganizationsLocationsListCall) Filter(filter string) *OrganizationsLocationsListCall {
16774	c.urlParams_.Set("filter", filter)
16775	return c
16776}
16777
16778// PageSize sets the optional parameter "pageSize": The standard list
16779// page size.
16780func (c *OrganizationsLocationsListCall) PageSize(pageSize int64) *OrganizationsLocationsListCall {
16781	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
16782	return c
16783}
16784
16785// PageToken sets the optional parameter "pageToken": The standard list
16786// page token.
16787func (c *OrganizationsLocationsListCall) PageToken(pageToken string) *OrganizationsLocationsListCall {
16788	c.urlParams_.Set("pageToken", pageToken)
16789	return c
16790}
16791
16792// Fields allows partial responses to be retrieved. See
16793// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16794// for more information.
16795func (c *OrganizationsLocationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsListCall {
16796	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16797	return c
16798}
16799
16800// IfNoneMatch sets the optional parameter which makes the operation
16801// fail if the object's ETag matches the given value. This is useful for
16802// getting updates only after the object has changed since the last
16803// request. Use googleapi.IsNotModified to check whether the response
16804// error from Do is the result of In-None-Match.
16805func (c *OrganizationsLocationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsListCall {
16806	c.ifNoneMatch_ = entityTag
16807	return c
16808}
16809
16810// Context sets the context to be used in this call's Do method. Any
16811// pending HTTP request will be aborted if the provided context is
16812// canceled.
16813func (c *OrganizationsLocationsListCall) Context(ctx context.Context) *OrganizationsLocationsListCall {
16814	c.ctx_ = ctx
16815	return c
16816}
16817
16818// Header returns an http.Header that can be modified by the caller to
16819// add HTTP headers to the request.
16820func (c *OrganizationsLocationsListCall) Header() http.Header {
16821	if c.header_ == nil {
16822		c.header_ = make(http.Header)
16823	}
16824	return c.header_
16825}
16826
16827func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, error) {
16828	reqHeaders := make(http.Header)
16829	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
16830	for k, v := range c.header_ {
16831		reqHeaders[k] = v
16832	}
16833	reqHeaders.Set("User-Agent", c.s.userAgent())
16834	if c.ifNoneMatch_ != "" {
16835		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16836	}
16837	var body io.Reader = nil
16838	c.urlParams_.Set("alt", alt)
16839	c.urlParams_.Set("prettyPrint", "false")
16840	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
16841	urls += "?" + c.urlParams_.Encode()
16842	req, err := http.NewRequest("GET", urls, body)
16843	if err != nil {
16844		return nil, err
16845	}
16846	req.Header = reqHeaders
16847	googleapi.Expand(req.URL, map[string]string{
16848		"name": c.name,
16849	})
16850	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16851}
16852
16853// Do executes the "logging.organizations.locations.list" call.
16854// Exactly one of *ListLocationsResponse or error will be non-nil. Any
16855// non-2xx status code is an error. Response headers are in either
16856// *ListLocationsResponse.ServerResponse.Header or (if a response was
16857// returned at all) in error.(*googleapi.Error).Header. Use
16858// googleapi.IsNotModified to check whether the returned error was
16859// because http.StatusNotModified was returned.
16860func (c *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
16861	gensupport.SetOptions(c.urlParams_, opts...)
16862	res, err := c.doRequest("json")
16863	if res != nil && res.StatusCode == http.StatusNotModified {
16864		if res.Body != nil {
16865			res.Body.Close()
16866		}
16867		return nil, &googleapi.Error{
16868			Code:   res.StatusCode,
16869			Header: res.Header,
16870		}
16871	}
16872	if err != nil {
16873		return nil, err
16874	}
16875	defer googleapi.CloseBody(res)
16876	if err := googleapi.CheckResponse(res); err != nil {
16877		return nil, err
16878	}
16879	ret := &ListLocationsResponse{
16880		ServerResponse: googleapi.ServerResponse{
16881			Header:         res.Header,
16882			HTTPStatusCode: res.StatusCode,
16883		},
16884	}
16885	target := &ret
16886	if err := gensupport.DecodeResponse(target, res); err != nil {
16887		return nil, err
16888	}
16889	return ret, nil
16890	// {
16891	//   "description": "Lists information about the supported locations for this service.",
16892	//   "flatPath": "v2/organizations/{organizationsId}/locations",
16893	//   "httpMethod": "GET",
16894	//   "id": "logging.organizations.locations.list",
16895	//   "parameterOrder": [
16896	//     "name"
16897	//   ],
16898	//   "parameters": {
16899	//     "filter": {
16900	//       "description": "The standard list filter.",
16901	//       "location": "query",
16902	//       "type": "string"
16903	//     },
16904	//     "name": {
16905	//       "description": "The resource that owns the locations collection, if applicable.",
16906	//       "location": "path",
16907	//       "pattern": "^organizations/[^/]+$",
16908	//       "required": true,
16909	//       "type": "string"
16910	//     },
16911	//     "pageSize": {
16912	//       "description": "The standard list page size.",
16913	//       "format": "int32",
16914	//       "location": "query",
16915	//       "type": "integer"
16916	//     },
16917	//     "pageToken": {
16918	//       "description": "The standard list page token.",
16919	//       "location": "query",
16920	//       "type": "string"
16921	//     }
16922	//   },
16923	//   "path": "v2/{+name}/locations",
16924	//   "response": {
16925	//     "$ref": "ListLocationsResponse"
16926	//   },
16927	//   "scopes": [
16928	//     "https://www.googleapis.com/auth/cloud-platform",
16929	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
16930	//     "https://www.googleapis.com/auth/logging.admin",
16931	//     "https://www.googleapis.com/auth/logging.read"
16932	//   ]
16933	// }
16934
16935}
16936
16937// Pages invokes f for each page of results.
16938// A non-nil error returned from f will halt the iteration.
16939// The provided context supersedes any context provided to the Context method.
16940func (c *OrganizationsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
16941	c.ctx_ = ctx
16942	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
16943	for {
16944		x, err := c.Do()
16945		if err != nil {
16946			return err
16947		}
16948		if err := f(x); err != nil {
16949			return err
16950		}
16951		if x.NextPageToken == "" {
16952			return nil
16953		}
16954		c.PageToken(x.NextPageToken)
16955	}
16956}
16957
16958// method id "logging.organizations.locations.buckets.create":
16959
16960type OrganizationsLocationsBucketsCreateCall struct {
16961	s          *Service
16962	parent     string
16963	logbucket  *LogBucket
16964	urlParams_ gensupport.URLParams
16965	ctx_       context.Context
16966	header_    http.Header
16967}
16968
16969// Create: Creates a bucket that can be used to store log entries. Once
16970// a bucket has been created, the region cannot be changed.
16971func (r *OrganizationsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateCall {
16972	c := &OrganizationsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16973	c.parent = parent
16974	c.logbucket = logbucket
16975	return c
16976}
16977
16978// BucketId sets the optional parameter "bucketId": Required. A
16979// client-assigned identifier such as "my-bucket". Identifiers are
16980// limited to 100 characters and can include only letters, digits,
16981// underscores, hyphens, and periods.
16982func (c *OrganizationsLocationsBucketsCreateCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateCall {
16983	c.urlParams_.Set("bucketId", bucketId)
16984	return c
16985}
16986
16987// Fields allows partial responses to be retrieved. See
16988// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16989// for more information.
16990func (c *OrganizationsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateCall {
16991	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16992	return c
16993}
16994
16995// Context sets the context to be used in this call's Do method. Any
16996// pending HTTP request will be aborted if the provided context is
16997// canceled.
16998func (c *OrganizationsLocationsBucketsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateCall {
16999	c.ctx_ = ctx
17000	return c
17001}
17002
17003// Header returns an http.Header that can be modified by the caller to
17004// add HTTP headers to the request.
17005func (c *OrganizationsLocationsBucketsCreateCall) Header() http.Header {
17006	if c.header_ == nil {
17007		c.header_ = make(http.Header)
17008	}
17009	return c.header_
17010}
17011
17012func (c *OrganizationsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
17013	reqHeaders := make(http.Header)
17014	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
17015	for k, v := range c.header_ {
17016		reqHeaders[k] = v
17017	}
17018	reqHeaders.Set("User-Agent", c.s.userAgent())
17019	var body io.Reader = nil
17020	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
17021	if err != nil {
17022		return nil, err
17023	}
17024	reqHeaders.Set("Content-Type", "application/json")
17025	c.urlParams_.Set("alt", alt)
17026	c.urlParams_.Set("prettyPrint", "false")
17027	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
17028	urls += "?" + c.urlParams_.Encode()
17029	req, err := http.NewRequest("POST", urls, body)
17030	if err != nil {
17031		return nil, err
17032	}
17033	req.Header = reqHeaders
17034	googleapi.Expand(req.URL, map[string]string{
17035		"parent": c.parent,
17036	})
17037	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17038}
17039
17040// Do executes the "logging.organizations.locations.buckets.create" call.
17041// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
17042// status code is an error. Response headers are in either
17043// *LogBucket.ServerResponse.Header or (if a response was returned at
17044// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
17045// to check whether the returned error was because
17046// http.StatusNotModified was returned.
17047func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
17048	gensupport.SetOptions(c.urlParams_, opts...)
17049	res, err := c.doRequest("json")
17050	if res != nil && res.StatusCode == http.StatusNotModified {
17051		if res.Body != nil {
17052			res.Body.Close()
17053		}
17054		return nil, &googleapi.Error{
17055			Code:   res.StatusCode,
17056			Header: res.Header,
17057		}
17058	}
17059	if err != nil {
17060		return nil, err
17061	}
17062	defer googleapi.CloseBody(res)
17063	if err := googleapi.CheckResponse(res); err != nil {
17064		return nil, err
17065	}
17066	ret := &LogBucket{
17067		ServerResponse: googleapi.ServerResponse{
17068			Header:         res.Header,
17069			HTTPStatusCode: res.StatusCode,
17070		},
17071	}
17072	target := &ret
17073	if err := gensupport.DecodeResponse(target, res); err != nil {
17074		return nil, err
17075	}
17076	return ret, nil
17077	// {
17078	//   "description": "Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.",
17079	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets",
17080	//   "httpMethod": "POST",
17081	//   "id": "logging.organizations.locations.buckets.create",
17082	//   "parameterOrder": [
17083	//     "parent"
17084	//   ],
17085	//   "parameters": {
17086	//     "bucketId": {
17087	//       "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.",
17088	//       "location": "query",
17089	//       "type": "string"
17090	//     },
17091	//     "parent": {
17092	//       "description": "Required. The resource in which to create the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" Example: \"projects/my-logging-project/locations/global\"",
17093	//       "location": "path",
17094	//       "pattern": "^organizations/[^/]+/locations/[^/]+$",
17095	//       "required": true,
17096	//       "type": "string"
17097	//     }
17098	//   },
17099	//   "path": "v2/{+parent}/buckets",
17100	//   "request": {
17101	//     "$ref": "LogBucket"
17102	//   },
17103	//   "response": {
17104	//     "$ref": "LogBucket"
17105	//   },
17106	//   "scopes": [
17107	//     "https://www.googleapis.com/auth/cloud-platform",
17108	//     "https://www.googleapis.com/auth/logging.admin"
17109	//   ]
17110	// }
17111
17112}
17113
17114// method id "logging.organizations.locations.buckets.delete":
17115
17116type OrganizationsLocationsBucketsDeleteCall struct {
17117	s          *Service
17118	name       string
17119	urlParams_ gensupport.URLParams
17120	ctx_       context.Context
17121	header_    http.Header
17122}
17123
17124// Delete: Deletes a bucket. Moves the bucket to the DELETE_REQUESTED
17125// state. After 7 days, the bucket will be purged and all logs in the
17126// bucket will be permanently deleted.
17127func (r *OrganizationsLocationsBucketsService) Delete(name string) *OrganizationsLocationsBucketsDeleteCall {
17128	c := &OrganizationsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17129	c.name = name
17130	return c
17131}
17132
17133// Fields allows partial responses to be retrieved. See
17134// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17135// for more information.
17136func (c *OrganizationsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsDeleteCall {
17137	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17138	return c
17139}
17140
17141// Context sets the context to be used in this call's Do method. Any
17142// pending HTTP request will be aborted if the provided context is
17143// canceled.
17144func (c *OrganizationsLocationsBucketsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsDeleteCall {
17145	c.ctx_ = ctx
17146	return c
17147}
17148
17149// Header returns an http.Header that can be modified by the caller to
17150// add HTTP headers to the request.
17151func (c *OrganizationsLocationsBucketsDeleteCall) Header() http.Header {
17152	if c.header_ == nil {
17153		c.header_ = make(http.Header)
17154	}
17155	return c.header_
17156}
17157
17158func (c *OrganizationsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
17159	reqHeaders := make(http.Header)
17160	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
17161	for k, v := range c.header_ {
17162		reqHeaders[k] = v
17163	}
17164	reqHeaders.Set("User-Agent", c.s.userAgent())
17165	var body io.Reader = nil
17166	c.urlParams_.Set("alt", alt)
17167	c.urlParams_.Set("prettyPrint", "false")
17168	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
17169	urls += "?" + c.urlParams_.Encode()
17170	req, err := http.NewRequest("DELETE", urls, body)
17171	if err != nil {
17172		return nil, err
17173	}
17174	req.Header = reqHeaders
17175	googleapi.Expand(req.URL, map[string]string{
17176		"name": c.name,
17177	})
17178	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17179}
17180
17181// Do executes the "logging.organizations.locations.buckets.delete" call.
17182// Exactly one of *Empty or error will be non-nil. Any non-2xx status
17183// code is an error. Response headers are in either
17184// *Empty.ServerResponse.Header or (if a response was returned at all)
17185// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
17186// check whether the returned error was because http.StatusNotModified
17187// was returned.
17188func (c *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
17189	gensupport.SetOptions(c.urlParams_, opts...)
17190	res, err := c.doRequest("json")
17191	if res != nil && res.StatusCode == http.StatusNotModified {
17192		if res.Body != nil {
17193			res.Body.Close()
17194		}
17195		return nil, &googleapi.Error{
17196			Code:   res.StatusCode,
17197			Header: res.Header,
17198		}
17199	}
17200	if err != nil {
17201		return nil, err
17202	}
17203	defer googleapi.CloseBody(res)
17204	if err := googleapi.CheckResponse(res); err != nil {
17205		return nil, err
17206	}
17207	ret := &Empty{
17208		ServerResponse: googleapi.ServerResponse{
17209			Header:         res.Header,
17210			HTTPStatusCode: res.StatusCode,
17211		},
17212	}
17213	target := &ret
17214	if err := gensupport.DecodeResponse(target, res); err != nil {
17215		return nil, err
17216	}
17217	return ret, nil
17218	// {
17219	//   "description": "Deletes a bucket. Moves the bucket to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all logs in the bucket will be permanently deleted.",
17220	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}",
17221	//   "httpMethod": "DELETE",
17222	//   "id": "logging.organizations.locations.buckets.delete",
17223	//   "parameterOrder": [
17224	//     "name"
17225	//   ],
17226	//   "parameters": {
17227	//     "name": {
17228	//       "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
17229	//       "location": "path",
17230	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
17231	//       "required": true,
17232	//       "type": "string"
17233	//     }
17234	//   },
17235	//   "path": "v2/{+name}",
17236	//   "response": {
17237	//     "$ref": "Empty"
17238	//   },
17239	//   "scopes": [
17240	//     "https://www.googleapis.com/auth/cloud-platform",
17241	//     "https://www.googleapis.com/auth/logging.admin"
17242	//   ]
17243	// }
17244
17245}
17246
17247// method id "logging.organizations.locations.buckets.get":
17248
17249type OrganizationsLocationsBucketsGetCall struct {
17250	s            *Service
17251	name         string
17252	urlParams_   gensupport.URLParams
17253	ifNoneMatch_ string
17254	ctx_         context.Context
17255	header_      http.Header
17256}
17257
17258// Get: Gets a bucket.
17259func (r *OrganizationsLocationsBucketsService) Get(name string) *OrganizationsLocationsBucketsGetCall {
17260	c := &OrganizationsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17261	c.name = name
17262	return c
17263}
17264
17265// Fields allows partial responses to be retrieved. See
17266// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17267// for more information.
17268func (c *OrganizationsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsGetCall {
17269	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17270	return c
17271}
17272
17273// IfNoneMatch sets the optional parameter which makes the operation
17274// fail if the object's ETag matches the given value. This is useful for
17275// getting updates only after the object has changed since the last
17276// request. Use googleapi.IsNotModified to check whether the response
17277// error from Do is the result of In-None-Match.
17278func (c *OrganizationsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsGetCall {
17279	c.ifNoneMatch_ = entityTag
17280	return c
17281}
17282
17283// Context sets the context to be used in this call's Do method. Any
17284// pending HTTP request will be aborted if the provided context is
17285// canceled.
17286func (c *OrganizationsLocationsBucketsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsGetCall {
17287	c.ctx_ = ctx
17288	return c
17289}
17290
17291// Header returns an http.Header that can be modified by the caller to
17292// add HTTP headers to the request.
17293func (c *OrganizationsLocationsBucketsGetCall) Header() http.Header {
17294	if c.header_ == nil {
17295		c.header_ = make(http.Header)
17296	}
17297	return c.header_
17298}
17299
17300func (c *OrganizationsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
17301	reqHeaders := make(http.Header)
17302	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
17303	for k, v := range c.header_ {
17304		reqHeaders[k] = v
17305	}
17306	reqHeaders.Set("User-Agent", c.s.userAgent())
17307	if c.ifNoneMatch_ != "" {
17308		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17309	}
17310	var body io.Reader = nil
17311	c.urlParams_.Set("alt", alt)
17312	c.urlParams_.Set("prettyPrint", "false")
17313	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
17314	urls += "?" + c.urlParams_.Encode()
17315	req, err := http.NewRequest("GET", urls, body)
17316	if err != nil {
17317		return nil, err
17318	}
17319	req.Header = reqHeaders
17320	googleapi.Expand(req.URL, map[string]string{
17321		"name": c.name,
17322	})
17323	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17324}
17325
17326// Do executes the "logging.organizations.locations.buckets.get" call.
17327// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
17328// status code is an error. Response headers are in either
17329// *LogBucket.ServerResponse.Header or (if a response was returned at
17330// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
17331// to check whether the returned error was because
17332// http.StatusNotModified was returned.
17333func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
17334	gensupport.SetOptions(c.urlParams_, opts...)
17335	res, err := c.doRequest("json")
17336	if res != nil && res.StatusCode == http.StatusNotModified {
17337		if res.Body != nil {
17338			res.Body.Close()
17339		}
17340		return nil, &googleapi.Error{
17341			Code:   res.StatusCode,
17342			Header: res.Header,
17343		}
17344	}
17345	if err != nil {
17346		return nil, err
17347	}
17348	defer googleapi.CloseBody(res)
17349	if err := googleapi.CheckResponse(res); err != nil {
17350		return nil, err
17351	}
17352	ret := &LogBucket{
17353		ServerResponse: googleapi.ServerResponse{
17354			Header:         res.Header,
17355			HTTPStatusCode: res.StatusCode,
17356		},
17357	}
17358	target := &ret
17359	if err := gensupport.DecodeResponse(target, res); err != nil {
17360		return nil, err
17361	}
17362	return ret, nil
17363	// {
17364	//   "description": "Gets a bucket.",
17365	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}",
17366	//   "httpMethod": "GET",
17367	//   "id": "logging.organizations.locations.buckets.get",
17368	//   "parameterOrder": [
17369	//     "name"
17370	//   ],
17371	//   "parameters": {
17372	//     "name": {
17373	//       "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
17374	//       "location": "path",
17375	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
17376	//       "required": true,
17377	//       "type": "string"
17378	//     }
17379	//   },
17380	//   "path": "v2/{+name}",
17381	//   "response": {
17382	//     "$ref": "LogBucket"
17383	//   },
17384	//   "scopes": [
17385	//     "https://www.googleapis.com/auth/cloud-platform",
17386	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
17387	//     "https://www.googleapis.com/auth/logging.admin",
17388	//     "https://www.googleapis.com/auth/logging.read"
17389	//   ]
17390	// }
17391
17392}
17393
17394// method id "logging.organizations.locations.buckets.list":
17395
17396type OrganizationsLocationsBucketsListCall struct {
17397	s            *Service
17398	parent       string
17399	urlParams_   gensupport.URLParams
17400	ifNoneMatch_ string
17401	ctx_         context.Context
17402	header_      http.Header
17403}
17404
17405// List: Lists buckets.
17406func (r *OrganizationsLocationsBucketsService) List(parent string) *OrganizationsLocationsBucketsListCall {
17407	c := &OrganizationsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17408	c.parent = parent
17409	return c
17410}
17411
17412// PageSize sets the optional parameter "pageSize": The maximum number
17413// of results to return from this request. Non-positive values are
17414// ignored. The presence of nextPageToken in the response indicates that
17415// more results might be available.
17416func (c *OrganizationsLocationsBucketsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsListCall {
17417	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
17418	return c
17419}
17420
17421// PageToken sets the optional parameter "pageToken": If present, then
17422// retrieve the next batch of results from the preceding call to this
17423// method. pageToken must be the value of nextPageToken from the
17424// previous response. The values of other method parameters should be
17425// identical to those in the previous call.
17426func (c *OrganizationsLocationsBucketsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsListCall {
17427	c.urlParams_.Set("pageToken", pageToken)
17428	return c
17429}
17430
17431// Fields allows partial responses to be retrieved. See
17432// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17433// for more information.
17434func (c *OrganizationsLocationsBucketsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsListCall {
17435	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17436	return c
17437}
17438
17439// IfNoneMatch sets the optional parameter which makes the operation
17440// fail if the object's ETag matches the given value. This is useful for
17441// getting updates only after the object has changed since the last
17442// request. Use googleapi.IsNotModified to check whether the response
17443// error from Do is the result of In-None-Match.
17444func (c *OrganizationsLocationsBucketsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsListCall {
17445	c.ifNoneMatch_ = entityTag
17446	return c
17447}
17448
17449// Context sets the context to be used in this call's Do method. Any
17450// pending HTTP request will be aborted if the provided context is
17451// canceled.
17452func (c *OrganizationsLocationsBucketsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsListCall {
17453	c.ctx_ = ctx
17454	return c
17455}
17456
17457// Header returns an http.Header that can be modified by the caller to
17458// add HTTP headers to the request.
17459func (c *OrganizationsLocationsBucketsListCall) Header() http.Header {
17460	if c.header_ == nil {
17461		c.header_ = make(http.Header)
17462	}
17463	return c.header_
17464}
17465
17466func (c *OrganizationsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
17467	reqHeaders := make(http.Header)
17468	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
17469	for k, v := range c.header_ {
17470		reqHeaders[k] = v
17471	}
17472	reqHeaders.Set("User-Agent", c.s.userAgent())
17473	if c.ifNoneMatch_ != "" {
17474		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17475	}
17476	var body io.Reader = nil
17477	c.urlParams_.Set("alt", alt)
17478	c.urlParams_.Set("prettyPrint", "false")
17479	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
17480	urls += "?" + c.urlParams_.Encode()
17481	req, err := http.NewRequest("GET", urls, body)
17482	if err != nil {
17483		return nil, err
17484	}
17485	req.Header = reqHeaders
17486	googleapi.Expand(req.URL, map[string]string{
17487		"parent": c.parent,
17488	})
17489	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17490}
17491
17492// Do executes the "logging.organizations.locations.buckets.list" call.
17493// Exactly one of *ListBucketsResponse or error will be non-nil. Any
17494// non-2xx status code is an error. Response headers are in either
17495// *ListBucketsResponse.ServerResponse.Header or (if a response was
17496// returned at all) in error.(*googleapi.Error).Header. Use
17497// googleapi.IsNotModified to check whether the returned error was
17498// because http.StatusNotModified was returned.
17499func (c *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
17500	gensupport.SetOptions(c.urlParams_, opts...)
17501	res, err := c.doRequest("json")
17502	if res != nil && res.StatusCode == http.StatusNotModified {
17503		if res.Body != nil {
17504			res.Body.Close()
17505		}
17506		return nil, &googleapi.Error{
17507			Code:   res.StatusCode,
17508			Header: res.Header,
17509		}
17510	}
17511	if err != nil {
17512		return nil, err
17513	}
17514	defer googleapi.CloseBody(res)
17515	if err := googleapi.CheckResponse(res); err != nil {
17516		return nil, err
17517	}
17518	ret := &ListBucketsResponse{
17519		ServerResponse: googleapi.ServerResponse{
17520			Header:         res.Header,
17521			HTTPStatusCode: res.StatusCode,
17522		},
17523	}
17524	target := &ret
17525	if err := gensupport.DecodeResponse(target, res); err != nil {
17526		return nil, err
17527	}
17528	return ret, nil
17529	// {
17530	//   "description": "Lists buckets.",
17531	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets",
17532	//   "httpMethod": "GET",
17533	//   "id": "logging.organizations.locations.buckets.list",
17534	//   "parameterOrder": [
17535	//     "parent"
17536	//   ],
17537	//   "parameters": {
17538	//     "pageSize": {
17539	//       "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.",
17540	//       "format": "int32",
17541	//       "location": "query",
17542	//       "type": "integer"
17543	//     },
17544	//     "pageToken": {
17545	//       "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.",
17546	//       "location": "query",
17547	//       "type": "string"
17548	//     },
17549	//     "parent": {
17550	//       "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.",
17551	//       "location": "path",
17552	//       "pattern": "^organizations/[^/]+/locations/[^/]+$",
17553	//       "required": true,
17554	//       "type": "string"
17555	//     }
17556	//   },
17557	//   "path": "v2/{+parent}/buckets",
17558	//   "response": {
17559	//     "$ref": "ListBucketsResponse"
17560	//   },
17561	//   "scopes": [
17562	//     "https://www.googleapis.com/auth/cloud-platform",
17563	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
17564	//     "https://www.googleapis.com/auth/logging.admin",
17565	//     "https://www.googleapis.com/auth/logging.read"
17566	//   ]
17567	// }
17568
17569}
17570
17571// Pages invokes f for each page of results.
17572// A non-nil error returned from f will halt the iteration.
17573// The provided context supersedes any context provided to the Context method.
17574func (c *OrganizationsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
17575	c.ctx_ = ctx
17576	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
17577	for {
17578		x, err := c.Do()
17579		if err != nil {
17580			return err
17581		}
17582		if err := f(x); err != nil {
17583			return err
17584		}
17585		if x.NextPageToken == "" {
17586			return nil
17587		}
17588		c.PageToken(x.NextPageToken)
17589	}
17590}
17591
17592// method id "logging.organizations.locations.buckets.patch":
17593
17594type OrganizationsLocationsBucketsPatchCall struct {
17595	s          *Service
17596	name       string
17597	logbucket  *LogBucket
17598	urlParams_ gensupport.URLParams
17599	ctx_       context.Context
17600	header_    http.Header
17601}
17602
17603// Patch: Updates a bucket. This method replaces the following fields in
17604// the existing bucket with values from the new bucket:
17605// retention_periodIf the retention period is decreased and the bucket
17606// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
17607// LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
17608// returned.A buckets region may not be modified after it is created.
17609func (r *OrganizationsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsPatchCall {
17610	c := &OrganizationsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17611	c.name = name
17612	c.logbucket = logbucket
17613	return c
17614}
17615
17616// UpdateMask sets the optional parameter "updateMask": Required. Field
17617// mask that specifies the fields in bucket that need an update. A
17618// bucket field will be overwritten if, and only if, it is in the update
17619// mask. name and output only fields cannot be updated.For a detailed
17620// FieldMask definition, see
17621// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
17622// updateMask=retention_days.
17623func (c *OrganizationsLocationsBucketsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsPatchCall {
17624	c.urlParams_.Set("updateMask", updateMask)
17625	return c
17626}
17627
17628// Fields allows partial responses to be retrieved. See
17629// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17630// for more information.
17631func (c *OrganizationsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsPatchCall {
17632	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17633	return c
17634}
17635
17636// Context sets the context to be used in this call's Do method. Any
17637// pending HTTP request will be aborted if the provided context is
17638// canceled.
17639func (c *OrganizationsLocationsBucketsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsPatchCall {
17640	c.ctx_ = ctx
17641	return c
17642}
17643
17644// Header returns an http.Header that can be modified by the caller to
17645// add HTTP headers to the request.
17646func (c *OrganizationsLocationsBucketsPatchCall) Header() http.Header {
17647	if c.header_ == nil {
17648		c.header_ = make(http.Header)
17649	}
17650	return c.header_
17651}
17652
17653func (c *OrganizationsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
17654	reqHeaders := make(http.Header)
17655	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
17656	for k, v := range c.header_ {
17657		reqHeaders[k] = v
17658	}
17659	reqHeaders.Set("User-Agent", c.s.userAgent())
17660	var body io.Reader = nil
17661	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
17662	if err != nil {
17663		return nil, err
17664	}
17665	reqHeaders.Set("Content-Type", "application/json")
17666	c.urlParams_.Set("alt", alt)
17667	c.urlParams_.Set("prettyPrint", "false")
17668	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
17669	urls += "?" + c.urlParams_.Encode()
17670	req, err := http.NewRequest("PATCH", urls, body)
17671	if err != nil {
17672		return nil, err
17673	}
17674	req.Header = reqHeaders
17675	googleapi.Expand(req.URL, map[string]string{
17676		"name": c.name,
17677	})
17678	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17679}
17680
17681// Do executes the "logging.organizations.locations.buckets.patch" call.
17682// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
17683// status code is an error. Response headers are in either
17684// *LogBucket.ServerResponse.Header or (if a response was returned at
17685// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
17686// to check whether the returned error was because
17687// http.StatusNotModified was returned.
17688func (c *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
17689	gensupport.SetOptions(c.urlParams_, opts...)
17690	res, err := c.doRequest("json")
17691	if res != nil && res.StatusCode == http.StatusNotModified {
17692		if res.Body != nil {
17693			res.Body.Close()
17694		}
17695		return nil, &googleapi.Error{
17696			Code:   res.StatusCode,
17697			Header: res.Header,
17698		}
17699	}
17700	if err != nil {
17701		return nil, err
17702	}
17703	defer googleapi.CloseBody(res)
17704	if err := googleapi.CheckResponse(res); err != nil {
17705		return nil, err
17706	}
17707	ret := &LogBucket{
17708		ServerResponse: googleapi.ServerResponse{
17709			Header:         res.Header,
17710			HTTPStatusCode: res.StatusCode,
17711		},
17712	}
17713	target := &ret
17714	if err := gensupport.DecodeResponse(target, res); err != nil {
17715		return nil, err
17716	}
17717	return ret, nil
17718	// {
17719	//   "description": "Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created.",
17720	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}",
17721	//   "httpMethod": "PATCH",
17722	//   "id": "logging.organizations.locations.buckets.patch",
17723	//   "parameterOrder": [
17724	//     "name"
17725	//   ],
17726	//   "parameters": {
17727	//     "name": {
17728	//       "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\". Also requires permission \"resourcemanager.projects.updateLiens\" to set the locked property",
17729	//       "location": "path",
17730	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
17731	//       "required": true,
17732	//       "type": "string"
17733	//     },
17734	//     "updateMask": {
17735	//       "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days.",
17736	//       "format": "google-fieldmask",
17737	//       "location": "query",
17738	//       "type": "string"
17739	//     }
17740	//   },
17741	//   "path": "v2/{+name}",
17742	//   "request": {
17743	//     "$ref": "LogBucket"
17744	//   },
17745	//   "response": {
17746	//     "$ref": "LogBucket"
17747	//   },
17748	//   "scopes": [
17749	//     "https://www.googleapis.com/auth/cloud-platform",
17750	//     "https://www.googleapis.com/auth/logging.admin"
17751	//   ]
17752	// }
17753
17754}
17755
17756// method id "logging.organizations.locations.buckets.undelete":
17757
17758type OrganizationsLocationsBucketsUndeleteCall struct {
17759	s                     *Service
17760	name                  string
17761	undeletebucketrequest *UndeleteBucketRequest
17762	urlParams_            gensupport.URLParams
17763	ctx_                  context.Context
17764	header_               http.Header
17765}
17766
17767// Undelete: Undeletes a bucket. A bucket that has been deleted may be
17768// undeleted within the grace period of 7 days.
17769func (r *OrganizationsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *OrganizationsLocationsBucketsUndeleteCall {
17770	c := &OrganizationsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17771	c.name = name
17772	c.undeletebucketrequest = undeletebucketrequest
17773	return c
17774}
17775
17776// Fields allows partial responses to be retrieved. See
17777// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17778// for more information.
17779func (c *OrganizationsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUndeleteCall {
17780	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17781	return c
17782}
17783
17784// Context sets the context to be used in this call's Do method. Any
17785// pending HTTP request will be aborted if the provided context is
17786// canceled.
17787func (c *OrganizationsLocationsBucketsUndeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUndeleteCall {
17788	c.ctx_ = ctx
17789	return c
17790}
17791
17792// Header returns an http.Header that can be modified by the caller to
17793// add HTTP headers to the request.
17794func (c *OrganizationsLocationsBucketsUndeleteCall) Header() http.Header {
17795	if c.header_ == nil {
17796		c.header_ = make(http.Header)
17797	}
17798	return c.header_
17799}
17800
17801func (c *OrganizationsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
17802	reqHeaders := make(http.Header)
17803	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
17804	for k, v := range c.header_ {
17805		reqHeaders[k] = v
17806	}
17807	reqHeaders.Set("User-Agent", c.s.userAgent())
17808	var body io.Reader = nil
17809	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
17810	if err != nil {
17811		return nil, err
17812	}
17813	reqHeaders.Set("Content-Type", "application/json")
17814	c.urlParams_.Set("alt", alt)
17815	c.urlParams_.Set("prettyPrint", "false")
17816	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
17817	urls += "?" + c.urlParams_.Encode()
17818	req, err := http.NewRequest("POST", urls, body)
17819	if err != nil {
17820		return nil, err
17821	}
17822	req.Header = reqHeaders
17823	googleapi.Expand(req.URL, map[string]string{
17824		"name": c.name,
17825	})
17826	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17827}
17828
17829// Do executes the "logging.organizations.locations.buckets.undelete" call.
17830// Exactly one of *Empty or error will be non-nil. Any non-2xx status
17831// code is an error. Response headers are in either
17832// *Empty.ServerResponse.Header or (if a response was returned at all)
17833// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
17834// check whether the returned error was because http.StatusNotModified
17835// was returned.
17836func (c *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
17837	gensupport.SetOptions(c.urlParams_, opts...)
17838	res, err := c.doRequest("json")
17839	if res != nil && res.StatusCode == http.StatusNotModified {
17840		if res.Body != nil {
17841			res.Body.Close()
17842		}
17843		return nil, &googleapi.Error{
17844			Code:   res.StatusCode,
17845			Header: res.Header,
17846		}
17847	}
17848	if err != nil {
17849		return nil, err
17850	}
17851	defer googleapi.CloseBody(res)
17852	if err := googleapi.CheckResponse(res); err != nil {
17853		return nil, err
17854	}
17855	ret := &Empty{
17856		ServerResponse: googleapi.ServerResponse{
17857			Header:         res.Header,
17858			HTTPStatusCode: res.StatusCode,
17859		},
17860	}
17861	target := &ret
17862	if err := gensupport.DecodeResponse(target, res); err != nil {
17863		return nil, err
17864	}
17865	return ret, nil
17866	// {
17867	//   "description": "Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.",
17868	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
17869	//   "httpMethod": "POST",
17870	//   "id": "logging.organizations.locations.buckets.undelete",
17871	//   "parameterOrder": [
17872	//     "name"
17873	//   ],
17874	//   "parameters": {
17875	//     "name": {
17876	//       "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
17877	//       "location": "path",
17878	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
17879	//       "required": true,
17880	//       "type": "string"
17881	//     }
17882	//   },
17883	//   "path": "v2/{+name}:undelete",
17884	//   "request": {
17885	//     "$ref": "UndeleteBucketRequest"
17886	//   },
17887	//   "response": {
17888	//     "$ref": "Empty"
17889	//   },
17890	//   "scopes": [
17891	//     "https://www.googleapis.com/auth/cloud-platform",
17892	//     "https://www.googleapis.com/auth/logging.admin"
17893	//   ]
17894	// }
17895
17896}
17897
17898// method id "logging.organizations.locations.buckets.views.create":
17899
17900type OrganizationsLocationsBucketsViewsCreateCall struct {
17901	s          *Service
17902	parent     string
17903	logview    *LogView
17904	urlParams_ gensupport.URLParams
17905	ctx_       context.Context
17906	header_    http.Header
17907}
17908
17909// Create: Creates a view over logs in a bucket. A bucket may contain a
17910// maximum of 50 views.
17911func (r *OrganizationsLocationsBucketsViewsService) Create(parent string, logview *LogView) *OrganizationsLocationsBucketsViewsCreateCall {
17912	c := &OrganizationsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17913	c.parent = parent
17914	c.logview = logview
17915	return c
17916}
17917
17918// ViewId sets the optional parameter "viewId": Required. The id to use
17919// for this view.
17920func (c *OrganizationsLocationsBucketsViewsCreateCall) ViewId(viewId string) *OrganizationsLocationsBucketsViewsCreateCall {
17921	c.urlParams_.Set("viewId", viewId)
17922	return c
17923}
17924
17925// Fields allows partial responses to be retrieved. See
17926// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17927// for more information.
17928func (c *OrganizationsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsCreateCall {
17929	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17930	return c
17931}
17932
17933// Context sets the context to be used in this call's Do method. Any
17934// pending HTTP request will be aborted if the provided context is
17935// canceled.
17936func (c *OrganizationsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsCreateCall {
17937	c.ctx_ = ctx
17938	return c
17939}
17940
17941// Header returns an http.Header that can be modified by the caller to
17942// add HTTP headers to the request.
17943func (c *OrganizationsLocationsBucketsViewsCreateCall) Header() http.Header {
17944	if c.header_ == nil {
17945		c.header_ = make(http.Header)
17946	}
17947	return c.header_
17948}
17949
17950func (c *OrganizationsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
17951	reqHeaders := make(http.Header)
17952	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
17953	for k, v := range c.header_ {
17954		reqHeaders[k] = v
17955	}
17956	reqHeaders.Set("User-Agent", c.s.userAgent())
17957	var body io.Reader = nil
17958	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
17959	if err != nil {
17960		return nil, err
17961	}
17962	reqHeaders.Set("Content-Type", "application/json")
17963	c.urlParams_.Set("alt", alt)
17964	c.urlParams_.Set("prettyPrint", "false")
17965	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
17966	urls += "?" + c.urlParams_.Encode()
17967	req, err := http.NewRequest("POST", urls, body)
17968	if err != nil {
17969		return nil, err
17970	}
17971	req.Header = reqHeaders
17972	googleapi.Expand(req.URL, map[string]string{
17973		"parent": c.parent,
17974	})
17975	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17976}
17977
17978// Do executes the "logging.organizations.locations.buckets.views.create" call.
17979// Exactly one of *LogView or error will be non-nil. Any non-2xx status
17980// code is an error. Response headers are in either
17981// *LogView.ServerResponse.Header or (if a response was returned at all)
17982// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
17983// check whether the returned error was because http.StatusNotModified
17984// was returned.
17985func (c *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
17986	gensupport.SetOptions(c.urlParams_, opts...)
17987	res, err := c.doRequest("json")
17988	if res != nil && res.StatusCode == http.StatusNotModified {
17989		if res.Body != nil {
17990			res.Body.Close()
17991		}
17992		return nil, &googleapi.Error{
17993			Code:   res.StatusCode,
17994			Header: res.Header,
17995		}
17996	}
17997	if err != nil {
17998		return nil, err
17999	}
18000	defer googleapi.CloseBody(res)
18001	if err := googleapi.CheckResponse(res); err != nil {
18002		return nil, err
18003	}
18004	ret := &LogView{
18005		ServerResponse: googleapi.ServerResponse{
18006			Header:         res.Header,
18007			HTTPStatusCode: res.StatusCode,
18008		},
18009	}
18010	target := &ret
18011	if err := gensupport.DecodeResponse(target, res); err != nil {
18012		return nil, err
18013	}
18014	return ret, nil
18015	// {
18016	//   "description": "Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.",
18017	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views",
18018	//   "httpMethod": "POST",
18019	//   "id": "logging.organizations.locations.buckets.views.create",
18020	//   "parameterOrder": [
18021	//     "parent"
18022	//   ],
18023	//   "parameters": {
18024	//     "parent": {
18025	//       "description": "Required. The bucket in which to create the view \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-logging-project/locations/my-location/buckets/my-bucket\"",
18026	//       "location": "path",
18027	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
18028	//       "required": true,
18029	//       "type": "string"
18030	//     },
18031	//     "viewId": {
18032	//       "description": "Required. The id to use for this view.",
18033	//       "location": "query",
18034	//       "type": "string"
18035	//     }
18036	//   },
18037	//   "path": "v2/{+parent}/views",
18038	//   "request": {
18039	//     "$ref": "LogView"
18040	//   },
18041	//   "response": {
18042	//     "$ref": "LogView"
18043	//   },
18044	//   "scopes": [
18045	//     "https://www.googleapis.com/auth/cloud-platform",
18046	//     "https://www.googleapis.com/auth/logging.admin"
18047	//   ]
18048	// }
18049
18050}
18051
18052// method id "logging.organizations.locations.buckets.views.delete":
18053
18054type OrganizationsLocationsBucketsViewsDeleteCall struct {
18055	s          *Service
18056	name       string
18057	urlParams_ gensupport.URLParams
18058	ctx_       context.Context
18059	header_    http.Header
18060}
18061
18062// Delete: Deletes a view from a bucket.
18063func (r *OrganizationsLocationsBucketsViewsService) Delete(name string) *OrganizationsLocationsBucketsViewsDeleteCall {
18064	c := &OrganizationsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18065	c.name = name
18066	return c
18067}
18068
18069// Fields allows partial responses to be retrieved. See
18070// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18071// for more information.
18072func (c *OrganizationsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsDeleteCall {
18073	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18074	return c
18075}
18076
18077// Context sets the context to be used in this call's Do method. Any
18078// pending HTTP request will be aborted if the provided context is
18079// canceled.
18080func (c *OrganizationsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsDeleteCall {
18081	c.ctx_ = ctx
18082	return c
18083}
18084
18085// Header returns an http.Header that can be modified by the caller to
18086// add HTTP headers to the request.
18087func (c *OrganizationsLocationsBucketsViewsDeleteCall) Header() http.Header {
18088	if c.header_ == nil {
18089		c.header_ = make(http.Header)
18090	}
18091	return c.header_
18092}
18093
18094func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
18095	reqHeaders := make(http.Header)
18096	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
18097	for k, v := range c.header_ {
18098		reqHeaders[k] = v
18099	}
18100	reqHeaders.Set("User-Agent", c.s.userAgent())
18101	var body io.Reader = nil
18102	c.urlParams_.Set("alt", alt)
18103	c.urlParams_.Set("prettyPrint", "false")
18104	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
18105	urls += "?" + c.urlParams_.Encode()
18106	req, err := http.NewRequest("DELETE", urls, body)
18107	if err != nil {
18108		return nil, err
18109	}
18110	req.Header = reqHeaders
18111	googleapi.Expand(req.URL, map[string]string{
18112		"name": c.name,
18113	})
18114	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18115}
18116
18117// Do executes the "logging.organizations.locations.buckets.views.delete" call.
18118// Exactly one of *Empty or error will be non-nil. Any non-2xx status
18119// code is an error. Response headers are in either
18120// *Empty.ServerResponse.Header or (if a response was returned at all)
18121// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18122// check whether the returned error was because http.StatusNotModified
18123// was returned.
18124func (c *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
18125	gensupport.SetOptions(c.urlParams_, opts...)
18126	res, err := c.doRequest("json")
18127	if res != nil && res.StatusCode == http.StatusNotModified {
18128		if res.Body != nil {
18129			res.Body.Close()
18130		}
18131		return nil, &googleapi.Error{
18132			Code:   res.StatusCode,
18133			Header: res.Header,
18134		}
18135	}
18136	if err != nil {
18137		return nil, err
18138	}
18139	defer googleapi.CloseBody(res)
18140	if err := googleapi.CheckResponse(res); err != nil {
18141		return nil, err
18142	}
18143	ret := &Empty{
18144		ServerResponse: googleapi.ServerResponse{
18145			Header:         res.Header,
18146			HTTPStatusCode: res.StatusCode,
18147		},
18148	}
18149	target := &ret
18150	if err := gensupport.DecodeResponse(target, res); err != nil {
18151		return nil, err
18152	}
18153	return ret, nil
18154	// {
18155	//   "description": "Deletes a view from a bucket.",
18156	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
18157	//   "httpMethod": "DELETE",
18158	//   "id": "logging.organizations.locations.buckets.views.delete",
18159	//   "parameterOrder": [
18160	//     "name"
18161	//   ],
18162	//   "parameters": {
18163	//     "name": {
18164	//       "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
18165	//       "location": "path",
18166	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
18167	//       "required": true,
18168	//       "type": "string"
18169	//     }
18170	//   },
18171	//   "path": "v2/{+name}",
18172	//   "response": {
18173	//     "$ref": "Empty"
18174	//   },
18175	//   "scopes": [
18176	//     "https://www.googleapis.com/auth/cloud-platform",
18177	//     "https://www.googleapis.com/auth/logging.admin"
18178	//   ]
18179	// }
18180
18181}
18182
18183// method id "logging.organizations.locations.buckets.views.get":
18184
18185type OrganizationsLocationsBucketsViewsGetCall struct {
18186	s            *Service
18187	name         string
18188	urlParams_   gensupport.URLParams
18189	ifNoneMatch_ string
18190	ctx_         context.Context
18191	header_      http.Header
18192}
18193
18194// Get: Gets a view.
18195func (r *OrganizationsLocationsBucketsViewsService) Get(name string) *OrganizationsLocationsBucketsViewsGetCall {
18196	c := &OrganizationsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18197	c.name = name
18198	return c
18199}
18200
18201// Fields allows partial responses to be retrieved. See
18202// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18203// for more information.
18204func (c *OrganizationsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsGetCall {
18205	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18206	return c
18207}
18208
18209// IfNoneMatch sets the optional parameter which makes the operation
18210// fail if the object's ETag matches the given value. This is useful for
18211// getting updates only after the object has changed since the last
18212// request. Use googleapi.IsNotModified to check whether the response
18213// error from Do is the result of In-None-Match.
18214func (c *OrganizationsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsGetCall {
18215	c.ifNoneMatch_ = entityTag
18216	return c
18217}
18218
18219// Context sets the context to be used in this call's Do method. Any
18220// pending HTTP request will be aborted if the provided context is
18221// canceled.
18222func (c *OrganizationsLocationsBucketsViewsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsGetCall {
18223	c.ctx_ = ctx
18224	return c
18225}
18226
18227// Header returns an http.Header that can be modified by the caller to
18228// add HTTP headers to the request.
18229func (c *OrganizationsLocationsBucketsViewsGetCall) Header() http.Header {
18230	if c.header_ == nil {
18231		c.header_ = make(http.Header)
18232	}
18233	return c.header_
18234}
18235
18236func (c *OrganizationsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
18237	reqHeaders := make(http.Header)
18238	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
18239	for k, v := range c.header_ {
18240		reqHeaders[k] = v
18241	}
18242	reqHeaders.Set("User-Agent", c.s.userAgent())
18243	if c.ifNoneMatch_ != "" {
18244		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18245	}
18246	var body io.Reader = nil
18247	c.urlParams_.Set("alt", alt)
18248	c.urlParams_.Set("prettyPrint", "false")
18249	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
18250	urls += "?" + c.urlParams_.Encode()
18251	req, err := http.NewRequest("GET", urls, body)
18252	if err != nil {
18253		return nil, err
18254	}
18255	req.Header = reqHeaders
18256	googleapi.Expand(req.URL, map[string]string{
18257		"name": c.name,
18258	})
18259	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18260}
18261
18262// Do executes the "logging.organizations.locations.buckets.views.get" call.
18263// Exactly one of *LogView or error will be non-nil. Any non-2xx status
18264// code is an error. Response headers are in either
18265// *LogView.ServerResponse.Header or (if a response was returned at all)
18266// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18267// check whether the returned error was because http.StatusNotModified
18268// was returned.
18269func (c *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
18270	gensupport.SetOptions(c.urlParams_, opts...)
18271	res, err := c.doRequest("json")
18272	if res != nil && res.StatusCode == http.StatusNotModified {
18273		if res.Body != nil {
18274			res.Body.Close()
18275		}
18276		return nil, &googleapi.Error{
18277			Code:   res.StatusCode,
18278			Header: res.Header,
18279		}
18280	}
18281	if err != nil {
18282		return nil, err
18283	}
18284	defer googleapi.CloseBody(res)
18285	if err := googleapi.CheckResponse(res); err != nil {
18286		return nil, err
18287	}
18288	ret := &LogView{
18289		ServerResponse: googleapi.ServerResponse{
18290			Header:         res.Header,
18291			HTTPStatusCode: res.StatusCode,
18292		},
18293	}
18294	target := &ret
18295	if err := gensupport.DecodeResponse(target, res); err != nil {
18296		return nil, err
18297	}
18298	return ret, nil
18299	// {
18300	//   "description": "Gets a view.",
18301	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
18302	//   "httpMethod": "GET",
18303	//   "id": "logging.organizations.locations.buckets.views.get",
18304	//   "parameterOrder": [
18305	//     "name"
18306	//   ],
18307	//   "parameters": {
18308	//     "name": {
18309	//       "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
18310	//       "location": "path",
18311	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
18312	//       "required": true,
18313	//       "type": "string"
18314	//     }
18315	//   },
18316	//   "path": "v2/{+name}",
18317	//   "response": {
18318	//     "$ref": "LogView"
18319	//   },
18320	//   "scopes": [
18321	//     "https://www.googleapis.com/auth/cloud-platform",
18322	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
18323	//     "https://www.googleapis.com/auth/logging.admin",
18324	//     "https://www.googleapis.com/auth/logging.read"
18325	//   ]
18326	// }
18327
18328}
18329
18330// method id "logging.organizations.locations.buckets.views.list":
18331
18332type OrganizationsLocationsBucketsViewsListCall struct {
18333	s            *Service
18334	parent       string
18335	urlParams_   gensupport.URLParams
18336	ifNoneMatch_ string
18337	ctx_         context.Context
18338	header_      http.Header
18339}
18340
18341// List: Lists views on a bucket.
18342func (r *OrganizationsLocationsBucketsViewsService) List(parent string) *OrganizationsLocationsBucketsViewsListCall {
18343	c := &OrganizationsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18344	c.parent = parent
18345	return c
18346}
18347
18348// PageSize sets the optional parameter "pageSize": The maximum number
18349// of results to return from this request. Non-positive values are
18350// ignored. The presence of nextPageToken in the response indicates that
18351// more results might be available.
18352func (c *OrganizationsLocationsBucketsViewsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsListCall {
18353	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
18354	return c
18355}
18356
18357// PageToken sets the optional parameter "pageToken": If present, then
18358// retrieve the next batch of results from the preceding call to this
18359// method. pageToken must be the value of nextPageToken from the
18360// previous response. The values of other method parameters should be
18361// identical to those in the previous call.
18362func (c *OrganizationsLocationsBucketsViewsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsListCall {
18363	c.urlParams_.Set("pageToken", pageToken)
18364	return c
18365}
18366
18367// Fields allows partial responses to be retrieved. See
18368// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18369// for more information.
18370func (c *OrganizationsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsListCall {
18371	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18372	return c
18373}
18374
18375// IfNoneMatch sets the optional parameter which makes the operation
18376// fail if the object's ETag matches the given value. This is useful for
18377// getting updates only after the object has changed since the last
18378// request. Use googleapi.IsNotModified to check whether the response
18379// error from Do is the result of In-None-Match.
18380func (c *OrganizationsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsListCall {
18381	c.ifNoneMatch_ = entityTag
18382	return c
18383}
18384
18385// Context sets the context to be used in this call's Do method. Any
18386// pending HTTP request will be aborted if the provided context is
18387// canceled.
18388func (c *OrganizationsLocationsBucketsViewsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsListCall {
18389	c.ctx_ = ctx
18390	return c
18391}
18392
18393// Header returns an http.Header that can be modified by the caller to
18394// add HTTP headers to the request.
18395func (c *OrganizationsLocationsBucketsViewsListCall) Header() http.Header {
18396	if c.header_ == nil {
18397		c.header_ = make(http.Header)
18398	}
18399	return c.header_
18400}
18401
18402func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
18403	reqHeaders := make(http.Header)
18404	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
18405	for k, v := range c.header_ {
18406		reqHeaders[k] = v
18407	}
18408	reqHeaders.Set("User-Agent", c.s.userAgent())
18409	if c.ifNoneMatch_ != "" {
18410		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18411	}
18412	var body io.Reader = nil
18413	c.urlParams_.Set("alt", alt)
18414	c.urlParams_.Set("prettyPrint", "false")
18415	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
18416	urls += "?" + c.urlParams_.Encode()
18417	req, err := http.NewRequest("GET", urls, body)
18418	if err != nil {
18419		return nil, err
18420	}
18421	req.Header = reqHeaders
18422	googleapi.Expand(req.URL, map[string]string{
18423		"parent": c.parent,
18424	})
18425	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18426}
18427
18428// Do executes the "logging.organizations.locations.buckets.views.list" call.
18429// Exactly one of *ListViewsResponse or error will be non-nil. Any
18430// non-2xx status code is an error. Response headers are in either
18431// *ListViewsResponse.ServerResponse.Header or (if a response was
18432// returned at all) in error.(*googleapi.Error).Header. Use
18433// googleapi.IsNotModified to check whether the returned error was
18434// because http.StatusNotModified was returned.
18435func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
18436	gensupport.SetOptions(c.urlParams_, opts...)
18437	res, err := c.doRequest("json")
18438	if res != nil && res.StatusCode == http.StatusNotModified {
18439		if res.Body != nil {
18440			res.Body.Close()
18441		}
18442		return nil, &googleapi.Error{
18443			Code:   res.StatusCode,
18444			Header: res.Header,
18445		}
18446	}
18447	if err != nil {
18448		return nil, err
18449	}
18450	defer googleapi.CloseBody(res)
18451	if err := googleapi.CheckResponse(res); err != nil {
18452		return nil, err
18453	}
18454	ret := &ListViewsResponse{
18455		ServerResponse: googleapi.ServerResponse{
18456			Header:         res.Header,
18457			HTTPStatusCode: res.StatusCode,
18458		},
18459	}
18460	target := &ret
18461	if err := gensupport.DecodeResponse(target, res); err != nil {
18462		return nil, err
18463	}
18464	return ret, nil
18465	// {
18466	//   "description": "Lists views on a bucket.",
18467	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views",
18468	//   "httpMethod": "GET",
18469	//   "id": "logging.organizations.locations.buckets.views.list",
18470	//   "parameterOrder": [
18471	//     "parent"
18472	//   ],
18473	//   "parameters": {
18474	//     "pageSize": {
18475	//       "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.",
18476	//       "format": "int32",
18477	//       "location": "query",
18478	//       "type": "integer"
18479	//     },
18480	//     "pageToken": {
18481	//       "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.",
18482	//       "location": "query",
18483	//       "type": "string"
18484	//     },
18485	//     "parent": {
18486	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
18487	//       "location": "path",
18488	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
18489	//       "required": true,
18490	//       "type": "string"
18491	//     }
18492	//   },
18493	//   "path": "v2/{+parent}/views",
18494	//   "response": {
18495	//     "$ref": "ListViewsResponse"
18496	//   },
18497	//   "scopes": [
18498	//     "https://www.googleapis.com/auth/cloud-platform",
18499	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
18500	//     "https://www.googleapis.com/auth/logging.admin",
18501	//     "https://www.googleapis.com/auth/logging.read"
18502	//   ]
18503	// }
18504
18505}
18506
18507// Pages invokes f for each page of results.
18508// A non-nil error returned from f will halt the iteration.
18509// The provided context supersedes any context provided to the Context method.
18510func (c *OrganizationsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
18511	c.ctx_ = ctx
18512	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
18513	for {
18514		x, err := c.Do()
18515		if err != nil {
18516			return err
18517		}
18518		if err := f(x); err != nil {
18519			return err
18520		}
18521		if x.NextPageToken == "" {
18522			return nil
18523		}
18524		c.PageToken(x.NextPageToken)
18525	}
18526}
18527
18528// method id "logging.organizations.locations.buckets.views.patch":
18529
18530type OrganizationsLocationsBucketsViewsPatchCall struct {
18531	s          *Service
18532	name       string
18533	logview    *LogView
18534	urlParams_ gensupport.URLParams
18535	ctx_       context.Context
18536	header_    http.Header
18537}
18538
18539// Patch: Updates a view. This method replaces the following fields in
18540// the existing view with values from the new view: filter.
18541func (r *OrganizationsLocationsBucketsViewsService) Patch(name string, logview *LogView) *OrganizationsLocationsBucketsViewsPatchCall {
18542	c := &OrganizationsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18543	c.name = name
18544	c.logview = logview
18545	return c
18546}
18547
18548// UpdateMask sets the optional parameter "updateMask": Field mask that
18549// specifies the fields in view that need an update. A field will be
18550// overwritten if, and only if, it is in the update mask. name and
18551// output only fields cannot be updated.For a detailed FieldMask
18552// definition, see
18553// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
18554// updateMask=filter.
18555func (c *OrganizationsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsViewsPatchCall {
18556	c.urlParams_.Set("updateMask", updateMask)
18557	return c
18558}
18559
18560// Fields allows partial responses to be retrieved. See
18561// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18562// for more information.
18563func (c *OrganizationsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsPatchCall {
18564	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18565	return c
18566}
18567
18568// Context sets the context to be used in this call's Do method. Any
18569// pending HTTP request will be aborted if the provided context is
18570// canceled.
18571func (c *OrganizationsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsPatchCall {
18572	c.ctx_ = ctx
18573	return c
18574}
18575
18576// Header returns an http.Header that can be modified by the caller to
18577// add HTTP headers to the request.
18578func (c *OrganizationsLocationsBucketsViewsPatchCall) Header() http.Header {
18579	if c.header_ == nil {
18580		c.header_ = make(http.Header)
18581	}
18582	return c.header_
18583}
18584
18585func (c *OrganizationsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
18586	reqHeaders := make(http.Header)
18587	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
18588	for k, v := range c.header_ {
18589		reqHeaders[k] = v
18590	}
18591	reqHeaders.Set("User-Agent", c.s.userAgent())
18592	var body io.Reader = nil
18593	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
18594	if err != nil {
18595		return nil, err
18596	}
18597	reqHeaders.Set("Content-Type", "application/json")
18598	c.urlParams_.Set("alt", alt)
18599	c.urlParams_.Set("prettyPrint", "false")
18600	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
18601	urls += "?" + c.urlParams_.Encode()
18602	req, err := http.NewRequest("PATCH", urls, body)
18603	if err != nil {
18604		return nil, err
18605	}
18606	req.Header = reqHeaders
18607	googleapi.Expand(req.URL, map[string]string{
18608		"name": c.name,
18609	})
18610	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18611}
18612
18613// Do executes the "logging.organizations.locations.buckets.views.patch" call.
18614// Exactly one of *LogView or error will be non-nil. Any non-2xx status
18615// code is an error. Response headers are in either
18616// *LogView.ServerResponse.Header or (if a response was returned at all)
18617// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18618// check whether the returned error was because http.StatusNotModified
18619// was returned.
18620func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
18621	gensupport.SetOptions(c.urlParams_, opts...)
18622	res, err := c.doRequest("json")
18623	if res != nil && res.StatusCode == http.StatusNotModified {
18624		if res.Body != nil {
18625			res.Body.Close()
18626		}
18627		return nil, &googleapi.Error{
18628			Code:   res.StatusCode,
18629			Header: res.Header,
18630		}
18631	}
18632	if err != nil {
18633		return nil, err
18634	}
18635	defer googleapi.CloseBody(res)
18636	if err := googleapi.CheckResponse(res); err != nil {
18637		return nil, err
18638	}
18639	ret := &LogView{
18640		ServerResponse: googleapi.ServerResponse{
18641			Header:         res.Header,
18642			HTTPStatusCode: res.StatusCode,
18643		},
18644	}
18645	target := &ret
18646	if err := gensupport.DecodeResponse(target, res); err != nil {
18647		return nil, err
18648	}
18649	return ret, nil
18650	// {
18651	//   "description": "Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.",
18652	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
18653	//   "httpMethod": "PATCH",
18654	//   "id": "logging.organizations.locations.buckets.views.patch",
18655	//   "parameterOrder": [
18656	//     "name"
18657	//   ],
18658	//   "parameters": {
18659	//     "name": {
18660	//       "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
18661	//       "location": "path",
18662	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
18663	//       "required": true,
18664	//       "type": "string"
18665	//     },
18666	//     "updateMask": {
18667	//       "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
18668	//       "format": "google-fieldmask",
18669	//       "location": "query",
18670	//       "type": "string"
18671	//     }
18672	//   },
18673	//   "path": "v2/{+name}",
18674	//   "request": {
18675	//     "$ref": "LogView"
18676	//   },
18677	//   "response": {
18678	//     "$ref": "LogView"
18679	//   },
18680	//   "scopes": [
18681	//     "https://www.googleapis.com/auth/cloud-platform",
18682	//     "https://www.googleapis.com/auth/logging.admin"
18683	//   ]
18684	// }
18685
18686}
18687
18688// method id "logging.organizations.logs.delete":
18689
18690type OrganizationsLogsDeleteCall struct {
18691	s          *Service
18692	logName    string
18693	urlParams_ gensupport.URLParams
18694	ctx_       context.Context
18695	header_    http.Header
18696}
18697
18698// Delete: Deletes all the log entries in a log. The log reappears if it
18699// receives new entries. Log entries written shortly before the delete
18700// operation might not be deleted. Entries received after the delete
18701// operation with a timestamp before the operation will be deleted.
18702func (r *OrganizationsLogsService) Delete(logName string) *OrganizationsLogsDeleteCall {
18703	c := &OrganizationsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18704	c.logName = logName
18705	return c
18706}
18707
18708// Fields allows partial responses to be retrieved. See
18709// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18710// for more information.
18711func (c *OrganizationsLogsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLogsDeleteCall {
18712	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18713	return c
18714}
18715
18716// Context sets the context to be used in this call's Do method. Any
18717// pending HTTP request will be aborted if the provided context is
18718// canceled.
18719func (c *OrganizationsLogsDeleteCall) Context(ctx context.Context) *OrganizationsLogsDeleteCall {
18720	c.ctx_ = ctx
18721	return c
18722}
18723
18724// Header returns an http.Header that can be modified by the caller to
18725// add HTTP headers to the request.
18726func (c *OrganizationsLogsDeleteCall) Header() http.Header {
18727	if c.header_ == nil {
18728		c.header_ = make(http.Header)
18729	}
18730	return c.header_
18731}
18732
18733func (c *OrganizationsLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
18734	reqHeaders := make(http.Header)
18735	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
18736	for k, v := range c.header_ {
18737		reqHeaders[k] = v
18738	}
18739	reqHeaders.Set("User-Agent", c.s.userAgent())
18740	var body io.Reader = nil
18741	c.urlParams_.Set("alt", alt)
18742	c.urlParams_.Set("prettyPrint", "false")
18743	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
18744	urls += "?" + c.urlParams_.Encode()
18745	req, err := http.NewRequest("DELETE", urls, body)
18746	if err != nil {
18747		return nil, err
18748	}
18749	req.Header = reqHeaders
18750	googleapi.Expand(req.URL, map[string]string{
18751		"logName": c.logName,
18752	})
18753	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18754}
18755
18756// Do executes the "logging.organizations.logs.delete" call.
18757// Exactly one of *Empty or error will be non-nil. Any non-2xx status
18758// code is an error. Response headers are in either
18759// *Empty.ServerResponse.Header or (if a response was returned at all)
18760// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18761// check whether the returned error was because http.StatusNotModified
18762// was returned.
18763func (c *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
18764	gensupport.SetOptions(c.urlParams_, opts...)
18765	res, err := c.doRequest("json")
18766	if res != nil && res.StatusCode == http.StatusNotModified {
18767		if res.Body != nil {
18768			res.Body.Close()
18769		}
18770		return nil, &googleapi.Error{
18771			Code:   res.StatusCode,
18772			Header: res.Header,
18773		}
18774	}
18775	if err != nil {
18776		return nil, err
18777	}
18778	defer googleapi.CloseBody(res)
18779	if err := googleapi.CheckResponse(res); err != nil {
18780		return nil, err
18781	}
18782	ret := &Empty{
18783		ServerResponse: googleapi.ServerResponse{
18784			Header:         res.Header,
18785			HTTPStatusCode: res.StatusCode,
18786		},
18787	}
18788	target := &ret
18789	if err := gensupport.DecodeResponse(target, res); err != nil {
18790		return nil, err
18791	}
18792	return ret, nil
18793	// {
18794	//   "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. Entries received after the delete operation with a timestamp before the operation will be deleted.",
18795	//   "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}",
18796	//   "httpMethod": "DELETE",
18797	//   "id": "logging.organizations.logs.delete",
18798	//   "parameterOrder": [
18799	//     "logName"
18800	//   ],
18801	//   "parameters": {
18802	//     "logName": {
18803	//       "description": "Required. The resource name of the log to delete: \"projects/[PROJECT_ID]/logs/[LOG_ID]\" \"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\" \"folders/[FOLDER_ID]/logs/[LOG_ID]\" [LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.",
18804	//       "location": "path",
18805	//       "pattern": "^organizations/[^/]+/logs/[^/]+$",
18806	//       "required": true,
18807	//       "type": "string"
18808	//     }
18809	//   },
18810	//   "path": "v2/{+logName}",
18811	//   "response": {
18812	//     "$ref": "Empty"
18813	//   },
18814	//   "scopes": [
18815	//     "https://www.googleapis.com/auth/cloud-platform",
18816	//     "https://www.googleapis.com/auth/logging.admin"
18817	//   ]
18818	// }
18819
18820}
18821
18822// method id "logging.organizations.logs.list":
18823
18824type OrganizationsLogsListCall struct {
18825	s            *Service
18826	parent       string
18827	urlParams_   gensupport.URLParams
18828	ifNoneMatch_ string
18829	ctx_         context.Context
18830	header_      http.Header
18831}
18832
18833// List: Lists the logs in projects, organizations, folders, or billing
18834// accounts. Only logs that have entries are listed.
18835func (r *OrganizationsLogsService) List(parent string) *OrganizationsLogsListCall {
18836	c := &OrganizationsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18837	c.parent = parent
18838	return c
18839}
18840
18841// PageSize sets the optional parameter "pageSize": The maximum number
18842// of results to return from this request. Non-positive values are
18843// ignored. The presence of nextPageToken in the response indicates that
18844// more results might be available.
18845func (c *OrganizationsLogsListCall) PageSize(pageSize int64) *OrganizationsLogsListCall {
18846	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
18847	return c
18848}
18849
18850// PageToken sets the optional parameter "pageToken": If present, then
18851// retrieve the next batch of results from the preceding call to this
18852// method. pageToken must be the value of nextPageToken from the
18853// previous response. The values of other method parameters should be
18854// identical to those in the previous call.
18855func (c *OrganizationsLogsListCall) PageToken(pageToken string) *OrganizationsLogsListCall {
18856	c.urlParams_.Set("pageToken", pageToken)
18857	return c
18858}
18859
18860// ResourceNames sets the optional parameter "resourceNames": The
18861// resource name that owns the logs:
18862// projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW
18863// _ID
18864// organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/v
18865// iews/VIEW_ID
18866// billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKE
18867// T_ID/views/VIEW_ID
18868// folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_I
18869// DTo support legacy queries, it could also be: "projects/PROJECT_ID"
18870// "organizations/ORGANIZATION_ID" "billingAccounts/BILLING_ACCOUNT_ID"
18871// "folders/FOLDER_ID"
18872func (c *OrganizationsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLogsListCall {
18873	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
18874	return c
18875}
18876
18877// Fields allows partial responses to be retrieved. See
18878// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18879// for more information.
18880func (c *OrganizationsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLogsListCall {
18881	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18882	return c
18883}
18884
18885// IfNoneMatch sets the optional parameter which makes the operation
18886// fail if the object's ETag matches the given value. This is useful for
18887// getting updates only after the object has changed since the last
18888// request. Use googleapi.IsNotModified to check whether the response
18889// error from Do is the result of In-None-Match.
18890func (c *OrganizationsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLogsListCall {
18891	c.ifNoneMatch_ = entityTag
18892	return c
18893}
18894
18895// Context sets the context to be used in this call's Do method. Any
18896// pending HTTP request will be aborted if the provided context is
18897// canceled.
18898func (c *OrganizationsLogsListCall) Context(ctx context.Context) *OrganizationsLogsListCall {
18899	c.ctx_ = ctx
18900	return c
18901}
18902
18903// Header returns an http.Header that can be modified by the caller to
18904// add HTTP headers to the request.
18905func (c *OrganizationsLogsListCall) Header() http.Header {
18906	if c.header_ == nil {
18907		c.header_ = make(http.Header)
18908	}
18909	return c.header_
18910}
18911
18912func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error) {
18913	reqHeaders := make(http.Header)
18914	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
18915	for k, v := range c.header_ {
18916		reqHeaders[k] = v
18917	}
18918	reqHeaders.Set("User-Agent", c.s.userAgent())
18919	if c.ifNoneMatch_ != "" {
18920		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18921	}
18922	var body io.Reader = nil
18923	c.urlParams_.Set("alt", alt)
18924	c.urlParams_.Set("prettyPrint", "false")
18925	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
18926	urls += "?" + c.urlParams_.Encode()
18927	req, err := http.NewRequest("GET", urls, body)
18928	if err != nil {
18929		return nil, err
18930	}
18931	req.Header = reqHeaders
18932	googleapi.Expand(req.URL, map[string]string{
18933		"parent": c.parent,
18934	})
18935	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18936}
18937
18938// Do executes the "logging.organizations.logs.list" call.
18939// Exactly one of *ListLogsResponse or error will be non-nil. Any
18940// non-2xx status code is an error. Response headers are in either
18941// *ListLogsResponse.ServerResponse.Header or (if a response was
18942// returned at all) in error.(*googleapi.Error).Header. Use
18943// googleapi.IsNotModified to check whether the returned error was
18944// because http.StatusNotModified was returned.
18945func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
18946	gensupport.SetOptions(c.urlParams_, opts...)
18947	res, err := c.doRequest("json")
18948	if res != nil && res.StatusCode == http.StatusNotModified {
18949		if res.Body != nil {
18950			res.Body.Close()
18951		}
18952		return nil, &googleapi.Error{
18953			Code:   res.StatusCode,
18954			Header: res.Header,
18955		}
18956	}
18957	if err != nil {
18958		return nil, err
18959	}
18960	defer googleapi.CloseBody(res)
18961	if err := googleapi.CheckResponse(res); err != nil {
18962		return nil, err
18963	}
18964	ret := &ListLogsResponse{
18965		ServerResponse: googleapi.ServerResponse{
18966			Header:         res.Header,
18967			HTTPStatusCode: res.StatusCode,
18968		},
18969	}
18970	target := &ret
18971	if err := gensupport.DecodeResponse(target, res); err != nil {
18972		return nil, err
18973	}
18974	return ret, nil
18975	// {
18976	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
18977	//   "flatPath": "v2/organizations/{organizationsId}/logs",
18978	//   "httpMethod": "GET",
18979	//   "id": "logging.organizations.logs.list",
18980	//   "parameterOrder": [
18981	//     "parent"
18982	//   ],
18983	//   "parameters": {
18984	//     "pageSize": {
18985	//       "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.",
18986	//       "format": "int32",
18987	//       "location": "query",
18988	//       "type": "integer"
18989	//     },
18990	//     "pageToken": {
18991	//       "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.",
18992	//       "location": "query",
18993	//       "type": "string"
18994	//     },
18995	//     "parent": {
18996	//       "description": "Required. The resource name that owns the logs: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
18997	//       "location": "path",
18998	//       "pattern": "^organizations/[^/]+$",
18999	//       "required": true,
19000	//       "type": "string"
19001	//     },
19002	//     "resourceNames": {
19003	//       "description": "Optional. The resource name that owns the logs: projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_IDTo support legacy queries, it could also be: \"projects/PROJECT_ID\" \"organizations/ORGANIZATION_ID\" \"billingAccounts/BILLING_ACCOUNT_ID\" \"folders/FOLDER_ID\"",
19004	//       "location": "query",
19005	//       "repeated": true,
19006	//       "type": "string"
19007	//     }
19008	//   },
19009	//   "path": "v2/{+parent}/logs",
19010	//   "response": {
19011	//     "$ref": "ListLogsResponse"
19012	//   },
19013	//   "scopes": [
19014	//     "https://www.googleapis.com/auth/cloud-platform",
19015	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
19016	//     "https://www.googleapis.com/auth/logging.admin",
19017	//     "https://www.googleapis.com/auth/logging.read"
19018	//   ]
19019	// }
19020
19021}
19022
19023// Pages invokes f for each page of results.
19024// A non-nil error returned from f will halt the iteration.
19025// The provided context supersedes any context provided to the Context method.
19026func (c *OrganizationsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
19027	c.ctx_ = ctx
19028	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
19029	for {
19030		x, err := c.Do()
19031		if err != nil {
19032			return err
19033		}
19034		if err := f(x); err != nil {
19035			return err
19036		}
19037		if x.NextPageToken == "" {
19038			return nil
19039		}
19040		c.PageToken(x.NextPageToken)
19041	}
19042}
19043
19044// method id "logging.organizations.sinks.create":
19045
19046type OrganizationsSinksCreateCall struct {
19047	s          *Service
19048	parent     string
19049	logsink    *LogSink
19050	urlParams_ gensupport.URLParams
19051	ctx_       context.Context
19052	header_    http.Header
19053}
19054
19055// Create: Creates a sink that exports specified log entries to a
19056// destination. The export of newly-ingested log entries begins
19057// immediately, unless the sink's writer_identity is not permitted to
19058// write to the destination. A sink can export log entries only from the
19059// resource owning the sink.
19060func (r *OrganizationsSinksService) Create(parent string, logsink *LogSink) *OrganizationsSinksCreateCall {
19061	c := &OrganizationsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19062	c.parent = parent
19063	c.logsink = logsink
19064	return c
19065}
19066
19067// UniqueWriterIdentity sets the optional parameter
19068// "uniqueWriterIdentity": Determines the kind of IAM identity returned
19069// as writer_identity in the new sink. If this value is omitted or set
19070// to false, and if the sink's parent is a project, then the value
19071// returned as writer_identity is the same group or service account used
19072// by Logging before the addition of writer identities to this API. The
19073// sink's destination must be in the same project as the sink itself.If
19074// this field is set to true, or if the sink is owned by a non-project
19075// resource such as an organization, then the value of writer_identity
19076// will be a unique service account used only for exports from the new
19077// sink. For more information, see writer_identity in LogSink.
19078func (c *OrganizationsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksCreateCall {
19079	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
19080	return c
19081}
19082
19083// Fields allows partial responses to be retrieved. See
19084// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19085// for more information.
19086func (c *OrganizationsSinksCreateCall) Fields(s ...googleapi.Field) *OrganizationsSinksCreateCall {
19087	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19088	return c
19089}
19090
19091// Context sets the context to be used in this call's Do method. Any
19092// pending HTTP request will be aborted if the provided context is
19093// canceled.
19094func (c *OrganizationsSinksCreateCall) Context(ctx context.Context) *OrganizationsSinksCreateCall {
19095	c.ctx_ = ctx
19096	return c
19097}
19098
19099// Header returns an http.Header that can be modified by the caller to
19100// add HTTP headers to the request.
19101func (c *OrganizationsSinksCreateCall) Header() http.Header {
19102	if c.header_ == nil {
19103		c.header_ = make(http.Header)
19104	}
19105	return c.header_
19106}
19107
19108func (c *OrganizationsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
19109	reqHeaders := make(http.Header)
19110	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
19111	for k, v := range c.header_ {
19112		reqHeaders[k] = v
19113	}
19114	reqHeaders.Set("User-Agent", c.s.userAgent())
19115	var body io.Reader = nil
19116	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
19117	if err != nil {
19118		return nil, err
19119	}
19120	reqHeaders.Set("Content-Type", "application/json")
19121	c.urlParams_.Set("alt", alt)
19122	c.urlParams_.Set("prettyPrint", "false")
19123	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
19124	urls += "?" + c.urlParams_.Encode()
19125	req, err := http.NewRequest("POST", urls, body)
19126	if err != nil {
19127		return nil, err
19128	}
19129	req.Header = reqHeaders
19130	googleapi.Expand(req.URL, map[string]string{
19131		"parent": c.parent,
19132	})
19133	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19134}
19135
19136// Do executes the "logging.organizations.sinks.create" call.
19137// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
19138// code is an error. Response headers are in either
19139// *LogSink.ServerResponse.Header or (if a response was returned at all)
19140// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19141// check whether the returned error was because http.StatusNotModified
19142// was returned.
19143func (c *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
19144	gensupport.SetOptions(c.urlParams_, opts...)
19145	res, err := c.doRequest("json")
19146	if res != nil && res.StatusCode == http.StatusNotModified {
19147		if res.Body != nil {
19148			res.Body.Close()
19149		}
19150		return nil, &googleapi.Error{
19151			Code:   res.StatusCode,
19152			Header: res.Header,
19153		}
19154	}
19155	if err != nil {
19156		return nil, err
19157	}
19158	defer googleapi.CloseBody(res)
19159	if err := googleapi.CheckResponse(res); err != nil {
19160		return nil, err
19161	}
19162	ret := &LogSink{
19163		ServerResponse: googleapi.ServerResponse{
19164			Header:         res.Header,
19165			HTTPStatusCode: res.StatusCode,
19166		},
19167	}
19168	target := &ret
19169	if err := gensupport.DecodeResponse(target, res); err != nil {
19170		return nil, err
19171	}
19172	return ret, nil
19173	// {
19174	//   "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.",
19175	//   "flatPath": "v2/organizations/{organizationsId}/sinks",
19176	//   "httpMethod": "POST",
19177	//   "id": "logging.organizations.sinks.create",
19178	//   "parameterOrder": [
19179	//     "parent"
19180	//   ],
19181	//   "parameters": {
19182	//     "parent": {
19183	//       "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" Examples: \"projects/my-logging-project\", \"organizations/123456789\".",
19184	//       "location": "path",
19185	//       "pattern": "^organizations/[^/]+$",
19186	//       "required": true,
19187	//       "type": "string"
19188	//     },
19189	//     "uniqueWriterIdentity": {
19190	//       "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.",
19191	//       "location": "query",
19192	//       "type": "boolean"
19193	//     }
19194	//   },
19195	//   "path": "v2/{+parent}/sinks",
19196	//   "request": {
19197	//     "$ref": "LogSink"
19198	//   },
19199	//   "response": {
19200	//     "$ref": "LogSink"
19201	//   },
19202	//   "scopes": [
19203	//     "https://www.googleapis.com/auth/cloud-platform",
19204	//     "https://www.googleapis.com/auth/logging.admin"
19205	//   ]
19206	// }
19207
19208}
19209
19210// method id "logging.organizations.sinks.delete":
19211
19212type OrganizationsSinksDeleteCall struct {
19213	s          *Service
19214	sinkNameid string
19215	urlParams_ gensupport.URLParams
19216	ctx_       context.Context
19217	header_    http.Header
19218}
19219
19220// Delete: Deletes a sink. If the sink has a unique writer_identity,
19221// then that service account is also deleted.
19222func (r *OrganizationsSinksService) Delete(sinkNameid string) *OrganizationsSinksDeleteCall {
19223	c := &OrganizationsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19224	c.sinkNameid = sinkNameid
19225	return c
19226}
19227
19228// Fields allows partial responses to be retrieved. See
19229// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19230// for more information.
19231func (c *OrganizationsSinksDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSinksDeleteCall {
19232	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19233	return c
19234}
19235
19236// Context sets the context to be used in this call's Do method. Any
19237// pending HTTP request will be aborted if the provided context is
19238// canceled.
19239func (c *OrganizationsSinksDeleteCall) Context(ctx context.Context) *OrganizationsSinksDeleteCall {
19240	c.ctx_ = ctx
19241	return c
19242}
19243
19244// Header returns an http.Header that can be modified by the caller to
19245// add HTTP headers to the request.
19246func (c *OrganizationsSinksDeleteCall) Header() http.Header {
19247	if c.header_ == nil {
19248		c.header_ = make(http.Header)
19249	}
19250	return c.header_
19251}
19252
19253func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
19254	reqHeaders := make(http.Header)
19255	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
19256	for k, v := range c.header_ {
19257		reqHeaders[k] = v
19258	}
19259	reqHeaders.Set("User-Agent", c.s.userAgent())
19260	var body io.Reader = nil
19261	c.urlParams_.Set("alt", alt)
19262	c.urlParams_.Set("prettyPrint", "false")
19263	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
19264	urls += "?" + c.urlParams_.Encode()
19265	req, err := http.NewRequest("DELETE", urls, body)
19266	if err != nil {
19267		return nil, err
19268	}
19269	req.Header = reqHeaders
19270	googleapi.Expand(req.URL, map[string]string{
19271		"sinkName": c.sinkNameid,
19272	})
19273	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19274}
19275
19276// Do executes the "logging.organizations.sinks.delete" call.
19277// Exactly one of *Empty or error will be non-nil. Any non-2xx status
19278// code is an error. Response headers are in either
19279// *Empty.ServerResponse.Header or (if a response was returned at all)
19280// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19281// check whether the returned error was because http.StatusNotModified
19282// was returned.
19283func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
19284	gensupport.SetOptions(c.urlParams_, opts...)
19285	res, err := c.doRequest("json")
19286	if res != nil && res.StatusCode == http.StatusNotModified {
19287		if res.Body != nil {
19288			res.Body.Close()
19289		}
19290		return nil, &googleapi.Error{
19291			Code:   res.StatusCode,
19292			Header: res.Header,
19293		}
19294	}
19295	if err != nil {
19296		return nil, err
19297	}
19298	defer googleapi.CloseBody(res)
19299	if err := googleapi.CheckResponse(res); err != nil {
19300		return nil, err
19301	}
19302	ret := &Empty{
19303		ServerResponse: googleapi.ServerResponse{
19304			Header:         res.Header,
19305			HTTPStatusCode: res.StatusCode,
19306		},
19307	}
19308	target := &ret
19309	if err := gensupport.DecodeResponse(target, res); err != nil {
19310		return nil, err
19311	}
19312	return ret, nil
19313	// {
19314	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
19315	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
19316	//   "httpMethod": "DELETE",
19317	//   "id": "logging.organizations.sinks.delete",
19318	//   "parameterOrder": [
19319	//     "sinkName"
19320	//   ],
19321	//   "parameters": {
19322	//     "sinkName": {
19323	//       "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
19324	//       "location": "path",
19325	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
19326	//       "required": true,
19327	//       "type": "string"
19328	//     }
19329	//   },
19330	//   "path": "v2/{+sinkName}",
19331	//   "response": {
19332	//     "$ref": "Empty"
19333	//   },
19334	//   "scopes": [
19335	//     "https://www.googleapis.com/auth/cloud-platform",
19336	//     "https://www.googleapis.com/auth/logging.admin"
19337	//   ]
19338	// }
19339
19340}
19341
19342// method id "logging.organizations.sinks.get":
19343
19344type OrganizationsSinksGetCall struct {
19345	s            *Service
19346	sinkName     string
19347	urlParams_   gensupport.URLParams
19348	ifNoneMatch_ string
19349	ctx_         context.Context
19350	header_      http.Header
19351}
19352
19353// Get: Gets a sink.
19354func (r *OrganizationsSinksService) Get(sinkName string) *OrganizationsSinksGetCall {
19355	c := &OrganizationsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19356	c.sinkName = sinkName
19357	return c
19358}
19359
19360// Fields allows partial responses to be retrieved. See
19361// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19362// for more information.
19363func (c *OrganizationsSinksGetCall) Fields(s ...googleapi.Field) *OrganizationsSinksGetCall {
19364	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19365	return c
19366}
19367
19368// IfNoneMatch sets the optional parameter which makes the operation
19369// fail if the object's ETag matches the given value. This is useful for
19370// getting updates only after the object has changed since the last
19371// request. Use googleapi.IsNotModified to check whether the response
19372// error from Do is the result of In-None-Match.
19373func (c *OrganizationsSinksGetCall) IfNoneMatch(entityTag string) *OrganizationsSinksGetCall {
19374	c.ifNoneMatch_ = entityTag
19375	return c
19376}
19377
19378// Context sets the context to be used in this call's Do method. Any
19379// pending HTTP request will be aborted if the provided context is
19380// canceled.
19381func (c *OrganizationsSinksGetCall) Context(ctx context.Context) *OrganizationsSinksGetCall {
19382	c.ctx_ = ctx
19383	return c
19384}
19385
19386// Header returns an http.Header that can be modified by the caller to
19387// add HTTP headers to the request.
19388func (c *OrganizationsSinksGetCall) Header() http.Header {
19389	if c.header_ == nil {
19390		c.header_ = make(http.Header)
19391	}
19392	return c.header_
19393}
19394
19395func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error) {
19396	reqHeaders := make(http.Header)
19397	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
19398	for k, v := range c.header_ {
19399		reqHeaders[k] = v
19400	}
19401	reqHeaders.Set("User-Agent", c.s.userAgent())
19402	if c.ifNoneMatch_ != "" {
19403		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
19404	}
19405	var body io.Reader = nil
19406	c.urlParams_.Set("alt", alt)
19407	c.urlParams_.Set("prettyPrint", "false")
19408	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
19409	urls += "?" + c.urlParams_.Encode()
19410	req, err := http.NewRequest("GET", urls, body)
19411	if err != nil {
19412		return nil, err
19413	}
19414	req.Header = reqHeaders
19415	googleapi.Expand(req.URL, map[string]string{
19416		"sinkName": c.sinkName,
19417	})
19418	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19419}
19420
19421// Do executes the "logging.organizations.sinks.get" call.
19422// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
19423// code is an error. Response headers are in either
19424// *LogSink.ServerResponse.Header or (if a response was returned at all)
19425// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19426// check whether the returned error was because http.StatusNotModified
19427// was returned.
19428func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
19429	gensupport.SetOptions(c.urlParams_, opts...)
19430	res, err := c.doRequest("json")
19431	if res != nil && res.StatusCode == http.StatusNotModified {
19432		if res.Body != nil {
19433			res.Body.Close()
19434		}
19435		return nil, &googleapi.Error{
19436			Code:   res.StatusCode,
19437			Header: res.Header,
19438		}
19439	}
19440	if err != nil {
19441		return nil, err
19442	}
19443	defer googleapi.CloseBody(res)
19444	if err := googleapi.CheckResponse(res); err != nil {
19445		return nil, err
19446	}
19447	ret := &LogSink{
19448		ServerResponse: googleapi.ServerResponse{
19449			Header:         res.Header,
19450			HTTPStatusCode: res.StatusCode,
19451		},
19452	}
19453	target := &ret
19454	if err := gensupport.DecodeResponse(target, res); err != nil {
19455		return nil, err
19456	}
19457	return ret, nil
19458	// {
19459	//   "description": "Gets a sink.",
19460	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
19461	//   "httpMethod": "GET",
19462	//   "id": "logging.organizations.sinks.get",
19463	//   "parameterOrder": [
19464	//     "sinkName"
19465	//   ],
19466	//   "parameters": {
19467	//     "sinkName": {
19468	//       "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
19469	//       "location": "path",
19470	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
19471	//       "required": true,
19472	//       "type": "string"
19473	//     }
19474	//   },
19475	//   "path": "v2/{+sinkName}",
19476	//   "response": {
19477	//     "$ref": "LogSink"
19478	//   },
19479	//   "scopes": [
19480	//     "https://www.googleapis.com/auth/cloud-platform",
19481	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
19482	//     "https://www.googleapis.com/auth/logging.admin",
19483	//     "https://www.googleapis.com/auth/logging.read"
19484	//   ]
19485	// }
19486
19487}
19488
19489// method id "logging.organizations.sinks.list":
19490
19491type OrganizationsSinksListCall struct {
19492	s            *Service
19493	parent       string
19494	urlParams_   gensupport.URLParams
19495	ifNoneMatch_ string
19496	ctx_         context.Context
19497	header_      http.Header
19498}
19499
19500// List: Lists sinks.
19501func (r *OrganizationsSinksService) List(parent string) *OrganizationsSinksListCall {
19502	c := &OrganizationsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19503	c.parent = parent
19504	return c
19505}
19506
19507// PageSize sets the optional parameter "pageSize": The maximum number
19508// of results to return from this request. Non-positive values are
19509// ignored. The presence of nextPageToken in the response indicates that
19510// more results might be available.
19511func (c *OrganizationsSinksListCall) PageSize(pageSize int64) *OrganizationsSinksListCall {
19512	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
19513	return c
19514}
19515
19516// PageToken sets the optional parameter "pageToken": If present, then
19517// retrieve the next batch of results from the preceding call to this
19518// method. pageToken must be the value of nextPageToken from the
19519// previous response. The values of other method parameters should be
19520// identical to those in the previous call.
19521func (c *OrganizationsSinksListCall) PageToken(pageToken string) *OrganizationsSinksListCall {
19522	c.urlParams_.Set("pageToken", pageToken)
19523	return c
19524}
19525
19526// Fields allows partial responses to be retrieved. See
19527// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19528// for more information.
19529func (c *OrganizationsSinksListCall) Fields(s ...googleapi.Field) *OrganizationsSinksListCall {
19530	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19531	return c
19532}
19533
19534// IfNoneMatch sets the optional parameter which makes the operation
19535// fail if the object's ETag matches the given value. This is useful for
19536// getting updates only after the object has changed since the last
19537// request. Use googleapi.IsNotModified to check whether the response
19538// error from Do is the result of In-None-Match.
19539func (c *OrganizationsSinksListCall) IfNoneMatch(entityTag string) *OrganizationsSinksListCall {
19540	c.ifNoneMatch_ = entityTag
19541	return c
19542}
19543
19544// Context sets the context to be used in this call's Do method. Any
19545// pending HTTP request will be aborted if the provided context is
19546// canceled.
19547func (c *OrganizationsSinksListCall) Context(ctx context.Context) *OrganizationsSinksListCall {
19548	c.ctx_ = ctx
19549	return c
19550}
19551
19552// Header returns an http.Header that can be modified by the caller to
19553// add HTTP headers to the request.
19554func (c *OrganizationsSinksListCall) Header() http.Header {
19555	if c.header_ == nil {
19556		c.header_ = make(http.Header)
19557	}
19558	return c.header_
19559}
19560
19561func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, error) {
19562	reqHeaders := make(http.Header)
19563	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
19564	for k, v := range c.header_ {
19565		reqHeaders[k] = v
19566	}
19567	reqHeaders.Set("User-Agent", c.s.userAgent())
19568	if c.ifNoneMatch_ != "" {
19569		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
19570	}
19571	var body io.Reader = nil
19572	c.urlParams_.Set("alt", alt)
19573	c.urlParams_.Set("prettyPrint", "false")
19574	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
19575	urls += "?" + c.urlParams_.Encode()
19576	req, err := http.NewRequest("GET", urls, body)
19577	if err != nil {
19578		return nil, err
19579	}
19580	req.Header = reqHeaders
19581	googleapi.Expand(req.URL, map[string]string{
19582		"parent": c.parent,
19583	})
19584	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19585}
19586
19587// Do executes the "logging.organizations.sinks.list" call.
19588// Exactly one of *ListSinksResponse or error will be non-nil. Any
19589// non-2xx status code is an error. Response headers are in either
19590// *ListSinksResponse.ServerResponse.Header or (if a response was
19591// returned at all) in error.(*googleapi.Error).Header. Use
19592// googleapi.IsNotModified to check whether the returned error was
19593// because http.StatusNotModified was returned.
19594func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
19595	gensupport.SetOptions(c.urlParams_, opts...)
19596	res, err := c.doRequest("json")
19597	if res != nil && res.StatusCode == http.StatusNotModified {
19598		if res.Body != nil {
19599			res.Body.Close()
19600		}
19601		return nil, &googleapi.Error{
19602			Code:   res.StatusCode,
19603			Header: res.Header,
19604		}
19605	}
19606	if err != nil {
19607		return nil, err
19608	}
19609	defer googleapi.CloseBody(res)
19610	if err := googleapi.CheckResponse(res); err != nil {
19611		return nil, err
19612	}
19613	ret := &ListSinksResponse{
19614		ServerResponse: googleapi.ServerResponse{
19615			Header:         res.Header,
19616			HTTPStatusCode: res.StatusCode,
19617		},
19618	}
19619	target := &ret
19620	if err := gensupport.DecodeResponse(target, res); err != nil {
19621		return nil, err
19622	}
19623	return ret, nil
19624	// {
19625	//   "description": "Lists sinks.",
19626	//   "flatPath": "v2/organizations/{organizationsId}/sinks",
19627	//   "httpMethod": "GET",
19628	//   "id": "logging.organizations.sinks.list",
19629	//   "parameterOrder": [
19630	//     "parent"
19631	//   ],
19632	//   "parameters": {
19633	//     "pageSize": {
19634	//       "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.",
19635	//       "format": "int32",
19636	//       "location": "query",
19637	//       "type": "integer"
19638	//     },
19639	//     "pageToken": {
19640	//       "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.",
19641	//       "location": "query",
19642	//       "type": "string"
19643	//     },
19644	//     "parent": {
19645	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
19646	//       "location": "path",
19647	//       "pattern": "^organizations/[^/]+$",
19648	//       "required": true,
19649	//       "type": "string"
19650	//     }
19651	//   },
19652	//   "path": "v2/{+parent}/sinks",
19653	//   "response": {
19654	//     "$ref": "ListSinksResponse"
19655	//   },
19656	//   "scopes": [
19657	//     "https://www.googleapis.com/auth/cloud-platform",
19658	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
19659	//     "https://www.googleapis.com/auth/logging.admin",
19660	//     "https://www.googleapis.com/auth/logging.read"
19661	//   ]
19662	// }
19663
19664}
19665
19666// Pages invokes f for each page of results.
19667// A non-nil error returned from f will halt the iteration.
19668// The provided context supersedes any context provided to the Context method.
19669func (c *OrganizationsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
19670	c.ctx_ = ctx
19671	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
19672	for {
19673		x, err := c.Do()
19674		if err != nil {
19675			return err
19676		}
19677		if err := f(x); err != nil {
19678			return err
19679		}
19680		if x.NextPageToken == "" {
19681			return nil
19682		}
19683		c.PageToken(x.NextPageToken)
19684	}
19685}
19686
19687// method id "logging.organizations.sinks.patch":
19688
19689type OrganizationsSinksPatchCall struct {
19690	s          *Service
19691	sinkNameid string
19692	logsink    *LogSink
19693	urlParams_ gensupport.URLParams
19694	ctx_       context.Context
19695	header_    http.Header
19696}
19697
19698// Patch: Updates a sink. This method replaces the following fields in
19699// the existing sink with values from the new sink: destination, and
19700// filter.The updated sink might also have a new writer_identity; see
19701// the unique_writer_identity field.
19702func (r *OrganizationsSinksService) Patch(sinkNameid string, logsink *LogSink) *OrganizationsSinksPatchCall {
19703	c := &OrganizationsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19704	c.sinkNameid = sinkNameid
19705	c.logsink = logsink
19706	return c
19707}
19708
19709// UniqueWriterIdentity sets the optional parameter
19710// "uniqueWriterIdentity": See sinks.create for a description of this
19711// field. When updating a sink, the effect of this field on the value of
19712// writer_identity in the updated sink depends on both the old and new
19713// values of this field: If the old and new values of this field are
19714// both false or both true, then there is no change to the sink's
19715// writer_identity. If the old value is false and the new value is true,
19716// then writer_identity is changed to a unique service account. It is an
19717// error if the old value is true and the new value is set to false or
19718// defaulted to false.
19719func (c *OrganizationsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksPatchCall {
19720	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
19721	return c
19722}
19723
19724// UpdateMask sets the optional parameter "updateMask": Field mask that
19725// specifies the fields in sink that need an update. A sink field will
19726// be overwritten if, and only if, it is in the update mask. name and
19727// output only fields cannot be updated.An empty updateMask is
19728// temporarily treated as using the following mask for backwards
19729// compatibility purposes: destination,filter,includeChildren At some
19730// point in the future, behavior will be removed and specifying an empty
19731// updateMask will be an error.For a detailed FieldMask definition, see
19732// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
19733// updateMask=filter.
19734func (c *OrganizationsSinksPatchCall) UpdateMask(updateMask string) *OrganizationsSinksPatchCall {
19735	c.urlParams_.Set("updateMask", updateMask)
19736	return c
19737}
19738
19739// Fields allows partial responses to be retrieved. See
19740// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19741// for more information.
19742func (c *OrganizationsSinksPatchCall) Fields(s ...googleapi.Field) *OrganizationsSinksPatchCall {
19743	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19744	return c
19745}
19746
19747// Context sets the context to be used in this call's Do method. Any
19748// pending HTTP request will be aborted if the provided context is
19749// canceled.
19750func (c *OrganizationsSinksPatchCall) Context(ctx context.Context) *OrganizationsSinksPatchCall {
19751	c.ctx_ = ctx
19752	return c
19753}
19754
19755// Header returns an http.Header that can be modified by the caller to
19756// add HTTP headers to the request.
19757func (c *OrganizationsSinksPatchCall) Header() http.Header {
19758	if c.header_ == nil {
19759		c.header_ = make(http.Header)
19760	}
19761	return c.header_
19762}
19763
19764func (c *OrganizationsSinksPatchCall) doRequest(alt string) (*http.Response, error) {
19765	reqHeaders := make(http.Header)
19766	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
19767	for k, v := range c.header_ {
19768		reqHeaders[k] = v
19769	}
19770	reqHeaders.Set("User-Agent", c.s.userAgent())
19771	var body io.Reader = nil
19772	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
19773	if err != nil {
19774		return nil, err
19775	}
19776	reqHeaders.Set("Content-Type", "application/json")
19777	c.urlParams_.Set("alt", alt)
19778	c.urlParams_.Set("prettyPrint", "false")
19779	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
19780	urls += "?" + c.urlParams_.Encode()
19781	req, err := http.NewRequest("PATCH", urls, body)
19782	if err != nil {
19783		return nil, err
19784	}
19785	req.Header = reqHeaders
19786	googleapi.Expand(req.URL, map[string]string{
19787		"sinkName": c.sinkNameid,
19788	})
19789	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19790}
19791
19792// Do executes the "logging.organizations.sinks.patch" call.
19793// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
19794// code is an error. Response headers are in either
19795// *LogSink.ServerResponse.Header or (if a response was returned at all)
19796// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19797// check whether the returned error was because http.StatusNotModified
19798// was returned.
19799func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
19800	gensupport.SetOptions(c.urlParams_, opts...)
19801	res, err := c.doRequest("json")
19802	if res != nil && res.StatusCode == http.StatusNotModified {
19803		if res.Body != nil {
19804			res.Body.Close()
19805		}
19806		return nil, &googleapi.Error{
19807			Code:   res.StatusCode,
19808			Header: res.Header,
19809		}
19810	}
19811	if err != nil {
19812		return nil, err
19813	}
19814	defer googleapi.CloseBody(res)
19815	if err := googleapi.CheckResponse(res); err != nil {
19816		return nil, err
19817	}
19818	ret := &LogSink{
19819		ServerResponse: googleapi.ServerResponse{
19820			Header:         res.Header,
19821			HTTPStatusCode: res.StatusCode,
19822		},
19823	}
19824	target := &ret
19825	if err := gensupport.DecodeResponse(target, res); err != nil {
19826		return nil, err
19827	}
19828	return ret, nil
19829	// {
19830	//   "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.",
19831	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
19832	//   "httpMethod": "PATCH",
19833	//   "id": "logging.organizations.sinks.patch",
19834	//   "parameterOrder": [
19835	//     "sinkName"
19836	//   ],
19837	//   "parameters": {
19838	//     "sinkName": {
19839	//       "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
19840	//       "location": "path",
19841	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
19842	//       "required": true,
19843	//       "type": "string"
19844	//     },
19845	//     "uniqueWriterIdentity": {
19846	//       "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: 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.",
19847	//       "location": "query",
19848	//       "type": "boolean"
19849	//     },
19850	//     "updateMask": {
19851	//       "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.",
19852	//       "format": "google-fieldmask",
19853	//       "location": "query",
19854	//       "type": "string"
19855	//     }
19856	//   },
19857	//   "path": "v2/{+sinkName}",
19858	//   "request": {
19859	//     "$ref": "LogSink"
19860	//   },
19861	//   "response": {
19862	//     "$ref": "LogSink"
19863	//   },
19864	//   "scopes": [
19865	//     "https://www.googleapis.com/auth/cloud-platform",
19866	//     "https://www.googleapis.com/auth/logging.admin"
19867	//   ]
19868	// }
19869
19870}
19871
19872// method id "logging.organizations.sinks.update":
19873
19874type OrganizationsSinksUpdateCall struct {
19875	s          *Service
19876	sinkNameid string
19877	logsink    *LogSink
19878	urlParams_ gensupport.URLParams
19879	ctx_       context.Context
19880	header_    http.Header
19881}
19882
19883// Update: Updates a sink. This method replaces the following fields in
19884// the existing sink with values from the new sink: destination, and
19885// filter.The updated sink might also have a new writer_identity; see
19886// the unique_writer_identity field.
19887func (r *OrganizationsSinksService) Update(sinkNameid string, logsink *LogSink) *OrganizationsSinksUpdateCall {
19888	c := &OrganizationsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19889	c.sinkNameid = sinkNameid
19890	c.logsink = logsink
19891	return c
19892}
19893
19894// UniqueWriterIdentity sets the optional parameter
19895// "uniqueWriterIdentity": See sinks.create for a description of this
19896// field. When updating a sink, the effect of this field on the value of
19897// writer_identity in the updated sink depends on both the old and new
19898// values of this field: If the old and new values of this field are
19899// both false or both true, then there is no change to the sink's
19900// writer_identity. If the old value is false and the new value is true,
19901// then writer_identity is changed to a unique service account. It is an
19902// error if the old value is true and the new value is set to false or
19903// defaulted to false.
19904func (c *OrganizationsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksUpdateCall {
19905	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
19906	return c
19907}
19908
19909// UpdateMask sets the optional parameter "updateMask": Field mask that
19910// specifies the fields in sink that need an update. A sink field will
19911// be overwritten if, and only if, it is in the update mask. name and
19912// output only fields cannot be updated.An empty updateMask is
19913// temporarily treated as using the following mask for backwards
19914// compatibility purposes: destination,filter,includeChildren At some
19915// point in the future, behavior will be removed and specifying an empty
19916// updateMask will be an error.For a detailed FieldMask definition, see
19917// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
19918// updateMask=filter.
19919func (c *OrganizationsSinksUpdateCall) UpdateMask(updateMask string) *OrganizationsSinksUpdateCall {
19920	c.urlParams_.Set("updateMask", updateMask)
19921	return c
19922}
19923
19924// Fields allows partial responses to be retrieved. See
19925// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19926// for more information.
19927func (c *OrganizationsSinksUpdateCall) Fields(s ...googleapi.Field) *OrganizationsSinksUpdateCall {
19928	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19929	return c
19930}
19931
19932// Context sets the context to be used in this call's Do method. Any
19933// pending HTTP request will be aborted if the provided context is
19934// canceled.
19935func (c *OrganizationsSinksUpdateCall) Context(ctx context.Context) *OrganizationsSinksUpdateCall {
19936	c.ctx_ = ctx
19937	return c
19938}
19939
19940// Header returns an http.Header that can be modified by the caller to
19941// add HTTP headers to the request.
19942func (c *OrganizationsSinksUpdateCall) Header() http.Header {
19943	if c.header_ == nil {
19944		c.header_ = make(http.Header)
19945	}
19946	return c.header_
19947}
19948
19949func (c *OrganizationsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
19950	reqHeaders := make(http.Header)
19951	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
19952	for k, v := range c.header_ {
19953		reqHeaders[k] = v
19954	}
19955	reqHeaders.Set("User-Agent", c.s.userAgent())
19956	var body io.Reader = nil
19957	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
19958	if err != nil {
19959		return nil, err
19960	}
19961	reqHeaders.Set("Content-Type", "application/json")
19962	c.urlParams_.Set("alt", alt)
19963	c.urlParams_.Set("prettyPrint", "false")
19964	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
19965	urls += "?" + c.urlParams_.Encode()
19966	req, err := http.NewRequest("PUT", urls, body)
19967	if err != nil {
19968		return nil, err
19969	}
19970	req.Header = reqHeaders
19971	googleapi.Expand(req.URL, map[string]string{
19972		"sinkName": c.sinkNameid,
19973	})
19974	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19975}
19976
19977// Do executes the "logging.organizations.sinks.update" call.
19978// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
19979// code is an error. Response headers are in either
19980// *LogSink.ServerResponse.Header or (if a response was returned at all)
19981// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19982// check whether the returned error was because http.StatusNotModified
19983// was returned.
19984func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
19985	gensupport.SetOptions(c.urlParams_, opts...)
19986	res, err := c.doRequest("json")
19987	if res != nil && res.StatusCode == http.StatusNotModified {
19988		if res.Body != nil {
19989			res.Body.Close()
19990		}
19991		return nil, &googleapi.Error{
19992			Code:   res.StatusCode,
19993			Header: res.Header,
19994		}
19995	}
19996	if err != nil {
19997		return nil, err
19998	}
19999	defer googleapi.CloseBody(res)
20000	if err := googleapi.CheckResponse(res); err != nil {
20001		return nil, err
20002	}
20003	ret := &LogSink{
20004		ServerResponse: googleapi.ServerResponse{
20005			Header:         res.Header,
20006			HTTPStatusCode: res.StatusCode,
20007		},
20008	}
20009	target := &ret
20010	if err := gensupport.DecodeResponse(target, res); err != nil {
20011		return nil, err
20012	}
20013	return ret, nil
20014	// {
20015	//   "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.",
20016	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
20017	//   "httpMethod": "PUT",
20018	//   "id": "logging.organizations.sinks.update",
20019	//   "parameterOrder": [
20020	//     "sinkName"
20021	//   ],
20022	//   "parameters": {
20023	//     "sinkName": {
20024	//       "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
20025	//       "location": "path",
20026	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
20027	//       "required": true,
20028	//       "type": "string"
20029	//     },
20030	//     "uniqueWriterIdentity": {
20031	//       "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: 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.",
20032	//       "location": "query",
20033	//       "type": "boolean"
20034	//     },
20035	//     "updateMask": {
20036	//       "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.",
20037	//       "format": "google-fieldmask",
20038	//       "location": "query",
20039	//       "type": "string"
20040	//     }
20041	//   },
20042	//   "path": "v2/{+sinkName}",
20043	//   "request": {
20044	//     "$ref": "LogSink"
20045	//   },
20046	//   "response": {
20047	//     "$ref": "LogSink"
20048	//   },
20049	//   "scopes": [
20050	//     "https://www.googleapis.com/auth/cloud-platform",
20051	//     "https://www.googleapis.com/auth/logging.admin"
20052	//   ]
20053	// }
20054
20055}
20056
20057// method id "logging.projects.exclusions.create":
20058
20059type ProjectsExclusionsCreateCall struct {
20060	s            *Service
20061	parent       string
20062	logexclusion *LogExclusion
20063	urlParams_   gensupport.URLParams
20064	ctx_         context.Context
20065	header_      http.Header
20066}
20067
20068// Create: Creates a new exclusion in a specified parent resource. Only
20069// log entries belonging to that resource can be excluded. You can have
20070// up to 10 exclusions in a resource.
20071func (r *ProjectsExclusionsService) Create(parent string, logexclusion *LogExclusion) *ProjectsExclusionsCreateCall {
20072	c := &ProjectsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20073	c.parent = parent
20074	c.logexclusion = logexclusion
20075	return c
20076}
20077
20078// Fields allows partial responses to be retrieved. See
20079// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20080// for more information.
20081func (c *ProjectsExclusionsCreateCall) Fields(s ...googleapi.Field) *ProjectsExclusionsCreateCall {
20082	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20083	return c
20084}
20085
20086// Context sets the context to be used in this call's Do method. Any
20087// pending HTTP request will be aborted if the provided context is
20088// canceled.
20089func (c *ProjectsExclusionsCreateCall) Context(ctx context.Context) *ProjectsExclusionsCreateCall {
20090	c.ctx_ = ctx
20091	return c
20092}
20093
20094// Header returns an http.Header that can be modified by the caller to
20095// add HTTP headers to the request.
20096func (c *ProjectsExclusionsCreateCall) Header() http.Header {
20097	if c.header_ == nil {
20098		c.header_ = make(http.Header)
20099	}
20100	return c.header_
20101}
20102
20103func (c *ProjectsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
20104	reqHeaders := make(http.Header)
20105	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
20106	for k, v := range c.header_ {
20107		reqHeaders[k] = v
20108	}
20109	reqHeaders.Set("User-Agent", c.s.userAgent())
20110	var body io.Reader = nil
20111	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
20112	if err != nil {
20113		return nil, err
20114	}
20115	reqHeaders.Set("Content-Type", "application/json")
20116	c.urlParams_.Set("alt", alt)
20117	c.urlParams_.Set("prettyPrint", "false")
20118	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
20119	urls += "?" + c.urlParams_.Encode()
20120	req, err := http.NewRequest("POST", urls, body)
20121	if err != nil {
20122		return nil, err
20123	}
20124	req.Header = reqHeaders
20125	googleapi.Expand(req.URL, map[string]string{
20126		"parent": c.parent,
20127	})
20128	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20129}
20130
20131// Do executes the "logging.projects.exclusions.create" call.
20132// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
20133// status code is an error. Response headers are in either
20134// *LogExclusion.ServerResponse.Header or (if a response was returned at
20135// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
20136// to check whether the returned error was because
20137// http.StatusNotModified was returned.
20138func (c *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
20139	gensupport.SetOptions(c.urlParams_, opts...)
20140	res, err := c.doRequest("json")
20141	if res != nil && res.StatusCode == http.StatusNotModified {
20142		if res.Body != nil {
20143			res.Body.Close()
20144		}
20145		return nil, &googleapi.Error{
20146			Code:   res.StatusCode,
20147			Header: res.Header,
20148		}
20149	}
20150	if err != nil {
20151		return nil, err
20152	}
20153	defer googleapi.CloseBody(res)
20154	if err := googleapi.CheckResponse(res); err != nil {
20155		return nil, err
20156	}
20157	ret := &LogExclusion{
20158		ServerResponse: googleapi.ServerResponse{
20159			Header:         res.Header,
20160			HTTPStatusCode: res.StatusCode,
20161		},
20162	}
20163	target := &ret
20164	if err := gensupport.DecodeResponse(target, res); err != nil {
20165		return nil, err
20166	}
20167	return ret, nil
20168	// {
20169	//   "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.",
20170	//   "flatPath": "v2/projects/{projectsId}/exclusions",
20171	//   "httpMethod": "POST",
20172	//   "id": "logging.projects.exclusions.create",
20173	//   "parameterOrder": [
20174	//     "parent"
20175	//   ],
20176	//   "parameters": {
20177	//     "parent": {
20178	//       "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" Examples: \"projects/my-logging-project\", \"organizations/123456789\".",
20179	//       "location": "path",
20180	//       "pattern": "^projects/[^/]+$",
20181	//       "required": true,
20182	//       "type": "string"
20183	//     }
20184	//   },
20185	//   "path": "v2/{+parent}/exclusions",
20186	//   "request": {
20187	//     "$ref": "LogExclusion"
20188	//   },
20189	//   "response": {
20190	//     "$ref": "LogExclusion"
20191	//   },
20192	//   "scopes": [
20193	//     "https://www.googleapis.com/auth/cloud-platform",
20194	//     "https://www.googleapis.com/auth/logging.admin"
20195	//   ]
20196	// }
20197
20198}
20199
20200// method id "logging.projects.exclusions.delete":
20201
20202type ProjectsExclusionsDeleteCall struct {
20203	s          *Service
20204	name       string
20205	urlParams_ gensupport.URLParams
20206	ctx_       context.Context
20207	header_    http.Header
20208}
20209
20210// Delete: Deletes an exclusion.
20211func (r *ProjectsExclusionsService) Delete(name string) *ProjectsExclusionsDeleteCall {
20212	c := &ProjectsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20213	c.name = name
20214	return c
20215}
20216
20217// Fields allows partial responses to be retrieved. See
20218// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20219// for more information.
20220func (c *ProjectsExclusionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsExclusionsDeleteCall {
20221	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20222	return c
20223}
20224
20225// Context sets the context to be used in this call's Do method. Any
20226// pending HTTP request will be aborted if the provided context is
20227// canceled.
20228func (c *ProjectsExclusionsDeleteCall) Context(ctx context.Context) *ProjectsExclusionsDeleteCall {
20229	c.ctx_ = ctx
20230	return c
20231}
20232
20233// Header returns an http.Header that can be modified by the caller to
20234// add HTTP headers to the request.
20235func (c *ProjectsExclusionsDeleteCall) Header() http.Header {
20236	if c.header_ == nil {
20237		c.header_ = make(http.Header)
20238	}
20239	return c.header_
20240}
20241
20242func (c *ProjectsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
20243	reqHeaders := make(http.Header)
20244	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
20245	for k, v := range c.header_ {
20246		reqHeaders[k] = v
20247	}
20248	reqHeaders.Set("User-Agent", c.s.userAgent())
20249	var body io.Reader = nil
20250	c.urlParams_.Set("alt", alt)
20251	c.urlParams_.Set("prettyPrint", "false")
20252	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
20253	urls += "?" + c.urlParams_.Encode()
20254	req, err := http.NewRequest("DELETE", urls, body)
20255	if err != nil {
20256		return nil, err
20257	}
20258	req.Header = reqHeaders
20259	googleapi.Expand(req.URL, map[string]string{
20260		"name": c.name,
20261	})
20262	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20263}
20264
20265// Do executes the "logging.projects.exclusions.delete" call.
20266// Exactly one of *Empty or error will be non-nil. Any non-2xx status
20267// code is an error. Response headers are in either
20268// *Empty.ServerResponse.Header or (if a response was returned at all)
20269// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
20270// check whether the returned error was because http.StatusNotModified
20271// was returned.
20272func (c *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
20273	gensupport.SetOptions(c.urlParams_, opts...)
20274	res, err := c.doRequest("json")
20275	if res != nil && res.StatusCode == http.StatusNotModified {
20276		if res.Body != nil {
20277			res.Body.Close()
20278		}
20279		return nil, &googleapi.Error{
20280			Code:   res.StatusCode,
20281			Header: res.Header,
20282		}
20283	}
20284	if err != nil {
20285		return nil, err
20286	}
20287	defer googleapi.CloseBody(res)
20288	if err := googleapi.CheckResponse(res); err != nil {
20289		return nil, err
20290	}
20291	ret := &Empty{
20292		ServerResponse: googleapi.ServerResponse{
20293			Header:         res.Header,
20294			HTTPStatusCode: res.StatusCode,
20295		},
20296	}
20297	target := &ret
20298	if err := gensupport.DecodeResponse(target, res); err != nil {
20299		return nil, err
20300	}
20301	return ret, nil
20302	// {
20303	//   "description": "Deletes an exclusion.",
20304	//   "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}",
20305	//   "httpMethod": "DELETE",
20306	//   "id": "logging.projects.exclusions.delete",
20307	//   "parameterOrder": [
20308	//     "name"
20309	//   ],
20310	//   "parameters": {
20311	//     "name": {
20312	//       "description": "Required. The resource name of an existing exclusion to delete: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
20313	//       "location": "path",
20314	//       "pattern": "^projects/[^/]+/exclusions/[^/]+$",
20315	//       "required": true,
20316	//       "type": "string"
20317	//     }
20318	//   },
20319	//   "path": "v2/{+name}",
20320	//   "response": {
20321	//     "$ref": "Empty"
20322	//   },
20323	//   "scopes": [
20324	//     "https://www.googleapis.com/auth/cloud-platform",
20325	//     "https://www.googleapis.com/auth/logging.admin"
20326	//   ]
20327	// }
20328
20329}
20330
20331// method id "logging.projects.exclusions.get":
20332
20333type ProjectsExclusionsGetCall struct {
20334	s            *Service
20335	name         string
20336	urlParams_   gensupport.URLParams
20337	ifNoneMatch_ string
20338	ctx_         context.Context
20339	header_      http.Header
20340}
20341
20342// Get: Gets the description of an exclusion.
20343func (r *ProjectsExclusionsService) Get(name string) *ProjectsExclusionsGetCall {
20344	c := &ProjectsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20345	c.name = name
20346	return c
20347}
20348
20349// Fields allows partial responses to be retrieved. See
20350// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20351// for more information.
20352func (c *ProjectsExclusionsGetCall) Fields(s ...googleapi.Field) *ProjectsExclusionsGetCall {
20353	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20354	return c
20355}
20356
20357// IfNoneMatch sets the optional parameter which makes the operation
20358// fail if the object's ETag matches the given value. This is useful for
20359// getting updates only after the object has changed since the last
20360// request. Use googleapi.IsNotModified to check whether the response
20361// error from Do is the result of In-None-Match.
20362func (c *ProjectsExclusionsGetCall) IfNoneMatch(entityTag string) *ProjectsExclusionsGetCall {
20363	c.ifNoneMatch_ = entityTag
20364	return c
20365}
20366
20367// Context sets the context to be used in this call's Do method. Any
20368// pending HTTP request will be aborted if the provided context is
20369// canceled.
20370func (c *ProjectsExclusionsGetCall) Context(ctx context.Context) *ProjectsExclusionsGetCall {
20371	c.ctx_ = ctx
20372	return c
20373}
20374
20375// Header returns an http.Header that can be modified by the caller to
20376// add HTTP headers to the request.
20377func (c *ProjectsExclusionsGetCall) Header() http.Header {
20378	if c.header_ == nil {
20379		c.header_ = make(http.Header)
20380	}
20381	return c.header_
20382}
20383
20384func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
20385	reqHeaders := make(http.Header)
20386	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
20387	for k, v := range c.header_ {
20388		reqHeaders[k] = v
20389	}
20390	reqHeaders.Set("User-Agent", c.s.userAgent())
20391	if c.ifNoneMatch_ != "" {
20392		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
20393	}
20394	var body io.Reader = nil
20395	c.urlParams_.Set("alt", alt)
20396	c.urlParams_.Set("prettyPrint", "false")
20397	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
20398	urls += "?" + c.urlParams_.Encode()
20399	req, err := http.NewRequest("GET", urls, body)
20400	if err != nil {
20401		return nil, err
20402	}
20403	req.Header = reqHeaders
20404	googleapi.Expand(req.URL, map[string]string{
20405		"name": c.name,
20406	})
20407	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20408}
20409
20410// Do executes the "logging.projects.exclusions.get" call.
20411// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
20412// status code is an error. Response headers are in either
20413// *LogExclusion.ServerResponse.Header or (if a response was returned at
20414// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
20415// to check whether the returned error was because
20416// http.StatusNotModified was returned.
20417func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
20418	gensupport.SetOptions(c.urlParams_, opts...)
20419	res, err := c.doRequest("json")
20420	if res != nil && res.StatusCode == http.StatusNotModified {
20421		if res.Body != nil {
20422			res.Body.Close()
20423		}
20424		return nil, &googleapi.Error{
20425			Code:   res.StatusCode,
20426			Header: res.Header,
20427		}
20428	}
20429	if err != nil {
20430		return nil, err
20431	}
20432	defer googleapi.CloseBody(res)
20433	if err := googleapi.CheckResponse(res); err != nil {
20434		return nil, err
20435	}
20436	ret := &LogExclusion{
20437		ServerResponse: googleapi.ServerResponse{
20438			Header:         res.Header,
20439			HTTPStatusCode: res.StatusCode,
20440		},
20441	}
20442	target := &ret
20443	if err := gensupport.DecodeResponse(target, res); err != nil {
20444		return nil, err
20445	}
20446	return ret, nil
20447	// {
20448	//   "description": "Gets the description of an exclusion.",
20449	//   "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}",
20450	//   "httpMethod": "GET",
20451	//   "id": "logging.projects.exclusions.get",
20452	//   "parameterOrder": [
20453	//     "name"
20454	//   ],
20455	//   "parameters": {
20456	//     "name": {
20457	//       "description": "Required. The resource name of an existing exclusion: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
20458	//       "location": "path",
20459	//       "pattern": "^projects/[^/]+/exclusions/[^/]+$",
20460	//       "required": true,
20461	//       "type": "string"
20462	//     }
20463	//   },
20464	//   "path": "v2/{+name}",
20465	//   "response": {
20466	//     "$ref": "LogExclusion"
20467	//   },
20468	//   "scopes": [
20469	//     "https://www.googleapis.com/auth/cloud-platform",
20470	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
20471	//     "https://www.googleapis.com/auth/logging.admin",
20472	//     "https://www.googleapis.com/auth/logging.read"
20473	//   ]
20474	// }
20475
20476}
20477
20478// method id "logging.projects.exclusions.list":
20479
20480type ProjectsExclusionsListCall struct {
20481	s            *Service
20482	parent       string
20483	urlParams_   gensupport.URLParams
20484	ifNoneMatch_ string
20485	ctx_         context.Context
20486	header_      http.Header
20487}
20488
20489// List: Lists all the exclusions in a parent resource.
20490func (r *ProjectsExclusionsService) List(parent string) *ProjectsExclusionsListCall {
20491	c := &ProjectsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20492	c.parent = parent
20493	return c
20494}
20495
20496// PageSize sets the optional parameter "pageSize": The maximum number
20497// of results to return from this request. Non-positive values are
20498// ignored. The presence of nextPageToken in the response indicates that
20499// more results might be available.
20500func (c *ProjectsExclusionsListCall) PageSize(pageSize int64) *ProjectsExclusionsListCall {
20501	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
20502	return c
20503}
20504
20505// PageToken sets the optional parameter "pageToken": If present, then
20506// retrieve the next batch of results from the preceding call to this
20507// method. pageToken must be the value of nextPageToken from the
20508// previous response. The values of other method parameters should be
20509// identical to those in the previous call.
20510func (c *ProjectsExclusionsListCall) PageToken(pageToken string) *ProjectsExclusionsListCall {
20511	c.urlParams_.Set("pageToken", pageToken)
20512	return c
20513}
20514
20515// Fields allows partial responses to be retrieved. See
20516// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20517// for more information.
20518func (c *ProjectsExclusionsListCall) Fields(s ...googleapi.Field) *ProjectsExclusionsListCall {
20519	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20520	return c
20521}
20522
20523// IfNoneMatch sets the optional parameter which makes the operation
20524// fail if the object's ETag matches the given value. This is useful for
20525// getting updates only after the object has changed since the last
20526// request. Use googleapi.IsNotModified to check whether the response
20527// error from Do is the result of In-None-Match.
20528func (c *ProjectsExclusionsListCall) IfNoneMatch(entityTag string) *ProjectsExclusionsListCall {
20529	c.ifNoneMatch_ = entityTag
20530	return c
20531}
20532
20533// Context sets the context to be used in this call's Do method. Any
20534// pending HTTP request will be aborted if the provided context is
20535// canceled.
20536func (c *ProjectsExclusionsListCall) Context(ctx context.Context) *ProjectsExclusionsListCall {
20537	c.ctx_ = ctx
20538	return c
20539}
20540
20541// Header returns an http.Header that can be modified by the caller to
20542// add HTTP headers to the request.
20543func (c *ProjectsExclusionsListCall) Header() http.Header {
20544	if c.header_ == nil {
20545		c.header_ = make(http.Header)
20546	}
20547	return c.header_
20548}
20549
20550func (c *ProjectsExclusionsListCall) doRequest(alt string) (*http.Response, error) {
20551	reqHeaders := make(http.Header)
20552	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
20553	for k, v := range c.header_ {
20554		reqHeaders[k] = v
20555	}
20556	reqHeaders.Set("User-Agent", c.s.userAgent())
20557	if c.ifNoneMatch_ != "" {
20558		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
20559	}
20560	var body io.Reader = nil
20561	c.urlParams_.Set("alt", alt)
20562	c.urlParams_.Set("prettyPrint", "false")
20563	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
20564	urls += "?" + c.urlParams_.Encode()
20565	req, err := http.NewRequest("GET", urls, body)
20566	if err != nil {
20567		return nil, err
20568	}
20569	req.Header = reqHeaders
20570	googleapi.Expand(req.URL, map[string]string{
20571		"parent": c.parent,
20572	})
20573	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20574}
20575
20576// Do executes the "logging.projects.exclusions.list" call.
20577// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
20578// non-2xx status code is an error. Response headers are in either
20579// *ListExclusionsResponse.ServerResponse.Header or (if a response was
20580// returned at all) in error.(*googleapi.Error).Header. Use
20581// googleapi.IsNotModified to check whether the returned error was
20582// because http.StatusNotModified was returned.
20583func (c *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
20584	gensupport.SetOptions(c.urlParams_, opts...)
20585	res, err := c.doRequest("json")
20586	if res != nil && res.StatusCode == http.StatusNotModified {
20587		if res.Body != nil {
20588			res.Body.Close()
20589		}
20590		return nil, &googleapi.Error{
20591			Code:   res.StatusCode,
20592			Header: res.Header,
20593		}
20594	}
20595	if err != nil {
20596		return nil, err
20597	}
20598	defer googleapi.CloseBody(res)
20599	if err := googleapi.CheckResponse(res); err != nil {
20600		return nil, err
20601	}
20602	ret := &ListExclusionsResponse{
20603		ServerResponse: googleapi.ServerResponse{
20604			Header:         res.Header,
20605			HTTPStatusCode: res.StatusCode,
20606		},
20607	}
20608	target := &ret
20609	if err := gensupport.DecodeResponse(target, res); err != nil {
20610		return nil, err
20611	}
20612	return ret, nil
20613	// {
20614	//   "description": "Lists all the exclusions in a parent resource.",
20615	//   "flatPath": "v2/projects/{projectsId}/exclusions",
20616	//   "httpMethod": "GET",
20617	//   "id": "logging.projects.exclusions.list",
20618	//   "parameterOrder": [
20619	//     "parent"
20620	//   ],
20621	//   "parameters": {
20622	//     "pageSize": {
20623	//       "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.",
20624	//       "format": "int32",
20625	//       "location": "query",
20626	//       "type": "integer"
20627	//     },
20628	//     "pageToken": {
20629	//       "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.",
20630	//       "location": "query",
20631	//       "type": "string"
20632	//     },
20633	//     "parent": {
20634	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
20635	//       "location": "path",
20636	//       "pattern": "^projects/[^/]+$",
20637	//       "required": true,
20638	//       "type": "string"
20639	//     }
20640	//   },
20641	//   "path": "v2/{+parent}/exclusions",
20642	//   "response": {
20643	//     "$ref": "ListExclusionsResponse"
20644	//   },
20645	//   "scopes": [
20646	//     "https://www.googleapis.com/auth/cloud-platform",
20647	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
20648	//     "https://www.googleapis.com/auth/logging.admin",
20649	//     "https://www.googleapis.com/auth/logging.read"
20650	//   ]
20651	// }
20652
20653}
20654
20655// Pages invokes f for each page of results.
20656// A non-nil error returned from f will halt the iteration.
20657// The provided context supersedes any context provided to the Context method.
20658func (c *ProjectsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
20659	c.ctx_ = ctx
20660	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
20661	for {
20662		x, err := c.Do()
20663		if err != nil {
20664			return err
20665		}
20666		if err := f(x); err != nil {
20667			return err
20668		}
20669		if x.NextPageToken == "" {
20670			return nil
20671		}
20672		c.PageToken(x.NextPageToken)
20673	}
20674}
20675
20676// method id "logging.projects.exclusions.patch":
20677
20678type ProjectsExclusionsPatchCall struct {
20679	s            *Service
20680	name         string
20681	logexclusion *LogExclusion
20682	urlParams_   gensupport.URLParams
20683	ctx_         context.Context
20684	header_      http.Header
20685}
20686
20687// Patch: Changes one or more properties of an existing exclusion.
20688func (r *ProjectsExclusionsService) Patch(name string, logexclusion *LogExclusion) *ProjectsExclusionsPatchCall {
20689	c := &ProjectsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20690	c.name = name
20691	c.logexclusion = logexclusion
20692	return c
20693}
20694
20695// UpdateMask sets the optional parameter "updateMask": Required. A
20696// non-empty list of fields to change in the existing exclusion. New
20697// values for the fields are taken from the corresponding fields in the
20698// LogExclusion included in this request. Fields not mentioned in
20699// update_mask are not changed and are ignored in the request.For
20700// example, to change the filter and description of an exclusion,
20701// specify an update_mask of "filter,description".
20702func (c *ProjectsExclusionsPatchCall) UpdateMask(updateMask string) *ProjectsExclusionsPatchCall {
20703	c.urlParams_.Set("updateMask", updateMask)
20704	return c
20705}
20706
20707// Fields allows partial responses to be retrieved. See
20708// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20709// for more information.
20710func (c *ProjectsExclusionsPatchCall) Fields(s ...googleapi.Field) *ProjectsExclusionsPatchCall {
20711	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20712	return c
20713}
20714
20715// Context sets the context to be used in this call's Do method. Any
20716// pending HTTP request will be aborted if the provided context is
20717// canceled.
20718func (c *ProjectsExclusionsPatchCall) Context(ctx context.Context) *ProjectsExclusionsPatchCall {
20719	c.ctx_ = ctx
20720	return c
20721}
20722
20723// Header returns an http.Header that can be modified by the caller to
20724// add HTTP headers to the request.
20725func (c *ProjectsExclusionsPatchCall) Header() http.Header {
20726	if c.header_ == nil {
20727		c.header_ = make(http.Header)
20728	}
20729	return c.header_
20730}
20731
20732func (c *ProjectsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
20733	reqHeaders := make(http.Header)
20734	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
20735	for k, v := range c.header_ {
20736		reqHeaders[k] = v
20737	}
20738	reqHeaders.Set("User-Agent", c.s.userAgent())
20739	var body io.Reader = nil
20740	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
20741	if err != nil {
20742		return nil, err
20743	}
20744	reqHeaders.Set("Content-Type", "application/json")
20745	c.urlParams_.Set("alt", alt)
20746	c.urlParams_.Set("prettyPrint", "false")
20747	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
20748	urls += "?" + c.urlParams_.Encode()
20749	req, err := http.NewRequest("PATCH", urls, body)
20750	if err != nil {
20751		return nil, err
20752	}
20753	req.Header = reqHeaders
20754	googleapi.Expand(req.URL, map[string]string{
20755		"name": c.name,
20756	})
20757	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20758}
20759
20760// Do executes the "logging.projects.exclusions.patch" call.
20761// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
20762// status code is an error. Response headers are in either
20763// *LogExclusion.ServerResponse.Header or (if a response was returned at
20764// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
20765// to check whether the returned error was because
20766// http.StatusNotModified was returned.
20767func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
20768	gensupport.SetOptions(c.urlParams_, opts...)
20769	res, err := c.doRequest("json")
20770	if res != nil && res.StatusCode == http.StatusNotModified {
20771		if res.Body != nil {
20772			res.Body.Close()
20773		}
20774		return nil, &googleapi.Error{
20775			Code:   res.StatusCode,
20776			Header: res.Header,
20777		}
20778	}
20779	if err != nil {
20780		return nil, err
20781	}
20782	defer googleapi.CloseBody(res)
20783	if err := googleapi.CheckResponse(res); err != nil {
20784		return nil, err
20785	}
20786	ret := &LogExclusion{
20787		ServerResponse: googleapi.ServerResponse{
20788			Header:         res.Header,
20789			HTTPStatusCode: res.StatusCode,
20790		},
20791	}
20792	target := &ret
20793	if err := gensupport.DecodeResponse(target, res); err != nil {
20794		return nil, err
20795	}
20796	return ret, nil
20797	// {
20798	//   "description": "Changes one or more properties of an existing exclusion.",
20799	//   "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}",
20800	//   "httpMethod": "PATCH",
20801	//   "id": "logging.projects.exclusions.patch",
20802	//   "parameterOrder": [
20803	//     "name"
20804	//   ],
20805	//   "parameters": {
20806	//     "name": {
20807	//       "description": "Required. The resource name of the exclusion to update: \"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]\" \"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]\" \"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]\" Example: \"projects/my-project-id/exclusions/my-exclusion-id\".",
20808	//       "location": "path",
20809	//       "pattern": "^projects/[^/]+/exclusions/[^/]+$",
20810	//       "required": true,
20811	//       "type": "string"
20812	//     },
20813	//     "updateMask": {
20814	//       "description": "Required. A non-empty 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\".",
20815	//       "format": "google-fieldmask",
20816	//       "location": "query",
20817	//       "type": "string"
20818	//     }
20819	//   },
20820	//   "path": "v2/{+name}",
20821	//   "request": {
20822	//     "$ref": "LogExclusion"
20823	//   },
20824	//   "response": {
20825	//     "$ref": "LogExclusion"
20826	//   },
20827	//   "scopes": [
20828	//     "https://www.googleapis.com/auth/cloud-platform",
20829	//     "https://www.googleapis.com/auth/logging.admin"
20830	//   ]
20831	// }
20832
20833}
20834
20835// method id "logging.projects.locations.get":
20836
20837type ProjectsLocationsGetCall struct {
20838	s            *Service
20839	name         string
20840	urlParams_   gensupport.URLParams
20841	ifNoneMatch_ string
20842	ctx_         context.Context
20843	header_      http.Header
20844}
20845
20846// Get: Gets information about a location.
20847func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
20848	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20849	c.name = name
20850	return c
20851}
20852
20853// Fields allows partial responses to be retrieved. See
20854// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20855// for more information.
20856func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
20857	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20858	return c
20859}
20860
20861// IfNoneMatch sets the optional parameter which makes the operation
20862// fail if the object's ETag matches the given value. This is useful for
20863// getting updates only after the object has changed since the last
20864// request. Use googleapi.IsNotModified to check whether the response
20865// error from Do is the result of In-None-Match.
20866func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
20867	c.ifNoneMatch_ = entityTag
20868	return c
20869}
20870
20871// Context sets the context to be used in this call's Do method. Any
20872// pending HTTP request will be aborted if the provided context is
20873// canceled.
20874func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
20875	c.ctx_ = ctx
20876	return c
20877}
20878
20879// Header returns an http.Header that can be modified by the caller to
20880// add HTTP headers to the request.
20881func (c *ProjectsLocationsGetCall) Header() http.Header {
20882	if c.header_ == nil {
20883		c.header_ = make(http.Header)
20884	}
20885	return c.header_
20886}
20887
20888func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
20889	reqHeaders := make(http.Header)
20890	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
20891	for k, v := range c.header_ {
20892		reqHeaders[k] = v
20893	}
20894	reqHeaders.Set("User-Agent", c.s.userAgent())
20895	if c.ifNoneMatch_ != "" {
20896		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
20897	}
20898	var body io.Reader = nil
20899	c.urlParams_.Set("alt", alt)
20900	c.urlParams_.Set("prettyPrint", "false")
20901	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
20902	urls += "?" + c.urlParams_.Encode()
20903	req, err := http.NewRequest("GET", urls, body)
20904	if err != nil {
20905		return nil, err
20906	}
20907	req.Header = reqHeaders
20908	googleapi.Expand(req.URL, map[string]string{
20909		"name": c.name,
20910	})
20911	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20912}
20913
20914// Do executes the "logging.projects.locations.get" call.
20915// Exactly one of *Location or error will be non-nil. Any non-2xx status
20916// code is an error. Response headers are in either
20917// *Location.ServerResponse.Header or (if a response was returned at
20918// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
20919// to check whether the returned error was because
20920// http.StatusNotModified was returned.
20921func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
20922	gensupport.SetOptions(c.urlParams_, opts...)
20923	res, err := c.doRequest("json")
20924	if res != nil && res.StatusCode == http.StatusNotModified {
20925		if res.Body != nil {
20926			res.Body.Close()
20927		}
20928		return nil, &googleapi.Error{
20929			Code:   res.StatusCode,
20930			Header: res.Header,
20931		}
20932	}
20933	if err != nil {
20934		return nil, err
20935	}
20936	defer googleapi.CloseBody(res)
20937	if err := googleapi.CheckResponse(res); err != nil {
20938		return nil, err
20939	}
20940	ret := &Location{
20941		ServerResponse: googleapi.ServerResponse{
20942			Header:         res.Header,
20943			HTTPStatusCode: res.StatusCode,
20944		},
20945	}
20946	target := &ret
20947	if err := gensupport.DecodeResponse(target, res); err != nil {
20948		return nil, err
20949	}
20950	return ret, nil
20951	// {
20952	//   "description": "Gets information about a location.",
20953	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}",
20954	//   "httpMethod": "GET",
20955	//   "id": "logging.projects.locations.get",
20956	//   "parameterOrder": [
20957	//     "name"
20958	//   ],
20959	//   "parameters": {
20960	//     "name": {
20961	//       "description": "Resource name for the location.",
20962	//       "location": "path",
20963	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
20964	//       "required": true,
20965	//       "type": "string"
20966	//     }
20967	//   },
20968	//   "path": "v2/{+name}",
20969	//   "response": {
20970	//     "$ref": "Location"
20971	//   },
20972	//   "scopes": [
20973	//     "https://www.googleapis.com/auth/cloud-platform",
20974	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
20975	//     "https://www.googleapis.com/auth/logging.admin",
20976	//     "https://www.googleapis.com/auth/logging.read"
20977	//   ]
20978	// }
20979
20980}
20981
20982// method id "logging.projects.locations.list":
20983
20984type ProjectsLocationsListCall struct {
20985	s            *Service
20986	name         string
20987	urlParams_   gensupport.URLParams
20988	ifNoneMatch_ string
20989	ctx_         context.Context
20990	header_      http.Header
20991}
20992
20993// List: Lists information about the supported locations for this
20994// service.
20995func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
20996	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20997	c.name = name
20998	return c
20999}
21000
21001// Filter sets the optional parameter "filter": The standard list
21002// filter.
21003func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
21004	c.urlParams_.Set("filter", filter)
21005	return c
21006}
21007
21008// PageSize sets the optional parameter "pageSize": The standard list
21009// page size.
21010func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
21011	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
21012	return c
21013}
21014
21015// PageToken sets the optional parameter "pageToken": The standard list
21016// page token.
21017func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
21018	c.urlParams_.Set("pageToken", pageToken)
21019	return c
21020}
21021
21022// Fields allows partial responses to be retrieved. See
21023// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21024// for more information.
21025func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
21026	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21027	return c
21028}
21029
21030// IfNoneMatch sets the optional parameter which makes the operation
21031// fail if the object's ETag matches the given value. This is useful for
21032// getting updates only after the object has changed since the last
21033// request. Use googleapi.IsNotModified to check whether the response
21034// error from Do is the result of In-None-Match.
21035func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
21036	c.ifNoneMatch_ = entityTag
21037	return c
21038}
21039
21040// Context sets the context to be used in this call's Do method. Any
21041// pending HTTP request will be aborted if the provided context is
21042// canceled.
21043func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
21044	c.ctx_ = ctx
21045	return c
21046}
21047
21048// Header returns an http.Header that can be modified by the caller to
21049// add HTTP headers to the request.
21050func (c *ProjectsLocationsListCall) Header() http.Header {
21051	if c.header_ == nil {
21052		c.header_ = make(http.Header)
21053	}
21054	return c.header_
21055}
21056
21057func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
21058	reqHeaders := make(http.Header)
21059	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
21060	for k, v := range c.header_ {
21061		reqHeaders[k] = v
21062	}
21063	reqHeaders.Set("User-Agent", c.s.userAgent())
21064	if c.ifNoneMatch_ != "" {
21065		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
21066	}
21067	var body io.Reader = nil
21068	c.urlParams_.Set("alt", alt)
21069	c.urlParams_.Set("prettyPrint", "false")
21070	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
21071	urls += "?" + c.urlParams_.Encode()
21072	req, err := http.NewRequest("GET", urls, body)
21073	if err != nil {
21074		return nil, err
21075	}
21076	req.Header = reqHeaders
21077	googleapi.Expand(req.URL, map[string]string{
21078		"name": c.name,
21079	})
21080	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21081}
21082
21083// Do executes the "logging.projects.locations.list" call.
21084// Exactly one of *ListLocationsResponse or error will be non-nil. Any
21085// non-2xx status code is an error. Response headers are in either
21086// *ListLocationsResponse.ServerResponse.Header or (if a response was
21087// returned at all) in error.(*googleapi.Error).Header. Use
21088// googleapi.IsNotModified to check whether the returned error was
21089// because http.StatusNotModified was returned.
21090func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
21091	gensupport.SetOptions(c.urlParams_, opts...)
21092	res, err := c.doRequest("json")
21093	if res != nil && res.StatusCode == http.StatusNotModified {
21094		if res.Body != nil {
21095			res.Body.Close()
21096		}
21097		return nil, &googleapi.Error{
21098			Code:   res.StatusCode,
21099			Header: res.Header,
21100		}
21101	}
21102	if err != nil {
21103		return nil, err
21104	}
21105	defer googleapi.CloseBody(res)
21106	if err := googleapi.CheckResponse(res); err != nil {
21107		return nil, err
21108	}
21109	ret := &ListLocationsResponse{
21110		ServerResponse: googleapi.ServerResponse{
21111			Header:         res.Header,
21112			HTTPStatusCode: res.StatusCode,
21113		},
21114	}
21115	target := &ret
21116	if err := gensupport.DecodeResponse(target, res); err != nil {
21117		return nil, err
21118	}
21119	return ret, nil
21120	// {
21121	//   "description": "Lists information about the supported locations for this service.",
21122	//   "flatPath": "v2/projects/{projectsId}/locations",
21123	//   "httpMethod": "GET",
21124	//   "id": "logging.projects.locations.list",
21125	//   "parameterOrder": [
21126	//     "name"
21127	//   ],
21128	//   "parameters": {
21129	//     "filter": {
21130	//       "description": "The standard list filter.",
21131	//       "location": "query",
21132	//       "type": "string"
21133	//     },
21134	//     "name": {
21135	//       "description": "The resource that owns the locations collection, if applicable.",
21136	//       "location": "path",
21137	//       "pattern": "^projects/[^/]+$",
21138	//       "required": true,
21139	//       "type": "string"
21140	//     },
21141	//     "pageSize": {
21142	//       "description": "The standard list page size.",
21143	//       "format": "int32",
21144	//       "location": "query",
21145	//       "type": "integer"
21146	//     },
21147	//     "pageToken": {
21148	//       "description": "The standard list page token.",
21149	//       "location": "query",
21150	//       "type": "string"
21151	//     }
21152	//   },
21153	//   "path": "v2/{+name}/locations",
21154	//   "response": {
21155	//     "$ref": "ListLocationsResponse"
21156	//   },
21157	//   "scopes": [
21158	//     "https://www.googleapis.com/auth/cloud-platform",
21159	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21160	//     "https://www.googleapis.com/auth/logging.admin",
21161	//     "https://www.googleapis.com/auth/logging.read"
21162	//   ]
21163	// }
21164
21165}
21166
21167// Pages invokes f for each page of results.
21168// A non-nil error returned from f will halt the iteration.
21169// The provided context supersedes any context provided to the Context method.
21170func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
21171	c.ctx_ = ctx
21172	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
21173	for {
21174		x, err := c.Do()
21175		if err != nil {
21176			return err
21177		}
21178		if err := f(x); err != nil {
21179			return err
21180		}
21181		if x.NextPageToken == "" {
21182			return nil
21183		}
21184		c.PageToken(x.NextPageToken)
21185	}
21186}
21187
21188// method id "logging.projects.locations.buckets.create":
21189
21190type ProjectsLocationsBucketsCreateCall struct {
21191	s          *Service
21192	parent     string
21193	logbucket  *LogBucket
21194	urlParams_ gensupport.URLParams
21195	ctx_       context.Context
21196	header_    http.Header
21197}
21198
21199// Create: Creates a bucket that can be used to store log entries. Once
21200// a bucket has been created, the region cannot be changed.
21201func (r *ProjectsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateCall {
21202	c := &ProjectsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21203	c.parent = parent
21204	c.logbucket = logbucket
21205	return c
21206}
21207
21208// BucketId sets the optional parameter "bucketId": Required. A
21209// client-assigned identifier such as "my-bucket". Identifiers are
21210// limited to 100 characters and can include only letters, digits,
21211// underscores, hyphens, and periods.
21212func (c *ProjectsLocationsBucketsCreateCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateCall {
21213	c.urlParams_.Set("bucketId", bucketId)
21214	return c
21215}
21216
21217// Fields allows partial responses to be retrieved. See
21218// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21219// for more information.
21220func (c *ProjectsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateCall {
21221	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21222	return c
21223}
21224
21225// Context sets the context to be used in this call's Do method. Any
21226// pending HTTP request will be aborted if the provided context is
21227// canceled.
21228func (c *ProjectsLocationsBucketsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateCall {
21229	c.ctx_ = ctx
21230	return c
21231}
21232
21233// Header returns an http.Header that can be modified by the caller to
21234// add HTTP headers to the request.
21235func (c *ProjectsLocationsBucketsCreateCall) Header() http.Header {
21236	if c.header_ == nil {
21237		c.header_ = make(http.Header)
21238	}
21239	return c.header_
21240}
21241
21242func (c *ProjectsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
21243	reqHeaders := make(http.Header)
21244	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
21245	for k, v := range c.header_ {
21246		reqHeaders[k] = v
21247	}
21248	reqHeaders.Set("User-Agent", c.s.userAgent())
21249	var body io.Reader = nil
21250	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
21251	if err != nil {
21252		return nil, err
21253	}
21254	reqHeaders.Set("Content-Type", "application/json")
21255	c.urlParams_.Set("alt", alt)
21256	c.urlParams_.Set("prettyPrint", "false")
21257	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
21258	urls += "?" + c.urlParams_.Encode()
21259	req, err := http.NewRequest("POST", urls, body)
21260	if err != nil {
21261		return nil, err
21262	}
21263	req.Header = reqHeaders
21264	googleapi.Expand(req.URL, map[string]string{
21265		"parent": c.parent,
21266	})
21267	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21268}
21269
21270// Do executes the "logging.projects.locations.buckets.create" call.
21271// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
21272// status code is an error. Response headers are in either
21273// *LogBucket.ServerResponse.Header or (if a response was returned at
21274// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
21275// to check whether the returned error was because
21276// http.StatusNotModified was returned.
21277func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
21278	gensupport.SetOptions(c.urlParams_, opts...)
21279	res, err := c.doRequest("json")
21280	if res != nil && res.StatusCode == http.StatusNotModified {
21281		if res.Body != nil {
21282			res.Body.Close()
21283		}
21284		return nil, &googleapi.Error{
21285			Code:   res.StatusCode,
21286			Header: res.Header,
21287		}
21288	}
21289	if err != nil {
21290		return nil, err
21291	}
21292	defer googleapi.CloseBody(res)
21293	if err := googleapi.CheckResponse(res); err != nil {
21294		return nil, err
21295	}
21296	ret := &LogBucket{
21297		ServerResponse: googleapi.ServerResponse{
21298			Header:         res.Header,
21299			HTTPStatusCode: res.StatusCode,
21300		},
21301	}
21302	target := &ret
21303	if err := gensupport.DecodeResponse(target, res); err != nil {
21304		return nil, err
21305	}
21306	return ret, nil
21307	// {
21308	//   "description": "Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.",
21309	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets",
21310	//   "httpMethod": "POST",
21311	//   "id": "logging.projects.locations.buckets.create",
21312	//   "parameterOrder": [
21313	//     "parent"
21314	//   ],
21315	//   "parameters": {
21316	//     "bucketId": {
21317	//       "description": "Required. A client-assigned identifier such as \"my-bucket\". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.",
21318	//       "location": "query",
21319	//       "type": "string"
21320	//     },
21321	//     "parent": {
21322	//       "description": "Required. The resource in which to create the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" Example: \"projects/my-logging-project/locations/global\"",
21323	//       "location": "path",
21324	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
21325	//       "required": true,
21326	//       "type": "string"
21327	//     }
21328	//   },
21329	//   "path": "v2/{+parent}/buckets",
21330	//   "request": {
21331	//     "$ref": "LogBucket"
21332	//   },
21333	//   "response": {
21334	//     "$ref": "LogBucket"
21335	//   },
21336	//   "scopes": [
21337	//     "https://www.googleapis.com/auth/cloud-platform",
21338	//     "https://www.googleapis.com/auth/logging.admin"
21339	//   ]
21340	// }
21341
21342}
21343
21344// method id "logging.projects.locations.buckets.delete":
21345
21346type ProjectsLocationsBucketsDeleteCall struct {
21347	s          *Service
21348	name       string
21349	urlParams_ gensupport.URLParams
21350	ctx_       context.Context
21351	header_    http.Header
21352}
21353
21354// Delete: Deletes a bucket. Moves the bucket to the DELETE_REQUESTED
21355// state. After 7 days, the bucket will be purged and all logs in the
21356// bucket will be permanently deleted.
21357func (r *ProjectsLocationsBucketsService) Delete(name string) *ProjectsLocationsBucketsDeleteCall {
21358	c := &ProjectsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21359	c.name = name
21360	return c
21361}
21362
21363// Fields allows partial responses to be retrieved. See
21364// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21365// for more information.
21366func (c *ProjectsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsDeleteCall {
21367	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21368	return c
21369}
21370
21371// Context sets the context to be used in this call's Do method. Any
21372// pending HTTP request will be aborted if the provided context is
21373// canceled.
21374func (c *ProjectsLocationsBucketsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsDeleteCall {
21375	c.ctx_ = ctx
21376	return c
21377}
21378
21379// Header returns an http.Header that can be modified by the caller to
21380// add HTTP headers to the request.
21381func (c *ProjectsLocationsBucketsDeleteCall) Header() http.Header {
21382	if c.header_ == nil {
21383		c.header_ = make(http.Header)
21384	}
21385	return c.header_
21386}
21387
21388func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
21389	reqHeaders := make(http.Header)
21390	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
21391	for k, v := range c.header_ {
21392		reqHeaders[k] = v
21393	}
21394	reqHeaders.Set("User-Agent", c.s.userAgent())
21395	var body io.Reader = nil
21396	c.urlParams_.Set("alt", alt)
21397	c.urlParams_.Set("prettyPrint", "false")
21398	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
21399	urls += "?" + c.urlParams_.Encode()
21400	req, err := http.NewRequest("DELETE", urls, body)
21401	if err != nil {
21402		return nil, err
21403	}
21404	req.Header = reqHeaders
21405	googleapi.Expand(req.URL, map[string]string{
21406		"name": c.name,
21407	})
21408	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21409}
21410
21411// Do executes the "logging.projects.locations.buckets.delete" call.
21412// Exactly one of *Empty or error will be non-nil. Any non-2xx status
21413// code is an error. Response headers are in either
21414// *Empty.ServerResponse.Header or (if a response was returned at all)
21415// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
21416// check whether the returned error was because http.StatusNotModified
21417// was returned.
21418func (c *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
21419	gensupport.SetOptions(c.urlParams_, opts...)
21420	res, err := c.doRequest("json")
21421	if res != nil && res.StatusCode == http.StatusNotModified {
21422		if res.Body != nil {
21423			res.Body.Close()
21424		}
21425		return nil, &googleapi.Error{
21426			Code:   res.StatusCode,
21427			Header: res.Header,
21428		}
21429	}
21430	if err != nil {
21431		return nil, err
21432	}
21433	defer googleapi.CloseBody(res)
21434	if err := googleapi.CheckResponse(res); err != nil {
21435		return nil, err
21436	}
21437	ret := &Empty{
21438		ServerResponse: googleapi.ServerResponse{
21439			Header:         res.Header,
21440			HTTPStatusCode: res.StatusCode,
21441		},
21442	}
21443	target := &ret
21444	if err := gensupport.DecodeResponse(target, res); err != nil {
21445		return nil, err
21446	}
21447	return ret, nil
21448	// {
21449	//   "description": "Deletes a bucket. Moves the bucket to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all logs in the bucket will be permanently deleted.",
21450	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}",
21451	//   "httpMethod": "DELETE",
21452	//   "id": "logging.projects.locations.buckets.delete",
21453	//   "parameterOrder": [
21454	//     "name"
21455	//   ],
21456	//   "parameters": {
21457	//     "name": {
21458	//       "description": "Required. The full resource name of the bucket to delete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
21459	//       "location": "path",
21460	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
21461	//       "required": true,
21462	//       "type": "string"
21463	//     }
21464	//   },
21465	//   "path": "v2/{+name}",
21466	//   "response": {
21467	//     "$ref": "Empty"
21468	//   },
21469	//   "scopes": [
21470	//     "https://www.googleapis.com/auth/cloud-platform",
21471	//     "https://www.googleapis.com/auth/logging.admin"
21472	//   ]
21473	// }
21474
21475}
21476
21477// method id "logging.projects.locations.buckets.get":
21478
21479type ProjectsLocationsBucketsGetCall struct {
21480	s            *Service
21481	name         string
21482	urlParams_   gensupport.URLParams
21483	ifNoneMatch_ string
21484	ctx_         context.Context
21485	header_      http.Header
21486}
21487
21488// Get: Gets a bucket.
21489func (r *ProjectsLocationsBucketsService) Get(name string) *ProjectsLocationsBucketsGetCall {
21490	c := &ProjectsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21491	c.name = name
21492	return c
21493}
21494
21495// Fields allows partial responses to be retrieved. See
21496// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21497// for more information.
21498func (c *ProjectsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsGetCall {
21499	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21500	return c
21501}
21502
21503// IfNoneMatch sets the optional parameter which makes the operation
21504// fail if the object's ETag matches the given value. This is useful for
21505// getting updates only after the object has changed since the last
21506// request. Use googleapi.IsNotModified to check whether the response
21507// error from Do is the result of In-None-Match.
21508func (c *ProjectsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsGetCall {
21509	c.ifNoneMatch_ = entityTag
21510	return c
21511}
21512
21513// Context sets the context to be used in this call's Do method. Any
21514// pending HTTP request will be aborted if the provided context is
21515// canceled.
21516func (c *ProjectsLocationsBucketsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsGetCall {
21517	c.ctx_ = ctx
21518	return c
21519}
21520
21521// Header returns an http.Header that can be modified by the caller to
21522// add HTTP headers to the request.
21523func (c *ProjectsLocationsBucketsGetCall) Header() http.Header {
21524	if c.header_ == nil {
21525		c.header_ = make(http.Header)
21526	}
21527	return c.header_
21528}
21529
21530func (c *ProjectsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
21531	reqHeaders := make(http.Header)
21532	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
21533	for k, v := range c.header_ {
21534		reqHeaders[k] = v
21535	}
21536	reqHeaders.Set("User-Agent", c.s.userAgent())
21537	if c.ifNoneMatch_ != "" {
21538		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
21539	}
21540	var body io.Reader = nil
21541	c.urlParams_.Set("alt", alt)
21542	c.urlParams_.Set("prettyPrint", "false")
21543	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
21544	urls += "?" + c.urlParams_.Encode()
21545	req, err := http.NewRequest("GET", urls, body)
21546	if err != nil {
21547		return nil, err
21548	}
21549	req.Header = reqHeaders
21550	googleapi.Expand(req.URL, map[string]string{
21551		"name": c.name,
21552	})
21553	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21554}
21555
21556// Do executes the "logging.projects.locations.buckets.get" call.
21557// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
21558// status code is an error. Response headers are in either
21559// *LogBucket.ServerResponse.Header or (if a response was returned at
21560// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
21561// to check whether the returned error was because
21562// http.StatusNotModified was returned.
21563func (c *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
21564	gensupport.SetOptions(c.urlParams_, opts...)
21565	res, err := c.doRequest("json")
21566	if res != nil && res.StatusCode == http.StatusNotModified {
21567		if res.Body != nil {
21568			res.Body.Close()
21569		}
21570		return nil, &googleapi.Error{
21571			Code:   res.StatusCode,
21572			Header: res.Header,
21573		}
21574	}
21575	if err != nil {
21576		return nil, err
21577	}
21578	defer googleapi.CloseBody(res)
21579	if err := googleapi.CheckResponse(res); err != nil {
21580		return nil, err
21581	}
21582	ret := &LogBucket{
21583		ServerResponse: googleapi.ServerResponse{
21584			Header:         res.Header,
21585			HTTPStatusCode: res.StatusCode,
21586		},
21587	}
21588	target := &ret
21589	if err := gensupport.DecodeResponse(target, res); err != nil {
21590		return nil, err
21591	}
21592	return ret, nil
21593	// {
21594	//   "description": "Gets a bucket.",
21595	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}",
21596	//   "httpMethod": "GET",
21597	//   "id": "logging.projects.locations.buckets.get",
21598	//   "parameterOrder": [
21599	//     "name"
21600	//   ],
21601	//   "parameters": {
21602	//     "name": {
21603	//       "description": "Required. The resource name of the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
21604	//       "location": "path",
21605	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
21606	//       "required": true,
21607	//       "type": "string"
21608	//     }
21609	//   },
21610	//   "path": "v2/{+name}",
21611	//   "response": {
21612	//     "$ref": "LogBucket"
21613	//   },
21614	//   "scopes": [
21615	//     "https://www.googleapis.com/auth/cloud-platform",
21616	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21617	//     "https://www.googleapis.com/auth/logging.admin",
21618	//     "https://www.googleapis.com/auth/logging.read"
21619	//   ]
21620	// }
21621
21622}
21623
21624// method id "logging.projects.locations.buckets.list":
21625
21626type ProjectsLocationsBucketsListCall struct {
21627	s            *Service
21628	parent       string
21629	urlParams_   gensupport.URLParams
21630	ifNoneMatch_ string
21631	ctx_         context.Context
21632	header_      http.Header
21633}
21634
21635// List: Lists buckets.
21636func (r *ProjectsLocationsBucketsService) List(parent string) *ProjectsLocationsBucketsListCall {
21637	c := &ProjectsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21638	c.parent = parent
21639	return c
21640}
21641
21642// PageSize sets the optional parameter "pageSize": The maximum number
21643// of results to return from this request. Non-positive values are
21644// ignored. The presence of nextPageToken in the response indicates that
21645// more results might be available.
21646func (c *ProjectsLocationsBucketsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsListCall {
21647	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
21648	return c
21649}
21650
21651// PageToken sets the optional parameter "pageToken": If present, then
21652// retrieve the next batch of results from the preceding call to this
21653// method. pageToken must be the value of nextPageToken from the
21654// previous response. The values of other method parameters should be
21655// identical to those in the previous call.
21656func (c *ProjectsLocationsBucketsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsListCall {
21657	c.urlParams_.Set("pageToken", pageToken)
21658	return c
21659}
21660
21661// Fields allows partial responses to be retrieved. See
21662// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21663// for more information.
21664func (c *ProjectsLocationsBucketsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsListCall {
21665	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21666	return c
21667}
21668
21669// IfNoneMatch sets the optional parameter which makes the operation
21670// fail if the object's ETag matches the given value. This is useful for
21671// getting updates only after the object has changed since the last
21672// request. Use googleapi.IsNotModified to check whether the response
21673// error from Do is the result of In-None-Match.
21674func (c *ProjectsLocationsBucketsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsListCall {
21675	c.ifNoneMatch_ = entityTag
21676	return c
21677}
21678
21679// Context sets the context to be used in this call's Do method. Any
21680// pending HTTP request will be aborted if the provided context is
21681// canceled.
21682func (c *ProjectsLocationsBucketsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsListCall {
21683	c.ctx_ = ctx
21684	return c
21685}
21686
21687// Header returns an http.Header that can be modified by the caller to
21688// add HTTP headers to the request.
21689func (c *ProjectsLocationsBucketsListCall) Header() http.Header {
21690	if c.header_ == nil {
21691		c.header_ = make(http.Header)
21692	}
21693	return c.header_
21694}
21695
21696func (c *ProjectsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
21697	reqHeaders := make(http.Header)
21698	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
21699	for k, v := range c.header_ {
21700		reqHeaders[k] = v
21701	}
21702	reqHeaders.Set("User-Agent", c.s.userAgent())
21703	if c.ifNoneMatch_ != "" {
21704		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
21705	}
21706	var body io.Reader = nil
21707	c.urlParams_.Set("alt", alt)
21708	c.urlParams_.Set("prettyPrint", "false")
21709	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
21710	urls += "?" + c.urlParams_.Encode()
21711	req, err := http.NewRequest("GET", urls, body)
21712	if err != nil {
21713		return nil, err
21714	}
21715	req.Header = reqHeaders
21716	googleapi.Expand(req.URL, map[string]string{
21717		"parent": c.parent,
21718	})
21719	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21720}
21721
21722// Do executes the "logging.projects.locations.buckets.list" call.
21723// Exactly one of *ListBucketsResponse or error will be non-nil. Any
21724// non-2xx status code is an error. Response headers are in either
21725// *ListBucketsResponse.ServerResponse.Header or (if a response was
21726// returned at all) in error.(*googleapi.Error).Header. Use
21727// googleapi.IsNotModified to check whether the returned error was
21728// because http.StatusNotModified was returned.
21729func (c *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
21730	gensupport.SetOptions(c.urlParams_, opts...)
21731	res, err := c.doRequest("json")
21732	if res != nil && res.StatusCode == http.StatusNotModified {
21733		if res.Body != nil {
21734			res.Body.Close()
21735		}
21736		return nil, &googleapi.Error{
21737			Code:   res.StatusCode,
21738			Header: res.Header,
21739		}
21740	}
21741	if err != nil {
21742		return nil, err
21743	}
21744	defer googleapi.CloseBody(res)
21745	if err := googleapi.CheckResponse(res); err != nil {
21746		return nil, err
21747	}
21748	ret := &ListBucketsResponse{
21749		ServerResponse: googleapi.ServerResponse{
21750			Header:         res.Header,
21751			HTTPStatusCode: res.StatusCode,
21752		},
21753	}
21754	target := &ret
21755	if err := gensupport.DecodeResponse(target, res); err != nil {
21756		return nil, err
21757	}
21758	return ret, nil
21759	// {
21760	//   "description": "Lists buckets.",
21761	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets",
21762	//   "httpMethod": "GET",
21763	//   "id": "logging.projects.locations.buckets.list",
21764	//   "parameterOrder": [
21765	//     "parent"
21766	//   ],
21767	//   "parameters": {
21768	//     "pageSize": {
21769	//       "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.",
21770	//       "format": "int32",
21771	//       "location": "query",
21772	//       "type": "integer"
21773	//     },
21774	//     "pageToken": {
21775	//       "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.",
21776	//       "location": "query",
21777	//       "type": "string"
21778	//     },
21779	//     "parent": {
21780	//       "description": "Required. The parent resource whose buckets are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]\" Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets.",
21781	//       "location": "path",
21782	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
21783	//       "required": true,
21784	//       "type": "string"
21785	//     }
21786	//   },
21787	//   "path": "v2/{+parent}/buckets",
21788	//   "response": {
21789	//     "$ref": "ListBucketsResponse"
21790	//   },
21791	//   "scopes": [
21792	//     "https://www.googleapis.com/auth/cloud-platform",
21793	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21794	//     "https://www.googleapis.com/auth/logging.admin",
21795	//     "https://www.googleapis.com/auth/logging.read"
21796	//   ]
21797	// }
21798
21799}
21800
21801// Pages invokes f for each page of results.
21802// A non-nil error returned from f will halt the iteration.
21803// The provided context supersedes any context provided to the Context method.
21804func (c *ProjectsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
21805	c.ctx_ = ctx
21806	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
21807	for {
21808		x, err := c.Do()
21809		if err != nil {
21810			return err
21811		}
21812		if err := f(x); err != nil {
21813			return err
21814		}
21815		if x.NextPageToken == "" {
21816			return nil
21817		}
21818		c.PageToken(x.NextPageToken)
21819	}
21820}
21821
21822// method id "logging.projects.locations.buckets.patch":
21823
21824type ProjectsLocationsBucketsPatchCall struct {
21825	s          *Service
21826	name       string
21827	logbucket  *LogBucket
21828	urlParams_ gensupport.URLParams
21829	ctx_       context.Context
21830	header_    http.Header
21831}
21832
21833// Patch: Updates a bucket. This method replaces the following fields in
21834// the existing bucket with values from the new bucket:
21835// retention_periodIf the retention period is decreased and the bucket
21836// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
21837// LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
21838// returned.A buckets region may not be modified after it is created.
21839func (r *ProjectsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *ProjectsLocationsBucketsPatchCall {
21840	c := &ProjectsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21841	c.name = name
21842	c.logbucket = logbucket
21843	return c
21844}
21845
21846// UpdateMask sets the optional parameter "updateMask": Required. Field
21847// mask that specifies the fields in bucket that need an update. A
21848// bucket field will be overwritten if, and only if, it is in the update
21849// mask. name and output only fields cannot be updated.For a detailed
21850// FieldMask definition, see
21851// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
21852// updateMask=retention_days.
21853func (c *ProjectsLocationsBucketsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsPatchCall {
21854	c.urlParams_.Set("updateMask", updateMask)
21855	return c
21856}
21857
21858// Fields allows partial responses to be retrieved. See
21859// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21860// for more information.
21861func (c *ProjectsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsPatchCall {
21862	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21863	return c
21864}
21865
21866// Context sets the context to be used in this call's Do method. Any
21867// pending HTTP request will be aborted if the provided context is
21868// canceled.
21869func (c *ProjectsLocationsBucketsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsPatchCall {
21870	c.ctx_ = ctx
21871	return c
21872}
21873
21874// Header returns an http.Header that can be modified by the caller to
21875// add HTTP headers to the request.
21876func (c *ProjectsLocationsBucketsPatchCall) Header() http.Header {
21877	if c.header_ == nil {
21878		c.header_ = make(http.Header)
21879	}
21880	return c.header_
21881}
21882
21883func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
21884	reqHeaders := make(http.Header)
21885	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
21886	for k, v := range c.header_ {
21887		reqHeaders[k] = v
21888	}
21889	reqHeaders.Set("User-Agent", c.s.userAgent())
21890	var body io.Reader = nil
21891	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
21892	if err != nil {
21893		return nil, err
21894	}
21895	reqHeaders.Set("Content-Type", "application/json")
21896	c.urlParams_.Set("alt", alt)
21897	c.urlParams_.Set("prettyPrint", "false")
21898	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
21899	urls += "?" + c.urlParams_.Encode()
21900	req, err := http.NewRequest("PATCH", urls, body)
21901	if err != nil {
21902		return nil, err
21903	}
21904	req.Header = reqHeaders
21905	googleapi.Expand(req.URL, map[string]string{
21906		"name": c.name,
21907	})
21908	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21909}
21910
21911// Do executes the "logging.projects.locations.buckets.patch" call.
21912// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
21913// status code is an error. Response headers are in either
21914// *LogBucket.ServerResponse.Header or (if a response was returned at
21915// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
21916// to check whether the returned error was because
21917// http.StatusNotModified was returned.
21918func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
21919	gensupport.SetOptions(c.urlParams_, opts...)
21920	res, err := c.doRequest("json")
21921	if res != nil && res.StatusCode == http.StatusNotModified {
21922		if res.Body != nil {
21923			res.Body.Close()
21924		}
21925		return nil, &googleapi.Error{
21926			Code:   res.StatusCode,
21927			Header: res.Header,
21928		}
21929	}
21930	if err != nil {
21931		return nil, err
21932	}
21933	defer googleapi.CloseBody(res)
21934	if err := googleapi.CheckResponse(res); err != nil {
21935		return nil, err
21936	}
21937	ret := &LogBucket{
21938		ServerResponse: googleapi.ServerResponse{
21939			Header:         res.Header,
21940			HTTPStatusCode: res.StatusCode,
21941		},
21942	}
21943	target := &ret
21944	if err := gensupport.DecodeResponse(target, res); err != nil {
21945		return nil, err
21946	}
21947	return ret, nil
21948	// {
21949	//   "description": "Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created.",
21950	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}",
21951	//   "httpMethod": "PATCH",
21952	//   "id": "logging.projects.locations.buckets.patch",
21953	//   "parameterOrder": [
21954	//     "name"
21955	//   ],
21956	//   "parameters": {
21957	//     "name": {
21958	//       "description": "Required. The full resource name of the bucket to update. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\". Also requires permission \"resourcemanager.projects.updateLiens\" to set the locked property",
21959	//       "location": "path",
21960	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
21961	//       "required": true,
21962	//       "type": "string"
21963	//     },
21964	//     "updateMask": {
21965	//       "description": "Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days.",
21966	//       "format": "google-fieldmask",
21967	//       "location": "query",
21968	//       "type": "string"
21969	//     }
21970	//   },
21971	//   "path": "v2/{+name}",
21972	//   "request": {
21973	//     "$ref": "LogBucket"
21974	//   },
21975	//   "response": {
21976	//     "$ref": "LogBucket"
21977	//   },
21978	//   "scopes": [
21979	//     "https://www.googleapis.com/auth/cloud-platform",
21980	//     "https://www.googleapis.com/auth/logging.admin"
21981	//   ]
21982	// }
21983
21984}
21985
21986// method id "logging.projects.locations.buckets.undelete":
21987
21988type ProjectsLocationsBucketsUndeleteCall struct {
21989	s                     *Service
21990	name                  string
21991	undeletebucketrequest *UndeleteBucketRequest
21992	urlParams_            gensupport.URLParams
21993	ctx_                  context.Context
21994	header_               http.Header
21995}
21996
21997// Undelete: Undeletes a bucket. A bucket that has been deleted may be
21998// undeleted within the grace period of 7 days.
21999func (r *ProjectsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *ProjectsLocationsBucketsUndeleteCall {
22000	c := &ProjectsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22001	c.name = name
22002	c.undeletebucketrequest = undeletebucketrequest
22003	return c
22004}
22005
22006// Fields allows partial responses to be retrieved. See
22007// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22008// for more information.
22009func (c *ProjectsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUndeleteCall {
22010	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22011	return c
22012}
22013
22014// Context sets the context to be used in this call's Do method. Any
22015// pending HTTP request will be aborted if the provided context is
22016// canceled.
22017func (c *ProjectsLocationsBucketsUndeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsUndeleteCall {
22018	c.ctx_ = ctx
22019	return c
22020}
22021
22022// Header returns an http.Header that can be modified by the caller to
22023// add HTTP headers to the request.
22024func (c *ProjectsLocationsBucketsUndeleteCall) Header() http.Header {
22025	if c.header_ == nil {
22026		c.header_ = make(http.Header)
22027	}
22028	return c.header_
22029}
22030
22031func (c *ProjectsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
22032	reqHeaders := make(http.Header)
22033	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
22034	for k, v := range c.header_ {
22035		reqHeaders[k] = v
22036	}
22037	reqHeaders.Set("User-Agent", c.s.userAgent())
22038	var body io.Reader = nil
22039	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
22040	if err != nil {
22041		return nil, err
22042	}
22043	reqHeaders.Set("Content-Type", "application/json")
22044	c.urlParams_.Set("alt", alt)
22045	c.urlParams_.Set("prettyPrint", "false")
22046	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
22047	urls += "?" + c.urlParams_.Encode()
22048	req, err := http.NewRequest("POST", urls, body)
22049	if err != nil {
22050		return nil, err
22051	}
22052	req.Header = reqHeaders
22053	googleapi.Expand(req.URL, map[string]string{
22054		"name": c.name,
22055	})
22056	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22057}
22058
22059// Do executes the "logging.projects.locations.buckets.undelete" call.
22060// Exactly one of *Empty or error will be non-nil. Any non-2xx status
22061// code is an error. Response headers are in either
22062// *Empty.ServerResponse.Header or (if a response was returned at all)
22063// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22064// check whether the returned error was because http.StatusNotModified
22065// was returned.
22066func (c *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
22067	gensupport.SetOptions(c.urlParams_, opts...)
22068	res, err := c.doRequest("json")
22069	if res != nil && res.StatusCode == http.StatusNotModified {
22070		if res.Body != nil {
22071			res.Body.Close()
22072		}
22073		return nil, &googleapi.Error{
22074			Code:   res.StatusCode,
22075			Header: res.Header,
22076		}
22077	}
22078	if err != nil {
22079		return nil, err
22080	}
22081	defer googleapi.CloseBody(res)
22082	if err := googleapi.CheckResponse(res); err != nil {
22083		return nil, err
22084	}
22085	ret := &Empty{
22086		ServerResponse: googleapi.ServerResponse{
22087			Header:         res.Header,
22088			HTTPStatusCode: res.StatusCode,
22089		},
22090	}
22091	target := &ret
22092	if err := gensupport.DecodeResponse(target, res); err != nil {
22093		return nil, err
22094	}
22095	return ret, nil
22096	// {
22097	//   "description": "Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.",
22098	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
22099	//   "httpMethod": "POST",
22100	//   "id": "logging.projects.locations.buckets.undelete",
22101	//   "parameterOrder": [
22102	//     "name"
22103	//   ],
22104	//   "parameters": {
22105	//     "name": {
22106	//       "description": "Required. The full resource name of the bucket to undelete. \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" \"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id\".",
22107	//       "location": "path",
22108	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
22109	//       "required": true,
22110	//       "type": "string"
22111	//     }
22112	//   },
22113	//   "path": "v2/{+name}:undelete",
22114	//   "request": {
22115	//     "$ref": "UndeleteBucketRequest"
22116	//   },
22117	//   "response": {
22118	//     "$ref": "Empty"
22119	//   },
22120	//   "scopes": [
22121	//     "https://www.googleapis.com/auth/cloud-platform",
22122	//     "https://www.googleapis.com/auth/logging.admin"
22123	//   ]
22124	// }
22125
22126}
22127
22128// method id "logging.projects.locations.buckets.views.create":
22129
22130type ProjectsLocationsBucketsViewsCreateCall struct {
22131	s          *Service
22132	parent     string
22133	logview    *LogView
22134	urlParams_ gensupport.URLParams
22135	ctx_       context.Context
22136	header_    http.Header
22137}
22138
22139// Create: Creates a view over logs in a bucket. A bucket may contain a
22140// maximum of 50 views.
22141func (r *ProjectsLocationsBucketsViewsService) Create(parent string, logview *LogView) *ProjectsLocationsBucketsViewsCreateCall {
22142	c := &ProjectsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22143	c.parent = parent
22144	c.logview = logview
22145	return c
22146}
22147
22148// ViewId sets the optional parameter "viewId": Required. The id to use
22149// for this view.
22150func (c *ProjectsLocationsBucketsViewsCreateCall) ViewId(viewId string) *ProjectsLocationsBucketsViewsCreateCall {
22151	c.urlParams_.Set("viewId", viewId)
22152	return c
22153}
22154
22155// Fields allows partial responses to be retrieved. See
22156// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22157// for more information.
22158func (c *ProjectsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsCreateCall {
22159	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22160	return c
22161}
22162
22163// Context sets the context to be used in this call's Do method. Any
22164// pending HTTP request will be aborted if the provided context is
22165// canceled.
22166func (c *ProjectsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsCreateCall {
22167	c.ctx_ = ctx
22168	return c
22169}
22170
22171// Header returns an http.Header that can be modified by the caller to
22172// add HTTP headers to the request.
22173func (c *ProjectsLocationsBucketsViewsCreateCall) Header() http.Header {
22174	if c.header_ == nil {
22175		c.header_ = make(http.Header)
22176	}
22177	return c.header_
22178}
22179
22180func (c *ProjectsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
22181	reqHeaders := make(http.Header)
22182	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
22183	for k, v := range c.header_ {
22184		reqHeaders[k] = v
22185	}
22186	reqHeaders.Set("User-Agent", c.s.userAgent())
22187	var body io.Reader = nil
22188	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
22189	if err != nil {
22190		return nil, err
22191	}
22192	reqHeaders.Set("Content-Type", "application/json")
22193	c.urlParams_.Set("alt", alt)
22194	c.urlParams_.Set("prettyPrint", "false")
22195	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
22196	urls += "?" + c.urlParams_.Encode()
22197	req, err := http.NewRequest("POST", urls, body)
22198	if err != nil {
22199		return nil, err
22200	}
22201	req.Header = reqHeaders
22202	googleapi.Expand(req.URL, map[string]string{
22203		"parent": c.parent,
22204	})
22205	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22206}
22207
22208// Do executes the "logging.projects.locations.buckets.views.create" call.
22209// Exactly one of *LogView or error will be non-nil. Any non-2xx status
22210// code is an error. Response headers are in either
22211// *LogView.ServerResponse.Header or (if a response was returned at all)
22212// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22213// check whether the returned error was because http.StatusNotModified
22214// was returned.
22215func (c *ProjectsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
22216	gensupport.SetOptions(c.urlParams_, opts...)
22217	res, err := c.doRequest("json")
22218	if res != nil && res.StatusCode == http.StatusNotModified {
22219		if res.Body != nil {
22220			res.Body.Close()
22221		}
22222		return nil, &googleapi.Error{
22223			Code:   res.StatusCode,
22224			Header: res.Header,
22225		}
22226	}
22227	if err != nil {
22228		return nil, err
22229	}
22230	defer googleapi.CloseBody(res)
22231	if err := googleapi.CheckResponse(res); err != nil {
22232		return nil, err
22233	}
22234	ret := &LogView{
22235		ServerResponse: googleapi.ServerResponse{
22236			Header:         res.Header,
22237			HTTPStatusCode: res.StatusCode,
22238		},
22239	}
22240	target := &ret
22241	if err := gensupport.DecodeResponse(target, res); err != nil {
22242		return nil, err
22243	}
22244	return ret, nil
22245	// {
22246	//   "description": "Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.",
22247	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views",
22248	//   "httpMethod": "POST",
22249	//   "id": "logging.projects.locations.buckets.views.create",
22250	//   "parameterOrder": [
22251	//     "parent"
22252	//   ],
22253	//   "parameters": {
22254	//     "parent": {
22255	//       "description": "Required. The bucket in which to create the view \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" Example: \"projects/my-logging-project/locations/my-location/buckets/my-bucket\"",
22256	//       "location": "path",
22257	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
22258	//       "required": true,
22259	//       "type": "string"
22260	//     },
22261	//     "viewId": {
22262	//       "description": "Required. The id to use for this view.",
22263	//       "location": "query",
22264	//       "type": "string"
22265	//     }
22266	//   },
22267	//   "path": "v2/{+parent}/views",
22268	//   "request": {
22269	//     "$ref": "LogView"
22270	//   },
22271	//   "response": {
22272	//     "$ref": "LogView"
22273	//   },
22274	//   "scopes": [
22275	//     "https://www.googleapis.com/auth/cloud-platform",
22276	//     "https://www.googleapis.com/auth/logging.admin"
22277	//   ]
22278	// }
22279
22280}
22281
22282// method id "logging.projects.locations.buckets.views.delete":
22283
22284type ProjectsLocationsBucketsViewsDeleteCall struct {
22285	s          *Service
22286	name       string
22287	urlParams_ gensupport.URLParams
22288	ctx_       context.Context
22289	header_    http.Header
22290}
22291
22292// Delete: Deletes a view from a bucket.
22293func (r *ProjectsLocationsBucketsViewsService) Delete(name string) *ProjectsLocationsBucketsViewsDeleteCall {
22294	c := &ProjectsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22295	c.name = name
22296	return c
22297}
22298
22299// Fields allows partial responses to be retrieved. See
22300// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22301// for more information.
22302func (c *ProjectsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsDeleteCall {
22303	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22304	return c
22305}
22306
22307// Context sets the context to be used in this call's Do method. Any
22308// pending HTTP request will be aborted if the provided context is
22309// canceled.
22310func (c *ProjectsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsDeleteCall {
22311	c.ctx_ = ctx
22312	return c
22313}
22314
22315// Header returns an http.Header that can be modified by the caller to
22316// add HTTP headers to the request.
22317func (c *ProjectsLocationsBucketsViewsDeleteCall) Header() http.Header {
22318	if c.header_ == nil {
22319		c.header_ = make(http.Header)
22320	}
22321	return c.header_
22322}
22323
22324func (c *ProjectsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
22325	reqHeaders := make(http.Header)
22326	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
22327	for k, v := range c.header_ {
22328		reqHeaders[k] = v
22329	}
22330	reqHeaders.Set("User-Agent", c.s.userAgent())
22331	var body io.Reader = nil
22332	c.urlParams_.Set("alt", alt)
22333	c.urlParams_.Set("prettyPrint", "false")
22334	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
22335	urls += "?" + c.urlParams_.Encode()
22336	req, err := http.NewRequest("DELETE", urls, body)
22337	if err != nil {
22338		return nil, err
22339	}
22340	req.Header = reqHeaders
22341	googleapi.Expand(req.URL, map[string]string{
22342		"name": c.name,
22343	})
22344	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22345}
22346
22347// Do executes the "logging.projects.locations.buckets.views.delete" call.
22348// Exactly one of *Empty or error will be non-nil. Any non-2xx status
22349// code is an error. Response headers are in either
22350// *Empty.ServerResponse.Header or (if a response was returned at all)
22351// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22352// check whether the returned error was because http.StatusNotModified
22353// was returned.
22354func (c *ProjectsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
22355	gensupport.SetOptions(c.urlParams_, opts...)
22356	res, err := c.doRequest("json")
22357	if res != nil && res.StatusCode == http.StatusNotModified {
22358		if res.Body != nil {
22359			res.Body.Close()
22360		}
22361		return nil, &googleapi.Error{
22362			Code:   res.StatusCode,
22363			Header: res.Header,
22364		}
22365	}
22366	if err != nil {
22367		return nil, err
22368	}
22369	defer googleapi.CloseBody(res)
22370	if err := googleapi.CheckResponse(res); err != nil {
22371		return nil, err
22372	}
22373	ret := &Empty{
22374		ServerResponse: googleapi.ServerResponse{
22375			Header:         res.Header,
22376			HTTPStatusCode: res.StatusCode,
22377		},
22378	}
22379	target := &ret
22380	if err := gensupport.DecodeResponse(target, res); err != nil {
22381		return nil, err
22382	}
22383	return ret, nil
22384	// {
22385	//   "description": "Deletes a view from a bucket.",
22386	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
22387	//   "httpMethod": "DELETE",
22388	//   "id": "logging.projects.locations.buckets.views.delete",
22389	//   "parameterOrder": [
22390	//     "name"
22391	//   ],
22392	//   "parameters": {
22393	//     "name": {
22394	//       "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
22395	//       "location": "path",
22396	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
22397	//       "required": true,
22398	//       "type": "string"
22399	//     }
22400	//   },
22401	//   "path": "v2/{+name}",
22402	//   "response": {
22403	//     "$ref": "Empty"
22404	//   },
22405	//   "scopes": [
22406	//     "https://www.googleapis.com/auth/cloud-platform",
22407	//     "https://www.googleapis.com/auth/logging.admin"
22408	//   ]
22409	// }
22410
22411}
22412
22413// method id "logging.projects.locations.buckets.views.get":
22414
22415type ProjectsLocationsBucketsViewsGetCall struct {
22416	s            *Service
22417	name         string
22418	urlParams_   gensupport.URLParams
22419	ifNoneMatch_ string
22420	ctx_         context.Context
22421	header_      http.Header
22422}
22423
22424// Get: Gets a view.
22425func (r *ProjectsLocationsBucketsViewsService) Get(name string) *ProjectsLocationsBucketsViewsGetCall {
22426	c := &ProjectsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22427	c.name = name
22428	return c
22429}
22430
22431// Fields allows partial responses to be retrieved. See
22432// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22433// for more information.
22434func (c *ProjectsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsGetCall {
22435	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22436	return c
22437}
22438
22439// IfNoneMatch sets the optional parameter which makes the operation
22440// fail if the object's ETag matches the given value. This is useful for
22441// getting updates only after the object has changed since the last
22442// request. Use googleapi.IsNotModified to check whether the response
22443// error from Do is the result of In-None-Match.
22444func (c *ProjectsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsGetCall {
22445	c.ifNoneMatch_ = entityTag
22446	return c
22447}
22448
22449// Context sets the context to be used in this call's Do method. Any
22450// pending HTTP request will be aborted if the provided context is
22451// canceled.
22452func (c *ProjectsLocationsBucketsViewsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsGetCall {
22453	c.ctx_ = ctx
22454	return c
22455}
22456
22457// Header returns an http.Header that can be modified by the caller to
22458// add HTTP headers to the request.
22459func (c *ProjectsLocationsBucketsViewsGetCall) Header() http.Header {
22460	if c.header_ == nil {
22461		c.header_ = make(http.Header)
22462	}
22463	return c.header_
22464}
22465
22466func (c *ProjectsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
22467	reqHeaders := make(http.Header)
22468	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
22469	for k, v := range c.header_ {
22470		reqHeaders[k] = v
22471	}
22472	reqHeaders.Set("User-Agent", c.s.userAgent())
22473	if c.ifNoneMatch_ != "" {
22474		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
22475	}
22476	var body io.Reader = nil
22477	c.urlParams_.Set("alt", alt)
22478	c.urlParams_.Set("prettyPrint", "false")
22479	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
22480	urls += "?" + c.urlParams_.Encode()
22481	req, err := http.NewRequest("GET", urls, body)
22482	if err != nil {
22483		return nil, err
22484	}
22485	req.Header = reqHeaders
22486	googleapi.Expand(req.URL, map[string]string{
22487		"name": c.name,
22488	})
22489	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22490}
22491
22492// Do executes the "logging.projects.locations.buckets.views.get" call.
22493// Exactly one of *LogView or error will be non-nil. Any non-2xx status
22494// code is an error. Response headers are in either
22495// *LogView.ServerResponse.Header or (if a response was returned at all)
22496// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22497// check whether the returned error was because http.StatusNotModified
22498// was returned.
22499func (c *ProjectsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
22500	gensupport.SetOptions(c.urlParams_, opts...)
22501	res, err := c.doRequest("json")
22502	if res != nil && res.StatusCode == http.StatusNotModified {
22503		if res.Body != nil {
22504			res.Body.Close()
22505		}
22506		return nil, &googleapi.Error{
22507			Code:   res.StatusCode,
22508			Header: res.Header,
22509		}
22510	}
22511	if err != nil {
22512		return nil, err
22513	}
22514	defer googleapi.CloseBody(res)
22515	if err := googleapi.CheckResponse(res); err != nil {
22516		return nil, err
22517	}
22518	ret := &LogView{
22519		ServerResponse: googleapi.ServerResponse{
22520			Header:         res.Header,
22521			HTTPStatusCode: res.StatusCode,
22522		},
22523	}
22524	target := &ret
22525	if err := gensupport.DecodeResponse(target, res); err != nil {
22526		return nil, err
22527	}
22528	return ret, nil
22529	// {
22530	//   "description": "Gets a view.",
22531	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
22532	//   "httpMethod": "GET",
22533	//   "id": "logging.projects.locations.buckets.views.get",
22534	//   "parameterOrder": [
22535	//     "name"
22536	//   ],
22537	//   "parameters": {
22538	//     "name": {
22539	//       "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
22540	//       "location": "path",
22541	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
22542	//       "required": true,
22543	//       "type": "string"
22544	//     }
22545	//   },
22546	//   "path": "v2/{+name}",
22547	//   "response": {
22548	//     "$ref": "LogView"
22549	//   },
22550	//   "scopes": [
22551	//     "https://www.googleapis.com/auth/cloud-platform",
22552	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
22553	//     "https://www.googleapis.com/auth/logging.admin",
22554	//     "https://www.googleapis.com/auth/logging.read"
22555	//   ]
22556	// }
22557
22558}
22559
22560// method id "logging.projects.locations.buckets.views.list":
22561
22562type ProjectsLocationsBucketsViewsListCall struct {
22563	s            *Service
22564	parent       string
22565	urlParams_   gensupport.URLParams
22566	ifNoneMatch_ string
22567	ctx_         context.Context
22568	header_      http.Header
22569}
22570
22571// List: Lists views on a bucket.
22572func (r *ProjectsLocationsBucketsViewsService) List(parent string) *ProjectsLocationsBucketsViewsListCall {
22573	c := &ProjectsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22574	c.parent = parent
22575	return c
22576}
22577
22578// PageSize sets the optional parameter "pageSize": The maximum number
22579// of results to return from this request. Non-positive values are
22580// ignored. The presence of nextPageToken in the response indicates that
22581// more results might be available.
22582func (c *ProjectsLocationsBucketsViewsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsViewsListCall {
22583	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
22584	return c
22585}
22586
22587// PageToken sets the optional parameter "pageToken": If present, then
22588// retrieve the next batch of results from the preceding call to this
22589// method. pageToken must be the value of nextPageToken from the
22590// previous response. The values of other method parameters should be
22591// identical to those in the previous call.
22592func (c *ProjectsLocationsBucketsViewsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsViewsListCall {
22593	c.urlParams_.Set("pageToken", pageToken)
22594	return c
22595}
22596
22597// Fields allows partial responses to be retrieved. See
22598// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22599// for more information.
22600func (c *ProjectsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsListCall {
22601	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22602	return c
22603}
22604
22605// IfNoneMatch sets the optional parameter which makes the operation
22606// fail if the object's ETag matches the given value. This is useful for
22607// getting updates only after the object has changed since the last
22608// request. Use googleapi.IsNotModified to check whether the response
22609// error from Do is the result of In-None-Match.
22610func (c *ProjectsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsListCall {
22611	c.ifNoneMatch_ = entityTag
22612	return c
22613}
22614
22615// Context sets the context to be used in this call's Do method. Any
22616// pending HTTP request will be aborted if the provided context is
22617// canceled.
22618func (c *ProjectsLocationsBucketsViewsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsListCall {
22619	c.ctx_ = ctx
22620	return c
22621}
22622
22623// Header returns an http.Header that can be modified by the caller to
22624// add HTTP headers to the request.
22625func (c *ProjectsLocationsBucketsViewsListCall) Header() http.Header {
22626	if c.header_ == nil {
22627		c.header_ = make(http.Header)
22628	}
22629	return c.header_
22630}
22631
22632func (c *ProjectsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
22633	reqHeaders := make(http.Header)
22634	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
22635	for k, v := range c.header_ {
22636		reqHeaders[k] = v
22637	}
22638	reqHeaders.Set("User-Agent", c.s.userAgent())
22639	if c.ifNoneMatch_ != "" {
22640		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
22641	}
22642	var body io.Reader = nil
22643	c.urlParams_.Set("alt", alt)
22644	c.urlParams_.Set("prettyPrint", "false")
22645	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
22646	urls += "?" + c.urlParams_.Encode()
22647	req, err := http.NewRequest("GET", urls, body)
22648	if err != nil {
22649		return nil, err
22650	}
22651	req.Header = reqHeaders
22652	googleapi.Expand(req.URL, map[string]string{
22653		"parent": c.parent,
22654	})
22655	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22656}
22657
22658// Do executes the "logging.projects.locations.buckets.views.list" call.
22659// Exactly one of *ListViewsResponse or error will be non-nil. Any
22660// non-2xx status code is an error. Response headers are in either
22661// *ListViewsResponse.ServerResponse.Header or (if a response was
22662// returned at all) in error.(*googleapi.Error).Header. Use
22663// googleapi.IsNotModified to check whether the returned error was
22664// because http.StatusNotModified was returned.
22665func (c *ProjectsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
22666	gensupport.SetOptions(c.urlParams_, opts...)
22667	res, err := c.doRequest("json")
22668	if res != nil && res.StatusCode == http.StatusNotModified {
22669		if res.Body != nil {
22670			res.Body.Close()
22671		}
22672		return nil, &googleapi.Error{
22673			Code:   res.StatusCode,
22674			Header: res.Header,
22675		}
22676	}
22677	if err != nil {
22678		return nil, err
22679	}
22680	defer googleapi.CloseBody(res)
22681	if err := googleapi.CheckResponse(res); err != nil {
22682		return nil, err
22683	}
22684	ret := &ListViewsResponse{
22685		ServerResponse: googleapi.ServerResponse{
22686			Header:         res.Header,
22687			HTTPStatusCode: res.StatusCode,
22688		},
22689	}
22690	target := &ret
22691	if err := gensupport.DecodeResponse(target, res); err != nil {
22692		return nil, err
22693	}
22694	return ret, nil
22695	// {
22696	//   "description": "Lists views on a bucket.",
22697	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views",
22698	//   "httpMethod": "GET",
22699	//   "id": "logging.projects.locations.buckets.views.list",
22700	//   "parameterOrder": [
22701	//     "parent"
22702	//   ],
22703	//   "parameters": {
22704	//     "pageSize": {
22705	//       "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.",
22706	//       "format": "int32",
22707	//       "location": "query",
22708	//       "type": "integer"
22709	//     },
22710	//     "pageToken": {
22711	//       "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.",
22712	//       "location": "query",
22713	//       "type": "string"
22714	//     },
22715	//     "parent": {
22716	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
22717	//       "location": "path",
22718	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
22719	//       "required": true,
22720	//       "type": "string"
22721	//     }
22722	//   },
22723	//   "path": "v2/{+parent}/views",
22724	//   "response": {
22725	//     "$ref": "ListViewsResponse"
22726	//   },
22727	//   "scopes": [
22728	//     "https://www.googleapis.com/auth/cloud-platform",
22729	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
22730	//     "https://www.googleapis.com/auth/logging.admin",
22731	//     "https://www.googleapis.com/auth/logging.read"
22732	//   ]
22733	// }
22734
22735}
22736
22737// Pages invokes f for each page of results.
22738// A non-nil error returned from f will halt the iteration.
22739// The provided context supersedes any context provided to the Context method.
22740func (c *ProjectsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
22741	c.ctx_ = ctx
22742	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
22743	for {
22744		x, err := c.Do()
22745		if err != nil {
22746			return err
22747		}
22748		if err := f(x); err != nil {
22749			return err
22750		}
22751		if x.NextPageToken == "" {
22752			return nil
22753		}
22754		c.PageToken(x.NextPageToken)
22755	}
22756}
22757
22758// method id "logging.projects.locations.buckets.views.patch":
22759
22760type ProjectsLocationsBucketsViewsPatchCall struct {
22761	s          *Service
22762	name       string
22763	logview    *LogView
22764	urlParams_ gensupport.URLParams
22765	ctx_       context.Context
22766	header_    http.Header
22767}
22768
22769// Patch: Updates a view. This method replaces the following fields in
22770// the existing view with values from the new view: filter.
22771func (r *ProjectsLocationsBucketsViewsService) Patch(name string, logview *LogView) *ProjectsLocationsBucketsViewsPatchCall {
22772	c := &ProjectsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22773	c.name = name
22774	c.logview = logview
22775	return c
22776}
22777
22778// UpdateMask sets the optional parameter "updateMask": Field mask that
22779// specifies the fields in view that need an update. A field will be
22780// overwritten if, and only if, it is in the update mask. name and
22781// output only fields cannot be updated.For a detailed FieldMask
22782// definition, see
22783// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
22784// updateMask=filter.
22785func (c *ProjectsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsViewsPatchCall {
22786	c.urlParams_.Set("updateMask", updateMask)
22787	return c
22788}
22789
22790// Fields allows partial responses to be retrieved. See
22791// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22792// for more information.
22793func (c *ProjectsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsPatchCall {
22794	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22795	return c
22796}
22797
22798// Context sets the context to be used in this call's Do method. Any
22799// pending HTTP request will be aborted if the provided context is
22800// canceled.
22801func (c *ProjectsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsPatchCall {
22802	c.ctx_ = ctx
22803	return c
22804}
22805
22806// Header returns an http.Header that can be modified by the caller to
22807// add HTTP headers to the request.
22808func (c *ProjectsLocationsBucketsViewsPatchCall) Header() http.Header {
22809	if c.header_ == nil {
22810		c.header_ = make(http.Header)
22811	}
22812	return c.header_
22813}
22814
22815func (c *ProjectsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
22816	reqHeaders := make(http.Header)
22817	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
22818	for k, v := range c.header_ {
22819		reqHeaders[k] = v
22820	}
22821	reqHeaders.Set("User-Agent", c.s.userAgent())
22822	var body io.Reader = nil
22823	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
22824	if err != nil {
22825		return nil, err
22826	}
22827	reqHeaders.Set("Content-Type", "application/json")
22828	c.urlParams_.Set("alt", alt)
22829	c.urlParams_.Set("prettyPrint", "false")
22830	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
22831	urls += "?" + c.urlParams_.Encode()
22832	req, err := http.NewRequest("PATCH", urls, body)
22833	if err != nil {
22834		return nil, err
22835	}
22836	req.Header = reqHeaders
22837	googleapi.Expand(req.URL, map[string]string{
22838		"name": c.name,
22839	})
22840	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22841}
22842
22843// Do executes the "logging.projects.locations.buckets.views.patch" call.
22844// Exactly one of *LogView or error will be non-nil. Any non-2xx status
22845// code is an error. Response headers are in either
22846// *LogView.ServerResponse.Header or (if a response was returned at all)
22847// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22848// check whether the returned error was because http.StatusNotModified
22849// was returned.
22850func (c *ProjectsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
22851	gensupport.SetOptions(c.urlParams_, opts...)
22852	res, err := c.doRequest("json")
22853	if res != nil && res.StatusCode == http.StatusNotModified {
22854		if res.Body != nil {
22855			res.Body.Close()
22856		}
22857		return nil, &googleapi.Error{
22858			Code:   res.StatusCode,
22859			Header: res.Header,
22860		}
22861	}
22862	if err != nil {
22863		return nil, err
22864	}
22865	defer googleapi.CloseBody(res)
22866	if err := googleapi.CheckResponse(res); err != nil {
22867		return nil, err
22868	}
22869	ret := &LogView{
22870		ServerResponse: googleapi.ServerResponse{
22871			Header:         res.Header,
22872			HTTPStatusCode: res.StatusCode,
22873		},
22874	}
22875	target := &ret
22876	if err := gensupport.DecodeResponse(target, res); err != nil {
22877		return nil, err
22878	}
22879	return ret, nil
22880	// {
22881	//   "description": "Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.",
22882	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
22883	//   "httpMethod": "PATCH",
22884	//   "id": "logging.projects.locations.buckets.views.patch",
22885	//   "parameterOrder": [
22886	//     "name"
22887	//   ],
22888	//   "parameters": {
22889	//     "name": {
22890	//       "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" Example: \"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id\".",
22891	//       "location": "path",
22892	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
22893	//       "required": true,
22894	//       "type": "string"
22895	//     },
22896	//     "updateMask": {
22897	//       "description": "Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
22898	//       "format": "google-fieldmask",
22899	//       "location": "query",
22900	//       "type": "string"
22901	//     }
22902	//   },
22903	//   "path": "v2/{+name}",
22904	//   "request": {
22905	//     "$ref": "LogView"
22906	//   },
22907	//   "response": {
22908	//     "$ref": "LogView"
22909	//   },
22910	//   "scopes": [
22911	//     "https://www.googleapis.com/auth/cloud-platform",
22912	//     "https://www.googleapis.com/auth/logging.admin"
22913	//   ]
22914	// }
22915
22916}
22917
22918// method id "logging.projects.logs.delete":
22919
22920type ProjectsLogsDeleteCall struct {
22921	s          *Service
22922	logName    string
22923	urlParams_ gensupport.URLParams
22924	ctx_       context.Context
22925	header_    http.Header
22926}
22927
22928// Delete: Deletes all the log entries in a log. The log reappears if it
22929// receives new entries. Log entries written shortly before the delete
22930// operation might not be deleted. Entries received after the delete
22931// operation with a timestamp before the operation will be deleted.
22932func (r *ProjectsLogsService) Delete(logName string) *ProjectsLogsDeleteCall {
22933	c := &ProjectsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22934	c.logName = logName
22935	return c
22936}
22937
22938// Fields allows partial responses to be retrieved. See
22939// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22940// for more information.
22941func (c *ProjectsLogsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsDeleteCall {
22942	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22943	return c
22944}
22945
22946// Context sets the context to be used in this call's Do method. Any
22947// pending HTTP request will be aborted if the provided context is
22948// canceled.
22949func (c *ProjectsLogsDeleteCall) Context(ctx context.Context) *ProjectsLogsDeleteCall {
22950	c.ctx_ = ctx
22951	return c
22952}
22953
22954// Header returns an http.Header that can be modified by the caller to
22955// add HTTP headers to the request.
22956func (c *ProjectsLogsDeleteCall) Header() http.Header {
22957	if c.header_ == nil {
22958		c.header_ = make(http.Header)
22959	}
22960	return c.header_
22961}
22962
22963func (c *ProjectsLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
22964	reqHeaders := make(http.Header)
22965	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
22966	for k, v := range c.header_ {
22967		reqHeaders[k] = v
22968	}
22969	reqHeaders.Set("User-Agent", c.s.userAgent())
22970	var body io.Reader = nil
22971	c.urlParams_.Set("alt", alt)
22972	c.urlParams_.Set("prettyPrint", "false")
22973	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
22974	urls += "?" + c.urlParams_.Encode()
22975	req, err := http.NewRequest("DELETE", urls, body)
22976	if err != nil {
22977		return nil, err
22978	}
22979	req.Header = reqHeaders
22980	googleapi.Expand(req.URL, map[string]string{
22981		"logName": c.logName,
22982	})
22983	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22984}
22985
22986// Do executes the "logging.projects.logs.delete" call.
22987// Exactly one of *Empty or error will be non-nil. Any non-2xx status
22988// code is an error. Response headers are in either
22989// *Empty.ServerResponse.Header or (if a response was returned at all)
22990// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22991// check whether the returned error was because http.StatusNotModified
22992// was returned.
22993func (c *ProjectsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
22994	gensupport.SetOptions(c.urlParams_, opts...)
22995	res, err := c.doRequest("json")
22996	if res != nil && res.StatusCode == http.StatusNotModified {
22997		if res.Body != nil {
22998			res.Body.Close()
22999		}
23000		return nil, &googleapi.Error{
23001			Code:   res.StatusCode,
23002			Header: res.Header,
23003		}
23004	}
23005	if err != nil {
23006		return nil, err
23007	}
23008	defer googleapi.CloseBody(res)
23009	if err := googleapi.CheckResponse(res); err != nil {
23010		return nil, err
23011	}
23012	ret := &Empty{
23013		ServerResponse: googleapi.ServerResponse{
23014			Header:         res.Header,
23015			HTTPStatusCode: res.StatusCode,
23016		},
23017	}
23018	target := &ret
23019	if err := gensupport.DecodeResponse(target, res); err != nil {
23020		return nil, err
23021	}
23022	return ret, nil
23023	// {
23024	//   "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. Entries received after the delete operation with a timestamp before the operation will be deleted.",
23025	//   "flatPath": "v2/projects/{projectsId}/logs/{logsId}",
23026	//   "httpMethod": "DELETE",
23027	//   "id": "logging.projects.logs.delete",
23028	//   "parameterOrder": [
23029	//     "logName"
23030	//   ],
23031	//   "parameters": {
23032	//     "logName": {
23033	//       "description": "Required. The resource name of the log to delete: \"projects/[PROJECT_ID]/logs/[LOG_ID]\" \"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\" \"folders/[FOLDER_ID]/logs/[LOG_ID]\" [LOG_ID] must be URL-encoded. For example, \"projects/my-project-id/logs/syslog\", \"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\". For more information about log names, see LogEntry.",
23034	//       "location": "path",
23035	//       "pattern": "^projects/[^/]+/logs/[^/]+$",
23036	//       "required": true,
23037	//       "type": "string"
23038	//     }
23039	//   },
23040	//   "path": "v2/{+logName}",
23041	//   "response": {
23042	//     "$ref": "Empty"
23043	//   },
23044	//   "scopes": [
23045	//     "https://www.googleapis.com/auth/cloud-platform",
23046	//     "https://www.googleapis.com/auth/logging.admin"
23047	//   ]
23048	// }
23049
23050}
23051
23052// method id "logging.projects.logs.list":
23053
23054type ProjectsLogsListCall struct {
23055	s            *Service
23056	parent       string
23057	urlParams_   gensupport.URLParams
23058	ifNoneMatch_ string
23059	ctx_         context.Context
23060	header_      http.Header
23061}
23062
23063// List: Lists the logs in projects, organizations, folders, or billing
23064// accounts. Only logs that have entries are listed.
23065func (r *ProjectsLogsService) List(parent string) *ProjectsLogsListCall {
23066	c := &ProjectsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23067	c.parent = parent
23068	return c
23069}
23070
23071// PageSize sets the optional parameter "pageSize": The maximum number
23072// of results to return from this request. Non-positive values are
23073// ignored. The presence of nextPageToken in the response indicates that
23074// more results might be available.
23075func (c *ProjectsLogsListCall) PageSize(pageSize int64) *ProjectsLogsListCall {
23076	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
23077	return c
23078}
23079
23080// PageToken sets the optional parameter "pageToken": If present, then
23081// retrieve the next batch of results from the preceding call to this
23082// method. pageToken must be the value of nextPageToken from the
23083// previous response. The values of other method parameters should be
23084// identical to those in the previous call.
23085func (c *ProjectsLogsListCall) PageToken(pageToken string) *ProjectsLogsListCall {
23086	c.urlParams_.Set("pageToken", pageToken)
23087	return c
23088}
23089
23090// ResourceNames sets the optional parameter "resourceNames": The
23091// resource name that owns the logs:
23092// projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW
23093// _ID
23094// organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/v
23095// iews/VIEW_ID
23096// billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKE
23097// T_ID/views/VIEW_ID
23098// folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_I
23099// DTo support legacy queries, it could also be: "projects/PROJECT_ID"
23100// "organizations/ORGANIZATION_ID" "billingAccounts/BILLING_ACCOUNT_ID"
23101// "folders/FOLDER_ID"
23102func (c *ProjectsLogsListCall) ResourceNames(resourceNames ...string) *ProjectsLogsListCall {
23103	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
23104	return c
23105}
23106
23107// Fields allows partial responses to be retrieved. See
23108// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23109// for more information.
23110func (c *ProjectsLogsListCall) Fields(s ...googleapi.Field) *ProjectsLogsListCall {
23111	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23112	return c
23113}
23114
23115// IfNoneMatch sets the optional parameter which makes the operation
23116// fail if the object's ETag matches the given value. This is useful for
23117// getting updates only after the object has changed since the last
23118// request. Use googleapi.IsNotModified to check whether the response
23119// error from Do is the result of In-None-Match.
23120func (c *ProjectsLogsListCall) IfNoneMatch(entityTag string) *ProjectsLogsListCall {
23121	c.ifNoneMatch_ = entityTag
23122	return c
23123}
23124
23125// Context sets the context to be used in this call's Do method. Any
23126// pending HTTP request will be aborted if the provided context is
23127// canceled.
23128func (c *ProjectsLogsListCall) Context(ctx context.Context) *ProjectsLogsListCall {
23129	c.ctx_ = ctx
23130	return c
23131}
23132
23133// Header returns an http.Header that can be modified by the caller to
23134// add HTTP headers to the request.
23135func (c *ProjectsLogsListCall) Header() http.Header {
23136	if c.header_ == nil {
23137		c.header_ = make(http.Header)
23138	}
23139	return c.header_
23140}
23141
23142func (c *ProjectsLogsListCall) doRequest(alt string) (*http.Response, error) {
23143	reqHeaders := make(http.Header)
23144	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
23145	for k, v := range c.header_ {
23146		reqHeaders[k] = v
23147	}
23148	reqHeaders.Set("User-Agent", c.s.userAgent())
23149	if c.ifNoneMatch_ != "" {
23150		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
23151	}
23152	var body io.Reader = nil
23153	c.urlParams_.Set("alt", alt)
23154	c.urlParams_.Set("prettyPrint", "false")
23155	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
23156	urls += "?" + c.urlParams_.Encode()
23157	req, err := http.NewRequest("GET", urls, body)
23158	if err != nil {
23159		return nil, err
23160	}
23161	req.Header = reqHeaders
23162	googleapi.Expand(req.URL, map[string]string{
23163		"parent": c.parent,
23164	})
23165	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23166}
23167
23168// Do executes the "logging.projects.logs.list" call.
23169// Exactly one of *ListLogsResponse or error will be non-nil. Any
23170// non-2xx status code is an error. Response headers are in either
23171// *ListLogsResponse.ServerResponse.Header or (if a response was
23172// returned at all) in error.(*googleapi.Error).Header. Use
23173// googleapi.IsNotModified to check whether the returned error was
23174// because http.StatusNotModified was returned.
23175func (c *ProjectsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
23176	gensupport.SetOptions(c.urlParams_, opts...)
23177	res, err := c.doRequest("json")
23178	if res != nil && res.StatusCode == http.StatusNotModified {
23179		if res.Body != nil {
23180			res.Body.Close()
23181		}
23182		return nil, &googleapi.Error{
23183			Code:   res.StatusCode,
23184			Header: res.Header,
23185		}
23186	}
23187	if err != nil {
23188		return nil, err
23189	}
23190	defer googleapi.CloseBody(res)
23191	if err := googleapi.CheckResponse(res); err != nil {
23192		return nil, err
23193	}
23194	ret := &ListLogsResponse{
23195		ServerResponse: googleapi.ServerResponse{
23196			Header:         res.Header,
23197			HTTPStatusCode: res.StatusCode,
23198		},
23199	}
23200	target := &ret
23201	if err := gensupport.DecodeResponse(target, res); err != nil {
23202		return nil, err
23203	}
23204	return ret, nil
23205	// {
23206	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
23207	//   "flatPath": "v2/projects/{projectsId}/logs",
23208	//   "httpMethod": "GET",
23209	//   "id": "logging.projects.logs.list",
23210	//   "parameterOrder": [
23211	//     "parent"
23212	//   ],
23213	//   "parameters": {
23214	//     "pageSize": {
23215	//       "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.",
23216	//       "format": "int32",
23217	//       "location": "query",
23218	//       "type": "integer"
23219	//     },
23220	//     "pageToken": {
23221	//       "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.",
23222	//       "location": "query",
23223	//       "type": "string"
23224	//     },
23225	//     "parent": {
23226	//       "description": "Required. The resource name that owns the logs: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
23227	//       "location": "path",
23228	//       "pattern": "^projects/[^/]+$",
23229	//       "required": true,
23230	//       "type": "string"
23231	//     },
23232	//     "resourceNames": {
23233	//       "description": "Optional. The resource name that owns the logs: projects/PROJECT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID organization/ORGANIZATION_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID billingAccounts/BILLING_ACCOUNT_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_ID folders/FOLDER_ID/locations/LOCATION_ID/buckets/BUCKET_ID/views/VIEW_IDTo support legacy queries, it could also be: \"projects/PROJECT_ID\" \"organizations/ORGANIZATION_ID\" \"billingAccounts/BILLING_ACCOUNT_ID\" \"folders/FOLDER_ID\"",
23234	//       "location": "query",
23235	//       "repeated": true,
23236	//       "type": "string"
23237	//     }
23238	//   },
23239	//   "path": "v2/{+parent}/logs",
23240	//   "response": {
23241	//     "$ref": "ListLogsResponse"
23242	//   },
23243	//   "scopes": [
23244	//     "https://www.googleapis.com/auth/cloud-platform",
23245	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
23246	//     "https://www.googleapis.com/auth/logging.admin",
23247	//     "https://www.googleapis.com/auth/logging.read"
23248	//   ]
23249	// }
23250
23251}
23252
23253// Pages invokes f for each page of results.
23254// A non-nil error returned from f will halt the iteration.
23255// The provided context supersedes any context provided to the Context method.
23256func (c *ProjectsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
23257	c.ctx_ = ctx
23258	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
23259	for {
23260		x, err := c.Do()
23261		if err != nil {
23262			return err
23263		}
23264		if err := f(x); err != nil {
23265			return err
23266		}
23267		if x.NextPageToken == "" {
23268			return nil
23269		}
23270		c.PageToken(x.NextPageToken)
23271	}
23272}
23273
23274// method id "logging.projects.metrics.create":
23275
23276type ProjectsMetricsCreateCall struct {
23277	s          *Service
23278	parent     string
23279	logmetric  *LogMetric
23280	urlParams_ gensupport.URLParams
23281	ctx_       context.Context
23282	header_    http.Header
23283}
23284
23285// Create: Creates a logs-based metric.
23286func (r *ProjectsMetricsService) Create(parent string, logmetric *LogMetric) *ProjectsMetricsCreateCall {
23287	c := &ProjectsMetricsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23288	c.parent = parent
23289	c.logmetric = logmetric
23290	return c
23291}
23292
23293// Fields allows partial responses to be retrieved. See
23294// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23295// for more information.
23296func (c *ProjectsMetricsCreateCall) Fields(s ...googleapi.Field) *ProjectsMetricsCreateCall {
23297	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23298	return c
23299}
23300
23301// Context sets the context to be used in this call's Do method. Any
23302// pending HTTP request will be aborted if the provided context is
23303// canceled.
23304func (c *ProjectsMetricsCreateCall) Context(ctx context.Context) *ProjectsMetricsCreateCall {
23305	c.ctx_ = ctx
23306	return c
23307}
23308
23309// Header returns an http.Header that can be modified by the caller to
23310// add HTTP headers to the request.
23311func (c *ProjectsMetricsCreateCall) Header() http.Header {
23312	if c.header_ == nil {
23313		c.header_ = make(http.Header)
23314	}
23315	return c.header_
23316}
23317
23318func (c *ProjectsMetricsCreateCall) doRequest(alt string) (*http.Response, error) {
23319	reqHeaders := make(http.Header)
23320	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
23321	for k, v := range c.header_ {
23322		reqHeaders[k] = v
23323	}
23324	reqHeaders.Set("User-Agent", c.s.userAgent())
23325	var body io.Reader = nil
23326	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric)
23327	if err != nil {
23328		return nil, err
23329	}
23330	reqHeaders.Set("Content-Type", "application/json")
23331	c.urlParams_.Set("alt", alt)
23332	c.urlParams_.Set("prettyPrint", "false")
23333	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/metrics")
23334	urls += "?" + c.urlParams_.Encode()
23335	req, err := http.NewRequest("POST", urls, body)
23336	if err != nil {
23337		return nil, err
23338	}
23339	req.Header = reqHeaders
23340	googleapi.Expand(req.URL, map[string]string{
23341		"parent": c.parent,
23342	})
23343	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23344}
23345
23346// Do executes the "logging.projects.metrics.create" call.
23347// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
23348// status code is an error. Response headers are in either
23349// *LogMetric.ServerResponse.Header or (if a response was returned at
23350// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
23351// to check whether the returned error was because
23352// http.StatusNotModified was returned.
23353func (c *ProjectsMetricsCreateCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
23354	gensupport.SetOptions(c.urlParams_, opts...)
23355	res, err := c.doRequest("json")
23356	if res != nil && res.StatusCode == http.StatusNotModified {
23357		if res.Body != nil {
23358			res.Body.Close()
23359		}
23360		return nil, &googleapi.Error{
23361			Code:   res.StatusCode,
23362			Header: res.Header,
23363		}
23364	}
23365	if err != nil {
23366		return nil, err
23367	}
23368	defer googleapi.CloseBody(res)
23369	if err := googleapi.CheckResponse(res); err != nil {
23370		return nil, err
23371	}
23372	ret := &LogMetric{
23373		ServerResponse: googleapi.ServerResponse{
23374			Header:         res.Header,
23375			HTTPStatusCode: res.StatusCode,
23376		},
23377	}
23378	target := &ret
23379	if err := gensupport.DecodeResponse(target, res); err != nil {
23380		return nil, err
23381	}
23382	return ret, nil
23383	// {
23384	//   "description": "Creates a logs-based metric.",
23385	//   "flatPath": "v2/projects/{projectsId}/metrics",
23386	//   "httpMethod": "POST",
23387	//   "id": "logging.projects.metrics.create",
23388	//   "parameterOrder": [
23389	//     "parent"
23390	//   ],
23391	//   "parameters": {
23392	//     "parent": {
23393	//       "description": "Required. The resource name of the project in which to create the metric: \"projects/[PROJECT_ID]\" The new metric must be provided in the request.",
23394	//       "location": "path",
23395	//       "pattern": "^projects/[^/]+$",
23396	//       "required": true,
23397	//       "type": "string"
23398	//     }
23399	//   },
23400	//   "path": "v2/{+parent}/metrics",
23401	//   "request": {
23402	//     "$ref": "LogMetric"
23403	//   },
23404	//   "response": {
23405	//     "$ref": "LogMetric"
23406	//   },
23407	//   "scopes": [
23408	//     "https://www.googleapis.com/auth/cloud-platform",
23409	//     "https://www.googleapis.com/auth/logging.admin",
23410	//     "https://www.googleapis.com/auth/logging.write"
23411	//   ]
23412	// }
23413
23414}
23415
23416// method id "logging.projects.metrics.delete":
23417
23418type ProjectsMetricsDeleteCall struct {
23419	s          *Service
23420	metricName string
23421	urlParams_ gensupport.URLParams
23422	ctx_       context.Context
23423	header_    http.Header
23424}
23425
23426// Delete: Deletes a logs-based metric.
23427func (r *ProjectsMetricsService) Delete(metricName string) *ProjectsMetricsDeleteCall {
23428	c := &ProjectsMetricsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23429	c.metricName = metricName
23430	return c
23431}
23432
23433// Fields allows partial responses to be retrieved. See
23434// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23435// for more information.
23436func (c *ProjectsMetricsDeleteCall) Fields(s ...googleapi.Field) *ProjectsMetricsDeleteCall {
23437	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23438	return c
23439}
23440
23441// Context sets the context to be used in this call's Do method. Any
23442// pending HTTP request will be aborted if the provided context is
23443// canceled.
23444func (c *ProjectsMetricsDeleteCall) Context(ctx context.Context) *ProjectsMetricsDeleteCall {
23445	c.ctx_ = ctx
23446	return c
23447}
23448
23449// Header returns an http.Header that can be modified by the caller to
23450// add HTTP headers to the request.
23451func (c *ProjectsMetricsDeleteCall) Header() http.Header {
23452	if c.header_ == nil {
23453		c.header_ = make(http.Header)
23454	}
23455	return c.header_
23456}
23457
23458func (c *ProjectsMetricsDeleteCall) doRequest(alt string) (*http.Response, error) {
23459	reqHeaders := make(http.Header)
23460	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
23461	for k, v := range c.header_ {
23462		reqHeaders[k] = v
23463	}
23464	reqHeaders.Set("User-Agent", c.s.userAgent())
23465	var body io.Reader = nil
23466	c.urlParams_.Set("alt", alt)
23467	c.urlParams_.Set("prettyPrint", "false")
23468	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}")
23469	urls += "?" + c.urlParams_.Encode()
23470	req, err := http.NewRequest("DELETE", urls, body)
23471	if err != nil {
23472		return nil, err
23473	}
23474	req.Header = reqHeaders
23475	googleapi.Expand(req.URL, map[string]string{
23476		"metricName": c.metricName,
23477	})
23478	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23479}
23480
23481// Do executes the "logging.projects.metrics.delete" call.
23482// Exactly one of *Empty or error will be non-nil. Any non-2xx status
23483// code is an error. Response headers are in either
23484// *Empty.ServerResponse.Header or (if a response was returned at all)
23485// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
23486// check whether the returned error was because http.StatusNotModified
23487// was returned.
23488func (c *ProjectsMetricsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
23489	gensupport.SetOptions(c.urlParams_, opts...)
23490	res, err := c.doRequest("json")
23491	if res != nil && res.StatusCode == http.StatusNotModified {
23492		if res.Body != nil {
23493			res.Body.Close()
23494		}
23495		return nil, &googleapi.Error{
23496			Code:   res.StatusCode,
23497			Header: res.Header,
23498		}
23499	}
23500	if err != nil {
23501		return nil, err
23502	}
23503	defer googleapi.CloseBody(res)
23504	if err := googleapi.CheckResponse(res); err != nil {
23505		return nil, err
23506	}
23507	ret := &Empty{
23508		ServerResponse: googleapi.ServerResponse{
23509			Header:         res.Header,
23510			HTTPStatusCode: res.StatusCode,
23511		},
23512	}
23513	target := &ret
23514	if err := gensupport.DecodeResponse(target, res); err != nil {
23515		return nil, err
23516	}
23517	return ret, nil
23518	// {
23519	//   "description": "Deletes a logs-based metric.",
23520	//   "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
23521	//   "httpMethod": "DELETE",
23522	//   "id": "logging.projects.metrics.delete",
23523	//   "parameterOrder": [
23524	//     "metricName"
23525	//   ],
23526	//   "parameters": {
23527	//     "metricName": {
23528	//       "description": "Required. The resource name of the metric to delete: \"projects/[PROJECT_ID]/metrics/[METRIC_ID]\" ",
23529	//       "location": "path",
23530	//       "pattern": "^projects/[^/]+/metrics/[^/]+$",
23531	//       "required": true,
23532	//       "type": "string"
23533	//     }
23534	//   },
23535	//   "path": "v2/{+metricName}",
23536	//   "response": {
23537	//     "$ref": "Empty"
23538	//   },
23539	//   "scopes": [
23540	//     "https://www.googleapis.com/auth/cloud-platform",
23541	//     "https://www.googleapis.com/auth/logging.admin",
23542	//     "https://www.googleapis.com/auth/logging.write"
23543	//   ]
23544	// }
23545
23546}
23547
23548// method id "logging.projects.metrics.get":
23549
23550type ProjectsMetricsGetCall struct {
23551	s            *Service
23552	metricName   string
23553	urlParams_   gensupport.URLParams
23554	ifNoneMatch_ string
23555	ctx_         context.Context
23556	header_      http.Header
23557}
23558
23559// Get: Gets a logs-based metric.
23560func (r *ProjectsMetricsService) Get(metricName string) *ProjectsMetricsGetCall {
23561	c := &ProjectsMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23562	c.metricName = metricName
23563	return c
23564}
23565
23566// Fields allows partial responses to be retrieved. See
23567// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23568// for more information.
23569func (c *ProjectsMetricsGetCall) Fields(s ...googleapi.Field) *ProjectsMetricsGetCall {
23570	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23571	return c
23572}
23573
23574// IfNoneMatch sets the optional parameter which makes the operation
23575// fail if the object's ETag matches the given value. This is useful for
23576// getting updates only after the object has changed since the last
23577// request. Use googleapi.IsNotModified to check whether the response
23578// error from Do is the result of In-None-Match.
23579func (c *ProjectsMetricsGetCall) IfNoneMatch(entityTag string) *ProjectsMetricsGetCall {
23580	c.ifNoneMatch_ = entityTag
23581	return c
23582}
23583
23584// Context sets the context to be used in this call's Do method. Any
23585// pending HTTP request will be aborted if the provided context is
23586// canceled.
23587func (c *ProjectsMetricsGetCall) Context(ctx context.Context) *ProjectsMetricsGetCall {
23588	c.ctx_ = ctx
23589	return c
23590}
23591
23592// Header returns an http.Header that can be modified by the caller to
23593// add HTTP headers to the request.
23594func (c *ProjectsMetricsGetCall) Header() http.Header {
23595	if c.header_ == nil {
23596		c.header_ = make(http.Header)
23597	}
23598	return c.header_
23599}
23600
23601func (c *ProjectsMetricsGetCall) doRequest(alt string) (*http.Response, error) {
23602	reqHeaders := make(http.Header)
23603	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
23604	for k, v := range c.header_ {
23605		reqHeaders[k] = v
23606	}
23607	reqHeaders.Set("User-Agent", c.s.userAgent())
23608	if c.ifNoneMatch_ != "" {
23609		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
23610	}
23611	var body io.Reader = nil
23612	c.urlParams_.Set("alt", alt)
23613	c.urlParams_.Set("prettyPrint", "false")
23614	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}")
23615	urls += "?" + c.urlParams_.Encode()
23616	req, err := http.NewRequest("GET", urls, body)
23617	if err != nil {
23618		return nil, err
23619	}
23620	req.Header = reqHeaders
23621	googleapi.Expand(req.URL, map[string]string{
23622		"metricName": c.metricName,
23623	})
23624	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23625}
23626
23627// Do executes the "logging.projects.metrics.get" call.
23628// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
23629// status code is an error. Response headers are in either
23630// *LogMetric.ServerResponse.Header or (if a response was returned at
23631// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
23632// to check whether the returned error was because
23633// http.StatusNotModified was returned.
23634func (c *ProjectsMetricsGetCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
23635	gensupport.SetOptions(c.urlParams_, opts...)
23636	res, err := c.doRequest("json")
23637	if res != nil && res.StatusCode == http.StatusNotModified {
23638		if res.Body != nil {
23639			res.Body.Close()
23640		}
23641		return nil, &googleapi.Error{
23642			Code:   res.StatusCode,
23643			Header: res.Header,
23644		}
23645	}
23646	if err != nil {
23647		return nil, err
23648	}
23649	defer googleapi.CloseBody(res)
23650	if err := googleapi.CheckResponse(res); err != nil {
23651		return nil, err
23652	}
23653	ret := &LogMetric{
23654		ServerResponse: googleapi.ServerResponse{
23655			Header:         res.Header,
23656			HTTPStatusCode: res.StatusCode,
23657		},
23658	}
23659	target := &ret
23660	if err := gensupport.DecodeResponse(target, res); err != nil {
23661		return nil, err
23662	}
23663	return ret, nil
23664	// {
23665	//   "description": "Gets a logs-based metric.",
23666	//   "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
23667	//   "httpMethod": "GET",
23668	//   "id": "logging.projects.metrics.get",
23669	//   "parameterOrder": [
23670	//     "metricName"
23671	//   ],
23672	//   "parameters": {
23673	//     "metricName": {
23674	//       "description": "Required. The resource name of the desired metric: \"projects/[PROJECT_ID]/metrics/[METRIC_ID]\" ",
23675	//       "location": "path",
23676	//       "pattern": "^projects/[^/]+/metrics/[^/]+$",
23677	//       "required": true,
23678	//       "type": "string"
23679	//     }
23680	//   },
23681	//   "path": "v2/{+metricName}",
23682	//   "response": {
23683	//     "$ref": "LogMetric"
23684	//   },
23685	//   "scopes": [
23686	//     "https://www.googleapis.com/auth/cloud-platform",
23687	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
23688	//     "https://www.googleapis.com/auth/logging.admin",
23689	//     "https://www.googleapis.com/auth/logging.read"
23690	//   ]
23691	// }
23692
23693}
23694
23695// method id "logging.projects.metrics.list":
23696
23697type ProjectsMetricsListCall struct {
23698	s            *Service
23699	parent       string
23700	urlParams_   gensupport.URLParams
23701	ifNoneMatch_ string
23702	ctx_         context.Context
23703	header_      http.Header
23704}
23705
23706// List: Lists logs-based metrics.
23707func (r *ProjectsMetricsService) List(parent string) *ProjectsMetricsListCall {
23708	c := &ProjectsMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23709	c.parent = parent
23710	return c
23711}
23712
23713// PageSize sets the optional parameter "pageSize": The maximum number
23714// of results to return from this request. Non-positive values are
23715// ignored. The presence of nextPageToken in the response indicates that
23716// more results might be available.
23717func (c *ProjectsMetricsListCall) PageSize(pageSize int64) *ProjectsMetricsListCall {
23718	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
23719	return c
23720}
23721
23722// PageToken sets the optional parameter "pageToken": If present, then
23723// retrieve the next batch of results from the preceding call to this
23724// method. pageToken must be the value of nextPageToken from the
23725// previous response. The values of other method parameters should be
23726// identical to those in the previous call.
23727func (c *ProjectsMetricsListCall) PageToken(pageToken string) *ProjectsMetricsListCall {
23728	c.urlParams_.Set("pageToken", pageToken)
23729	return c
23730}
23731
23732// Fields allows partial responses to be retrieved. See
23733// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23734// for more information.
23735func (c *ProjectsMetricsListCall) Fields(s ...googleapi.Field) *ProjectsMetricsListCall {
23736	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23737	return c
23738}
23739
23740// IfNoneMatch sets the optional parameter which makes the operation
23741// fail if the object's ETag matches the given value. This is useful for
23742// getting updates only after the object has changed since the last
23743// request. Use googleapi.IsNotModified to check whether the response
23744// error from Do is the result of In-None-Match.
23745func (c *ProjectsMetricsListCall) IfNoneMatch(entityTag string) *ProjectsMetricsListCall {
23746	c.ifNoneMatch_ = entityTag
23747	return c
23748}
23749
23750// Context sets the context to be used in this call's Do method. Any
23751// pending HTTP request will be aborted if the provided context is
23752// canceled.
23753func (c *ProjectsMetricsListCall) Context(ctx context.Context) *ProjectsMetricsListCall {
23754	c.ctx_ = ctx
23755	return c
23756}
23757
23758// Header returns an http.Header that can be modified by the caller to
23759// add HTTP headers to the request.
23760func (c *ProjectsMetricsListCall) Header() http.Header {
23761	if c.header_ == nil {
23762		c.header_ = make(http.Header)
23763	}
23764	return c.header_
23765}
23766
23767func (c *ProjectsMetricsListCall) doRequest(alt string) (*http.Response, error) {
23768	reqHeaders := make(http.Header)
23769	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
23770	for k, v := range c.header_ {
23771		reqHeaders[k] = v
23772	}
23773	reqHeaders.Set("User-Agent", c.s.userAgent())
23774	if c.ifNoneMatch_ != "" {
23775		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
23776	}
23777	var body io.Reader = nil
23778	c.urlParams_.Set("alt", alt)
23779	c.urlParams_.Set("prettyPrint", "false")
23780	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/metrics")
23781	urls += "?" + c.urlParams_.Encode()
23782	req, err := http.NewRequest("GET", urls, body)
23783	if err != nil {
23784		return nil, err
23785	}
23786	req.Header = reqHeaders
23787	googleapi.Expand(req.URL, map[string]string{
23788		"parent": c.parent,
23789	})
23790	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23791}
23792
23793// Do executes the "logging.projects.metrics.list" call.
23794// Exactly one of *ListLogMetricsResponse or error will be non-nil. Any
23795// non-2xx status code is an error. Response headers are in either
23796// *ListLogMetricsResponse.ServerResponse.Header or (if a response was
23797// returned at all) in error.(*googleapi.Error).Header. Use
23798// googleapi.IsNotModified to check whether the returned error was
23799// because http.StatusNotModified was returned.
23800func (c *ProjectsMetricsListCall) Do(opts ...googleapi.CallOption) (*ListLogMetricsResponse, error) {
23801	gensupport.SetOptions(c.urlParams_, opts...)
23802	res, err := c.doRequest("json")
23803	if res != nil && res.StatusCode == http.StatusNotModified {
23804		if res.Body != nil {
23805			res.Body.Close()
23806		}
23807		return nil, &googleapi.Error{
23808			Code:   res.StatusCode,
23809			Header: res.Header,
23810		}
23811	}
23812	if err != nil {
23813		return nil, err
23814	}
23815	defer googleapi.CloseBody(res)
23816	if err := googleapi.CheckResponse(res); err != nil {
23817		return nil, err
23818	}
23819	ret := &ListLogMetricsResponse{
23820		ServerResponse: googleapi.ServerResponse{
23821			Header:         res.Header,
23822			HTTPStatusCode: res.StatusCode,
23823		},
23824	}
23825	target := &ret
23826	if err := gensupport.DecodeResponse(target, res); err != nil {
23827		return nil, err
23828	}
23829	return ret, nil
23830	// {
23831	//   "description": "Lists logs-based metrics.",
23832	//   "flatPath": "v2/projects/{projectsId}/metrics",
23833	//   "httpMethod": "GET",
23834	//   "id": "logging.projects.metrics.list",
23835	//   "parameterOrder": [
23836	//     "parent"
23837	//   ],
23838	//   "parameters": {
23839	//     "pageSize": {
23840	//       "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.",
23841	//       "format": "int32",
23842	//       "location": "query",
23843	//       "type": "integer"
23844	//     },
23845	//     "pageToken": {
23846	//       "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.",
23847	//       "location": "query",
23848	//       "type": "string"
23849	//     },
23850	//     "parent": {
23851	//       "description": "Required. The name of the project containing the metrics: \"projects/[PROJECT_ID]\" ",
23852	//       "location": "path",
23853	//       "pattern": "^projects/[^/]+$",
23854	//       "required": true,
23855	//       "type": "string"
23856	//     }
23857	//   },
23858	//   "path": "v2/{+parent}/metrics",
23859	//   "response": {
23860	//     "$ref": "ListLogMetricsResponse"
23861	//   },
23862	//   "scopes": [
23863	//     "https://www.googleapis.com/auth/cloud-platform",
23864	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
23865	//     "https://www.googleapis.com/auth/logging.admin",
23866	//     "https://www.googleapis.com/auth/logging.read"
23867	//   ]
23868	// }
23869
23870}
23871
23872// Pages invokes f for each page of results.
23873// A non-nil error returned from f will halt the iteration.
23874// The provided context supersedes any context provided to the Context method.
23875func (c *ProjectsMetricsListCall) Pages(ctx context.Context, f func(*ListLogMetricsResponse) error) error {
23876	c.ctx_ = ctx
23877	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
23878	for {
23879		x, err := c.Do()
23880		if err != nil {
23881			return err
23882		}
23883		if err := f(x); err != nil {
23884			return err
23885		}
23886		if x.NextPageToken == "" {
23887			return nil
23888		}
23889		c.PageToken(x.NextPageToken)
23890	}
23891}
23892
23893// method id "logging.projects.metrics.update":
23894
23895type ProjectsMetricsUpdateCall struct {
23896	s          *Service
23897	metricName string
23898	logmetric  *LogMetric
23899	urlParams_ gensupport.URLParams
23900	ctx_       context.Context
23901	header_    http.Header
23902}
23903
23904// Update: Creates or updates a logs-based metric.
23905func (r *ProjectsMetricsService) Update(metricName string, logmetric *LogMetric) *ProjectsMetricsUpdateCall {
23906	c := &ProjectsMetricsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23907	c.metricName = metricName
23908	c.logmetric = logmetric
23909	return c
23910}
23911
23912// Fields allows partial responses to be retrieved. See
23913// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23914// for more information.
23915func (c *ProjectsMetricsUpdateCall) Fields(s ...googleapi.Field) *ProjectsMetricsUpdateCall {
23916	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23917	return c
23918}
23919
23920// Context sets the context to be used in this call's Do method. Any
23921// pending HTTP request will be aborted if the provided context is
23922// canceled.
23923func (c *ProjectsMetricsUpdateCall) Context(ctx context.Context) *ProjectsMetricsUpdateCall {
23924	c.ctx_ = ctx
23925	return c
23926}
23927
23928// Header returns an http.Header that can be modified by the caller to
23929// add HTTP headers to the request.
23930func (c *ProjectsMetricsUpdateCall) Header() http.Header {
23931	if c.header_ == nil {
23932		c.header_ = make(http.Header)
23933	}
23934	return c.header_
23935}
23936
23937func (c *ProjectsMetricsUpdateCall) doRequest(alt string) (*http.Response, error) {
23938	reqHeaders := make(http.Header)
23939	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
23940	for k, v := range c.header_ {
23941		reqHeaders[k] = v
23942	}
23943	reqHeaders.Set("User-Agent", c.s.userAgent())
23944	var body io.Reader = nil
23945	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric)
23946	if err != nil {
23947		return nil, err
23948	}
23949	reqHeaders.Set("Content-Type", "application/json")
23950	c.urlParams_.Set("alt", alt)
23951	c.urlParams_.Set("prettyPrint", "false")
23952	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}")
23953	urls += "?" + c.urlParams_.Encode()
23954	req, err := http.NewRequest("PUT", urls, body)
23955	if err != nil {
23956		return nil, err
23957	}
23958	req.Header = reqHeaders
23959	googleapi.Expand(req.URL, map[string]string{
23960		"metricName": c.metricName,
23961	})
23962	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23963}
23964
23965// Do executes the "logging.projects.metrics.update" call.
23966// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
23967// status code is an error. Response headers are in either
23968// *LogMetric.ServerResponse.Header or (if a response was returned at
23969// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
23970// to check whether the returned error was because
23971// http.StatusNotModified was returned.
23972func (c *ProjectsMetricsUpdateCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
23973	gensupport.SetOptions(c.urlParams_, opts...)
23974	res, err := c.doRequest("json")
23975	if res != nil && res.StatusCode == http.StatusNotModified {
23976		if res.Body != nil {
23977			res.Body.Close()
23978		}
23979		return nil, &googleapi.Error{
23980			Code:   res.StatusCode,
23981			Header: res.Header,
23982		}
23983	}
23984	if err != nil {
23985		return nil, err
23986	}
23987	defer googleapi.CloseBody(res)
23988	if err := googleapi.CheckResponse(res); err != nil {
23989		return nil, err
23990	}
23991	ret := &LogMetric{
23992		ServerResponse: googleapi.ServerResponse{
23993			Header:         res.Header,
23994			HTTPStatusCode: res.StatusCode,
23995		},
23996	}
23997	target := &ret
23998	if err := gensupport.DecodeResponse(target, res); err != nil {
23999		return nil, err
24000	}
24001	return ret, nil
24002	// {
24003	//   "description": "Creates or updates a logs-based metric.",
24004	//   "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
24005	//   "httpMethod": "PUT",
24006	//   "id": "logging.projects.metrics.update",
24007	//   "parameterOrder": [
24008	//     "metricName"
24009	//   ],
24010	//   "parameters": {
24011	//     "metricName": {
24012	//       "description": "Required. The resource name of the metric to update: \"projects/[PROJECT_ID]/metrics/[METRIC_ID]\" The 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.",
24013	//       "location": "path",
24014	//       "pattern": "^projects/[^/]+/metrics/[^/]+$",
24015	//       "required": true,
24016	//       "type": "string"
24017	//     }
24018	//   },
24019	//   "path": "v2/{+metricName}",
24020	//   "request": {
24021	//     "$ref": "LogMetric"
24022	//   },
24023	//   "response": {
24024	//     "$ref": "LogMetric"
24025	//   },
24026	//   "scopes": [
24027	//     "https://www.googleapis.com/auth/cloud-platform",
24028	//     "https://www.googleapis.com/auth/logging.admin",
24029	//     "https://www.googleapis.com/auth/logging.write"
24030	//   ]
24031	// }
24032
24033}
24034
24035// method id "logging.projects.sinks.create":
24036
24037type ProjectsSinksCreateCall struct {
24038	s          *Service
24039	parent     string
24040	logsink    *LogSink
24041	urlParams_ gensupport.URLParams
24042	ctx_       context.Context
24043	header_    http.Header
24044}
24045
24046// Create: Creates a sink that exports specified log entries to a
24047// destination. The export of newly-ingested log entries begins
24048// immediately, unless the sink's writer_identity is not permitted to
24049// write to the destination. A sink can export log entries only from the
24050// resource owning the sink.
24051func (r *ProjectsSinksService) Create(parent string, logsink *LogSink) *ProjectsSinksCreateCall {
24052	c := &ProjectsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24053	c.parent = parent
24054	c.logsink = logsink
24055	return c
24056}
24057
24058// UniqueWriterIdentity sets the optional parameter
24059// "uniqueWriterIdentity": Determines the kind of IAM identity returned
24060// as writer_identity in the new sink. If this value is omitted or set
24061// to false, and if the sink's parent is a project, then the value
24062// returned as writer_identity is the same group or service account used
24063// by Logging before the addition of writer identities to this API. The
24064// sink's destination must be in the same project as the sink itself.If
24065// this field is set to true, or if the sink is owned by a non-project
24066// resource such as an organization, then the value of writer_identity
24067// will be a unique service account used only for exports from the new
24068// sink. For more information, see writer_identity in LogSink.
24069func (c *ProjectsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksCreateCall {
24070	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
24071	return c
24072}
24073
24074// Fields allows partial responses to be retrieved. See
24075// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24076// for more information.
24077func (c *ProjectsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsSinksCreateCall {
24078	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24079	return c
24080}
24081
24082// Context sets the context to be used in this call's Do method. Any
24083// pending HTTP request will be aborted if the provided context is
24084// canceled.
24085func (c *ProjectsSinksCreateCall) Context(ctx context.Context) *ProjectsSinksCreateCall {
24086	c.ctx_ = ctx
24087	return c
24088}
24089
24090// Header returns an http.Header that can be modified by the caller to
24091// add HTTP headers to the request.
24092func (c *ProjectsSinksCreateCall) Header() http.Header {
24093	if c.header_ == nil {
24094		c.header_ = make(http.Header)
24095	}
24096	return c.header_
24097}
24098
24099func (c *ProjectsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
24100	reqHeaders := make(http.Header)
24101	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
24102	for k, v := range c.header_ {
24103		reqHeaders[k] = v
24104	}
24105	reqHeaders.Set("User-Agent", c.s.userAgent())
24106	var body io.Reader = nil
24107	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
24108	if err != nil {
24109		return nil, err
24110	}
24111	reqHeaders.Set("Content-Type", "application/json")
24112	c.urlParams_.Set("alt", alt)
24113	c.urlParams_.Set("prettyPrint", "false")
24114	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
24115	urls += "?" + c.urlParams_.Encode()
24116	req, err := http.NewRequest("POST", urls, body)
24117	if err != nil {
24118		return nil, err
24119	}
24120	req.Header = reqHeaders
24121	googleapi.Expand(req.URL, map[string]string{
24122		"parent": c.parent,
24123	})
24124	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24125}
24126
24127// Do executes the "logging.projects.sinks.create" call.
24128// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
24129// code is an error. Response headers are in either
24130// *LogSink.ServerResponse.Header or (if a response was returned at all)
24131// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
24132// check whether the returned error was because http.StatusNotModified
24133// was returned.
24134func (c *ProjectsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
24135	gensupport.SetOptions(c.urlParams_, opts...)
24136	res, err := c.doRequest("json")
24137	if res != nil && res.StatusCode == http.StatusNotModified {
24138		if res.Body != nil {
24139			res.Body.Close()
24140		}
24141		return nil, &googleapi.Error{
24142			Code:   res.StatusCode,
24143			Header: res.Header,
24144		}
24145	}
24146	if err != nil {
24147		return nil, err
24148	}
24149	defer googleapi.CloseBody(res)
24150	if err := googleapi.CheckResponse(res); err != nil {
24151		return nil, err
24152	}
24153	ret := &LogSink{
24154		ServerResponse: googleapi.ServerResponse{
24155			Header:         res.Header,
24156			HTTPStatusCode: res.StatusCode,
24157		},
24158	}
24159	target := &ret
24160	if err := gensupport.DecodeResponse(target, res); err != nil {
24161		return nil, err
24162	}
24163	return ret, nil
24164	// {
24165	//   "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.",
24166	//   "flatPath": "v2/projects/{projectsId}/sinks",
24167	//   "httpMethod": "POST",
24168	//   "id": "logging.projects.sinks.create",
24169	//   "parameterOrder": [
24170	//     "parent"
24171	//   ],
24172	//   "parameters": {
24173	//     "parent": {
24174	//       "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" Examples: \"projects/my-logging-project\", \"organizations/123456789\".",
24175	//       "location": "path",
24176	//       "pattern": "^projects/[^/]+$",
24177	//       "required": true,
24178	//       "type": "string"
24179	//     },
24180	//     "uniqueWriterIdentity": {
24181	//       "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.",
24182	//       "location": "query",
24183	//       "type": "boolean"
24184	//     }
24185	//   },
24186	//   "path": "v2/{+parent}/sinks",
24187	//   "request": {
24188	//     "$ref": "LogSink"
24189	//   },
24190	//   "response": {
24191	//     "$ref": "LogSink"
24192	//   },
24193	//   "scopes": [
24194	//     "https://www.googleapis.com/auth/cloud-platform",
24195	//     "https://www.googleapis.com/auth/logging.admin"
24196	//   ]
24197	// }
24198
24199}
24200
24201// method id "logging.projects.sinks.delete":
24202
24203type ProjectsSinksDeleteCall struct {
24204	s          *Service
24205	sinkNameid string
24206	urlParams_ gensupport.URLParams
24207	ctx_       context.Context
24208	header_    http.Header
24209}
24210
24211// Delete: Deletes a sink. If the sink has a unique writer_identity,
24212// then that service account is also deleted.
24213func (r *ProjectsSinksService) Delete(sinkNameid string) *ProjectsSinksDeleteCall {
24214	c := &ProjectsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24215	c.sinkNameid = sinkNameid
24216	return c
24217}
24218
24219// Fields allows partial responses to be retrieved. See
24220// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24221// for more information.
24222func (c *ProjectsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsSinksDeleteCall {
24223	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24224	return c
24225}
24226
24227// Context sets the context to be used in this call's Do method. Any
24228// pending HTTP request will be aborted if the provided context is
24229// canceled.
24230func (c *ProjectsSinksDeleteCall) Context(ctx context.Context) *ProjectsSinksDeleteCall {
24231	c.ctx_ = ctx
24232	return c
24233}
24234
24235// Header returns an http.Header that can be modified by the caller to
24236// add HTTP headers to the request.
24237func (c *ProjectsSinksDeleteCall) Header() http.Header {
24238	if c.header_ == nil {
24239		c.header_ = make(http.Header)
24240	}
24241	return c.header_
24242}
24243
24244func (c *ProjectsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
24245	reqHeaders := make(http.Header)
24246	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
24247	for k, v := range c.header_ {
24248		reqHeaders[k] = v
24249	}
24250	reqHeaders.Set("User-Agent", c.s.userAgent())
24251	var body io.Reader = nil
24252	c.urlParams_.Set("alt", alt)
24253	c.urlParams_.Set("prettyPrint", "false")
24254	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
24255	urls += "?" + c.urlParams_.Encode()
24256	req, err := http.NewRequest("DELETE", urls, body)
24257	if err != nil {
24258		return nil, err
24259	}
24260	req.Header = reqHeaders
24261	googleapi.Expand(req.URL, map[string]string{
24262		"sinkName": c.sinkNameid,
24263	})
24264	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24265}
24266
24267// Do executes the "logging.projects.sinks.delete" call.
24268// Exactly one of *Empty or error will be non-nil. Any non-2xx status
24269// code is an error. Response headers are in either
24270// *Empty.ServerResponse.Header or (if a response was returned at all)
24271// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
24272// check whether the returned error was because http.StatusNotModified
24273// was returned.
24274func (c *ProjectsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
24275	gensupport.SetOptions(c.urlParams_, opts...)
24276	res, err := c.doRequest("json")
24277	if res != nil && res.StatusCode == http.StatusNotModified {
24278		if res.Body != nil {
24279			res.Body.Close()
24280		}
24281		return nil, &googleapi.Error{
24282			Code:   res.StatusCode,
24283			Header: res.Header,
24284		}
24285	}
24286	if err != nil {
24287		return nil, err
24288	}
24289	defer googleapi.CloseBody(res)
24290	if err := googleapi.CheckResponse(res); err != nil {
24291		return nil, err
24292	}
24293	ret := &Empty{
24294		ServerResponse: googleapi.ServerResponse{
24295			Header:         res.Header,
24296			HTTPStatusCode: res.StatusCode,
24297		},
24298	}
24299	target := &ret
24300	if err := gensupport.DecodeResponse(target, res); err != nil {
24301		return nil, err
24302	}
24303	return ret, nil
24304	// {
24305	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
24306	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
24307	//   "httpMethod": "DELETE",
24308	//   "id": "logging.projects.sinks.delete",
24309	//   "parameterOrder": [
24310	//     "sinkName"
24311	//   ],
24312	//   "parameters": {
24313	//     "sinkName": {
24314	//       "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
24315	//       "location": "path",
24316	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
24317	//       "required": true,
24318	//       "type": "string"
24319	//     }
24320	//   },
24321	//   "path": "v2/{+sinkName}",
24322	//   "response": {
24323	//     "$ref": "Empty"
24324	//   },
24325	//   "scopes": [
24326	//     "https://www.googleapis.com/auth/cloud-platform",
24327	//     "https://www.googleapis.com/auth/logging.admin"
24328	//   ]
24329	// }
24330
24331}
24332
24333// method id "logging.projects.sinks.get":
24334
24335type ProjectsSinksGetCall struct {
24336	s            *Service
24337	sinkName     string
24338	urlParams_   gensupport.URLParams
24339	ifNoneMatch_ string
24340	ctx_         context.Context
24341	header_      http.Header
24342}
24343
24344// Get: Gets a sink.
24345func (r *ProjectsSinksService) Get(sinkName string) *ProjectsSinksGetCall {
24346	c := &ProjectsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24347	c.sinkName = sinkName
24348	return c
24349}
24350
24351// Fields allows partial responses to be retrieved. See
24352// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24353// for more information.
24354func (c *ProjectsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsSinksGetCall {
24355	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24356	return c
24357}
24358
24359// IfNoneMatch sets the optional parameter which makes the operation
24360// fail if the object's ETag matches the given value. This is useful for
24361// getting updates only after the object has changed since the last
24362// request. Use googleapi.IsNotModified to check whether the response
24363// error from Do is the result of In-None-Match.
24364func (c *ProjectsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsSinksGetCall {
24365	c.ifNoneMatch_ = entityTag
24366	return c
24367}
24368
24369// Context sets the context to be used in this call's Do method. Any
24370// pending HTTP request will be aborted if the provided context is
24371// canceled.
24372func (c *ProjectsSinksGetCall) Context(ctx context.Context) *ProjectsSinksGetCall {
24373	c.ctx_ = ctx
24374	return c
24375}
24376
24377// Header returns an http.Header that can be modified by the caller to
24378// add HTTP headers to the request.
24379func (c *ProjectsSinksGetCall) Header() http.Header {
24380	if c.header_ == nil {
24381		c.header_ = make(http.Header)
24382	}
24383	return c.header_
24384}
24385
24386func (c *ProjectsSinksGetCall) doRequest(alt string) (*http.Response, error) {
24387	reqHeaders := make(http.Header)
24388	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
24389	for k, v := range c.header_ {
24390		reqHeaders[k] = v
24391	}
24392	reqHeaders.Set("User-Agent", c.s.userAgent())
24393	if c.ifNoneMatch_ != "" {
24394		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
24395	}
24396	var body io.Reader = nil
24397	c.urlParams_.Set("alt", alt)
24398	c.urlParams_.Set("prettyPrint", "false")
24399	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
24400	urls += "?" + c.urlParams_.Encode()
24401	req, err := http.NewRequest("GET", urls, body)
24402	if err != nil {
24403		return nil, err
24404	}
24405	req.Header = reqHeaders
24406	googleapi.Expand(req.URL, map[string]string{
24407		"sinkName": c.sinkName,
24408	})
24409	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24410}
24411
24412// Do executes the "logging.projects.sinks.get" call.
24413// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
24414// code is an error. Response headers are in either
24415// *LogSink.ServerResponse.Header or (if a response was returned at all)
24416// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
24417// check whether the returned error was because http.StatusNotModified
24418// was returned.
24419func (c *ProjectsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
24420	gensupport.SetOptions(c.urlParams_, opts...)
24421	res, err := c.doRequest("json")
24422	if res != nil && res.StatusCode == http.StatusNotModified {
24423		if res.Body != nil {
24424			res.Body.Close()
24425		}
24426		return nil, &googleapi.Error{
24427			Code:   res.StatusCode,
24428			Header: res.Header,
24429		}
24430	}
24431	if err != nil {
24432		return nil, err
24433	}
24434	defer googleapi.CloseBody(res)
24435	if err := googleapi.CheckResponse(res); err != nil {
24436		return nil, err
24437	}
24438	ret := &LogSink{
24439		ServerResponse: googleapi.ServerResponse{
24440			Header:         res.Header,
24441			HTTPStatusCode: res.StatusCode,
24442		},
24443	}
24444	target := &ret
24445	if err := gensupport.DecodeResponse(target, res); err != nil {
24446		return nil, err
24447	}
24448	return ret, nil
24449	// {
24450	//   "description": "Gets a sink.",
24451	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
24452	//   "httpMethod": "GET",
24453	//   "id": "logging.projects.sinks.get",
24454	//   "parameterOrder": [
24455	//     "sinkName"
24456	//   ],
24457	//   "parameters": {
24458	//     "sinkName": {
24459	//       "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
24460	//       "location": "path",
24461	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
24462	//       "required": true,
24463	//       "type": "string"
24464	//     }
24465	//   },
24466	//   "path": "v2/{+sinkName}",
24467	//   "response": {
24468	//     "$ref": "LogSink"
24469	//   },
24470	//   "scopes": [
24471	//     "https://www.googleapis.com/auth/cloud-platform",
24472	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
24473	//     "https://www.googleapis.com/auth/logging.admin",
24474	//     "https://www.googleapis.com/auth/logging.read"
24475	//   ]
24476	// }
24477
24478}
24479
24480// method id "logging.projects.sinks.list":
24481
24482type ProjectsSinksListCall struct {
24483	s            *Service
24484	parent       string
24485	urlParams_   gensupport.URLParams
24486	ifNoneMatch_ string
24487	ctx_         context.Context
24488	header_      http.Header
24489}
24490
24491// List: Lists sinks.
24492func (r *ProjectsSinksService) List(parent string) *ProjectsSinksListCall {
24493	c := &ProjectsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24494	c.parent = parent
24495	return c
24496}
24497
24498// PageSize sets the optional parameter "pageSize": The maximum number
24499// of results to return from this request. Non-positive values are
24500// ignored. The presence of nextPageToken in the response indicates that
24501// more results might be available.
24502func (c *ProjectsSinksListCall) PageSize(pageSize int64) *ProjectsSinksListCall {
24503	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
24504	return c
24505}
24506
24507// PageToken sets the optional parameter "pageToken": If present, then
24508// retrieve the next batch of results from the preceding call to this
24509// method. pageToken must be the value of nextPageToken from the
24510// previous response. The values of other method parameters should be
24511// identical to those in the previous call.
24512func (c *ProjectsSinksListCall) PageToken(pageToken string) *ProjectsSinksListCall {
24513	c.urlParams_.Set("pageToken", pageToken)
24514	return c
24515}
24516
24517// Fields allows partial responses to be retrieved. See
24518// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24519// for more information.
24520func (c *ProjectsSinksListCall) Fields(s ...googleapi.Field) *ProjectsSinksListCall {
24521	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24522	return c
24523}
24524
24525// IfNoneMatch sets the optional parameter which makes the operation
24526// fail if the object's ETag matches the given value. This is useful for
24527// getting updates only after the object has changed since the last
24528// request. Use googleapi.IsNotModified to check whether the response
24529// error from Do is the result of In-None-Match.
24530func (c *ProjectsSinksListCall) IfNoneMatch(entityTag string) *ProjectsSinksListCall {
24531	c.ifNoneMatch_ = entityTag
24532	return c
24533}
24534
24535// Context sets the context to be used in this call's Do method. Any
24536// pending HTTP request will be aborted if the provided context is
24537// canceled.
24538func (c *ProjectsSinksListCall) Context(ctx context.Context) *ProjectsSinksListCall {
24539	c.ctx_ = ctx
24540	return c
24541}
24542
24543// Header returns an http.Header that can be modified by the caller to
24544// add HTTP headers to the request.
24545func (c *ProjectsSinksListCall) Header() http.Header {
24546	if c.header_ == nil {
24547		c.header_ = make(http.Header)
24548	}
24549	return c.header_
24550}
24551
24552func (c *ProjectsSinksListCall) doRequest(alt string) (*http.Response, error) {
24553	reqHeaders := make(http.Header)
24554	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
24555	for k, v := range c.header_ {
24556		reqHeaders[k] = v
24557	}
24558	reqHeaders.Set("User-Agent", c.s.userAgent())
24559	if c.ifNoneMatch_ != "" {
24560		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
24561	}
24562	var body io.Reader = nil
24563	c.urlParams_.Set("alt", alt)
24564	c.urlParams_.Set("prettyPrint", "false")
24565	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
24566	urls += "?" + c.urlParams_.Encode()
24567	req, err := http.NewRequest("GET", urls, body)
24568	if err != nil {
24569		return nil, err
24570	}
24571	req.Header = reqHeaders
24572	googleapi.Expand(req.URL, map[string]string{
24573		"parent": c.parent,
24574	})
24575	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24576}
24577
24578// Do executes the "logging.projects.sinks.list" call.
24579// Exactly one of *ListSinksResponse or error will be non-nil. Any
24580// non-2xx status code is an error. Response headers are in either
24581// *ListSinksResponse.ServerResponse.Header or (if a response was
24582// returned at all) in error.(*googleapi.Error).Header. Use
24583// googleapi.IsNotModified to check whether the returned error was
24584// because http.StatusNotModified was returned.
24585func (c *ProjectsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
24586	gensupport.SetOptions(c.urlParams_, opts...)
24587	res, err := c.doRequest("json")
24588	if res != nil && res.StatusCode == http.StatusNotModified {
24589		if res.Body != nil {
24590			res.Body.Close()
24591		}
24592		return nil, &googleapi.Error{
24593			Code:   res.StatusCode,
24594			Header: res.Header,
24595		}
24596	}
24597	if err != nil {
24598		return nil, err
24599	}
24600	defer googleapi.CloseBody(res)
24601	if err := googleapi.CheckResponse(res); err != nil {
24602		return nil, err
24603	}
24604	ret := &ListSinksResponse{
24605		ServerResponse: googleapi.ServerResponse{
24606			Header:         res.Header,
24607			HTTPStatusCode: res.StatusCode,
24608		},
24609	}
24610	target := &ret
24611	if err := gensupport.DecodeResponse(target, res); err != nil {
24612		return nil, err
24613	}
24614	return ret, nil
24615	// {
24616	//   "description": "Lists sinks.",
24617	//   "flatPath": "v2/projects/{projectsId}/sinks",
24618	//   "httpMethod": "GET",
24619	//   "id": "logging.projects.sinks.list",
24620	//   "parameterOrder": [
24621	//     "parent"
24622	//   ],
24623	//   "parameters": {
24624	//     "pageSize": {
24625	//       "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.",
24626	//       "format": "int32",
24627	//       "location": "query",
24628	//       "type": "integer"
24629	//     },
24630	//     "pageToken": {
24631	//       "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.",
24632	//       "location": "query",
24633	//       "type": "string"
24634	//     },
24635	//     "parent": {
24636	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
24637	//       "location": "path",
24638	//       "pattern": "^projects/[^/]+$",
24639	//       "required": true,
24640	//       "type": "string"
24641	//     }
24642	//   },
24643	//   "path": "v2/{+parent}/sinks",
24644	//   "response": {
24645	//     "$ref": "ListSinksResponse"
24646	//   },
24647	//   "scopes": [
24648	//     "https://www.googleapis.com/auth/cloud-platform",
24649	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
24650	//     "https://www.googleapis.com/auth/logging.admin",
24651	//     "https://www.googleapis.com/auth/logging.read"
24652	//   ]
24653	// }
24654
24655}
24656
24657// Pages invokes f for each page of results.
24658// A non-nil error returned from f will halt the iteration.
24659// The provided context supersedes any context provided to the Context method.
24660func (c *ProjectsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
24661	c.ctx_ = ctx
24662	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
24663	for {
24664		x, err := c.Do()
24665		if err != nil {
24666			return err
24667		}
24668		if err := f(x); err != nil {
24669			return err
24670		}
24671		if x.NextPageToken == "" {
24672			return nil
24673		}
24674		c.PageToken(x.NextPageToken)
24675	}
24676}
24677
24678// method id "logging.projects.sinks.patch":
24679
24680type ProjectsSinksPatchCall struct {
24681	s          *Service
24682	sinkNameid string
24683	logsink    *LogSink
24684	urlParams_ gensupport.URLParams
24685	ctx_       context.Context
24686	header_    http.Header
24687}
24688
24689// Patch: Updates a sink. This method replaces the following fields in
24690// the existing sink with values from the new sink: destination, and
24691// filter.The updated sink might also have a new writer_identity; see
24692// the unique_writer_identity field.
24693func (r *ProjectsSinksService) Patch(sinkNameid string, logsink *LogSink) *ProjectsSinksPatchCall {
24694	c := &ProjectsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24695	c.sinkNameid = sinkNameid
24696	c.logsink = logsink
24697	return c
24698}
24699
24700// UniqueWriterIdentity sets the optional parameter
24701// "uniqueWriterIdentity": See sinks.create for a description of this
24702// field. When updating a sink, the effect of this field on the value of
24703// writer_identity in the updated sink depends on both the old and new
24704// values of this field: If the old and new values of this field are
24705// both false or both true, then there is no change to the sink's
24706// writer_identity. If the old value is false and the new value is true,
24707// then writer_identity is changed to a unique service account. It is an
24708// error if the old value is true and the new value is set to false or
24709// defaulted to false.
24710func (c *ProjectsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksPatchCall {
24711	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
24712	return c
24713}
24714
24715// UpdateMask sets the optional parameter "updateMask": Field mask that
24716// specifies the fields in sink that need an update. A sink field will
24717// be overwritten if, and only if, it is in the update mask. name and
24718// output only fields cannot be updated.An empty updateMask is
24719// temporarily treated as using the following mask for backwards
24720// compatibility purposes: destination,filter,includeChildren At some
24721// point in the future, behavior will be removed and specifying an empty
24722// updateMask will be an error.For a detailed FieldMask definition, see
24723// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
24724// updateMask=filter.
24725func (c *ProjectsSinksPatchCall) UpdateMask(updateMask string) *ProjectsSinksPatchCall {
24726	c.urlParams_.Set("updateMask", updateMask)
24727	return c
24728}
24729
24730// Fields allows partial responses to be retrieved. See
24731// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24732// for more information.
24733func (c *ProjectsSinksPatchCall) Fields(s ...googleapi.Field) *ProjectsSinksPatchCall {
24734	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24735	return c
24736}
24737
24738// Context sets the context to be used in this call's Do method. Any
24739// pending HTTP request will be aborted if the provided context is
24740// canceled.
24741func (c *ProjectsSinksPatchCall) Context(ctx context.Context) *ProjectsSinksPatchCall {
24742	c.ctx_ = ctx
24743	return c
24744}
24745
24746// Header returns an http.Header that can be modified by the caller to
24747// add HTTP headers to the request.
24748func (c *ProjectsSinksPatchCall) Header() http.Header {
24749	if c.header_ == nil {
24750		c.header_ = make(http.Header)
24751	}
24752	return c.header_
24753}
24754
24755func (c *ProjectsSinksPatchCall) doRequest(alt string) (*http.Response, error) {
24756	reqHeaders := make(http.Header)
24757	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
24758	for k, v := range c.header_ {
24759		reqHeaders[k] = v
24760	}
24761	reqHeaders.Set("User-Agent", c.s.userAgent())
24762	var body io.Reader = nil
24763	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
24764	if err != nil {
24765		return nil, err
24766	}
24767	reqHeaders.Set("Content-Type", "application/json")
24768	c.urlParams_.Set("alt", alt)
24769	c.urlParams_.Set("prettyPrint", "false")
24770	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
24771	urls += "?" + c.urlParams_.Encode()
24772	req, err := http.NewRequest("PATCH", urls, body)
24773	if err != nil {
24774		return nil, err
24775	}
24776	req.Header = reqHeaders
24777	googleapi.Expand(req.URL, map[string]string{
24778		"sinkName": c.sinkNameid,
24779	})
24780	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24781}
24782
24783// Do executes the "logging.projects.sinks.patch" call.
24784// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
24785// code is an error. Response headers are in either
24786// *LogSink.ServerResponse.Header or (if a response was returned at all)
24787// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
24788// check whether the returned error was because http.StatusNotModified
24789// was returned.
24790func (c *ProjectsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
24791	gensupport.SetOptions(c.urlParams_, opts...)
24792	res, err := c.doRequest("json")
24793	if res != nil && res.StatusCode == http.StatusNotModified {
24794		if res.Body != nil {
24795			res.Body.Close()
24796		}
24797		return nil, &googleapi.Error{
24798			Code:   res.StatusCode,
24799			Header: res.Header,
24800		}
24801	}
24802	if err != nil {
24803		return nil, err
24804	}
24805	defer googleapi.CloseBody(res)
24806	if err := googleapi.CheckResponse(res); err != nil {
24807		return nil, err
24808	}
24809	ret := &LogSink{
24810		ServerResponse: googleapi.ServerResponse{
24811			Header:         res.Header,
24812			HTTPStatusCode: res.StatusCode,
24813		},
24814	}
24815	target := &ret
24816	if err := gensupport.DecodeResponse(target, res); err != nil {
24817		return nil, err
24818	}
24819	return ret, nil
24820	// {
24821	//   "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.",
24822	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
24823	//   "httpMethod": "PATCH",
24824	//   "id": "logging.projects.sinks.patch",
24825	//   "parameterOrder": [
24826	//     "sinkName"
24827	//   ],
24828	//   "parameters": {
24829	//     "sinkName": {
24830	//       "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
24831	//       "location": "path",
24832	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
24833	//       "required": true,
24834	//       "type": "string"
24835	//     },
24836	//     "uniqueWriterIdentity": {
24837	//       "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: 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.",
24838	//       "location": "query",
24839	//       "type": "boolean"
24840	//     },
24841	//     "updateMask": {
24842	//       "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.",
24843	//       "format": "google-fieldmask",
24844	//       "location": "query",
24845	//       "type": "string"
24846	//     }
24847	//   },
24848	//   "path": "v2/{+sinkName}",
24849	//   "request": {
24850	//     "$ref": "LogSink"
24851	//   },
24852	//   "response": {
24853	//     "$ref": "LogSink"
24854	//   },
24855	//   "scopes": [
24856	//     "https://www.googleapis.com/auth/cloud-platform",
24857	//     "https://www.googleapis.com/auth/logging.admin"
24858	//   ]
24859	// }
24860
24861}
24862
24863// method id "logging.projects.sinks.update":
24864
24865type ProjectsSinksUpdateCall struct {
24866	s          *Service
24867	sinkNameid string
24868	logsink    *LogSink
24869	urlParams_ gensupport.URLParams
24870	ctx_       context.Context
24871	header_    http.Header
24872}
24873
24874// Update: Updates a sink. This method replaces the following fields in
24875// the existing sink with values from the new sink: destination, and
24876// filter.The updated sink might also have a new writer_identity; see
24877// the unique_writer_identity field.
24878func (r *ProjectsSinksService) Update(sinkNameid string, logsink *LogSink) *ProjectsSinksUpdateCall {
24879	c := &ProjectsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24880	c.sinkNameid = sinkNameid
24881	c.logsink = logsink
24882	return c
24883}
24884
24885// UniqueWriterIdentity sets the optional parameter
24886// "uniqueWriterIdentity": See sinks.create for a description of this
24887// field. When updating a sink, the effect of this field on the value of
24888// writer_identity in the updated sink depends on both the old and new
24889// values of this field: If the old and new values of this field are
24890// both false or both true, then there is no change to the sink's
24891// writer_identity. If the old value is false and the new value is true,
24892// then writer_identity is changed to a unique service account. It is an
24893// error if the old value is true and the new value is set to false or
24894// defaulted to false.
24895func (c *ProjectsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksUpdateCall {
24896	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
24897	return c
24898}
24899
24900// UpdateMask sets the optional parameter "updateMask": Field mask that
24901// specifies the fields in sink that need an update. A sink field will
24902// be overwritten if, and only if, it is in the update mask. name and
24903// output only fields cannot be updated.An empty updateMask is
24904// temporarily treated as using the following mask for backwards
24905// compatibility purposes: destination,filter,includeChildren At some
24906// point in the future, behavior will be removed and specifying an empty
24907// updateMask will be an error.For a detailed FieldMask definition, see
24908// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
24909// updateMask=filter.
24910func (c *ProjectsSinksUpdateCall) UpdateMask(updateMask string) *ProjectsSinksUpdateCall {
24911	c.urlParams_.Set("updateMask", updateMask)
24912	return c
24913}
24914
24915// Fields allows partial responses to be retrieved. See
24916// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24917// for more information.
24918func (c *ProjectsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsSinksUpdateCall {
24919	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24920	return c
24921}
24922
24923// Context sets the context to be used in this call's Do method. Any
24924// pending HTTP request will be aborted if the provided context is
24925// canceled.
24926func (c *ProjectsSinksUpdateCall) Context(ctx context.Context) *ProjectsSinksUpdateCall {
24927	c.ctx_ = ctx
24928	return c
24929}
24930
24931// Header returns an http.Header that can be modified by the caller to
24932// add HTTP headers to the request.
24933func (c *ProjectsSinksUpdateCall) Header() http.Header {
24934	if c.header_ == nil {
24935		c.header_ = make(http.Header)
24936	}
24937	return c.header_
24938}
24939
24940func (c *ProjectsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
24941	reqHeaders := make(http.Header)
24942	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
24943	for k, v := range c.header_ {
24944		reqHeaders[k] = v
24945	}
24946	reqHeaders.Set("User-Agent", c.s.userAgent())
24947	var body io.Reader = nil
24948	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
24949	if err != nil {
24950		return nil, err
24951	}
24952	reqHeaders.Set("Content-Type", "application/json")
24953	c.urlParams_.Set("alt", alt)
24954	c.urlParams_.Set("prettyPrint", "false")
24955	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
24956	urls += "?" + c.urlParams_.Encode()
24957	req, err := http.NewRequest("PUT", urls, body)
24958	if err != nil {
24959		return nil, err
24960	}
24961	req.Header = reqHeaders
24962	googleapi.Expand(req.URL, map[string]string{
24963		"sinkName": c.sinkNameid,
24964	})
24965	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24966}
24967
24968// Do executes the "logging.projects.sinks.update" call.
24969// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
24970// code is an error. Response headers are in either
24971// *LogSink.ServerResponse.Header or (if a response was returned at all)
24972// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
24973// check whether the returned error was because http.StatusNotModified
24974// was returned.
24975func (c *ProjectsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
24976	gensupport.SetOptions(c.urlParams_, opts...)
24977	res, err := c.doRequest("json")
24978	if res != nil && res.StatusCode == http.StatusNotModified {
24979		if res.Body != nil {
24980			res.Body.Close()
24981		}
24982		return nil, &googleapi.Error{
24983			Code:   res.StatusCode,
24984			Header: res.Header,
24985		}
24986	}
24987	if err != nil {
24988		return nil, err
24989	}
24990	defer googleapi.CloseBody(res)
24991	if err := googleapi.CheckResponse(res); err != nil {
24992		return nil, err
24993	}
24994	ret := &LogSink{
24995		ServerResponse: googleapi.ServerResponse{
24996			Header:         res.Header,
24997			HTTPStatusCode: res.StatusCode,
24998		},
24999	}
25000	target := &ret
25001	if err := gensupport.DecodeResponse(target, res); err != nil {
25002		return nil, err
25003	}
25004	return ret, nil
25005	// {
25006	//   "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.",
25007	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
25008	//   "httpMethod": "PUT",
25009	//   "id": "logging.projects.sinks.update",
25010	//   "parameterOrder": [
25011	//     "sinkName"
25012	//   ],
25013	//   "parameters": {
25014	//     "sinkName": {
25015	//       "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
25016	//       "location": "path",
25017	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
25018	//       "required": true,
25019	//       "type": "string"
25020	//     },
25021	//     "uniqueWriterIdentity": {
25022	//       "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: 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.",
25023	//       "location": "query",
25024	//       "type": "boolean"
25025	//     },
25026	//     "updateMask": {
25027	//       "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.",
25028	//       "format": "google-fieldmask",
25029	//       "location": "query",
25030	//       "type": "string"
25031	//     }
25032	//   },
25033	//   "path": "v2/{+sinkName}",
25034	//   "request": {
25035	//     "$ref": "LogSink"
25036	//   },
25037	//   "response": {
25038	//     "$ref": "LogSink"
25039	//   },
25040	//   "scopes": [
25041	//     "https://www.googleapis.com/auth/cloud-platform",
25042	//     "https://www.googleapis.com/auth/logging.admin"
25043	//   ]
25044	// }
25045
25046}
25047
25048// method id "logging.sinks.create":
25049
25050type SinksCreateCall struct {
25051	s          *Service
25052	parent     string
25053	logsink    *LogSink
25054	urlParams_ gensupport.URLParams
25055	ctx_       context.Context
25056	header_    http.Header
25057}
25058
25059// Create: Creates a sink that exports specified log entries to a
25060// destination. The export of newly-ingested log entries begins
25061// immediately, unless the sink's writer_identity is not permitted to
25062// write to the destination. A sink can export log entries only from the
25063// resource owning the sink.
25064func (r *SinksService) Create(parent string, logsink *LogSink) *SinksCreateCall {
25065	c := &SinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25066	c.parent = parent
25067	c.logsink = logsink
25068	return c
25069}
25070
25071// UniqueWriterIdentity sets the optional parameter
25072// "uniqueWriterIdentity": Determines the kind of IAM identity returned
25073// as writer_identity in the new sink. If this value is omitted or set
25074// to false, and if the sink's parent is a project, then the value
25075// returned as writer_identity is the same group or service account used
25076// by Logging before the addition of writer identities to this API. The
25077// sink's destination must be in the same project as the sink itself.If
25078// this field is set to true, or if the sink is owned by a non-project
25079// resource such as an organization, then the value of writer_identity
25080// will be a unique service account used only for exports from the new
25081// sink. For more information, see writer_identity in LogSink.
25082func (c *SinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *SinksCreateCall {
25083	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
25084	return c
25085}
25086
25087// Fields allows partial responses to be retrieved. See
25088// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25089// for more information.
25090func (c *SinksCreateCall) Fields(s ...googleapi.Field) *SinksCreateCall {
25091	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25092	return c
25093}
25094
25095// Context sets the context to be used in this call's Do method. Any
25096// pending HTTP request will be aborted if the provided context is
25097// canceled.
25098func (c *SinksCreateCall) Context(ctx context.Context) *SinksCreateCall {
25099	c.ctx_ = ctx
25100	return c
25101}
25102
25103// Header returns an http.Header that can be modified by the caller to
25104// add HTTP headers to the request.
25105func (c *SinksCreateCall) Header() http.Header {
25106	if c.header_ == nil {
25107		c.header_ = make(http.Header)
25108	}
25109	return c.header_
25110}
25111
25112func (c *SinksCreateCall) doRequest(alt string) (*http.Response, error) {
25113	reqHeaders := make(http.Header)
25114	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
25115	for k, v := range c.header_ {
25116		reqHeaders[k] = v
25117	}
25118	reqHeaders.Set("User-Agent", c.s.userAgent())
25119	var body io.Reader = nil
25120	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
25121	if err != nil {
25122		return nil, err
25123	}
25124	reqHeaders.Set("Content-Type", "application/json")
25125	c.urlParams_.Set("alt", alt)
25126	c.urlParams_.Set("prettyPrint", "false")
25127	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
25128	urls += "?" + c.urlParams_.Encode()
25129	req, err := http.NewRequest("POST", urls, body)
25130	if err != nil {
25131		return nil, err
25132	}
25133	req.Header = reqHeaders
25134	googleapi.Expand(req.URL, map[string]string{
25135		"parent": c.parent,
25136	})
25137	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25138}
25139
25140// Do executes the "logging.sinks.create" call.
25141// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
25142// code is an error. Response headers are in either
25143// *LogSink.ServerResponse.Header or (if a response was returned at all)
25144// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25145// check whether the returned error was because http.StatusNotModified
25146// was returned.
25147func (c *SinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
25148	gensupport.SetOptions(c.urlParams_, opts...)
25149	res, err := c.doRequest("json")
25150	if res != nil && res.StatusCode == http.StatusNotModified {
25151		if res.Body != nil {
25152			res.Body.Close()
25153		}
25154		return nil, &googleapi.Error{
25155			Code:   res.StatusCode,
25156			Header: res.Header,
25157		}
25158	}
25159	if err != nil {
25160		return nil, err
25161	}
25162	defer googleapi.CloseBody(res)
25163	if err := googleapi.CheckResponse(res); err != nil {
25164		return nil, err
25165	}
25166	ret := &LogSink{
25167		ServerResponse: googleapi.ServerResponse{
25168			Header:         res.Header,
25169			HTTPStatusCode: res.StatusCode,
25170		},
25171	}
25172	target := &ret
25173	if err := gensupport.DecodeResponse(target, res); err != nil {
25174		return nil, err
25175	}
25176	return ret, nil
25177	// {
25178	//   "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.",
25179	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks",
25180	//   "httpMethod": "POST",
25181	//   "id": "logging.sinks.create",
25182	//   "parameterOrder": [
25183	//     "parent"
25184	//   ],
25185	//   "parameters": {
25186	//     "parent": {
25187	//       "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" Examples: \"projects/my-logging-project\", \"organizations/123456789\".",
25188	//       "location": "path",
25189	//       "pattern": "^[^/]+/[^/]+$",
25190	//       "required": true,
25191	//       "type": "string"
25192	//     },
25193	//     "uniqueWriterIdentity": {
25194	//       "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.",
25195	//       "location": "query",
25196	//       "type": "boolean"
25197	//     }
25198	//   },
25199	//   "path": "v2/{+parent}/sinks",
25200	//   "request": {
25201	//     "$ref": "LogSink"
25202	//   },
25203	//   "response": {
25204	//     "$ref": "LogSink"
25205	//   },
25206	//   "scopes": [
25207	//     "https://www.googleapis.com/auth/cloud-platform",
25208	//     "https://www.googleapis.com/auth/logging.admin"
25209	//   ]
25210	// }
25211
25212}
25213
25214// method id "logging.sinks.delete":
25215
25216type SinksDeleteCall struct {
25217	s          *Service
25218	sinkNameid string
25219	urlParams_ gensupport.URLParams
25220	ctx_       context.Context
25221	header_    http.Header
25222}
25223
25224// Delete: Deletes a sink. If the sink has a unique writer_identity,
25225// then that service account is also deleted.
25226func (r *SinksService) Delete(sinkNameid string) *SinksDeleteCall {
25227	c := &SinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25228	c.sinkNameid = sinkNameid
25229	return c
25230}
25231
25232// Fields allows partial responses to be retrieved. See
25233// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25234// for more information.
25235func (c *SinksDeleteCall) Fields(s ...googleapi.Field) *SinksDeleteCall {
25236	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25237	return c
25238}
25239
25240// Context sets the context to be used in this call's Do method. Any
25241// pending HTTP request will be aborted if the provided context is
25242// canceled.
25243func (c *SinksDeleteCall) Context(ctx context.Context) *SinksDeleteCall {
25244	c.ctx_ = ctx
25245	return c
25246}
25247
25248// Header returns an http.Header that can be modified by the caller to
25249// add HTTP headers to the request.
25250func (c *SinksDeleteCall) Header() http.Header {
25251	if c.header_ == nil {
25252		c.header_ = make(http.Header)
25253	}
25254	return c.header_
25255}
25256
25257func (c *SinksDeleteCall) doRequest(alt string) (*http.Response, error) {
25258	reqHeaders := make(http.Header)
25259	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
25260	for k, v := range c.header_ {
25261		reqHeaders[k] = v
25262	}
25263	reqHeaders.Set("User-Agent", c.s.userAgent())
25264	var body io.Reader = nil
25265	c.urlParams_.Set("alt", alt)
25266	c.urlParams_.Set("prettyPrint", "false")
25267	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
25268	urls += "?" + c.urlParams_.Encode()
25269	req, err := http.NewRequest("DELETE", urls, body)
25270	if err != nil {
25271		return nil, err
25272	}
25273	req.Header = reqHeaders
25274	googleapi.Expand(req.URL, map[string]string{
25275		"sinkName": c.sinkNameid,
25276	})
25277	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25278}
25279
25280// Do executes the "logging.sinks.delete" call.
25281// Exactly one of *Empty or error will be non-nil. Any non-2xx status
25282// code is an error. Response headers are in either
25283// *Empty.ServerResponse.Header or (if a response was returned at all)
25284// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25285// check whether the returned error was because http.StatusNotModified
25286// was returned.
25287func (c *SinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
25288	gensupport.SetOptions(c.urlParams_, opts...)
25289	res, err := c.doRequest("json")
25290	if res != nil && res.StatusCode == http.StatusNotModified {
25291		if res.Body != nil {
25292			res.Body.Close()
25293		}
25294		return nil, &googleapi.Error{
25295			Code:   res.StatusCode,
25296			Header: res.Header,
25297		}
25298	}
25299	if err != nil {
25300		return nil, err
25301	}
25302	defer googleapi.CloseBody(res)
25303	if err := googleapi.CheckResponse(res); err != nil {
25304		return nil, err
25305	}
25306	ret := &Empty{
25307		ServerResponse: googleapi.ServerResponse{
25308			Header:         res.Header,
25309			HTTPStatusCode: res.StatusCode,
25310		},
25311	}
25312	target := &ret
25313	if err := gensupport.DecodeResponse(target, res); err != nil {
25314		return nil, err
25315	}
25316	return ret, nil
25317	// {
25318	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
25319	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
25320	//   "httpMethod": "DELETE",
25321	//   "id": "logging.sinks.delete",
25322	//   "parameterOrder": [
25323	//     "sinkName"
25324	//   ],
25325	//   "parameters": {
25326	//     "sinkName": {
25327	//       "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
25328	//       "location": "path",
25329	//       "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
25330	//       "required": true,
25331	//       "type": "string"
25332	//     }
25333	//   },
25334	//   "path": "v2/{+sinkName}",
25335	//   "response": {
25336	//     "$ref": "Empty"
25337	//   },
25338	//   "scopes": [
25339	//     "https://www.googleapis.com/auth/cloud-platform",
25340	//     "https://www.googleapis.com/auth/logging.admin"
25341	//   ]
25342	// }
25343
25344}
25345
25346// method id "logging.sinks.get":
25347
25348type SinksGetCall struct {
25349	s            *Service
25350	sinkName     string
25351	urlParams_   gensupport.URLParams
25352	ifNoneMatch_ string
25353	ctx_         context.Context
25354	header_      http.Header
25355}
25356
25357// Get: Gets a sink.
25358func (r *SinksService) Get(sinkName string) *SinksGetCall {
25359	c := &SinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25360	c.sinkName = sinkName
25361	return c
25362}
25363
25364// Fields allows partial responses to be retrieved. See
25365// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25366// for more information.
25367func (c *SinksGetCall) Fields(s ...googleapi.Field) *SinksGetCall {
25368	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25369	return c
25370}
25371
25372// IfNoneMatch sets the optional parameter which makes the operation
25373// fail if the object's ETag matches the given value. This is useful for
25374// getting updates only after the object has changed since the last
25375// request. Use googleapi.IsNotModified to check whether the response
25376// error from Do is the result of In-None-Match.
25377func (c *SinksGetCall) IfNoneMatch(entityTag string) *SinksGetCall {
25378	c.ifNoneMatch_ = entityTag
25379	return c
25380}
25381
25382// Context sets the context to be used in this call's Do method. Any
25383// pending HTTP request will be aborted if the provided context is
25384// canceled.
25385func (c *SinksGetCall) Context(ctx context.Context) *SinksGetCall {
25386	c.ctx_ = ctx
25387	return c
25388}
25389
25390// Header returns an http.Header that can be modified by the caller to
25391// add HTTP headers to the request.
25392func (c *SinksGetCall) Header() http.Header {
25393	if c.header_ == nil {
25394		c.header_ = make(http.Header)
25395	}
25396	return c.header_
25397}
25398
25399func (c *SinksGetCall) doRequest(alt string) (*http.Response, error) {
25400	reqHeaders := make(http.Header)
25401	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
25402	for k, v := range c.header_ {
25403		reqHeaders[k] = v
25404	}
25405	reqHeaders.Set("User-Agent", c.s.userAgent())
25406	if c.ifNoneMatch_ != "" {
25407		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
25408	}
25409	var body io.Reader = nil
25410	c.urlParams_.Set("alt", alt)
25411	c.urlParams_.Set("prettyPrint", "false")
25412	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
25413	urls += "?" + c.urlParams_.Encode()
25414	req, err := http.NewRequest("GET", urls, body)
25415	if err != nil {
25416		return nil, err
25417	}
25418	req.Header = reqHeaders
25419	googleapi.Expand(req.URL, map[string]string{
25420		"sinkName": c.sinkName,
25421	})
25422	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25423}
25424
25425// Do executes the "logging.sinks.get" call.
25426// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
25427// code is an error. Response headers are in either
25428// *LogSink.ServerResponse.Header or (if a response was returned at all)
25429// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25430// check whether the returned error was because http.StatusNotModified
25431// was returned.
25432func (c *SinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
25433	gensupport.SetOptions(c.urlParams_, opts...)
25434	res, err := c.doRequest("json")
25435	if res != nil && res.StatusCode == http.StatusNotModified {
25436		if res.Body != nil {
25437			res.Body.Close()
25438		}
25439		return nil, &googleapi.Error{
25440			Code:   res.StatusCode,
25441			Header: res.Header,
25442		}
25443	}
25444	if err != nil {
25445		return nil, err
25446	}
25447	defer googleapi.CloseBody(res)
25448	if err := googleapi.CheckResponse(res); err != nil {
25449		return nil, err
25450	}
25451	ret := &LogSink{
25452		ServerResponse: googleapi.ServerResponse{
25453			Header:         res.Header,
25454			HTTPStatusCode: res.StatusCode,
25455		},
25456	}
25457	target := &ret
25458	if err := gensupport.DecodeResponse(target, res); err != nil {
25459		return nil, err
25460	}
25461	return ret, nil
25462	// {
25463	//   "description": "Gets a sink.",
25464	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
25465	//   "httpMethod": "GET",
25466	//   "id": "logging.sinks.get",
25467	//   "parameterOrder": [
25468	//     "sinkName"
25469	//   ],
25470	//   "parameters": {
25471	//     "sinkName": {
25472	//       "description": "Required. The resource name of the sink: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
25473	//       "location": "path",
25474	//       "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
25475	//       "required": true,
25476	//       "type": "string"
25477	//     }
25478	//   },
25479	//   "path": "v2/{+sinkName}",
25480	//   "response": {
25481	//     "$ref": "LogSink"
25482	//   },
25483	//   "scopes": [
25484	//     "https://www.googleapis.com/auth/cloud-platform",
25485	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
25486	//     "https://www.googleapis.com/auth/logging.admin",
25487	//     "https://www.googleapis.com/auth/logging.read"
25488	//   ]
25489	// }
25490
25491}
25492
25493// method id "logging.sinks.list":
25494
25495type SinksListCall struct {
25496	s            *Service
25497	parent       string
25498	urlParams_   gensupport.URLParams
25499	ifNoneMatch_ string
25500	ctx_         context.Context
25501	header_      http.Header
25502}
25503
25504// List: Lists sinks.
25505func (r *SinksService) List(parent string) *SinksListCall {
25506	c := &SinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25507	c.parent = parent
25508	return c
25509}
25510
25511// PageSize sets the optional parameter "pageSize": The maximum number
25512// of results to return from this request. Non-positive values are
25513// ignored. The presence of nextPageToken in the response indicates that
25514// more results might be available.
25515func (c *SinksListCall) PageSize(pageSize int64) *SinksListCall {
25516	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
25517	return c
25518}
25519
25520// PageToken sets the optional parameter "pageToken": If present, then
25521// retrieve the next batch of results from the preceding call to this
25522// method. pageToken must be the value of nextPageToken from the
25523// previous response. The values of other method parameters should be
25524// identical to those in the previous call.
25525func (c *SinksListCall) PageToken(pageToken string) *SinksListCall {
25526	c.urlParams_.Set("pageToken", pageToken)
25527	return c
25528}
25529
25530// Fields allows partial responses to be retrieved. See
25531// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25532// for more information.
25533func (c *SinksListCall) Fields(s ...googleapi.Field) *SinksListCall {
25534	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25535	return c
25536}
25537
25538// IfNoneMatch sets the optional parameter which makes the operation
25539// fail if the object's ETag matches the given value. This is useful for
25540// getting updates only after the object has changed since the last
25541// request. Use googleapi.IsNotModified to check whether the response
25542// error from Do is the result of In-None-Match.
25543func (c *SinksListCall) IfNoneMatch(entityTag string) *SinksListCall {
25544	c.ifNoneMatch_ = entityTag
25545	return c
25546}
25547
25548// Context sets the context to be used in this call's Do method. Any
25549// pending HTTP request will be aborted if the provided context is
25550// canceled.
25551func (c *SinksListCall) Context(ctx context.Context) *SinksListCall {
25552	c.ctx_ = ctx
25553	return c
25554}
25555
25556// Header returns an http.Header that can be modified by the caller to
25557// add HTTP headers to the request.
25558func (c *SinksListCall) Header() http.Header {
25559	if c.header_ == nil {
25560		c.header_ = make(http.Header)
25561	}
25562	return c.header_
25563}
25564
25565func (c *SinksListCall) doRequest(alt string) (*http.Response, error) {
25566	reqHeaders := make(http.Header)
25567	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
25568	for k, v := range c.header_ {
25569		reqHeaders[k] = v
25570	}
25571	reqHeaders.Set("User-Agent", c.s.userAgent())
25572	if c.ifNoneMatch_ != "" {
25573		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
25574	}
25575	var body io.Reader = nil
25576	c.urlParams_.Set("alt", alt)
25577	c.urlParams_.Set("prettyPrint", "false")
25578	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
25579	urls += "?" + c.urlParams_.Encode()
25580	req, err := http.NewRequest("GET", urls, body)
25581	if err != nil {
25582		return nil, err
25583	}
25584	req.Header = reqHeaders
25585	googleapi.Expand(req.URL, map[string]string{
25586		"parent": c.parent,
25587	})
25588	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25589}
25590
25591// Do executes the "logging.sinks.list" call.
25592// Exactly one of *ListSinksResponse or error will be non-nil. Any
25593// non-2xx status code is an error. Response headers are in either
25594// *ListSinksResponse.ServerResponse.Header or (if a response was
25595// returned at all) in error.(*googleapi.Error).Header. Use
25596// googleapi.IsNotModified to check whether the returned error was
25597// because http.StatusNotModified was returned.
25598func (c *SinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
25599	gensupport.SetOptions(c.urlParams_, opts...)
25600	res, err := c.doRequest("json")
25601	if res != nil && res.StatusCode == http.StatusNotModified {
25602		if res.Body != nil {
25603			res.Body.Close()
25604		}
25605		return nil, &googleapi.Error{
25606			Code:   res.StatusCode,
25607			Header: res.Header,
25608		}
25609	}
25610	if err != nil {
25611		return nil, err
25612	}
25613	defer googleapi.CloseBody(res)
25614	if err := googleapi.CheckResponse(res); err != nil {
25615		return nil, err
25616	}
25617	ret := &ListSinksResponse{
25618		ServerResponse: googleapi.ServerResponse{
25619			Header:         res.Header,
25620			HTTPStatusCode: res.StatusCode,
25621		},
25622	}
25623	target := &ret
25624	if err := gensupport.DecodeResponse(target, res); err != nil {
25625		return nil, err
25626	}
25627	return ret, nil
25628	// {
25629	//   "description": "Lists sinks.",
25630	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks",
25631	//   "httpMethod": "GET",
25632	//   "id": "logging.sinks.list",
25633	//   "parameterOrder": [
25634	//     "parent"
25635	//   ],
25636	//   "parameters": {
25637	//     "pageSize": {
25638	//       "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.",
25639	//       "format": "int32",
25640	//       "location": "query",
25641	//       "type": "integer"
25642	//     },
25643	//     "pageToken": {
25644	//       "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.",
25645	//       "location": "query",
25646	//       "type": "string"
25647	//     },
25648	//     "parent": {
25649	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
25650	//       "location": "path",
25651	//       "pattern": "^[^/]+/[^/]+$",
25652	//       "required": true,
25653	//       "type": "string"
25654	//     }
25655	//   },
25656	//   "path": "v2/{+parent}/sinks",
25657	//   "response": {
25658	//     "$ref": "ListSinksResponse"
25659	//   },
25660	//   "scopes": [
25661	//     "https://www.googleapis.com/auth/cloud-platform",
25662	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
25663	//     "https://www.googleapis.com/auth/logging.admin",
25664	//     "https://www.googleapis.com/auth/logging.read"
25665	//   ]
25666	// }
25667
25668}
25669
25670// Pages invokes f for each page of results.
25671// A non-nil error returned from f will halt the iteration.
25672// The provided context supersedes any context provided to the Context method.
25673func (c *SinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
25674	c.ctx_ = ctx
25675	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
25676	for {
25677		x, err := c.Do()
25678		if err != nil {
25679			return err
25680		}
25681		if err := f(x); err != nil {
25682			return err
25683		}
25684		if x.NextPageToken == "" {
25685			return nil
25686		}
25687		c.PageToken(x.NextPageToken)
25688	}
25689}
25690
25691// method id "logging.sinks.update":
25692
25693type SinksUpdateCall struct {
25694	s          *Service
25695	sinkNameid string
25696	logsink    *LogSink
25697	urlParams_ gensupport.URLParams
25698	ctx_       context.Context
25699	header_    http.Header
25700}
25701
25702// Update: Updates a sink. This method replaces the following fields in
25703// the existing sink with values from the new sink: destination, and
25704// filter.The updated sink might also have a new writer_identity; see
25705// the unique_writer_identity field.
25706func (r *SinksService) Update(sinkNameid string, logsink *LogSink) *SinksUpdateCall {
25707	c := &SinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25708	c.sinkNameid = sinkNameid
25709	c.logsink = logsink
25710	return c
25711}
25712
25713// UniqueWriterIdentity sets the optional parameter
25714// "uniqueWriterIdentity": See sinks.create for a description of this
25715// field. When updating a sink, the effect of this field on the value of
25716// writer_identity in the updated sink depends on both the old and new
25717// values of this field: If the old and new values of this field are
25718// both false or both true, then there is no change to the sink's
25719// writer_identity. If the old value is false and the new value is true,
25720// then writer_identity is changed to a unique service account. It is an
25721// error if the old value is true and the new value is set to false or
25722// defaulted to false.
25723func (c *SinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *SinksUpdateCall {
25724	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
25725	return c
25726}
25727
25728// UpdateMask sets the optional parameter "updateMask": Field mask that
25729// specifies the fields in sink that need an update. A sink field will
25730// be overwritten if, and only if, it is in the update mask. name and
25731// output only fields cannot be updated.An empty updateMask is
25732// temporarily treated as using the following mask for backwards
25733// compatibility purposes: destination,filter,includeChildren At some
25734// point in the future, behavior will be removed and specifying an empty
25735// updateMask will be an error.For a detailed FieldMask definition, see
25736// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
25737// updateMask=filter.
25738func (c *SinksUpdateCall) UpdateMask(updateMask string) *SinksUpdateCall {
25739	c.urlParams_.Set("updateMask", updateMask)
25740	return c
25741}
25742
25743// Fields allows partial responses to be retrieved. See
25744// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25745// for more information.
25746func (c *SinksUpdateCall) Fields(s ...googleapi.Field) *SinksUpdateCall {
25747	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25748	return c
25749}
25750
25751// Context sets the context to be used in this call's Do method. Any
25752// pending HTTP request will be aborted if the provided context is
25753// canceled.
25754func (c *SinksUpdateCall) Context(ctx context.Context) *SinksUpdateCall {
25755	c.ctx_ = ctx
25756	return c
25757}
25758
25759// Header returns an http.Header that can be modified by the caller to
25760// add HTTP headers to the request.
25761func (c *SinksUpdateCall) Header() http.Header {
25762	if c.header_ == nil {
25763		c.header_ = make(http.Header)
25764	}
25765	return c.header_
25766}
25767
25768func (c *SinksUpdateCall) doRequest(alt string) (*http.Response, error) {
25769	reqHeaders := make(http.Header)
25770	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
25771	for k, v := range c.header_ {
25772		reqHeaders[k] = v
25773	}
25774	reqHeaders.Set("User-Agent", c.s.userAgent())
25775	var body io.Reader = nil
25776	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
25777	if err != nil {
25778		return nil, err
25779	}
25780	reqHeaders.Set("Content-Type", "application/json")
25781	c.urlParams_.Set("alt", alt)
25782	c.urlParams_.Set("prettyPrint", "false")
25783	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
25784	urls += "?" + c.urlParams_.Encode()
25785	req, err := http.NewRequest("PUT", urls, body)
25786	if err != nil {
25787		return nil, err
25788	}
25789	req.Header = reqHeaders
25790	googleapi.Expand(req.URL, map[string]string{
25791		"sinkName": c.sinkNameid,
25792	})
25793	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25794}
25795
25796// Do executes the "logging.sinks.update" call.
25797// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
25798// code is an error. Response headers are in either
25799// *LogSink.ServerResponse.Header or (if a response was returned at all)
25800// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25801// check whether the returned error was because http.StatusNotModified
25802// was returned.
25803func (c *SinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
25804	gensupport.SetOptions(c.urlParams_, opts...)
25805	res, err := c.doRequest("json")
25806	if res != nil && res.StatusCode == http.StatusNotModified {
25807		if res.Body != nil {
25808			res.Body.Close()
25809		}
25810		return nil, &googleapi.Error{
25811			Code:   res.StatusCode,
25812			Header: res.Header,
25813		}
25814	}
25815	if err != nil {
25816		return nil, err
25817	}
25818	defer googleapi.CloseBody(res)
25819	if err := googleapi.CheckResponse(res); err != nil {
25820		return nil, err
25821	}
25822	ret := &LogSink{
25823		ServerResponse: googleapi.ServerResponse{
25824			Header:         res.Header,
25825			HTTPStatusCode: res.StatusCode,
25826		},
25827	}
25828	target := &ret
25829	if err := gensupport.DecodeResponse(target, res); err != nil {
25830		return nil, err
25831	}
25832	return ret, nil
25833	// {
25834	//   "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.",
25835	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
25836	//   "httpMethod": "PUT",
25837	//   "id": "logging.sinks.update",
25838	//   "parameterOrder": [
25839	//     "sinkName"
25840	//   ],
25841	//   "parameters": {
25842	//     "sinkName": {
25843	//       "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier: \"projects/[PROJECT_ID]/sinks/[SINK_ID]\" \"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\" \"folders/[FOLDER_ID]/sinks/[SINK_ID]\" Example: \"projects/my-project-id/sinks/my-sink-id\".",
25844	//       "location": "path",
25845	//       "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
25846	//       "required": true,
25847	//       "type": "string"
25848	//     },
25849	//     "uniqueWriterIdentity": {
25850	//       "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: 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.",
25851	//       "location": "query",
25852	//       "type": "boolean"
25853	//     },
25854	//     "updateMask": {
25855	//       "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.",
25856	//       "format": "google-fieldmask",
25857	//       "location": "query",
25858	//       "type": "string"
25859	//     }
25860	//   },
25861	//   "path": "v2/{+sinkName}",
25862	//   "request": {
25863	//     "$ref": "LogSink"
25864	//   },
25865	//   "response": {
25866	//     "$ref": "LogSink"
25867	//   },
25868	//   "scopes": [
25869	//     "https://www.googleapis.com/auth/cloud-platform",
25870	//     "https://www.googleapis.com/auth/logging.admin"
25871	//   ]
25872	// }
25873
25874}
25875
25876// method id "logging.getCmekSettings":
25877
25878type V2GetCmekSettingsCall struct {
25879	s            *Service
25880	name         string
25881	urlParams_   gensupport.URLParams
25882	ifNoneMatch_ string
25883	ctx_         context.Context
25884	header_      http.Header
25885}
25886
25887// GetCmekSettings: Gets the Logs Router CMEK settings for the given
25888// resource.Note: CMEK for the Logs Router can currently only be
25889// configured for GCP organizations. Once configured, it applies to all
25890// projects and folders in the GCP organization.See Enabling CMEK for
25891// Logs Router
25892// (https://cloud.google.com/logging/docs/routing/managed-encryption)
25893// for more information.
25894func (r *V2Service) GetCmekSettings(name string) *V2GetCmekSettingsCall {
25895	c := &V2GetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25896	c.name = name
25897	return c
25898}
25899
25900// Fields allows partial responses to be retrieved. See
25901// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25902// for more information.
25903func (c *V2GetCmekSettingsCall) Fields(s ...googleapi.Field) *V2GetCmekSettingsCall {
25904	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25905	return c
25906}
25907
25908// IfNoneMatch sets the optional parameter which makes the operation
25909// fail if the object's ETag matches the given value. This is useful for
25910// getting updates only after the object has changed since the last
25911// request. Use googleapi.IsNotModified to check whether the response
25912// error from Do is the result of In-None-Match.
25913func (c *V2GetCmekSettingsCall) IfNoneMatch(entityTag string) *V2GetCmekSettingsCall {
25914	c.ifNoneMatch_ = entityTag
25915	return c
25916}
25917
25918// Context sets the context to be used in this call's Do method. Any
25919// pending HTTP request will be aborted if the provided context is
25920// canceled.
25921func (c *V2GetCmekSettingsCall) Context(ctx context.Context) *V2GetCmekSettingsCall {
25922	c.ctx_ = ctx
25923	return c
25924}
25925
25926// Header returns an http.Header that can be modified by the caller to
25927// add HTTP headers to the request.
25928func (c *V2GetCmekSettingsCall) Header() http.Header {
25929	if c.header_ == nil {
25930		c.header_ = make(http.Header)
25931	}
25932	return c.header_
25933}
25934
25935func (c *V2GetCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
25936	reqHeaders := make(http.Header)
25937	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
25938	for k, v := range c.header_ {
25939		reqHeaders[k] = v
25940	}
25941	reqHeaders.Set("User-Agent", c.s.userAgent())
25942	if c.ifNoneMatch_ != "" {
25943		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
25944	}
25945	var body io.Reader = nil
25946	c.urlParams_.Set("alt", alt)
25947	c.urlParams_.Set("prettyPrint", "false")
25948	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
25949	urls += "?" + c.urlParams_.Encode()
25950	req, err := http.NewRequest("GET", urls, body)
25951	if err != nil {
25952		return nil, err
25953	}
25954	req.Header = reqHeaders
25955	googleapi.Expand(req.URL, map[string]string{
25956		"name": c.name,
25957	})
25958	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25959}
25960
25961// Do executes the "logging.getCmekSettings" call.
25962// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
25963// status code is an error. Response headers are in either
25964// *CmekSettings.ServerResponse.Header or (if a response was returned at
25965// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
25966// to check whether the returned error was because
25967// http.StatusNotModified was returned.
25968func (c *V2GetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
25969	gensupport.SetOptions(c.urlParams_, opts...)
25970	res, err := c.doRequest("json")
25971	if res != nil && res.StatusCode == http.StatusNotModified {
25972		if res.Body != nil {
25973			res.Body.Close()
25974		}
25975		return nil, &googleapi.Error{
25976			Code:   res.StatusCode,
25977			Header: res.Header,
25978		}
25979	}
25980	if err != nil {
25981		return nil, err
25982	}
25983	defer googleapi.CloseBody(res)
25984	if err := googleapi.CheckResponse(res); err != nil {
25985		return nil, err
25986	}
25987	ret := &CmekSettings{
25988		ServerResponse: googleapi.ServerResponse{
25989			Header:         res.Header,
25990			HTTPStatusCode: res.StatusCode,
25991		},
25992	}
25993	target := &ret
25994	if err := gensupport.DecodeResponse(target, res); err != nil {
25995		return nil, err
25996	}
25997	return ret, nil
25998	// {
25999	//   "description": "Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.",
26000	//   "flatPath": "v2/{v2Id}/{v2Id1}/cmekSettings",
26001	//   "httpMethod": "GET",
26002	//   "id": "logging.getCmekSettings",
26003	//   "parameterOrder": [
26004	//     "name"
26005	//   ],
26006	//   "parameters": {
26007	//     "name": {
26008	//       "description": "Required. The resource for which to retrieve CMEK settings. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" Example: \"organizations/12345/cmekSettings\".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.",
26009	//       "location": "path",
26010	//       "pattern": "^[^/]+/[^/]+$",
26011	//       "required": true,
26012	//       "type": "string"
26013	//     }
26014	//   },
26015	//   "path": "v2/{+name}/cmekSettings",
26016	//   "response": {
26017	//     "$ref": "CmekSettings"
26018	//   },
26019	//   "scopes": [
26020	//     "https://www.googleapis.com/auth/cloud-platform",
26021	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
26022	//     "https://www.googleapis.com/auth/logging.admin",
26023	//     "https://www.googleapis.com/auth/logging.read"
26024	//   ]
26025	// }
26026
26027}
26028
26029// method id "logging.updateCmekSettings":
26030
26031type V2UpdateCmekSettingsCall struct {
26032	s            *Service
26033	name         string
26034	cmeksettings *CmekSettings
26035	urlParams_   gensupport.URLParams
26036	ctx_         context.Context
26037	header_      http.Header
26038}
26039
26040// UpdateCmekSettings: Updates the Logs Router CMEK settings for the
26041// given resource.Note: CMEK for the Logs Router can currently only be
26042// configured for GCP organizations. Once configured, it applies to all
26043// projects and folders in the GCP organization.UpdateCmekSettings will
26044// fail if 1) kms_key_name is invalid, or 2) the associated service
26045// account does not have the required
26046// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key,
26047// or 3) access to the key is disabled.See Enabling CMEK for Logs Router
26048// (https://cloud.google.com/logging/docs/routing/managed-encryption)
26049// for more information.
26050func (r *V2Service) UpdateCmekSettings(name string, cmeksettings *CmekSettings) *V2UpdateCmekSettingsCall {
26051	c := &V2UpdateCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26052	c.name = name
26053	c.cmeksettings = cmeksettings
26054	return c
26055}
26056
26057// UpdateMask sets the optional parameter "updateMask": Field mask
26058// identifying which fields from cmek_settings should be updated. A
26059// field will be overwritten if and only if it is in the update mask.
26060// Output only fields cannot be updated.See FieldMask for more
26061// information.Example: "updateMask=kmsKeyName"
26062func (c *V2UpdateCmekSettingsCall) UpdateMask(updateMask string) *V2UpdateCmekSettingsCall {
26063	c.urlParams_.Set("updateMask", updateMask)
26064	return c
26065}
26066
26067// Fields allows partial responses to be retrieved. See
26068// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26069// for more information.
26070func (c *V2UpdateCmekSettingsCall) Fields(s ...googleapi.Field) *V2UpdateCmekSettingsCall {
26071	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26072	return c
26073}
26074
26075// Context sets the context to be used in this call's Do method. Any
26076// pending HTTP request will be aborted if the provided context is
26077// canceled.
26078func (c *V2UpdateCmekSettingsCall) Context(ctx context.Context) *V2UpdateCmekSettingsCall {
26079	c.ctx_ = ctx
26080	return c
26081}
26082
26083// Header returns an http.Header that can be modified by the caller to
26084// add HTTP headers to the request.
26085func (c *V2UpdateCmekSettingsCall) Header() http.Header {
26086	if c.header_ == nil {
26087		c.header_ = make(http.Header)
26088	}
26089	return c.header_
26090}
26091
26092func (c *V2UpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
26093	reqHeaders := make(http.Header)
26094	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
26095	for k, v := range c.header_ {
26096		reqHeaders[k] = v
26097	}
26098	reqHeaders.Set("User-Agent", c.s.userAgent())
26099	var body io.Reader = nil
26100	body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings)
26101	if err != nil {
26102		return nil, err
26103	}
26104	reqHeaders.Set("Content-Type", "application/json")
26105	c.urlParams_.Set("alt", alt)
26106	c.urlParams_.Set("prettyPrint", "false")
26107	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
26108	urls += "?" + c.urlParams_.Encode()
26109	req, err := http.NewRequest("PATCH", urls, body)
26110	if err != nil {
26111		return nil, err
26112	}
26113	req.Header = reqHeaders
26114	googleapi.Expand(req.URL, map[string]string{
26115		"name": c.name,
26116	})
26117	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26118}
26119
26120// Do executes the "logging.updateCmekSettings" call.
26121// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
26122// status code is an error. Response headers are in either
26123// *CmekSettings.ServerResponse.Header or (if a response was returned at
26124// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
26125// to check whether the returned error was because
26126// http.StatusNotModified was returned.
26127func (c *V2UpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
26128	gensupport.SetOptions(c.urlParams_, opts...)
26129	res, err := c.doRequest("json")
26130	if res != nil && res.StatusCode == http.StatusNotModified {
26131		if res.Body != nil {
26132			res.Body.Close()
26133		}
26134		return nil, &googleapi.Error{
26135			Code:   res.StatusCode,
26136			Header: res.Header,
26137		}
26138	}
26139	if err != nil {
26140		return nil, err
26141	}
26142	defer googleapi.CloseBody(res)
26143	if err := googleapi.CheckResponse(res); err != nil {
26144		return nil, err
26145	}
26146	ret := &CmekSettings{
26147		ServerResponse: googleapi.ServerResponse{
26148			Header:         res.Header,
26149			HTTPStatusCode: res.StatusCode,
26150		},
26151	}
26152	target := &ret
26153	if err := gensupport.DecodeResponse(target, res); err != nil {
26154		return nil, err
26155	}
26156	return ret, nil
26157	// {
26158	//   "description": "Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Logs Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.",
26159	//   "flatPath": "v2/{v2Id}/{v2Id1}/cmekSettings",
26160	//   "httpMethod": "PATCH",
26161	//   "id": "logging.updateCmekSettings",
26162	//   "parameterOrder": [
26163	//     "name"
26164	//   ],
26165	//   "parameters": {
26166	//     "name": {
26167	//       "description": "Required. The resource name for the CMEK settings to update. \"projects/[PROJECT_ID]/cmekSettings\" \"organizations/[ORGANIZATION_ID]/cmekSettings\" \"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings\" \"folders/[FOLDER_ID]/cmekSettings\" Example: \"organizations/12345/cmekSettings\".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.",
26168	//       "location": "path",
26169	//       "pattern": "^[^/]+/[^/]+$",
26170	//       "required": true,
26171	//       "type": "string"
26172	//     },
26173	//     "updateMask": {
26174	//       "description": "Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.Example: \"updateMask=kmsKeyName\"",
26175	//       "format": "google-fieldmask",
26176	//       "location": "query",
26177	//       "type": "string"
26178	//     }
26179	//   },
26180	//   "path": "v2/{+name}/cmekSettings",
26181	//   "request": {
26182	//     "$ref": "CmekSettings"
26183	//   },
26184	//   "response": {
26185	//     "$ref": "CmekSettings"
26186	//   },
26187	//   "scopes": [
26188	//     "https://www.googleapis.com/auth/cloud-platform",
26189	//     "https://www.googleapis.com/auth/logging.admin"
26190	//   ]
26191	// }
26192
26193}
26194